diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2010-07-16 13:22:00 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2010-07-16 13:22:00 +0300 |
commit | 6cc7d587a710606d3fe52222707739c7cc1b8651 (patch) | |
tree | 2b6360852d8f966bd83eeb6efd8af90f8e9b83f9 | |
parent | e888f1834b88270590b7e04d64c03c75863e4565 (diff) | |
download | gawk-3.1.3.tar.gz |
Move to gawk-3.1.3.gawk-3.1.3
215 files changed, 19609 insertions, 11001 deletions
@@ -171,232 +171,422 @@ Available Packages ================== Languages are not equally supported in all packages. The following -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 +matrix shows the current state of internationalization, as of May 2003. +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 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 + Ready PO files am az be bg ca cs da de el en en_GB eo es + +-------------------------------------------+ + a2ps | [] [] [] [] | + aegis | () | + anubis | | + ap-utils | | + bash | [] [] [] | + batchelor | | + bfd | [] [] | + binutils | [] [] | + bison | [] [] [] | + bluez-pin | [] [] | + clisp | | + clisp | [] [] [] | + coreutils | [] [] [] [] | + cpio | [] [] [] | + darkstat | () [] | + diffutils | [] [] [] [] [] [] [] | + e2fsprogs | [] [] | + enscript | [] [] [] [] | + error | [] [] [] [] [] | + fetchmail | [] () [] [] [] [] | + fileutils | [] [] [] | + findutils | [] [] [] [] [] [] | + flex | [] [] [] [] | + gas | [] | + gawk | [] [] [] [] | + gcal | [] | + gcc | [] [] | + gettext | [] [] [] [] [] | + gettext-runtime | [] [] [] [] [] | + gettext-tools | [] [] | + gimp-print | [] [] [] [] [] | + gliv | | + glunarclock | [] [] [] | + gnucash | () [] | + gnucash-glossary | [] () [] | + gnupg | [] () [] [] [] [] | + gpe-calendar | [] | + gpe-conf | [] | + gpe-contacts | [] | + gpe-edit | | + gpe-login | [] | + gpe-ownerinfo | [] | + gpe-sketchbook | [] | + gpe-timesheet | | + gpe-today | [] | + gpe-todo | [] | + gphoto2 | [] [] [] [] | + gprof | [] [] | + gpsdrive | () () () | + grep | [] [] [] [] [] | + gretl | [] | + hello | [] [] [] [] [] [] | + id-utils | [] [] | + indent | [] [] [] [] | + jpilot | [] [] [] [] | + jwhois | [] | + kbd | [] [] [] [] [] | + ld | [] [] | + libc | [] [] [] [] [] [] | + libgpewidget | [] | + libiconv | [] [] [] [] [] | + lifelines | [] () | + lilypond | [] | + lingoteach | | + lingoteach_lessons | () () | + lynx | [] [] [] [] | + m4 | [] [] [] [] | + mailutils | [] [] | + make | [] [] [] | + man-db | [] () [] [] () | + mysecretdiary | [] [] [] | + nano | [] () [] [] [] | + nano_1_0 | [] () [] [] [] | + opcodes | [] [] | + parted | [] [] [] [] [] | + ptx | [] [] [] [] [] | + python | | + radius | | + recode | [] [] [] [] [] [] | + screem | | + sed | [] [] [] [] [] | + sh-utils | [] [] [] | + sharutils | [] [] [] [] [] [] | + sketch | [] () [] | + soundtracker | [] [] [] | + sp | [] | + tar | [] [] [] [] | + texinfo | [] [] [] [] | + textutils | [] [] [] [] | + tin | () () | + util-linux | [] [] [] [] [] | + vorbis-tools | [] [] [] | + wastesedge | () | + wdiff | [] [] [] [] | + wget | [] [] [] [] [] [] [] | + xchat | [] [] [] | + xpad | | + +-------------------------------------------+ + am az be bg ca cs da de el en en_GB eo es + 0 1 4 2 31 17 54 60 14 1 4 12 56 - gl he hr hu id it ja ko lv nb nl nn - +-------------------------------------+ - 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 | [] [] [] [] [] [] | - +-------------------------------------+ - gl he hr hu id it ja ko lv nb nl nn - 23 9 12 19 16 13 26 9 1 7 19 3 + et fa fi fr ga gl he hr hu id it ja ko + +----------------------------------------+ + a2ps | [] [] [] () () | + aegis | | + anubis | [] | + ap-utils | [] | + bash | [] [] | + batchelor | [] | + bfd | [] [] | + binutils | [] [] | + bison | [] [] [] [] | + bluez-pin | [] [] [] [] | + clisp | | + clisp | [] | + coreutils | [] [] [] [] | + cpio | [] [] [] [] | + darkstat | () [] [] [] | + diffutils | [] [] [] [] [] [] [] | + e2fsprogs | | + enscript | [] [] | + error | [] [] [] [] | + fetchmail | [] | + fileutils | [] [] [] [] [] | + findutils | [] [] [] [] [] [] [] [] [] [] [] | + flex | [] [] | + gas | [] | + gawk | [] [] | + gcal | [] | + gcc | [] | + gettext | [] [] [] | + gettext-runtime | [] [] [] [] | + gettext-tools | [] | + gimp-print | [] [] | + gliv | () | + glunarclock | [] [] [] [] | + gnucash | [] | + gnucash-glossary | [] | + gnupg | [] [] [] [] [] [] [] | + gpe-calendar | [] | + gpe-conf | | + gpe-contacts | [] | + gpe-edit | [] [] | + gpe-login | [] | + gpe-ownerinfo | [] [] [] | + gpe-sketchbook | [] | + gpe-timesheet | [] [] [] | + gpe-today | [] [] | + gpe-todo | [] [] | + gphoto2 | [] [] [] | + gprof | [] [] | + gpsdrive | () [] () () | + grep | [] [] [] [] [] [] [] [] [] [] [] | + gretl | [] | + hello | [] [] [] [] [] [] [] [] [] [] [] [] [] | + id-utils | [] [] [] | + indent | [] [] [] [] [] [] [] [] | + jpilot | [] () | + jwhois | [] [] [] [] | + kbd | [] | + ld | [] | + libc | [] [] [] [] [] [] | + libgpewidget | [] [] [] | + libiconv | [] [] [] [] [] [] [] [] | + lifelines | () | + lilypond | [] | + lingoteach | [] [] | + lingoteach_lessons | | + lynx | [] [] [] [] | + m4 | [] [] [] [] | + mailutils | | + make | [] [] [] [] [] [] | + man-db | [] () () | + mysecretdiary | [] [] | + nano | [] [] [] [] | + nano_1_0 | [] [] [] [] | + opcodes | [] [] | + parted | [] [] [] | + ptx | [] [] [] [] [] [] [] | + python | | + radius | | + recode | [] [] [] [] [] [] | + screem | | + sed | [] [] [] [] [] [] [] [] | + sh-utils | [] [] [] [] [] [] | + sharutils | [] [] [] [] [] | + sketch | [] | + soundtracker | [] [] [] | + sp | [] () | + tar | [] [] [] [] [] [] [] [] [] | + texinfo | [] [] [] [] | + textutils | [] [] [] [] [] | + tin | [] () | + util-linux | [] [] [] [] () [] | + vorbis-tools | [] | + wastesedge | () | + wdiff | [] [] [] [] [] | + wget | [] [] [] [] [] [] [] [] | + xchat | [] [] [] | + xpad | | + +----------------------------------------+ + et fa fi fr ga gl he hr hu id it ja ko + 20 1 15 73 14 24 8 10 30 31 19 31 9 - 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 + lg lt lv ms nb nl nn no pl pt pt_BR ro + +----------------------------------------+ + a2ps | [] [] () () () [] [] | + aegis | () | + anubis | [] [] | + ap-utils | () | + bash | [] | + batchelor | | + bfd | | + binutils | | + bison | [] [] [] [] | + bluez-pin | [] | + clisp | | + clisp | [] | + coreutils | [] | + cpio | [] [] [] | + darkstat | [] [] [] [] | + diffutils | [] [] [] | + e2fsprogs | | + enscript | [] [] | + error | [] [] | + fetchmail | () () | + fileutils | [] | + findutils | [] [] [] [] | + flex | [] | + gas | | + gawk | [] | + gcal | | + gcc | | + gettext | [] | + gettext-runtime | [] | + gettext-tools | | + gimp-print | [] | + gliv | [] | + glunarclock | [] | + gnucash | | + gnucash-glossary | [] [] | + gnupg | | + gpe-calendar | [] [] | + gpe-conf | [] [] | + gpe-contacts | [] | + gpe-edit | [] [] | + gpe-login | [] [] | + gpe-ownerinfo | [] [] | + gpe-sketchbook | [] [] | + gpe-timesheet | [] [] | + gpe-today | [] [] | + gpe-todo | [] [] | + gphoto2 | | + gprof | [] | + gpsdrive | () () () | + grep | [] [] [] [] | + gretl | | + hello | [] [] [] [] [] [] [] [] [] | + id-utils | [] [] [] | + indent | [] [] [] | + jpilot | () () | + jwhois | [] [] [] | + kbd | | + ld | | + libc | [] [] [] [] | + libgpewidget | [] [] | + libiconv | [] [] | + lifelines | | + lilypond | [] | + lingoteach | | + lingoteach_lessons | | + lynx | [] [] | + m4 | [] [] [] [] | + mailutils | | + make | [] [] | + man-db | [] | + mysecretdiary | [] | + nano | [] [] [] [] | + nano_1_0 | [] [] [] [] | + opcodes | [] [] [] | + parted | [] [] [] | + ptx | [] [] [] [] [] [] [] | + python | | + radius | | + recode | [] [] [] | + screem | | + sed | [] [] | + sh-utils | [] | + sharutils | [] | + sketch | [] | + soundtracker | | + sp | | + tar | [] [] [] [] [] [] | + texinfo | [] | + textutils | [] | + tin | | + util-linux | [] [] | + vorbis-tools | [] [] | + wastesedge | | + wdiff | [] [] [] [] | + wget | [] [] [] | + xchat | [] [] | + xpad | [] | + +----------------------------------------+ + lg lt lv ms nb nl nn no pl pt pt_BR ro + 0 0 2 11 7 26 3 4 18 15 34 34 + + ru sk sl sr sv ta tr uk vi wa zh_CN zh_TW + +-------------------------------------------+ + a2ps | [] [] [] [] [] | 16 + aegis | () | 0 + anubis | [] [] | 5 + ap-utils | () | 1 + bash | [] | 7 + batchelor | | 1 + bfd | [] [] [] | 7 + binutils | [] [] [] | 7 + bison | [] [] | 13 + bluez-pin | | 7 + clisp | | 0 + clisp | | 5 + coreutils | [] [] [] [] [] | 14 + cpio | [] [] [] | 13 + darkstat | [] () () | 9 + diffutils | [] [] [] [] | 21 + e2fsprogs | [] | 3 + enscript | [] [] [] | 11 + error | [] [] [] | 14 + fetchmail | [] | 7 + fileutils | [] [] [] [] [] [] | 15 + findutils | [] [] [] [] [] [] | 27 + flex | [] [] [] | 10 + gas | [] | 3 + gawk | [] [] | 9 + gcal | [] [] | 4 + gcc | [] | 4 + gettext | [] [] [] [] [] [] | 15 + gettext-runtime | [] [] [] [] [] [] | 16 + gettext-tools | [] [] | 5 + gimp-print | [] [] | 10 + gliv | | 1 + glunarclock | [] [] [] | 11 + gnucash | [] [] | 4 + gnucash-glossary | [] [] [] | 8 + gnupg | [] [] [] [] | 16 + gpe-calendar | [] | 5 + gpe-conf | | 3 + gpe-contacts | [] | 4 + gpe-edit | [] | 5 + gpe-login | [] | 5 + gpe-ownerinfo | [] | 7 + gpe-sketchbook | [] | 5 + gpe-timesheet | [] | 6 + gpe-today | [] | 6 + gpe-todo | [] | 6 + gphoto2 | [] [] | 9 + gprof | [] [] | 7 + gpsdrive | [] [] | 3 + grep | [] [] [] [] | 24 + gretl | | 2 + hello | [] [] [] [] [] | 33 + id-utils | [] [] [] | 11 + indent | [] [] [] [] | 19 + jpilot | [] [] [] [] [] | 10 + jwhois | () () [] [] | 10 + kbd | [] [] | 8 + ld | [] [] | 5 + libc | [] [] [] [] | 20 + libgpewidget | | 6 + libiconv | [] [] [] [] [] [] | 21 + lifelines | [] | 2 + lilypond | [] | 4 + lingoteach | | 2 + lingoteach_lessons | () | 0 + lynx | [] [] [] [] | 14 + m4 | [] [] [] | 15 + mailutils | | 2 + make | [] [] [] [] | 15 + man-db | [] | 6 + mysecretdiary | [] [] | 8 + nano | [] [] [] | 15 + nano_1_0 | [] [] [] | 15 + opcodes | [] [] | 9 + parted | [] [] | 13 + ptx | [] [] [] | 22 + python | | 0 + radius | | 0 + recode | [] [] [] [] | 19 + screem | [] | 1 + sed | [] [] [] [] [] | 20 + sh-utils | [] [] [] | 13 + sharutils | [] [] [] [] | 16 + sketch | [] | 5 + soundtracker | [] | 7 + sp | [] | 3 + tar | [] [] [] [] [] | 24 + texinfo | [] [] [] [] | 13 + textutils | [] [] [] [] [] | 15 + tin | | 1 + util-linux | [] [] | 14 + vorbis-tools | [] | 7 + wastesedge | | 0 + wdiff | [] [] [] [] | 17 + wget | [] [] [] [] [] [] [] | 25 + xchat | [] [] [] | 11 + xpad | | 1 + +-------------------------------------------+ + 50 teams ru sk sl sr sv ta tr uk vi wa zh_CN zh_TW + 97 domains 32 19 16 0 56 0 48 10 1 1 12 23 913 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 @@ -409,7 +599,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 August 2002 seems to be old, you may fetch a more recent copy of + If May 2003 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'. @@ -1,3 +1,430 @@ +Mon Jul 7 11:01:43 2003 Arnold D. Robbins <arnold@skeeve.com> + + * Release 3.1.3: Release tar file made. + +Mon Jul 7 09:55:49 2003 Arnold D. Robbins <arnold@skeeve.com> + + * main.c (copyleft, usage): Make sure to fflush output fp. Per Jim + Meyering, if error, exit non-zero. + * ext.c (get_argument): Fix array paramater handling. + +2003-07-06 Paul Eggert <eggert@twinsun.com> + + * builtin.c (do_substr): Issue better diagnostics when + d_substr and d_length are NaN, or when 0 < d_length < 1. + Be careful when comparing double to SIZE_MAX, as + the comparison might return the "wrong" answer when + (double) SIZE_MAX is a number that is not equal to + SIZE_MAX. + (do_gensub): Watch out for HOW values that are out of range + or are NaN. + (do_dcngettext): dcngettext wants an argument of type + unsigned long, not long, so use a value of that type. + +Fri Jul 4 10:58:02 2003 Arnold D. Robbins <arnold@skeeve.com> + + * main.c (main): Make option letter 'D' fall through into default + unknown case if not debugging. Let's us have just one version of + `optlist'. + +Thu Jun 26 15:25:57 2003 Arnold D. Robbins <arnold@skeeve.com> + + * array.c (get_actual): Undo Stepan Kasal change of 2003-06-17. + See test/match2.awk. + +Wed Jun 25 15:26:08 2003 Arnold D. Robbins <arnold@skeeve.com> + + * builtin.c (do_rand): Change calculation so that result + obeys constraint: 0 <= N < 1. This is per history and POSIX. + Thanks to Nelson Beebe (beebe@math.utah.edu) for reporting + this issue. + +Mon Jun 23 15:13:39 2003 Arnold D. Robbins <arnold@skeeve.com> + + * io.c (rs1scan): Per advice from Bruno Haible, it's safe + to skip the multibyte checking code if RS is '\n'. See + the comment in the code. Big performance improvement for + multibyte locales. + +2003-06-20 Stepan Kasal <kasal@ucw.cz> + + * eval.c (comp_func): if memcmp returns 0, we have to compare + the lengths. + +2003-06-19 Stepan Kasal <kasal@ucw.cz> + + * eval.c (interpret) <Node_K_arrayfor>: use NULL, not 0, to + initialize the variable list. + (comp_func): array indices no longer are string values, + you have to use ahname_str, ahname_len. + +Tue Jun 17 11:53:46 2003 Arnold D. Robbins <arnold@skeeve.com> + + * array.c (get_actual): Make check for isparam + smarter: also check for FUNC flag. + +2003-06-17 Stepan Kasal <kasal@ucw.cz> + + * array.c (get_actual): even if canfatal is FALSE, don't + tolerate existence of things which can't happen. + +Mon Jun 16 16:21:44 2003 Arnold D. Robbins <arnold@skeeve.com> + + * configure.ac: Removed m4/Makefile. + * m4/Makefile.am: Removed. + +2003-06-16 gettextize <bug-gnu-gettext@gnu.org> + + * configure.ac (AC_OUTPUT): Add m4/Makefile. + (AM_GNU_GETTEXT_VERSION): Bump to 0.12.1. + +Sun Jun 15 20:45:43 2003 Arnold D. Robbins <arnold@skeeve.com> + + * io.c (get_a_record): Enhance logic to fill buffers to include + `|| no_data_left(iop)'. + (rs1scan): Fix logic for setting recm fields for multibyte + character case. + +2003-06-10 Stepan Kasal <kasal@ucw.cz> + + * awkgram.y (release_all_vars): do not try to release a value of + Node_var_new; after get_lhs, use the lhs directly, do not try + to do (*lhs)->var_value; the Node_var case doesn't need + special treatment. + * builtin.c (do_match): `get_param' is successful iff it returns + Node_var_array---if the variable was new, get_param has already + changed the type. + * field.c (do_split): likewise. + +Sun Jun 15 19:36:35 2003 Arnold D. Robbins <arnold@skeeve.com> + + * node.c (r_dupnode): Typo fix in hash tables: stptr -> ahname_str. + Thanks to mary1john8@earthlink.net. + * array.c (get_actual): Add `if (canfatal)' before call to + `cant_happen'. + +Sun Jun 15 19:25:49 2003 Patrick T.J. McPhee <ptjm@interlog.com> + + * awk.h (memcpy_ulong): Add ! WIN32 to ifdefs. + +Mon Jun 9 18:38:20 2003 Arnold D. Robbins <arnold@skeeve.com> + + * custom.h (hpux): Added stuff to (hopefully) get `tzset' + declared on HP/UX 10 and up. + +Mon Jun 9 17:12:24 2003 Patrick T.J. McPhee <ptjm@interlog.com> + + * awk.h (ATTRIBUTE_EXPORTED): New macro for dynamic libs on Windows32. + * CONVMFTidx, stack_ptr, do_lint, lintfunc: Now have this attribute. + +Mon Jun 9 13:11:33 2003 Arnold D. Robbins <arnold@skeeve.com> + + Clean up of Stepan's patches. + + * array.c (get_actual): Renamed from r_get_array. Added second + param canfatal if routine should print fatal message when not an array. + (get_actual): Renamed 'prm' to `isparam'. + (array_vname): Add static msglen var; only realloc string if it grows. + Don't use `s += sprintf(...)'. No good on old systems where sprintf + returns char *. Minor formatting cleanups. + (do_adump): Restored separate `a' and `r' variables; helps for debugging. + + * awk.h (SCALAR, UNINITIALIZED): Removed entirely, renumbered other flags. + (get_array, get_param): New macros, calls get_actual. + (get_actual): Declaration changed from that of r_get_array. + + * awkgram.y (release_all_vars): Restored previous version of code; new + version isn't right for Node_xx variables. + (variable): Minor code cleanup for readability. + + * builtin.c (do_match): Use get_param and print our own message when + third parameter is not an array. + + * eval.c: Added a few comments here and there, removed some no longer + needed comments. + + * field.c (do_split): Use get_param and print our own message when + second parameter is not an array. + +Mon Jun 9 11:46:21 2003 Arnold D. Robbins <arnold@skeeve.com> + + * array.c (do_delete): Initialize hash1 and last to keep gcc -Wall happy. + * io.c (rsnullscan): Comment out label skip_leading for same reason. + +Wed May 28 08:31:23 CEST 2003 Stepan Kasal <kasal@math.cas.cz> + + * eval.c (forloops_active, in_function): Nuked. + (pop_all_forloops, pop_fcall_stack): are now inline. + +Wed May 28 07:58:35 2003 Stepan Kasal <kasal@math.cas.cz> + + * field.c, awk.h (Null_field): no longer static. + * field.c (init_fields): initial value of $0 can be Nnull_string, + no need to copy it. + * eval.c (r_get_lhs) <Node_field_spec>: test for uninitialized field, + which is Nnull_string for $0 and Null_field for $(>0). + * builtin.c (do_print_rec): test for uninitialized $0. + +Tue May 27 17:03:02 2003 Stepan Kasal <kasal@math.cas.cz> + + * awk.h (Node_var_new): New node type for variables which can be + either scalar or array. From now on, Node_var is always scalar. + (Node_gvar_ref): Nuked, its role can be taken by Node_array_ref. + (orig_var): removed, orig_array is enough. + (SCALAR, UNINITIALIZED): Flags nuked. + (var_uninitialized): new macro to distinguish uninitialized vars; + used in several other macros. + * array.c (r_get_array, array_vname, do_adump): adapt to the + above changes. + * awkgram.y, eval.c, field.c, main.c, node.c, profile.c: ditto. + +Tue May 27 14:27:50 2003 Stepan Kasal <kasal@math.cas.cz> + + * array.c (r_get_array): New function, which goes all the way + through Node_param_list to actual Node_var_array; if it encounters + non scalar Node_var, it changes it to Node_var_array. + (in_array, do_delete, do_delete_loop, do_adump, assoc_sort_inplace): + Use get_array. + (assoc_lookup): The parameter must be a Node_var_array. + * awk.h (get_array, r_get_array): Declare the new function and define + a macro to speed it up. + * builtin.c (do_match): Use get_array. + * eval.c (interpret) <Node_K_arrayfor>: ditto. + (r_get_lhs) <Node_K_arrayfor>: ditto. + * field.c (do_split): ditto. + +Tue May 27 08:23:51 2003 Stepan Kasal <kasal@math.cas.cz> + + Changed node->vname meaning for type Node_array_ref and Node_gvar_ref. + It contains only the reference name; one has to (recursively) follow + node->prev_array to find out the call history for the array. + + * array.c (array_vname): New function to print the array name. + (assoc_lookup, do_delete): Use array_vname. + * eval.c (interpret, r_tree_eval, r_get_lhs): Use array_vname. + (push_args, pop_fcall): Things have simplified. + * awk.h (array_vname): Declare. + (prev_array): Define. + +Sun Jun 8 11:25:36 2003 Stepan Kasal <kasal@ucw.cz> + + * awkgram.y (append_right): when using savetail, remember that it + is not necessarily the tail of the list---it's just a pointer to + the last chunk appended. + +Thu Jun 5 12:01:41 2003 Arnold D. Robbins <arnold@skeeve.com> + + * builtin.c (do_strtonum): Make `strtonum(13)' work. + +Wed Jun 4 17:07:06 2003 Corinna Vinschen <vinschen@redhat.com> + + * io.c (binmode): Include function for __CYGWIN__ too. + +Tue Jun 3 12:40:50 2003 Arnold D. Robbins <arnold@skeeve.com> + + * eval.c (interpret): Node_K_switch. For regex case, don't + call `free_temp' on the result of `force_string' if it's equal to + switch_value. Thanks to John DuBois <spcecdt@armory.com> + for finding the problem. + +Sun Jun 1 13:08:22 2003 Arnold D. Robbins <arnold@skeeve.com> + + * builtin.c (format_tree): For %c, force precision to 1. + +Wed May 28 11:55:48 2003 Arnold D. Robbins <arnold@skeeve.com> + + * awkgram.y (isnoeffect, isassignable): Add Node_TEXTDOMAIN to + switches in both functions. + +Wed May 28 11:38:59 2003 Stepan Kasal <kasal@math.cas.cz> + + * awkgram.y (switch_body): remove rule ``switch_body:/*empty/'' + as ``switch_body:case_statements'' covers it---this disambiguation + fixes a reduce/reduce conflict. + +Sun May 25 16:23:43 2003 Corinna Vinschen <vinschen@redhat.com> + + * configure.ac: Remove linking against /usr/lib/automode.o. + * configure: Regenerate. + +Sun May 25 15:19:19 2003 Stepan Kasal <kasal@math.cas.cz> + + * awk.h (get_lhs): For an initialized Node_var, you may return + the address of var_value pointer, no matter whether reference + bit was set or not. We were silly slowing down most of the + assignements. + + * (get_a_record): after grow_iop_buffer, move recm.rt_start even + if recm.len == 0. + +Mon May 19 16:55:59 2003 Arnold D. Robbins <arnold@skeeve.com> + + Code for C-style switch statements. Initial version contributed by + Michael Benzinger <Michael.Benzinger@sabre-holdings.com>. + + Disabled by default, use `configure --enable-switch' to turn it on. + + * configure.ac: New AC_ARG_ENABLE for switch statements. + * awk.h (NODETYPE): New types for switch, case, default keywords + and respective lists. + * awkgram.y: New productions for switch statement. Does checking to + avoid duplicate cases. + * eval.c (nodetypes): New entries for new NODETYPEs. + (interpret): New code to do switch execution. + * profile.c (pprint): New code to print switch statements. + +Mon May 19 15:05:43 2003 Arnold D. Robbins <arnold@skeeve.com> + + * configure.ac: Renamed from configure.in. + * fixvers: Now looks in configure.ac. + * Makefile.am: Now cites configure.ac. + + * Misc other: Updated to Automake 1.7.5. + +Sun May 18 12:03:56 2003 Arnold D. Robbins <arnold@skeeve.com> + + * array.c (do_delete_loop): Fix bracing of logic for + tests. + +Wed May 14 09:01:16 2003 Stepan Kasal <kasal@math.cas.cz> + + Misc patches: + + * builtin.c (do_match): if third parameter to `match' is supplied, + store all subexpressions which are applicable, even though there + are some unused between them. + + * awkgram.y (yylex): when returning from unterminated REGEXP + (which is /* kludge */), take care to fake a yylval, to + prevent ``internal error'' later. + +Sun May 11 15:51:00 2003 Stepan Kasal <kasal@math.cas.cz> + + * io.c (rsnullscan, get_a_record): Boundary condition bug fixes. + +Sun May 11 15:15:20 IDT 2003 Scott Deifik <scottd@amgen.com> + + * awk.h: Add decls for `memcpy_ulong', `memset_ulong', and + MSC defines. + * regex.c: Include <stdio.h> if MSC for size_t. + +Mon May 5 15:11:06 2003 Arnold D. Robbins <arnold@skeeve.com> + + * io.c (get_a_record): Only tweak RT's value in place if the current + RS scanner is the same as the last one. Bug report submitted by + John DuBois (<spcecdt@armory.com>). + +Fri May 2 14:39:48 2003 Arnold D. Robbins <arnold@skeeve.com> + + * io.c (get_a_record): Add logic at end to be smart about setting + RT. Saves considerable time, esp for default case where RS = "\n". + +Wed Apr 30 11:44:38 2003 Arnold D. Robbins <arnold@skeeve.com> + + * field.c (do_split): Add check and code for Node_gvar_ref. + * array.c (in_array, do_delete, asort_actual): Same. + * builtin.c (do_split): Same for 3rd arg array parameter. + * eval.c (interpret): Same for Node_K_array_for. + (push_args): Same for evaluating extra args. + +Tue Apr 29 15:54:28 2003 Arnold D. Robbins <arnold@skeeve.com> + + Record reading code redone/simplified considerably. + + * awk.h (IOBUF): Removed total field, no longer used. + * io.c (at_eof, has_data, no_data_left): New macros. + (RECVALUE, SCANSTATE): New enumerated types. + (rs1get_a_record, rsnull_get_a_record, rsre_get_a_record): Removed. + (get_a_record): Rewritten, again. Now contains just buffer and + record code; searching code moved into these functions: + (rs1scan, rsnullscan, rsrescan): New functions to scan a buffer + for record contents and terminator. Fill in values in: + (struct recmatch): Holds found record and terminator. + (spec_setup): Set iop->dataend to indicate data is already in buffer. + (nextfile, inrec): Use new macros instead of flag and pointer tests. + (set_RS): Set scanning function instead of record function. + + FWIW, it all passes `make test'. + +Sun Apr 27 21:02:39 2003 Arnold D. Robbins <arnold@skeeve.com> + + * io.c (do_close): At end, if do_posix return 0. See comment in code. + +Tue Apr 15 09:56:03 2003 Isamu Hasegawa <isamu@yamato.ibm.com> + + * configure.in: Check existence of wcrtomb, and wcscoll. + * configh.in: Likewise. + * configure: Re-generate. + Thanks to Kimura Koichi <kimura.koichi@canon.co.jp> for reporting. + +Sun Apr 13 16:02:10 2003 Arnold D. Robbins <arnold@skeeve.com> + + * main.c (main): Add call to `setlocale' for LC_NUMERIC after program is + parsed. + (arg_assign): Switch back to "C" locale for LC_NUMERIC for command + line assignments; this is per POSIX that period is decimal point for + program and command line assignments and the locale's separator + applies for input, output, and string to number conversion. + +2003-03-26 Paul Eggert <eggert@twinsun.com> + + * builtin.c [HAVE_INTTYPES_H]: Include <inttypes.h>. + [!HAVE_INTTYPES_H && HAVE_STDINT_H]: Include <stdint.h>. + (CHAR_BIT, INTMAX_MIN, UINTMAX_MAX): Define if the system does not. + (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): New macros, taken from + coreutils and many other GNU utilities. + (format_tree): When formatting, use widest possible integers + rather than settling with 'long'. + (do_lshift, do_rshift, do_and, do_or, do_xor, do_compl): Likewise, + when doing bitwise operations. + * configure.in (jm_AC_TYPE_LONG_LONG, jm_AC_TYPE_UNSIGNED_LONG_LONG, + jm_AC_TYPE_INTMAX_T, jm_AC_TYPE_UINTMAX_T): Add, since the mainline + code now needs this. + * doc/gawk.texi (Control Letters, Bitwise Functions): Document this. + * m4/intmax_t.m4: New file, taken from coreutils (but renamed to + avoid collision with our m4/inttypes.m4). + * m4/longlong.m4: New file, taken from coreutils. + * m4/uintmax_t.m4, m4/ulonglong.m4: Remove; superseded by the above + new m4 files. + + * builtin.c (BITS_PER_BYTE): Remove; use CHAR_BIT instead, since + it's the standard name. + (do_lshift, do_rshift): Complain if the shift width is exactly equal + to the word size, too. + +Thu Mar 27 10:44:11 2003 Arnold D. Robbins <arnold@skeeve.com> + + * io.c (rs1_get_a_record, rsnull_get_a_record, rsre_get_a_record): + Enhance check for no data left in file to be only if file has + non-zero size. Linux files such as /proc/filesystems stat as a + regular file of size 0, but actually have contents. Ugh. + Thanks to Martin Schlemmer <azarah@gentoo.org> for the bug report. + +Wed Mar 26 12:19:32 2003 Arnold D. Robbins <arnold@skeeve.com> + + * builtin.c (format_tree): Add a lint warning at label `out_of_range'. + +Tue Mar 25 12:24:38 2003 Arnold D. Robbins <arnold@skeeve.com> + + * awkgram.y (variable): For array subscript, if NAME is in the + symbol table, but not a variable, array, or parameter, generate + a syntax error. + (isarray): New function, tests if a symbol can be an array. + + * custom.h: Add check for HP/UX, needed for GCC. + +Mon Mar 17 09:21:09 2003 Arnold D. Robbins <arnold@skeeve.com> + + Allow simultaneous manipulation of a global array directly + and when passed as a parameter. + + * awk.h (Node_gvar_ref): New nodetype. + [orig_var]: New macro. + * array.c (do_delete_loop, do_delete): Add logic to handle + seeing Node_gvar_ref. + * eval.c (nodetypes): Add Node_gvar_ref. + (r_tree_eval, r_get_lhs): Add Node_gvar_ref case. + Wed Mar 19 14:10:31 2003 Arnold D. Robbins <arnold@skeeve.com> This time for sure. @@ -3586,7 +4013,7 @@ Sun Sep 14 00:08:53 1997 Arnold D. Robbins <arnold@gnu.org> * io.c (get_a_record): replace all occurrences of the test `grRS == FALSE' with `RS_is_null' which makes ` RS = "\0" ' - actually work, is clearer code, and actually makes use of + actually work, is clearer code, and actually makes use of the `RS_is_null' variable! Sun Aug 17 07:15:12 1997 Arnold D. Robbins <arnold@gnu.org> @@ -34,6 +34,19 @@ In 3.1 For 3.2 ======= + Simplify awk.h. + + Consider moving var_value info into Node_var itself + to reduce memory usage. + + Add IPv6 support. + + Look at ISO C 99 printf features. + + Add %'d for putting in commas in formatting? + + Consider integrating Fred Fish's DBUG library into gawk. + Move the loadable modules interface to libtool. Redo the loadable modules interface from the awk level. @@ -45,12 +58,6 @@ For 3.2 DBM storage of awk arrays. Try to allow multiple dbm packages. - Look at ISO C 99 printf features. - - Add %'d for putting in commas in formatting? - - Consider integrating Fred Fish's DBUG library into gawk. - Consider removing use of and/or need for the protos.h file. Additional manual features: diff --git a/Makefile.am b/Makefile.am index c1b266d0..d1371a00 100644 --- a/Makefile.am +++ b/Makefile.am @@ -27,7 +27,7 @@ AUTOMAKE_OPTIONS = ansi2knr dist-bzip2 # This undocumented variable insures that aclocal runs -# correctly after changing configure.in +# correctly after changing configure.ac ACLOCAL_AMFLAGS = -I m4 # This insures that make flags get passed down to child makes. @@ -166,12 +166,12 @@ awkgram.c: awkgram.y else :; fi # These force version and patchlevel to be up to date based -# on what's in configure.in. No-one else but me should have +# on what's in configure.ac. No-one else but me should have # to use them. So there. -patchlev.h: configure.in +patchlev.h: configure.ac $(srcdir)/fixvers -p -version.c: configure.in version.in +version.c: configure.ac version.in $(srcdir)/fixvers -v # This is for my development & testing. diff --git a/Makefile.in b/Makefile.in index 0974733b..a75dfce9 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.7.3 from Makefile.am. +# Makefile.in generated by automake 1.7.5 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 @@ -172,7 +172,7 @@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = ansi2knr dist-bzip2 # This undocumented variable insures that aclocal runs -# correctly after changing configure.in +# correctly after changing configure.ac ACLOCAL_AMFLAGS = -I m4 # This insures that make flags get passed down to child makes. @@ -326,7 +326,7 @@ RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-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 \ + configh.in configure configure.ac depcomp install-sh missing \ mkinstalldirs ylwrap DIST_SUBDIRS = $(SUBDIRS) SOURCES = $(gawk_SOURCES) $(pgawk_SOURCES) @@ -339,7 +339,7 @@ all: config.h am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @@ -347,10 +347,10 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck -$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) +$(srcdir)/configure: $(srcdir)/configure.ac $(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/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 +$(ACLOCAL_M4): configure.ac acinclude.m4 m4/arch.m4 m4/codeset.m4 m4/gettext.m4 m4/glibc21.m4 m4/iconv.m4 m4/intdiv0.m4 m4/intmax_t.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/longlong.m4 m4/nls.m4 m4/po.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-h1 @@ -363,7 +363,7 @@ 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) +$(srcdir)/configh.in: $(top_srcdir)/configure.ac $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOHEADER) touch $(srcdir)/configh.in @@ -447,7 +447,7 @@ distclean-depend: .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ @am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ @am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ @am__fastdepCC_TRUE@ fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @@ -458,7 +458,7 @@ distclean-depend: .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ @am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ -@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ @am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ @am__fastdepCC_TRUE@ fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @@ -598,9 +598,15 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) configh.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ + if (etags --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + else \ + include_option=--include; \ + fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + test -f $$subdir/TAGS && \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) configh.in $(LISP) $(TAGS_FILES)'; \ @@ -753,7 +759,7 @@ distcheck: dist @echo "$(distdir).tar.gz is ready for distribution" | \ sed 'h;s/./=/g;p;x;p;x' distuninstallcheck: - cd $(distuninstallcheck_dir) \ + @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ @@ -762,11 +768,11 @@ distuninstallcheck: $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean - if test '$(srcdir)' = . ; then \ + @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi - test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 @@ -911,12 +917,12 @@ awkgram.c: awkgram.y else :; fi # These force version and patchlevel to be up to date based -# on what's in configure.in. No-one else but me should have +# on what's in configure.ac. No-one else but me should have # to use them. So there. -patchlev.h: configure.in +patchlev.h: configure.ac $(srcdir)/fixvers -p -version.c: configure.in version.in +version.c: configure.ac version.in $(srcdir)/fixvers -v # This is for my development & testing. @@ -1,3 +1,50 @@ +Changes from 3.1.2 to 3.1.3 +--------------------------- + +1. Gawk now follows POSIX in handling of local numeric formats for + input, output and number/string conversions. + +2. Multibyte detection improved. See README_d/README.multibyte for more + info about multibyte locales. + +3. Handling of `close' made more POSIX-compliant for POSIXLY_CORRECT, + see the documentation. + +4. The record reading code was redone, again. This time it's much + better. Really! + +5. For RS = "\n" and RS = "", gawk now only sets RT when it has changed. + This provides considerable performance improvement. + +6. `match' now sets all the subscripts in the third argument array + correctly, even if not all subexpressions matched. + +7. Updated to Automake 1.7.5. configure.in renamed configure.ac. + +8. C-style switch statements are available, but must be enabled at + compile time via `configure --enable-switch'. For 3.2 they'll be + enabled by default. Thanks to Michael Benzinger for the initial + code. + +9. %c now always prints no more than one character, whatever + precision is provided. + +10. strtonum(<number>) now works again. + +11. Gawk is now much better about scalar/array typing of global + uninitiailzed variables passed as parameters. Once the parameter + is then used one way or the other, the global var's type is + adjusted accordingly. Thanks to Stepan Kasal for the original + (considerable) changes. + +12. Dynamic function loading under Windows32 should now be possible. See + README_d/README.pcdynamic. Thanks to Patrick T.J. McPhee for the changes. + +13. Updated to gettext 0.12.1. + +14. Gawk now follows historical practice and POSIX for the return + value of `rand': It's now 0 <= N < 1. + Changes from 3.1.1 to 3.1.2 --------------------------- @@ -49,7 +96,7 @@ Changes from 3.1.1 to 3.1.2 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(). + heuristic. See io.c:rsre_get_a_record. 14. Profiling no longer dumps core if there are extension functions in place. @@ -92,15 +139,15 @@ Changes from 3.1.1 to 3.1.2 25. More translations. -26. The get_a_record() routine has been revamped (currently by splitting it +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: +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 +28. New `asorti' function with same interface as `asort', but sorts indices instead of values. 29. Documentation updated to FDL 1.2. @@ -134,7 +181,7 @@ Changes from 3.1.0 to 3.1.1 7. Gawk can now be built with byacc; an accidental bison dependency was removed. -8. yyerror() will no longer dump core on long source lines. +8. `yyerror' will no longer dump core on long source lines. 9. Gawk now correctly queries getgroups(2) to figure out how many groups the process has. @@ -190,7 +237,7 @@ Changes from 3.0.6 to 3.1.0 9. On systems that support it, gawk now sets the `close on exec' flag on all files and pipes it opens. This makes sure that child processes run via - system() or pipes have plenty of file descriptors available. + `system' or pipes have plenty of file descriptors available. 10. New ports: Tandem and BeOS. The Tandem port is unsupported. @@ -209,7 +256,7 @@ Changes from 3.0.6 to 3.1.0 though. (NOTE! This is borrowed from ksh: it is not the same as the same operator in csh!) -16. The close() function now takes an optional second string argument +16. The `close' function now takes an optional second string argument that allows closing one or the other end of the two-way pipe to a co-process. This is needed to use `sort' in a co-process, see the doc. @@ -257,7 +304,7 @@ Changes from 3.0.6 to 3.1.0 over to using automake. You need Automake 1.4a (from the CVS archive) if you want to muck with the Makefile.am files. -28. New asort() function for sorting arrays. See the doc for details. +28. New `asort' function for sorting arrays. See the doc for details. 29. The match function takes an optional array third argument to hold the text matched by parenthesized sub-expressions. @@ -267,11 +314,11 @@ Changes from 3.0.6 to 3.1.0 data is now enabled at runtime with --non-decimal-data command line option. 31. Internationalization features available at the awk level: new TEXTDOMAIN - variable and bindtextdomain() and dcgettext() functions. printf formats + variable and `bindtextdomain' and `dcgettext' functions. printf formats may contain the "%2$3.5d" kind of notation for use in translations. See the texinfo manual for details. -32. The return value from close() has been rationalized. Most notably, +32. The return value from `close' has been rationalized. Most notably, closing something that wasn't open returns -1 but remains non-fatal. 33. The array effeciency change from 3.0.5 was reverted; the semantics were @@ -350,7 +397,7 @@ Bugs Fixed: 12. `b += b += 1' now works correctly. -13. IGNORECASE changing with calls match() now works better. (Fix for +13. IGNORECASE changing with calls `match' now works better. (Fix for semi-obscure bug.) 14. Multicharacter values for RS now generate a lint warning. @@ -401,7 +448,7 @@ Bugs Fixed: 13. Weird problems with number conversions on MIPS and other systems have been fixed. -14. When parsing using FIELDWIDTHS is in effect, split() with no third +14. When parsing using FIELDWIDTHS is in effect, `split' with no third argument will still use the value of FS. 15. Large File Support for Solaris, HP-UX, AIX, and IRIX is now enabled at @@ -446,7 +493,7 @@ The horrendous per-record memory leak introduced in 3.0.1 is gone, finally. The `amiga' directory is now gone; Amiga support is now entirely handled by the POSIX support. -Win32 support has been added in the `pc' directory. See `README_d/README.pc' +Windows32 support has been added in the `pc' directory. See `README_d/README.pc' for more info. The mmap changes are disabled in io.c, and will be removed entirely @@ -500,7 +547,7 @@ Troff source for a handy-dandy five color reference card is now provided. Thanks to SSC for their macros. Gawk now behaves like Unix awk and mawk, in that newline acts as white -space for separating fields and for split(), by default. In posix mode, +space for separating fields and for `split', by default. In posix mode, only space and tab separate fields. The documentation has been updated to reflect this. @@ -1,6 +1,6 @@ README: -This is GNU Awk 3.1.1. It is upwardly compatible with the Bell Labs +This is GNU Awk 3.1.3. It is upwardly compatible with the Bell Labs research version of awk. It is almost completely compliant with the 1993 POSIX 1003.2 standard for awk. (See the note below about POSIX.) @@ -29,7 +29,7 @@ generated with bison, and has no proprietary code in it. (Note that modifying awkgram.y without bison or yacc will be difficult, at best. You might want to get a copy of bison from the FSF too.) -If you have a Win32, MS-DOS or OS/2 system, use the stuff in the `pc' +If you have a Windows32, MS-DOS or OS/2 system, use the stuff in the `pc' directory. Similarly, there is a separate directory for VMS. Ports for the Atari and Tandem are supplied, but they are unsupported. diff --git a/README_d/README.multibyte b/README_d/README.multibyte new file mode 100644 index 00000000..6bc973a6 --- /dev/null +++ b/README_d/README.multibyte @@ -0,0 +1,22 @@ +Wed Jun 18 16:47:31 IDT 2003 +============================ + +Multibyte locales can cause occasional weirdness, in particular with +ranges inside brackets: /[....]/. Something that works great for ASCII +will choke for, e.g., en_US.UTF-8. One such program is test/gsubtst5.awk. + +By default, the test suite runs with LC_ALL=C and LANG=C. You +can change this by doing (from a Bourne-style shell): + + $ GAWKLOCALE=some_locale make check + +Then the test suite will set LC_ALL and LANG to the given locale. + +As of this writing, this works for en_US.UTF-8, and all tests +pass except gsubtst5. + +For the normal case of RS = "\n", the locale is largely irrelevant. +For other single byte record separators, using LC_ALL=C will give you +much better performance when reading records. Otherwise, gawk has to +make several function calls, *per input character* to find the record +terminator. You have been warned. diff --git a/README_d/README.pc b/README_d/README.pc index 5218508b..5022596b 100644 --- a/README_d/README.pc +++ b/README_d/README.pc @@ -1,10 +1,10 @@ -This is the README for GNU awk 3.1 under Win32, OS/2, and DOS. +This is the README for GNU awk 3.1 under Windows32, OS/2, and DOS. - Gawk has been compiled and tested under OS/2, DOS, and Win32 using + Gawk has been compiled and tested under OS/2, DOS, and Windows32 using the GNU development tools from DJ Delorie (DJGPP; DOS with special support for long filenames under Win95), Eberhard Mattes (EMX; OS/2, -DOS, and 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 +DOS, and Windows32 with rsxnt), and Jan-Jaap van der Heijden and Mumit Khan +(Mingw32; Windows32). Microsoft Visual C/C++ can be used to build a Windows32 version for Windows 9x/NT, and MSC can be used to build 16-bit versions for DOS and OS/2. (As of 3.1.2, the MSC version doesn't work, but the maintainer for it is working on fixing it.) @@ -28,7 +28,7 @@ Building gawk ------------- Building on DOS or Windows environments can be troublesome, in part due -to shell limitations, the long filename issue, and various Win32 pipe +to shell limitations, the long filename issue, and various Windows32 pipe considerations. The situation is somewhat better on OS/2. The general recommendation is to use tools (especially make) which are compatible or built with the compiler to be used on gawk. @@ -95,7 +95,7 @@ djgpp collection. The GNUish Project was designed to bring GNU-like programs to small systems running OS/2 and DOS. Binary distributions of gawk are maintained in GNUish, and include 16bit OS/2 and DOS, 32bit djgpp, -and Win32 versions. Information on GNUish is available via +and Windows32 versions. Information on GNUish is available via http://www.simtel.net/simtel.net/ or @@ -107,7 +107,7 @@ Kai Uwe Rommel <rommel@leo.org> maintains a (mostly OS/2) collection at http://www.leo.org/archiv/os2 or ftp://ftp.leo.org -It contains emx-compiled (32bit) versions of gawk for OS/2, DOS, and Win32, +It contains emx-compiled (32bit) versions of gawk for OS/2, DOS, and Windows32, along with many OS/2 utilities. The djgpp collection at @@ -139,12 +139,12 @@ application"). djgpp | DPMI DPMI DPMI DPMI,NoLFN DPMI emx(1) | N N N N OS2 emxbnd(2) | VCPI,DPMI DPMI DPMI,NoLFN DPMI,NoLFN DPMI,OS2 - emxnt(3) | N N Win32 Win32 N + emxnt(3) | N N Windows32 Windows32 N msc(4) | 16 16 16,NoLFN 16,NoLFN 16,DOS msc6bnd | 16 16 16,NoLFN 16,NoLFN 16,DOS,OS2 msc6os2 | N N N N 16,OS2 - vcWin32 | N N Win32 Win32 N - mingw32 | N N Win32 Win32 N + vcWin32 | N N Windows32 Windows32 N + mingw32 | N N Windows32 Windows32 N (1) Requires emxrt. @@ -174,23 +174,23 @@ application"). OS2 Runs as an OS/2 application. - rsxnt Runtimes for use with DPMI or Win32. + rsxnt Runtimes for use with DPMI or Windows32. VCPI Virtual Control Program Interface; program runs as a DOS app. Memory managers (such as emm386) may need adjustment. VCPI cannot be used under OS/2, Win/WfW, Win-95, or NT. See also DPMI. - Win32 Uses/supports Win32 features (such as long filenames). +Windows32 Uses/supports Windows32 features (such as long filenames). -Reportedly, NTEmacs (another Win32 program) can run programs such as -Win32-gawk asynchronously. Similarly, as native OS/2 versions are a -plus under OS/2 even for command-line programs, native Win32 versions +Reportedly, NTEmacs (another Windows32 program) can run programs such as +Windows32-gawk asynchronously. Similarly, as native OS/2 versions are a +plus under OS/2 even for command-line programs, native Windows32 versions may be desired under NT and Win95. -Users interested in Win32 applications may also wish to examine the +Users interested in Windows32 applications may also wish to examine the Cygnus cygwin project at http://sources.redhat.com/cygwin/ or the -Mingw32 work at http://www.mingw.org. Win32 gawk will often require -that utilities run from within gawk be Win32 (e.g., the tests place this +Mingw32 work at http://www.mingw.org. Windows32 gawk will often require +that utilities run from within gawk be Windows32 (e.g., the tests place this requirement on the cat utility). @@ -237,7 +237,7 @@ continues to be a problem. Stewartson's shell may be the best choice for emx-compiled programs (although djgpp-bash almost works with emx on DOS). GNU make is recommended if using djgpp-bash. -Beginning with 3.0.4, the MSC (DOS/Win32) and Mingw32 versions write +Beginning with 3.0.4, the MSC (DOS/Windows32) and Mingw32 versions write pipe and system() commands to a temporary file, and then execute with SHELL or COMSPEC. The current mechanism defaults to dos-style shell conventions unless the shell is one of sh, bash, csh, tcsh, sh32, @@ -245,7 +245,7 @@ sh16, or ksh. 4. GNU make is available at LEO for OS/2, in the djgpp collection -for DOS, and in the Mingw32 collection for Win32. +for DOS, and in the Mingw32 collection for Windows32. dmake is by Dennis Vadura (dvadura@watdragon.uwaterloo.ca), CS Dept., University of Waterloo. OS/2 and DOS versions can be found as @@ -358,7 +358,7 @@ reading, and he was always willing to answer our questions (even when we didn't read the relevant portions of the FAQ :). We are indebted to Juan Grigera <juan@biophnet.unlp.edu.ar> for the -Visual C++ target, and for additional help on changes for Win32. +Visual C++ target, and for additional help on changes for Windows32. ---- @@ -370,10 +370,10 @@ or gawk-maintainer@unixos2.org (OS/2 version) Darrel Hankerson, hankedr@mail.auburn.edu -Support for Win32 started in gawk-3.0.3. Reports on +Support for Windows32 started in gawk-3.0.3. Reports on the Visual C++ version (vcWin32) may be sent to Juan Grigera, juan@biophnet.unlp.edu.ar (Visual C++ version) -with a copy to Scott Deifik. Other Win32 reports may go to Darrel +with a copy to Scott Deifik. Other Windows32 reports may go to Darrel Hankerson. diff --git a/README_d/README.pcdynamic b/README_d/README.pcdynamic new file mode 100644 index 00000000..678206e6 --- /dev/null +++ b/README_d/README.pcdynamic @@ -0,0 +1,93 @@ +This is the README for dynamic extension support for GNU awk 3.1.2 under Windows32 +This part of the README is directed to the gawk maintainers. + +The implementation consists of + +pc/dlfcn.h +pc/dlfcn.c + An implementation of the POSIX dynamic loading functions for Windows32. + Bugs and limitations: + the RTLD_* flags are ignored + passing NULL as the module name is not really supported. + dlerror() doesn't always generate useful output. + +pc/w32dynamic.patch + A patch to pc/Makefile. This adds macros to allow dynamic loading + to be compiled in. The macros (DYN_EXP, DYN_OBJ, DYN_FLAGS, and + DYN_MAKEXP) are commented-out by default (which is the default on + Unix as well). I've added definitions only for MS VC and MinGW. + I also added support for pgawk under MS VC and MinGW. + +pc/gawkw32.def + A list of functions to export from gawk.exe. Every function used + in an extension DLL needs to be in this file. I've added the ones + required by the provided examples, but some thought should go into + determining a useful set of API functions. From a maintenance + perspective, it's important that the ordinals (the number following @) + never change. You can use an existing DLL with a gawk.exe which has + new exported functions, but if you change the ordinal of an existing + function, you have to recompile all the extensions that use it. + +extension/Makefile.pc + A make file which compiles a few of the extension examples. + Only readfile, ordchr, and arrayparm are built, since the + other functions didn't compile without sizeable modifications. + +extension/pcext.def + A module definition file which exports dlload. + +extension/w32dynamic.patch + A patch to readfile.c to have it open files in binary mode. Without + this, the bytes read doesn't always match the file size. + +w32dynamic.patch + A patch to awk.h. This makes the temporary variable _t static and + adds an attribute to some data declarations when WIN32_EXTENSION is + defined. The issue is that data imported from a separate module has + a different level of indirection from the same data in the + original module. The difference can be made transparent by adding + __declspec(dllimport)) to the declarations used in the importing module. + Since _t doesn't actually have to be shared, I've just made it + static to the extension module and avoided the problem. + +README_d/README.pcdynamic + This file. + +The remainder of the file is intended for people installing and using gawk +and probably ought to be added to README.pc +--- +To compile gawk with dynamic extension support, uncomment the +definitions of DYN_FLAGS, DYN_EXP, DYN_OBJ, and DYN_MAKEXP in the +configuration section of Makefile. There are two definitions for +DYN_MAKEXP -- pick the one that matches your target. + +To build some of the example extension libraries, cd to the extension +directory and copy Makefile.pc to Makefile. You can then build using the same +two targets. To run the example awk scripts, you'll need to either change the +call to the `extension' function to match the name of the library (for +instance, change "./ordchr.so" to "ordchr.dll" or simply "ordchr"), or rename +the library to match the call (for instance, rename ordchr.dll to ordchr.so). + +If you build gawk.exe with one compiler but want to build an extension library +with the other, you need to copy the import library. Visual C uses a library +called gawk.lib, while MinGW uses a library called libgawk.a. These files +are equivalent and will interoperate if you give them the correct name. +The resulting shared libraries are also interoperable. + +To create your own extension library, you can use the examples as models, but +you're essentially on your own. Post to comp.lang.awk or send e-mail to +ptjm@interlog.com if you have problems getting started. If you need to access +functions or variables which are not exported by gawk.exe, add them to +gawkw32.def and rebuild. You should also add ATTRIBUTE_EXPORTED to the +declaration in awk.h of any variables you add to gawkw32.def. + +Note that extension libraries have the name of the awk executable embedded in +them at link time, so they will work only with gawk.exe. In particular, they won't +work if you rename gawk.exe to awk.exe or if you try to use pgawk.exe. You can +perform profiling by temporarily renaming pgawk.exe to gawk.exe. You can resolve +this problem by changing the program name in the definition of DYN_MAKEXP for +your compiler. + +On Windows32, libraries are sought first in the current directory, then in the +directory containing gawk.exe, and finally through the PATH environment +variable. @@ -1,4 +1,4 @@ -# generated automatically by aclocal 1.7.3 -*- Autoconf -*- +# generated automatically by aclocal 1.7.5 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. @@ -23,7 +23,7 @@ m4_sinclude(strtod.m4)dnl # 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 +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify @@ -41,14 +41,7 @@ m4_sinclude(strtod.m4)dnl # 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, -# will think it sees a *use*, and therefore will trigger all it's -# C support machinery. Also note that it means that autoscan, seeing -# CC etc. in the Makefile, will ask for an AC_PROG_CC use... - +# serial 10 AC_PREREQ([2.54]) @@ -177,7 +170,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"]) # 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])]) + [AM_AUTOMAKE_VERSION([1.7.5])]) # Helper functions for option handling. -*- Autoconf -*- @@ -727,7 +720,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 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 @@ -752,8 +745,9 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' -doit: +am__doit: @echo done +.PHONY: am__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]) @@ -781,9 +775,9 @@ if test "$am__include" = "#"; then _am_result=BSD fi fi -AC_SUBST(am__include) -AC_SUBST(am__quote) -AC_MSG_RESULT($_am_result) +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) @@ -1067,8 +1061,8 @@ AC_SUBST(ANSI2KNR)dnl 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. +# gettext.m4 serial 20 (gettext-0.12) +dnl Copyright (C) 1995-2003 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 @@ -1086,7 +1080,7 @@ dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000. -dnl Bruno Haible <haible@clisp.cons.org>, 2000-2002. +dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003. dnl Macro to add for using GNU gettext. @@ -1161,13 +1155,8 @@ AC_DEFUN([AM_GNU_GETTEXT], AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) ]) - AC_MSG_CHECKING([whether NLS is requested]) - dnl Default is enabled NLS - AC_ARG_ENABLE(nls, - [ --disable-nls do not use Native Language Support], - USE_NLS=$enableval, USE_NLS=yes) - AC_MSG_RESULT($USE_NLS) - AC_SUBST(USE_NLS) + dnl Set USE_NLS. + AM_NLS ifelse(gt_included_intl, yes, [ BUILD_INCLUDED_LIBINTL=no @@ -1285,7 +1274,8 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", dnl libintl. (Cf. the install rule in intl/Makefile.in.) if test "$gt_cv_func_gnugettext_libc" = "yes" \ || { test "$gt_cv_func_gnugettext_libintl" = "yes" \ - && test "$PACKAGE" != gettext; }; then + && test "$PACKAGE" != gettext-runtime \ + && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else dnl Reset the values set by searching for libintl. @@ -1304,7 +1294,6 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", if test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions used to generate GNU NLS library. - INTLOBJS="\$(GETTOBJS)" BUILD_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV" @@ -1329,6 +1318,22 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", fi fi + AC_MSG_CHECKING([whether to use NLS]) + AC_MSG_RESULT([$USE_NLS]) + if test "$USE_NLS" = "yes"; then + AC_MSG_CHECKING([where the gettext function comes from]) + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if test "$gt_cv_func_gnugettext_libintl" = "yes"; then + gt_source="external libintl" + else + gt_source="libc" + fi + else + gt_source="included intl directory" + fi + AC_MSG_RESULT([$gt_source]) + fi + if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then @@ -1352,7 +1357,7 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", ifelse(gt_included_intl, yes, [ dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL dnl to 'yes' because some of the testsuite requires it. - if test "$PACKAGE" = gettext; then + if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then BUILD_INCLUDED_LIBINTL=yes fi @@ -1360,7 +1365,6 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", AC_SUBST(BUILD_INCLUDED_LIBINTL) AC_SUBST(USE_INCLUDED_LIBINTL) AC_SUBST(CATOBJEXT) - AC_SUBST(INTLOBJS) dnl For backward compatibility. Some configure.ins may be using this. nls_cv_header_intl= @@ -1378,6 +1382,12 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", GENCAT=gencat AC_SUBST(GENCAT) + dnl For backward compatibility. Some Makefiles may be using this. + if test "$USE_INCLUDED_LIBINTL" = yes; then + INTLOBJS="\$(GETTOBJS)" + fi + AC_SUBST(INTLOBJS) + dnl Enable libtool support if the surrounding package wishes it. INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) @@ -1394,13 +1404,107 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", ]) -dnl Checks for all prerequisites of the po subdirectory, -dnl except for USE_NLS. +dnl Checks for all prerequisites of the intl subdirectory, +dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS, +dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL. +AC_DEFUN([AM_INTL_SUBDIR], +[ + AC_REQUIRE([AC_PROG_INSTALL])dnl + AC_REQUIRE([AM_MKINSTALLDIRS])dnl + AC_REQUIRE([AC_PROG_CC])dnl + AC_REQUIRE([AC_CANONICAL_HOST])dnl + AC_REQUIRE([AC_PROG_RANLIB])dnl + AC_REQUIRE([AC_ISC_POSIX])dnl + AC_REQUIRE([AC_HEADER_STDC])dnl + AC_REQUIRE([AC_C_CONST])dnl + AC_REQUIRE([AC_C_INLINE])dnl + AC_REQUIRE([AC_TYPE_OFF_T])dnl + AC_REQUIRE([AC_TYPE_SIZE_T])dnl + AC_REQUIRE([AC_FUNC_ALLOCA])dnl + AC_REQUIRE([AC_FUNC_MMAP])dnl + AC_REQUIRE([jm_GLIBC21])dnl + AC_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]) + AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \ +geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \ +strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next \ +__fsetlocking]) + + AM_ICONV + AM_LANGINFO_CODESET + 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 + dnl bison-1.26 because earlier versions generate a plural.c that doesn't + dnl compile. + dnl bison is only needed for the maintainer (who touches plural.y). But in + dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put + dnl the rule in general Makefile. Now, some people carelessly touch the + dnl files or have a broken "make" program, hence the plural.c rule will + dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not + dnl present or too old. + AC_CHECK_PROGS([INTLBISON], [bison]) + if test -z "$INTLBISON"; then + ac_verc_fail=yes + else + dnl Found it, now check the version. + AC_MSG_CHECKING([version of bison]) +changequote(<<,>>)dnl + ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` + case $ac_prog_version in + '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; + 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) +changequote([,])dnl + ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; + *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; + esac + AC_MSG_RESULT([$ac_prog_version]) + fi + if test $ac_verc_fail = yes; then + INTLBISON=: + fi +]) + + +dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) +AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) + +# po.m4 serial 1 (gettext-0.12) +dnl Copyright (C) 1995-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. +dnl +dnl This file can can be used in projects which are not available under +dnl the GNU General Public License or the GNU Library General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Library General Public License, and the rest of the GNU +dnl gettext package package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Authors: +dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000. +dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003. + +dnl Checks for all prerequisites of the po subdirectory. AC_DEFUN([AM_PO_SUBDIRS], [ AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AM_MKINSTALLDIRS])dnl + AC_REQUIRE([AM_NLS])dnl dnl Perform the following tests also if --disable-nls has been given, dnl because they are needed for "make dist" to work. @@ -1414,12 +1518,12 @@ AC_DEFUN([AM_PO_SUBDIRS], :) AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) - dnl Search for GNU xgettext 0.11 or newer in the PATH. + dnl Search for GNU xgettext 0.12 or newer in the PATH. dnl The first test excludes Solaris xgettext and early GNU xgettext versions. dnl The second test excludes FreeBSD xgettext. AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, - [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 && - (if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], + [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && + (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) dnl Remove leftover from FreeBSD xgettext call. rm -f messages.po @@ -1449,8 +1553,8 @@ AC_DEFUN([AM_PO_SUBDIRS], if test "$XGETTEXT" != ":"; then dnl If it is no GNU xgettext we define it as : so that the dnl Makefiles still can work. - if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 && - (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && + (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then : ; else AC_MSG_RESULT( @@ -1485,17 +1589,22 @@ AC_DEFUN([AM_PO_SUBDIRS], rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" + POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. - if test -n "$ALL_LINGUAS"; then + if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assigment from automake. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" + else + # The set of available languages was given in configure.in. + eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi case "$ac_given_srcdir" in .) srcdirpre= ;; @@ -1544,7 +1653,7 @@ AC_DEFUN([AM_PO_SUBDIRS], done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" - sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in @@ -1560,90 +1669,55 @@ AC_DEFUN([AM_PO_SUBDIRS], [# 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"' + eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" ]) ]) +# nls.m4 serial 1 (gettext-0.12) +dnl Copyright (C) 1995-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. +dnl +dnl This file can can be used in projects which are not available under +dnl the GNU General Public License or the GNU Library General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Library General Public License, and the rest of the GNU +dnl gettext package package is covered by the GNU General Public License. +dnl They are *not* in the public domain. -dnl Checks for all prerequisites of the intl subdirectory, -dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS, -dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL. -AC_DEFUN([AM_INTL_SUBDIR], -[ - AC_REQUIRE([AC_PROG_INSTALL])dnl - AC_REQUIRE([AM_MKINSTALLDIRS])dnl - AC_REQUIRE([AC_PROG_CC])dnl - AC_REQUIRE([AC_CANONICAL_HOST])dnl - AC_REQUIRE([AC_PROG_RANLIB])dnl - AC_REQUIRE([AC_ISC_POSIX])dnl - AC_REQUIRE([AC_HEADER_STDC])dnl - AC_REQUIRE([AC_C_CONST])dnl - AC_REQUIRE([AC_C_INLINE])dnl - AC_REQUIRE([AC_TYPE_OFF_T])dnl - AC_REQUIRE([AC_TYPE_SIZE_T])dnl - AC_REQUIRE([AC_FUNC_ALLOCA])dnl - AC_REQUIRE([AC_FUNC_MMAP])dnl - AC_REQUIRE([jm_GLIBC21])dnl - AC_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]) - AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \ -geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \ -strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next]) - - AM_ICONV - AM_LANGINFO_CODESET - if test $ac_cv_header_locale_h = yes; then - AM_LC_MESSAGES - fi +dnl Authors: +dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000. +dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003. - dnl intl/plural.c is generated from intl/plural.y. It requires bison, - dnl because plural.y uses bison specific features. It requires at least - dnl bison-1.26 because earlier versions generate a plural.c that doesn't - dnl compile. - dnl bison is only needed for the maintainer (who touches plural.y). But in - dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put - dnl the rule in general Makefile. Now, some people carelessly touch the - dnl files or have a broken "make" program, hence the plural.c rule will - dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not - dnl present or too old. - AC_CHECK_PROGS([INTLBISON], [bison]) - if test -z "$INTLBISON"; then - ac_verc_fail=yes - else - dnl Found it, now check the version. - AC_MSG_CHECKING([version of bison]) -changequote(<<,>>)dnl - ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` - case $ac_prog_version in - '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; - 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) -changequote([,])dnl - ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; - *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; - esac - AC_MSG_RESULT([$ac_prog_version]) - fi - if test $ac_verc_fail = yes; then - INTLBISON=: - fi +AC_DEFUN([AM_NLS], +[ + AC_MSG_CHECKING([whether NLS is requested]) + dnl Default is enabled NLS + AC_ARG_ENABLE(nls, + [ --disable-nls do not use Native Language Support], + USE_NLS=$enableval, USE_NLS=yes) + AC_MSG_RESULT($USE_NLS) + AC_SUBST(USE_NLS) ]) - AC_DEFUN([AM_MKINSTALLDIRS], [ dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly dnl find the mkinstalldirs script in another subdir but $(top_srcdir). - dnl Try to locate is. + dnl Try to locate it. MKINSTALLDIRS= if test -n "$ac_aux_dir"; then - MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" + case "$ac_aux_dir" in + /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;; + *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;; + esac fi if test -z "$MKINSTALLDIRS"; then MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" @@ -1651,12 +1725,100 @@ AC_DEFUN([AM_MKINSTALLDIRS], AC_SUBST(MKINSTALLDIRS) ]) +# progtest.m4 serial 3 (gettext-0.12) +dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. +dnl +dnl This file can can be used in projects which are not available under +dnl the GNU General Public License or the GNU Library General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Library General Public License, and the rest of the GNU +dnl gettext package package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Authors: +dnl Ulrich Drepper <drepper@cygnus.com>, 1996. -dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) -AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) +# Search path for a program which passes the given test. + +dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, +dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) +AC_DEFUN([AM_PATH_PROG_WITH_TEST], +[ +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "$2", so it can be a program name with args. +set dummy $2; ac_word=[$]2 +AC_MSG_CHECKING([for $ac_word]) +AC_CACHE_VAL(ac_cv_path_$1, +[case "[$]$1" in + [[\\/]]* | ?:[[\\/]]*) + ac_cv_path_$1="[$]$1" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in ifelse([$5], , $PATH, [$5]); do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + if [$3]; then + ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" +dnl If no 4th arg is given, leave the cache variable unset, +dnl so AC_PATH_PROGS will keep looking. +ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" +])dnl + ;; +esac])dnl +$1="$ac_cv_path_$1" +if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then + AC_MSG_RESULT([$]$1) +else + AC_MSG_RESULT(no) +fi +AC_SUBST($1)dnl +]) -# lib-prefix.m4 serial 1 (gettext-0.11) -dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. +# lib-prefix.m4 serial 2 (gettext-0.12) +dnl Copyright (C) 2001-2003 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 @@ -1665,6 +1827,13 @@ dnl the same distribution terms as the rest of that program. dnl From Bruno Haible. +dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and +dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't +dnl require excessive bracketing. +ifdef([AC_HELP_STRING], +[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], +[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) + dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed dnl to access previously installed libraries. The basic assumption is that dnl a user will want packages to use other packages he previously installed @@ -1683,7 +1852,7 @@ AC_DEFUN([AC_LIB_PREFIX], eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) - AC_ARG_WITH([lib-prefix], + AC_LIB_ARG_WITH([lib-prefix], [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib --without-lib-prefix don't search for libraries in includedir and libdir], [ @@ -1804,8 +1973,8 @@ AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], prefix="$acl_save_prefix" ]) -# lib-link.m4 serial 3 (gettext-0.11.3) -dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. +# lib-link.m4 serial 4 (gettext-0.12) +dnl Copyright (C) 2001-2003 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 @@ -1898,8 +2067,7 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], dnl Determine the platform dependent parameters needed to use rpath: dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, -dnl hardcode_direct, hardcode_minus_L, -dnl sys_lib_search_path_spec, sys_lib_dlsearch_path_spec. +dnl hardcode_direct, hardcode_minus_L. AC_DEFUN([AC_LIB_RPATH], [ AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS @@ -1920,8 +2088,6 @@ AC_DEFUN([AC_LIB_RPATH], hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" hardcode_direct="$acl_cv_hardcode_direct" hardcode_minus_L="$acl_cv_hardcode_minus_L" - sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec" - sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec" dnl Determine whether the user wants rpath handling at all. AC_ARG_ENABLE(rpath, [ --disable-rpath do not hardcode runtime library paths], @@ -1941,7 +2107,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) - AC_ARG_WITH([lib$1-prefix], + AC_LIB_ARG_WITH([lib$1-prefix], [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib --without-lib$1-prefix don't search for lib$1 in includedir and libdir], [ @@ -2359,8 +2525,8 @@ AC_DEFUN([AC_LIB_APPENDTOVAR], done ]) -# lib-ld.m4 serial 1 (gettext-0.11) -dnl Copyright (C) 1996-2002 Free Software Foundation, Inc. +# lib-ld.m4 serial 2 (gettext-0.12) +dnl Copyright (C) 1996-2003 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 @@ -2390,6 +2556,19 @@ AC_DEFUN([AC_LIB_PROG_LD], test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. @@ -2561,66 +2740,6 @@ size_t iconv(); fi ]) -# progtest.m4 serial 2 (gettext-0.10.40) -dnl Copyright (C) 1996-2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. -dnl -dnl This file can can be used in projects which are not available under -dnl the GNU General Public License or the GNU Library General Public -dnl License but which still want to provide support for the GNU gettext -dnl functionality. -dnl Please note that the actual code of the GNU gettext library is covered -dnl by the GNU Library General Public License, and the rest of the GNU -dnl gettext package package is covered by the GNU General Public License. -dnl They are *not* in the public domain. - -dnl Authors: -dnl Ulrich Drepper <drepper@cygnus.com>, 1996. - -# Search path for a program which passes the given test. - -dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, -dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) -AC_DEFUN([AM_PATH_PROG_WITH_TEST], -[# Extract the first word of "$2", so it can be a program name with args. -set dummy $2; ac_word=[$]2 -AC_MSG_CHECKING([for $ac_word]) -AC_CACHE_VAL(ac_cv_path_$1, -[case "[$]$1" in - /*) - ac_cv_path_$1="[$]$1" # Let the user override the test with a path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in ifelse([$5], , $PATH, [$5]); do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if [$3]; then - ac_cv_path_$1="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" -dnl If no 4th arg is given, leave the cache variable unset, -dnl so AC_PATH_PROGS will keep looking. -ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" -])dnl - ;; -esac])dnl -$1="$ac_cv_path_$1" -if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then - AC_MSG_RESULT([$]$1) -else - AC_MSG_RESULT(no) -fi -AC_SUBST($1)dnl -]) - # glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40) dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU @@ -2727,103 +2846,60 @@ int main () [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. +#serial 6 dnl From Paul Eggert. -AC_PREREQ(2.13) +AC_PREREQ(2.52) -# Define uintmax_t to `unsigned long' or `unsigned long long' -# if <inttypes.h> does not exist. +# Define intmax_t to long or long long if <inttypes.h> doesn't define. -AC_DEFUN([jm_AC_TYPE_UINTMAX_T], +AC_DEFUN([jm_AC_TYPE_INTMAX_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 + AC_REQUIRE([jm_AC_TYPE_LONG_LONG]) + AC_CHECK_TYPE(intmax_t, , + [test $ac_cv_type_long_long = yes \ + && ac_type='long long' \ + || ac_type='long' + AC_DEFINE_UNQUOTED(intmax_t, $ac_type, + [Define to widest signed type if <inttypes.h> doesn't define.])]) ]) -# 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. +# Define uintmax_t to unsigned long or unsigned long long +# if <inttypes.h> doesn't define. -AC_DEFUN([jm_AC_HEADER_INTTYPES_H], +AC_DEFUN([jm_AC_TYPE_UINTMAX_T], [ - 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 + AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG]) + AC_CHECK_TYPE(uintmax_t, , + [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 widest unsigned type if <inttypes.h> doesn't define.])]) ]) -# 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. +#serial 2 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. +# Define HAVE_LONG_LONG if 'long long' works. -AC_DEFUN([jm_AC_HEADER_STDINT_H], +AC_DEFUN([jm_AC_TYPE_LONG_LONG], [ - 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. ]) + AC_CACHE_CHECK([for long long], ac_cv_type_long_long, + [AC_TRY_LINK([long long ll = 1; int i = 63;], + [long long llmax = (long long) -1; + return ll << i | ll >> i | llmax / ll | llmax % ll;], + ac_cv_type_long_long=yes, + ac_cv_type_long_long=no)]) + if test $ac_cv_type_long_long = yes; then + AC_DEFINE(HAVE_LONG_LONG, 1, + [Define if you have the long long type.]) 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. +# Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works. AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG], [ @@ -70,6 +70,187 @@ array_init() hash = gst_hash_string; } +/* + * get_actual --- proceed to the actual Node_var_array, + * change Node_var_new to an array. + * If canfatal and type isn't good, die fatally, + * otherwise return the final actual value. + */ + +NODE * +get_actual(NODE *symbol, int canfatal) +{ + int isparam = (symbol->type == Node_param_list + && (symbol->flags & FUNC) == 0); + NODE *save_symbol = symbol; + + if (isparam) { + save_symbol = symbol = stack_ptr[symbol->param_cnt]; + if (symbol->type == Node_array_ref) + symbol = symbol->orig_array; + } + + switch (symbol->type) { + case Node_var_new: + symbol->type = Node_var_array; + symbol->var_array = NULL; + /* fall through */ + case Node_var_array: + break; + + case Node_array_ref: + case Node_param_list: + if (canfatal) + cant_happen(); + /* else + fall through */ + + default: + /* notably Node_var but catches also e.g. FS[1] = "x" */ + if (canfatal) + fatal(isparam ? + _("attempt to use scalar parameter `%s' as an array") : + _("attempt to use scalar `%s' as array"), + save_symbol->vname); + else + break; + } + + return symbol; +} + +/* + * array_vname --- print the name of the array + * + * Returns a pointer to a statically maintained dynamically allocated string. + * It's appropriate for printing the name once; if the caller wants + * to save it, they have to make a copy. + * + * Setting MAX_LEN to a positive value (eg. 140) would limit the length + * of the output to _roughly_ that length. + * + * If MAX_LEN == 0, which is the default, the whole stack is printed. + */ +#define MAX_LEN 0 + +char * +array_vname(register const NODE *symbol) +{ + if (symbol->type == Node_param_list) + symbol = stack_ptr[symbol->param_cnt]; + + if (symbol->type != Node_array_ref || symbol->orig_array->type != Node_var_array) + return symbol->vname; + else { + static char *message = NULL; + static size_t msglen = 0; + char *s; + size_t len; + int n; + const NODE *save_symbol = symbol; + const char *from = _("from %s"); + +#if (MAX_LEN <= 0) || !defined(HAVE_SNPRINTF) + /* This is the default branch. */ + + /* First, we have to compute the length of the string: */ + len = strlen(symbol->vname) + 2; /* "%s (" */ + n = 0; + do { + symbol = symbol->prev_array; + len += strlen(symbol->vname); + n++; + } while (symbol->type == Node_array_ref); + /* + * Each node contributes by strlen(from) minus the length + * of "%s" in the translation (which is at least 2) + * plus 2 for ", " or ")\0"; this adds up to strlen(from). + */ + len += n * strlen(from); + + /* (Re)allocate memory: */ + if (message == NULL) { + emalloc(message, char *, len, "array_vname"); + msglen = len; + } else if (len > msglen) { + erealloc(message, char *, len, "array_vname"); + msglen = len; + } /* else + current buffer can hold new name */ + + /* We're ready to print: */ + symbol = save_symbol; + s = message; + /* + * Ancient systems have sprintf() returning char *, not int. + * Thus, `s += sprintf(s, from, name);' is a no-no. + */ + sprintf(s, "%s (", symbol->vname); + s += strlen(s); + for (;;) { + symbol = symbol->prev_array; + sprintf(s, from, symbol->vname); + s += strlen(s); + if (symbol->type != Node_array_ref) + break; + sprintf(s, ", "); + s += strlen(s); + } + sprintf(s, ")"); + +#else /* MAX_LEN > 0 */ + + /* + * The following check fails only on + * abnormally_long_variable_name. + */ +#define PRINT_CHECK \ + if (n <= 0 || n >= len) \ + return save_symbol->vname; \ + s += n; len -= n +#define PRINT(str) \ + n = snprintf(s, len, str); \ + PRINT_CHECK +#define PRINT_vname(str) \ + n = snprintf(s, len, str, symbol->vname); \ + PRINT_CHECK + + if (message == NULL) + emalloc(message, char *, MAX_LEN, "array_vname"); + + s = message; + len = MAX_LEN; + + /* First, print the vname of the node. */ + PRINT_vname("%s ("); + + for (;;) { + symbol = symbol->prev_array; + /* + * When we don't have enough space and this is not + * the last node, shorten the list. + */ + if (len < 40 && symbol->type == Node_array_ref) { + PRINT("..., "); + symbol = symbol->orig_array; + } + PRINT_vname(from); + if (symbol->type != Node_array_ref) + break; + PRINT(", "); + } + PRINT(")"); + +#undef PRINT_CHECK +#undef PRINT +#undef PRINT_vname +#endif /* MAX_LEN <= 0 */ + + return message; + } +} +#undef MAX_LEN + /* concat_exp --- concatenate expression list into a single string */ NODE * @@ -266,14 +447,10 @@ in_array(NODE *symbol, NODE *subs) register int hash1; NODE *ret; - if (symbol->type == Node_param_list) - symbol = stack_ptr[symbol->param_cnt]; - if (symbol->type == Node_array_ref) - symbol = symbol->orig_array; - if ((symbol->flags & SCALAR) != 0) - fatal(_("attempt to use scalar `%s' as array"), symbol->vname); + symbol = get_array(symbol); + /* - * evaluate subscript first, it could have side effects + * Evaluate subscript first, it could have side effects. */ subs = concat_exp(subs); /* concat_exp returns a string node */ if (symbol->var_array == NULL) { @@ -304,20 +481,11 @@ assoc_lookup(NODE *symbol, NODE *subs, int reference) register int hash1; register NODE *bucket; - /* protect against silly users, e.g. FS[1] = "x" */ - if (symbol->type != Node_var_array && symbol->type != Node_var) - fatal(_("attempt to use scalar `%s' as array"), symbol->vname); + assert(symbol->type == Node_var_array); (void) force_string(subs); - if ((symbol->flags & SCALAR) != 0) - fatal(_("attempt to use scalar `%s' as array"), symbol->vname); - if (symbol->var_array == NULL) { - if (symbol->type != Node_var_array) { - unref(symbol->var_value); - symbol->type = Node_var_array; - } symbol->array_size = symbol->table_size = 0; /* sanity */ symbol->flags &= ~ARRAYMAXED; grow_table(symbol); @@ -336,13 +504,13 @@ assoc_lookup(NODE *symbol, NODE *subs, int reference) if (do_lint && reference) { subs->stptr[subs->stlen] = '\0'; lintwarn(_("reference to uninitialized element `%s[\"%s\"]'"), - symbol->vname, subs->stptr); + array_vname(symbol), subs->stptr); } /* It's not there, install it. */ if (do_lint && subs->stlen == 0) lintwarn(_("subscript of array `%s' is null string"), - symbol->vname); + array_vname(symbol)); /* first see if we would need to grow the array, before installing */ symbol->table_size++; @@ -389,86 +557,63 @@ assoc_lookup(NODE *symbol, NODE *subs, int reference) */ void -do_delete(NODE *symbol, NODE *tree) +do_delete(NODE *sym, NODE *tree) { register int hash1; 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 (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 (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); + register NODE *symbol = get_array(sym); if (tree == NULL) { /* delete array */ assoc_clear(symbol); return; } - hash1 = hash(subs->stptr, subs->stlen, (unsigned long) symbol->array_size); + last = NULL; /* shut up gcc -Wall */ + hash1 = 0; /* ditto */ - last = NULL; - for (bucket = symbol->var_array[hash1]; bucket != NULL; - last = bucket, bucket = bucket->ahnext) { - /* - * This used to use cmp_nodes() here. That's wrong. - * Array indexes are strings; compare as such, always! - */ - const char *s1_str; - size_t s1_len; - NODE *s2; - - s1_str = bucket->ahname_str; - s1_len = bucket->ahname_len; - s2 = subs; + /* + * Always evaluate subscript, it could have side effects. + */ + subs = concat_exp(tree); /* concat_exp returns string node */ - if (s1_len == s2->stlen) { - if (s1_len == 0 /* "" is a valid index */ - || STREQN(s1_str, s2->stptr, s1_len)) - break; + if (symbol->var_array != NULL) { + hash1 = hash(subs->stptr, subs->stlen, + (unsigned long) symbol->array_size); + last = NULL; + for (bucket = symbol->var_array[hash1]; bucket != NULL; + last = bucket, bucket = bucket->ahnext) { + /* + * This used to use cmp_nodes() here. That's wrong. + * Array indexes are strings; compare as such, always! + */ + const char *s1_str; + size_t s1_len; + NODE *s2; + + s1_str = bucket->ahname_str; + s1_len = bucket->ahname_len; + s2 = subs; + + if (s1_len == s2->stlen) { + if (s1_len == 0 /* "" is a valid index */ + || STREQN(s1_str, s2->stptr, s1_len)) + break; + } } - } + } else + bucket = NULL; /* The array is empty. */ if (bucket == NULL) { if (do_lint) lintwarn(_("delete: index `%s' not in array `%s'"), - subs->stptr, symbol->vname); + subs->stptr, array_vname(sym)); free_temp(subs); return; } + free_temp(subs); + if (last != NULL) last->ahnext = bucket->ahnext; else @@ -501,19 +646,10 @@ do_delete_loop(NODE *symbol, NODE *tree) NODE **lhs; Func_ptr after_assign = NULL; - if (symbol->type == Node_param_list) { - symbol = stack_ptr[symbol->param_cnt]; - if (symbol->type == Node_var) - return; - } - if (symbol->type == Node_array_ref) - symbol = symbol->orig_array; - if (symbol->type == Node_var_array) { - if (symbol->var_array == NULL) - return; - } else - fatal(_("delete: illegal use of variable `%s' as array"), - symbol->vname); + symbol = get_array(symbol); + + if (symbol->var_array == NULL) + return; /* get first index value */ for (i = 0; i < symbol->array_size; i++) { @@ -962,32 +1098,17 @@ assoc_sort_inplace(NODE *symbol, ASORT_TYPE how) static NODE * asort_actual(NODE *tree, ASORT_TYPE how) { - NODE *src, *dest; - - src = tree->lnode; - dest = NULL; - - if (src->type == Node_param_list) - src = stack_ptr[src->param_cnt]; - if (src->type == Node_array_ref) - src = src->orig_array; - if (src->type != Node_var_array) - fatal(_("asort: first argument is not an array")); + NODE *array = get_array(tree->lnode); if (tree->rnode != NULL) { /* 2nd optional arg */ - dest = tree->rnode->lnode; - if (dest->type == Node_param_list) - dest = stack_ptr[dest->param_cnt]; - if (dest->type == Node_array_ref) - dest = dest->orig_array; - if (dest->type != Node_var && dest->type != Node_var_array) - fatal(_("asort: second argument is not an array")); - dest->type = Node_var_array; + NODE *dest = get_array(tree->rnode->lnode); + assoc_clear(dest); - dup_table(src, dest); + dup_table(array, dest); + array = dest; } - return dest != NULL ? assoc_sort_inplace(dest, how) : assoc_sort_inplace(src, how); + return assoc_sort_inplace(array, how); } /* do_asort --- sort array by value */ @@ -256,6 +256,15 @@ extern double gawk_strtod(); #define __extension__ #endif +/* this is defined by Windows32 extension libraries. It must be added to + * every variable which is exported (including function pointers) */ +#if defined(WIN32_EXTENSION) && !defined(ATTRIBUTE_EXPORTED) +# define ATTRIBUTE_EXPORTED __declspec(dllimport) +#else +# define ATTRIBUTE_EXPORTED +#endif + + /* ------------------ Constants, Structures, Typedefs ------------------ */ #ifndef AWKNUM @@ -339,12 +348,17 @@ typedef enum nodevals { Node_rule_list, /* lnode is a rule, rnode is rest of list */ Node_rule_node, /* lnode is pattern, rnode is statement */ Node_statement_list, /* lnode is statement, rnode is more list */ + Node_switch_body, /* lnode is the case list, rnode is default list */ + Node_case_list, /* lnode is the case, rnode is a statement list */ Node_if_branches, /* lnode is to run on true, rnode on false */ Node_expression_list, /* lnode is an exp, rnode is more list */ Node_param_list, /* lnode is a variable, rnode is more list */ /* keywords */ Node_K_if, /* lnode is conditonal, rnode is if_branches */ + Node_K_switch, /* lnode is switch value, rnode is body of case statements */ + Node_K_case, /* lnode is case value, rnode is stuff to run */ + Node_K_default, /* lnode is empty, rnode is stuff to run */ Node_K_while, /* lnode is condtional, rnode is stuff to run */ Node_K_for, /* lnode is for_struct, rnode is stuff to run */ Node_K_arrayfor, /* lnode is for_struct, rnode is stuff to run */ @@ -372,8 +386,9 @@ typedef enum nodevals { Node_redirect_twoway, /* subnode is where to redirect */ /* Variables */ - Node_var, /* rnode is value, lnode is array stuff */ - Node_var_array, /* array is ptr to elements, asize num of eles */ + Node_var_new, /* newly created variable, may become an array */ + Node_var, /* scalar variable, lnode is value */ + Node_var_array, /* array is ptr to elements, table_size num of eles */ Node_val, /* node is a value - type in flags */ /* Builtins subnode is explist to work on, builtin is func to call */ @@ -490,12 +505,10 @@ typedef struct exp_node { # define MAYBE_NUM 128 /* user input: if NUMERIC then * a NUMBER */ # define ARRAYMAXED 256 /* array is at max size */ -# define SCALAR 512 /* used as scalar, can't be array */ -# define FUNC 1024 /* this parameter is really a - * function name; see awk.y */ -# define FIELD 2048 /* this is a field */ -# define INTLSTR 4096 /* use localized version */ -# define UNINITIALIZED 8192 /* value used before set */ +# define FUNC 512 /* this parameter is really a + * function name; see awkgram.y */ +# define FIELD 1024 /* this is a field */ +# define INTLSTR 2048 /* use localized version */ } NODE; #define vname sub.nodep.name @@ -529,12 +542,17 @@ typedef struct exp_node { #define numbr sub.val.fltnum +/* Node_var: */ #define var_value lnode + +/* Node_var_array: */ #define var_array sub.nodep.r.av #define array_size sub.nodep.l.ll #define table_size sub.nodep.x.xl +/* Node_array_ref: */ #define orig_array sub.nodep.x.extra +#define prev_array rnode #define printf_count sub.nodep.x.xl @@ -560,7 +578,6 @@ typedef struct iobuf { 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; @@ -649,7 +666,7 @@ extern char *ORS; extern int ORSlen; extern char *OFMT; extern char *CONVFMT; -extern int CONVFMTidx; +ATTRIBUTE_EXPORTED extern int CONVFMTidx; extern int OFMTidx; extern char *TEXTDOMAIN; extern NODE *BINMODE_node, *CONVFMT_node, *FIELDWIDTHS_node, *FILENAME_node; @@ -657,15 +674,21 @@ extern NODE *FNR_node, *FS_node, *IGNORECASE_node, *NF_node; extern NODE *NR_node, *OFMT_node, *OFS_node, *ORS_node, *RLENGTH_node; extern NODE *RSTART_node, *RS_node, *RT_node, *SUBSEP_node, *PROCINFO_node; extern NODE *LINT_node, *ERRNO_node, *TEXTDOMAIN_node; -extern NODE **stack_ptr; +ATTRIBUTE_EXPORTED extern NODE **stack_ptr; extern NODE *Nnull_string; +extern NODE *Null_field; extern NODE **fields_arr; extern int sourceline; extern char *source; extern NODE *expression_value; #if __GNUC__ < 2 -extern NODE *_t; /* used as temporary in tree_eval */ +# if defined(WIN32_EXTENSION) +static +# else +extern +#endif +NODE *_t; /* used as temporary in tree_eval */ #endif extern NODE *nextfree; @@ -684,7 +707,7 @@ extern int whiny_users; #define do_lint 0 #define do_lint_old 0 #else -extern int do_lint; +ATTRIBUTE_EXPORTED extern int do_lint; extern int do_lint_old; #endif #ifdef MBS_SUPPORT @@ -710,17 +733,19 @@ extern const char casetable[]; /* for case-independent regexp matching */ #define isnondecimal(str) (((str)[0]) == '0' && (ISDIGIT((str)[1]) \ || (str)[1] == 'x' || (str)[1] == 'X')) +#define var_uninitialized(n) ((n)->var_value == Nnull_string) + #ifdef MPROF -#define getnode(n) emalloc((n), NODE *, sizeof(NODE), "getnode"), (n)->flags = UNINITIALIZED, (n)-exec_count = 0; +#define getnode(n) emalloc((n), NODE *, sizeof(NODE), "getnode"), (n)->flags = 0, (n)-exec_count = 0; #define freenode(n) free(n) #else /* not MPROF */ #define getnode(n) if (nextfree) n = nextfree, nextfree = nextfree->nextp;\ else n = more_nodes() #ifndef NO_PROFILING -#define freenode(n) ((n)->flags = UNINITIALIZED,\ +#define freenode(n) ((n)->flags = 0,\ (n)->exec_count = 0, (n)->nextp = nextfree, nextfree = (n)) #else /* not PROFILING */ -#define freenode(n) ((n)->flags = UNINITIALIZED,\ +#define freenode(n) ((n)->flags = 0,\ (n)->nextp = nextfree, nextfree = (n)) #endif /* not PROFILING */ #endif /* not MPROF */ @@ -746,15 +771,19 @@ extern const char casetable[]; /* for case-independent regexp matching */ #define dupnode(n) r_dupnode(n) #endif /* GAWKDEBUG */ +#define get_array(t) get_actual(t, TRUE) /* allowed to die fatally */ +#define get_param(t) get_actual(t, FALSE) /* not allowed */ + #ifdef MEMDEBUG #undef freenode #define get_lhs(p, a, r) r_get_lhs((p), (a), (r)) #define m_tree_eval(t, iscond) r_tree_eval(t, iscond) #else #define get_lhs(p, a, r) ((p)->type == Node_var && \ - ((p)->flags & UNINITIALIZED) == 0 && (r) ? \ - (&(p)->var_value): \ + ! var_uninitialized(p) ? \ + (&(p)->var_value) : \ r_get_lhs((p), (a), (r))) +#define TREE_EVAL_MACRO 1 #if __GNUC__ >= 2 #define m_tree_eval(t, iscond) __extension__ \ ({NODE * _t = (t); \ @@ -767,7 +796,7 @@ extern const char casetable[]; /* for case-independent regexp matching */ _t = r_force_string(_t); \ break; \ case Node_var: \ - if ((_t->flags & UNINITIALIZED) == 0) { \ + if (! var_uninitialized(_t)) { \ _t = _t->var_value; \ break; \ } \ @@ -786,7 +815,7 @@ extern const char casetable[]; /* for case-independent regexp matching */ r_force_string(_t) : \ (_t->type == Node_val ? _t : \ (_t->type == Node_var && \ - (_t->flags & UNINITIALIZED) == 0 ? _t->var_value : \ + ! var_uninitialized(_t) ? _t->var_value : \ r_tree_eval(_t, iscond)))))) #endif /* __GNUC__ */ #endif /* not MEMDEBUG */ @@ -867,6 +896,8 @@ extern double _msc51bug; /* ------------- Function prototypes or defs (as appropriate) ------------- */ /* array.c */ +extern NODE *get_actual P((NODE *symbol, int canfatal)); +extern char *array_vname P((const NODE *symbol)); extern void array_init P((void)); extern NODE *concat_exp P((NODE *tree)); extern void assoc_clear P((NODE *symbol)); @@ -991,6 +1022,12 @@ extern void os_restore_mode P((int fd)); extern size_t optimal_bufsize P((int fd, struct stat *sbuf)); extern int ispath P((const char *file)); extern int isdirpunct P((int c)); +#if defined(_MSC_VER) && !defined(_WIN32) +extern char *memcpy_ulong P((char *dest, const char *src, unsigned long l)); +extern void *memset_ulong P((void *dest, int val, unsigned long l)); +#define memcpy memcpy_ulong +#define memset memset_ulong +#endif /* io.c */ extern void set_FNR P((void)); extern void set_NR P((void)); @@ -1025,6 +1062,7 @@ 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; +ATTRIBUTE_EXPORTED #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2) extern void (*lintfunc) (const char *mesg, ...) ATTRIBUTE_PRINTF_1; #else @@ -72,28 +72,31 @@ 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 + LEX_SWITCH = 277, + LEX_CASE = 278, + LEX_DEFAULT = 279, + LEX_WHILE = 280, + LEX_DO = 281, + LEX_FOR = 282, + LEX_BREAK = 283, + LEX_CONTINUE = 284, + LEX_PRINT = 285, + LEX_PRINTF = 286, + LEX_NEXT = 287, + LEX_EXIT = 288, + LEX_FUNCTION = 289, + LEX_GETLINE = 290, + LEX_NEXTFILE = 291, + LEX_IN = 292, + LEX_AND = 293, + LEX_OR = 294, + INCREMENT = 295, + DECREMENT = 296, + LEX_BUILTIN = 297, + LEX_LENGTH = 298, + NEWLINE = 299, + SLASH_BEFORE_EQUAL = 300, + UNARY = 301 }; #endif #define FUNC_CALL 258 @@ -115,28 +118,31 @@ #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 +#define LEX_SWITCH 277 +#define LEX_CASE 278 +#define LEX_DEFAULT 279 +#define LEX_WHILE 280 +#define LEX_DO 281 +#define LEX_FOR 282 +#define LEX_BREAK 283 +#define LEX_CONTINUE 284 +#define LEX_PRINT 285 +#define LEX_PRINTF 286 +#define LEX_NEXT 287 +#define LEX_EXIT 288 +#define LEX_FUNCTION 289 +#define LEX_GETLINE 290 +#define LEX_NEXTFILE 291 +#define LEX_IN 292 +#define LEX_AND 293 +#define LEX_OR 294 +#define INCREMENT 295 +#define DECREMENT 296 +#define LEX_BUILTIN 297 +#define LEX_LENGTH 298 +#define NEWLINE 299 +#define SLASH_BEFORE_EQUAL 300 +#define UNARY 301 @@ -178,6 +184,7 @@ static int isassignable P((NODE *n)); static void dumpintlstr P((const char *str, size_t len)); static void dumpintlstr2 P((const char *str1, size_t len1, const char *str2, size_t len2)); static void count_args P((NODE *n)); +static int isarray P((NODE *n)); enum defref { FUNC_DEFINE, FUNC_USE }; static void func_use P((const char *name, enum defref how)); @@ -240,7 +247,7 @@ static char builtin_func[] = "@builtin"; #endif #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 109 "awkgram.y" +#line 110 "awkgram.y" typedef union YYSTYPE { long lval; AWKNUM fval; @@ -250,7 +257,7 @@ typedef union YYSTYPE { NODE *(*ptrval) P((void)); } YYSTYPE; /* Line 191 of yacc.c. */ -#line 253 "y.tab.c" +#line 260 "y.tab.c" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 @@ -262,7 +269,7 @@ typedef union YYSTYPE { /* Line 214 of yacc.c. */ -#line 265 "y.tab.c" +#line 272 "y.tab.c" #if ! defined (yyoverflow) || YYERROR_VERBOSE @@ -363,20 +370,20 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 5 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 878 +#define YYLAST 1008 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 64 +#define YYNTOKENS 67 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 48 +#define YYNNTS 53 /* YYNRULES -- Number of rules. */ -#define YYNRULES 142 +#define YYNRULES 155 /* YYNRULES -- Number of states. */ -#define YYNSTATES 264 +#define YYNSTATES 293 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 298 +#define YYMAXUTOK 301 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -387,16 +394,16 @@ 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, 56, 2, 2, 59, 55, 2, 2, + 60, 61, 53, 51, 48, 52, 2, 54, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 47, 66, + 49, 2, 50, 46, 2, 2, 2, 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, 62, 2, 63, 58, 2, 2, 2, 2, 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, 64, 2, 65, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -413,7 +420,8 @@ static const unsigned char yytranslate[] = 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 + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 57 }; #if YYDEBUG @@ -424,89 +432,95 @@ 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 + 77, 80, 83, 87, 89, 99, 106, 115, 124, 137, + 149, 152, 155, 158, 161, 165, 166, 171, 174, 175, + 180, 186, 189, 194, 196, 197, 199, 201, 202, 205, + 208, 214, 219, 221, 224, 227, 229, 231, 233, 235, + 237, 243, 244, 245, 249, 256, 266, 268, 271, 272, + 274, 275, 278, 279, 281, 283, 287, 289, 292, 296, + 297, 299, 300, 302, 304, 308, 310, 313, 317, 321, + 325, 329, 333, 337, 341, 345, 351, 353, 355, 357, + 360, 362, 364, 366, 368, 370, 373, 379, 381, 384, + 386, 390, 394, 398, 402, 406, 410, 414, 419, 422, + 425, 428, 432, 437, 442, 444, 449, 451, 454, 457, + 459, 461, 464, 467, 468, 470, 472, 477, 480, 483, + 486, 488, 489, 491, 493, 495 }; /* 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 + 68, 0, -1, 97, 69, 97, -1, -1, 69, 70, + -1, 69, 1, -1, 71, 72, -1, 71, 81, -1, + 75, 72, -1, -1, 104, -1, 104, 48, 104, -1, + 16, -1, 17, -1, 113, 80, 114, 116, 97, -1, + 4, -1, 3, -1, 74, -1, 42, -1, 43, -1, + -1, 34, 76, 73, 60, 99, 115, 97, -1, -1, + 79, 78, 5, -1, 54, -1, 45, -1, -1, 80, + 82, -1, 80, 1, -1, 96, -1, 117, 97, -1, + 117, 97, -1, 113, 80, 114, -1, 95, -1, 22, + 60, 104, 115, 97, 113, 87, 97, 114, -1, 25, + 60, 104, 115, 97, 82, -1, 26, 97, 82, 25, + 60, 104, 115, 97, -1, 27, 60, 4, 37, 4, + 115, 97, 82, -1, 27, 60, 86, 117, 97, 104, + 117, 97, 86, 115, 97, 82, -1, 27, 60, 86, + 117, 97, 117, 97, 86, 115, 97, 82, -1, 28, + 81, -1, 29, 81, -1, 32, 81, -1, 36, 81, + -1, 33, 101, 81, -1, -1, 20, 83, 101, 81, + -1, 84, 81, -1, -1, 91, 85, 92, 93, -1, + 21, 4, 62, 103, 63, -1, 21, 4, -1, 21, + 60, 4, 61, -1, 104, -1, -1, 84, -1, 88, + -1, -1, 88, 89, -1, 88, 1, -1, 23, 90, + 118, 97, 80, -1, 24, 118, 97, 80, -1, 7, + -1, 52, 7, -1, 51, 7, -1, 8, -1, 77, + -1, 30, -1, 31, -1, 102, -1, 60, 104, 119, + 103, 115, -1, -1, -1, 10, 94, 108, -1, 18, + 60, 104, 115, 97, 82, -1, 18, 60, 104, 115, + 97, 82, 19, 97, 82, -1, 44, -1, 96, 44, + -1, -1, 96, -1, -1, 49, 109, -1, -1, 100, + -1, 4, -1, 100, 119, 4, -1, 1, -1, 100, + 1, -1, 100, 119, 1, -1, -1, 104, -1, -1, + 103, -1, 104, -1, 103, 119, 104, -1, 1, -1, + 103, 1, -1, 103, 1, 104, -1, 103, 119, 1, + -1, 112, 105, 104, -1, 104, 38, 104, -1, 104, + 39, 104, -1, 104, 14, 104, -1, 104, 37, 4, + -1, 104, 107, 104, -1, 104, 46, 104, 47, 104, + -1, 108, -1, 13, -1, 12, -1, 45, 13, -1, + 9, -1, 49, -1, 106, -1, 50, -1, 77, -1, + 56, 77, -1, 60, 103, 115, 37, 4, -1, 109, + -1, 108, 109, -1, 110, -1, 109, 58, 109, -1, + 109, 53, 109, -1, 109, 54, 109, -1, 109, 55, + 109, -1, 109, 51, 109, -1, 109, 52, 109, -1, + 35, 111, 98, -1, 109, 11, 35, 111, -1, 112, + 40, -1, 112, 41, -1, 56, 109, -1, 60, 104, + 115, -1, 42, 60, 102, 115, -1, 43, 60, 102, + 115, -1, 43, -1, 3, 60, 102, 115, -1, 112, + -1, 40, 112, -1, 41, 112, -1, 7, -1, 8, + -1, 52, 109, -1, 51, 109, -1, -1, 112, -1, + 4, -1, 4, 62, 103, 63, -1, 59, 110, -1, + 64, 97, -1, 65, 97, -1, 61, -1, -1, 117, + -1, 66, -1, 47, -1, 48, 97, -1 }; /* 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, + 0, 171, 171, 177, 179, 184, 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 + 358, 362, 364, 366, 368, 370, 372, 374, 416, 420, + 425, 428, 431, 440, 460, 463, 462, 469, 481, 481, + 512, 514, 528, 543, 549, 550, 555, 608, 609, 626, + 631, 633, 638, 640, 645, 647, 649, 654, 655, 663, + 664, 670, 675, 675, 686, 691, 698, 699, 702, 704, + 709, 710, 716, 717, 722, 724, 726, 728, 730, 737, + 738, 744, 745, 750, 752, 758, 760, 762, 764, 769, + 775, 777, 779, 785, 787, 793, 795, 800, 802, 804, + 809, 811, 815, 816, 821, 823, 831, 833, 835, 840, + 842, 844, 846, 848, 850, 852, 854, 860, 865, 867, + 872, 874, 876, 879, 881, 889, 897, 898, 900, 902, + 904, 907, 915, 927, 928, 933, 935, 949, 954, 958, + 962, 965, 967, 971, 975, 978 }; #endif @@ -518,22 +532,24 @@ 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 + "LEX_RETURN", "LEX_DELETE", "LEX_SWITCH", "LEX_CASE", "LEX_DEFAULT", + "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", + "switch_body", "case_statements", "case_statement", "case_value", + "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", "colon", "comma", 0 }; #endif @@ -546,30 +562,31 @@ static const unsigned short yytoknum[] = 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 + 295, 296, 297, 298, 299, 300, 63, 58, 44, 60, + 62, 43, 45, 42, 47, 37, 33, 301, 94, 36, + 40, 41, 91, 93, 123, 125, 59 }; # endif /* 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 + 0, 67, 68, 69, 69, 69, 70, 70, 70, 71, + 71, 71, 71, 71, 72, 73, 73, 73, 74, 74, + 76, 75, 78, 77, 79, 79, 80, 80, 80, 81, + 81, 82, 82, 82, 82, 82, 82, 82, 82, 82, + 82, 82, 82, 82, 82, 83, 82, 82, 85, 84, + 84, 84, 84, 84, 86, 86, 87, 88, 88, 88, + 89, 89, 90, 90, 90, 90, 90, 91, 91, 92, + 92, 93, 94, 93, 95, 95, 96, 96, 97, 97, + 98, 98, 99, 99, 100, 100, 100, 100, 100, 101, + 101, 102, 102, 103, 103, 103, 103, 103, 103, 104, + 104, 104, 104, 104, 104, 104, 104, 105, 105, 105, + 106, 106, 107, 107, 108, 108, 108, 108, 108, 109, + 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, + 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, + 110, 110, 110, 111, 111, 112, 112, 112, 113, 114, + 115, 116, 116, 117, 118, 119 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -578,18 +595,19 @@ 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 + 2, 2, 3, 1, 9, 6, 8, 8, 12, 11, + 2, 2, 2, 2, 3, 0, 4, 2, 0, 4, + 5, 2, 4, 1, 0, 1, 1, 0, 2, 2, + 5, 4, 1, 2, 2, 1, 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, 1, 2 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -597,309 +615,346 @@ static const unsigned char yyr2[] = 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 + 78, 76, 0, 79, 3, 1, 77, 0, 5, 0, + 145, 139, 140, 12, 13, 20, 143, 0, 0, 0, + 134, 25, 0, 0, 24, 0, 0, 0, 4, 0, + 0, 114, 22, 2, 10, 106, 117, 119, 136, 0, + 0, 0, 80, 144, 137, 138, 0, 0, 0, 0, + 142, 136, 141, 115, 130, 147, 136, 95, 0, 93, + 78, 153, 6, 7, 29, 26, 78, 8, 0, 110, + 0, 0, 0, 0, 0, 0, 111, 113, 112, 0, + 118, 0, 0, 0, 0, 0, 0, 0, 108, 107, + 128, 129, 0, 0, 0, 0, 93, 0, 16, 15, + 18, 19, 0, 17, 0, 126, 0, 0, 0, 96, + 78, 150, 0, 0, 131, 148, 0, 30, 23, 102, + 103, 100, 101, 0, 11, 104, 143, 124, 125, 121, + 122, 123, 120, 109, 99, 135, 146, 0, 81, 132, + 133, 97, 155, 0, 98, 94, 28, 0, 45, 0, + 0, 0, 78, 0, 0, 0, 67, 68, 0, 89, + 0, 78, 27, 0, 48, 33, 53, 26, 151, 78, + 0, 127, 86, 84, 0, 0, 116, 0, 89, 51, + 0, 0, 0, 0, 54, 40, 41, 42, 0, 90, + 43, 149, 47, 0, 0, 78, 152, 31, 105, 78, + 87, 0, 0, 0, 0, 0, 0, 0, 0, 145, + 55, 0, 44, 0, 71, 69, 32, 14, 21, 88, + 85, 78, 46, 0, 52, 78, 78, 0, 0, 78, + 93, 72, 49, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 74, 57, 35, 0, 78, 0, 78, 0, + 73, 78, 78, 0, 78, 0, 78, 54, 70, 0, + 0, 59, 0, 0, 58, 36, 37, 54, 0, 75, + 34, 62, 65, 0, 0, 66, 0, 154, 78, 0, + 78, 64, 63, 78, 26, 78, 0, 26, 0, 0, + 39, 0, 38 }; /* 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 + 31, 68, 32, 116, 63, 162, 178, 163, 193, 211, + 252, 253, 264, 276, 164, 214, 232, 241, 165, 3, + 4, 105, 174, 175, 188, 94, 95, 166, 93, 78, + 79, 35, 36, 37, 42, 38, 167, 168, 114, 195, + 169, 278, 113 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -238 +#define YYPACT_NINF -236 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 + -15, -236, 31, -3, -236, -236, -236, 292, -236, -8, + -2, -236, -236, -236, -236, -236, 26, 26, 26, 4, + 6, -236, 934, 934, -236, 876, 262, 717, -236, -16, + 3, -236, -236, -236, 769, 934, 480, -236, 554, 656, + 717, 33, 49, -236, -236, -236, 656, 656, 934, 905, + 41, -1, 41, -236, 41, -236, -236, -236, 117, 695, + -15, -236, -236, -236, -3, -236, -15, -236, 101, -236, + 905, 103, 905, 905, 905, 905, -236, -236, -236, 905, + 480, 74, 934, 934, 934, 934, 934, 934, -236, -236, + -236, -236, 100, 905, 54, 17, 958, 32, -236, -236, + -236, -236, 56, -236, 934, -236, 54, 54, 695, 905, + -15, -236, 86, 739, -236, -236, 454, -236, -236, 133, + -236, 184, 166, 823, 958, 7, 26, 136, 136, 41, + 41, 41, 41, -236, 958, -236, -236, 43, 538, -236, + -236, 958, -236, 121, -236, 958, -236, 68, -236, 2, + 69, 70, -15, 71, 61, 61, -236, -236, 61, 905, + 61, -15, -236, 61, -236, -236, 958, -236, 73, -15, + 905, -236, -236, -236, 54, 123, -236, 905, 905, 81, + 131, 905, 905, 580, 793, -236, -236, -236, 61, 958, + -236, -236, -236, 520, 454, -15, -236, -236, 958, -15, + -236, 45, 695, 61, 717, 83, 695, 695, 130, -11, + -236, 73, -236, 717, 147, -236, -236, -236, -236, -236, + -236, -15, -236, 34, -236, -15, -15, 108, 169, -15, + 508, -236, -236, 580, -236, 3, 580, 905, 54, 634, + 717, 905, 155, -236, -236, 695, -15, 502, -15, 117, + 934, -15, -15, 19, -15, 580, -15, 847, -236, 580, + 111, -236, 201, 132, -236, -236, -236, 847, 54, -236, + -236, -236, -236, 178, 179, -236, 132, -236, -15, 54, + -15, -236, -236, -15, -236, -15, 580, -236, 346, 580, + -236, 400, -236 }; /* 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 + -236, -236, -236, -236, -236, 165, -236, -236, -236, -236, + -24, -236, -236, -150, 152, -178, -236, -165, -236, -235, + -236, -236, -236, -236, -236, -236, -236, -236, -236, -22, + -7, -236, -236, -236, 21, -32, -17, 47, -236, -236, + -236, -41, 66, 175, 76, -14, -5, -181, 52, -236, + 9, -71, -130 }; /* 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 +#define YYTABLE_NINF -93 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, + 33, 53, 43, 44, 45, 208, 179, 64, 51, 51, + 58, 51, 56, 216, 106, 107, -93, 194, 109, 210, + 261, 51, 268, 97, 65, 65, 228, -92, 1, 1, + 10, 5, 279, 109, 51, 109, 98, 99, 66, 90, + 91, 6, 262, 263, 172, 201, 219, 173, 60, 220, + 61, 40, 39, 115, 34, 242, -93, -93, 244, 117, + 40, -92, 180, -56, 46, 110, 47, 60, 51, 51, + 51, 51, 51, 51, 59, 100, 101, 266, -92, 270, + 110, 269, 110, -92, -56, 26, 96, 96, 50, 52, + 51, 54, 210, 96, 96, 136, 108, 234, 104, 87, + 240, 80, 210, 142, -82, 1, 118, 120, 290, 126, + 112, 292, 43, 133, 54, 111, 137, 119, 109, 121, + 122, 123, 124, 143, 200, 176, 125, 61, 177, 181, + 182, 184, 64, 64, 288, 205, 64, 291, 64, 61, + 134, 64, 69, 204, 224, 183, 135, -93, 127, 128, + 129, 130, 131, 132, 191, 227, 141, 231, 139, 140, + 145, 215, 197, 66, 66, 110, 64, 66, 237, 66, + 138, 110, 66, 238, 251, 69, 161, 196, 111, 277, + 70, 64, 76, 77, -83, 281, 282, 223, 217, 84, + 85, 86, 218, 69, 87, 67, 58, 66, 70, 203, + 250, 55, 171, 71, 72, 283, 189, 0, 271, 272, + 0, 0, 66, 0, 233, 76, 77, 198, 235, 236, + 229, 71, 239, 249, 202, 189, 199, 51, 206, 207, + 243, 0, 0, 76, 77, 0, 51, 0, 275, 255, + 96, 257, 0, 0, 259, 260, 21, 265, 248, 267, + 0, 96, 273, 274, 221, 24, 256, 0, 225, 226, + 230, 0, 0, 0, 0, 9, 10, 0, 0, 11, + 12, 284, 0, 286, 0, 0, 287, 0, 289, 0, + 0, 0, 0, 0, 245, 0, 247, 96, 0, 0, + 246, 0, -78, 8, 0, 9, 10, 254, 0, 11, + 12, 258, 17, 18, 19, 20, 185, 186, 13, 14, + 187, 0, 190, 22, 23, 192, 80, 0, 48, 0, + 280, 26, 49, 0, 0, 0, 15, 16, 0, 0, + 0, 285, 17, 18, 19, 20, 1, 21, 0, 0, + 212, 0, 0, 22, 23, 0, 24, 146, 25, 9, + 10, 26, 27, 11, 12, 222, -9, 0, -9, 0, + 0, 0, 0, 0, 147, 0, 148, 149, 150, -61, + -61, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 0, 16, 160, 0, 0, 0, 17, 18, 19, 20, + -61, 21, 0, 0, 0, 0, 0, 22, 23, 0, + 24, 146, 25, 9, 10, 26, 27, 11, 12, 0, + 60, -61, 61, 0, 0, 0, 0, 0, 147, 0, + 148, 149, 150, -60, -60, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 0, 16, 160, 0, 0, 0, + 17, 18, 19, 20, -60, 21, 0, 0, 0, 0, + 0, 22, 23, 0, 24, 146, 25, 9, 10, 26, + 27, 11, 12, 0, 60, -60, 61, 0, 0, 0, + 0, 0, 147, 0, 148, 149, 150, 0, 0, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 0, 16, + 160, 81, 0, 0, 17, 18, 19, 20, 0, 21, + 0, 0, 0, 0, 0, 22, 23, 0, 24, 0, + 25, 69, 0, 26, 27, 0, 70, 69, 60, 161, + 61, 57, 70, 9, 10, 0, 0, 11, 12, 0, + -91, 82, 83, 84, 85, 86, 0, 0, 87, 71, + 72, 73, 0, 0, 0, 71, 72, 73, 74, -93, + 0, 76, 77, 0, 74, 16, 110, 76, 77, 0, + 17, 18, 19, 20, -91, 21, 88, 89, 61, 111, + 0, 22, 23, 0, 24, 0, 25, 0, 0, 26, + 213, -91, 0, 9, 10, 0, -91, 11, 12, 82, + 83, 84, 85, 86, 90, 91, 87, 0, 147, 92, + 148, 149, 150, 0, 0, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 0, 16, 160, 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, + 27, 11, 12, 0, 60, 0, 61, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 57, 0, 9, + 10, 0, 0, 11, 12, 0, 0, 0, 0, 16, + 0, 0, 0, 0, 17, 18, 19, 20, 0, 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, + 25, 16, 0, 26, 27, 0, 17, 18, 19, 20, + 61, 21, 0, 0, 69, 0, 0, 22, 23, 70, + 24, 0, 25, 0, 0, 26, 27, -91, 57, 0, + 9, 10, 0, 0, 11, 12, 0, 0, 0, 0, + 0, 0, 71, 72, 73, 0, 0, 0, 0, 0, + 144, 74, 9, 10, 76, 77, 11, 12, 0, 0, + 0, 0, 16, 0, 0, 0, 111, 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, 209, 26, 27, + 11, 12, 0, 0, 0, 0, 71, 72, 73, 0, + 0, 0, 0, 0, 149, 74, 0, 75, 76, 77, + 0, 0, 0, 156, 157, 0, 0, 0, 16, 0, + 0, 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, 0, 0, 0, + 71, 72, 73, 0, 0, 0, 0, 0, 149, 74, + 170, 0, 76, 77, 0, 0, 0, 156, 157, 9, + 10, 0, 16, 11, 12, 0, 0, 17, 18, 19, + 20, 0, 21, 0, 0, 0, 0, 0, 22, 23, + 0, 24, 0, 25, 0, 0, 26, 27, 9, 10, + 0, 16, 11, 12, 0, 0, 17, 18, 19, 20, + 0, 21, 0, 0, 0, 0, 0, 22, 23, 0, + 24, 0, 48, 0, 0, 26, 49, 9, 10, 0, + 16, 11, 12, 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 + 0, 25, 0, 0, 26, 27, 0, 69, 0, 16, + 0, 0, 70, 0, 17, 18, 19, 20, 0, 0, + 0, 0, 0, 0, 0, 22, 23, 0, 0, 0, + 48, 0, 0, 26, 49, 71, 72, 73, 0, 0, + 0, 0, 0, 0, 74, 0, 0, 76, 77 }; 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, + 7, 25, 16, 17, 18, 183, 4, 29, 22, 23, + 27, 25, 26, 194, 46, 47, 9, 167, 1, 184, + 1, 35, 257, 40, 29, 30, 37, 10, 44, 44, + 4, 0, 267, 1, 48, 1, 3, 4, 29, 40, + 41, 44, 23, 24, 1, 175, 1, 4, 64, 4, + 66, 62, 60, 60, 7, 233, 49, 50, 236, 66, + 62, 44, 60, 44, 60, 48, 60, 64, 82, 83, + 84, 85, 86, 87, 27, 42, 43, 255, 61, 260, + 48, 259, 48, 66, 65, 59, 39, 40, 22, 23, + 104, 25, 257, 46, 47, 63, 49, 63, 49, 58, + 230, 35, 267, 110, 61, 44, 5, 4, 286, 35, + 58, 289, 126, 13, 48, 61, 60, 70, 1, 72, + 73, 74, 75, 37, 1, 4, 79, 66, 60, 60, + 60, 60, 154, 155, 284, 4, 158, 287, 160, 66, + 93, 163, 9, 62, 61, 152, 94, 14, 82, 83, + 84, 85, 86, 87, 161, 25, 109, 10, 106, 107, + 113, 193, 169, 154, 155, 48, 188, 158, 60, 160, + 104, 48, 163, 4, 19, 9, 65, 168, 61, 47, + 14, 203, 49, 50, 61, 7, 7, 204, 195, 53, + 54, 55, 199, 9, 58, 30, 213, 188, 14, 178, + 241, 26, 126, 37, 38, 276, 159, -1, 7, 8, + -1, -1, 203, -1, 221, 49, 50, 170, 225, 226, + 211, 37, 229, 240, 177, 178, 174, 241, 181, 182, + 235, -1, -1, 49, 50, -1, 250, -1, 262, 246, + 193, 248, -1, -1, 251, 252, 45, 254, 239, 256, + -1, 204, 51, 52, 202, 54, 247, -1, 206, 207, + 213, -1, -1, -1, -1, 3, 4, -1, -1, 7, + 8, 278, -1, 280, -1, -1, 283, -1, 285, -1, + -1, -1, -1, -1, 237, -1, 239, 240, -1, -1, + 238, -1, 0, 1, -1, 3, 4, 245, -1, 7, + 8, 249, 40, 41, 42, 43, 154, 155, 16, 17, + 158, -1, 160, 51, 52, 163, 250, -1, 56, -1, + 268, 59, 60, -1, -1, -1, 34, 35, -1, -1, + -1, 279, 40, 41, 42, 43, 44, 45, -1, -1, + 188, -1, -1, 51, 52, -1, 54, 1, 56, 3, + 4, 59, 60, 7, 8, 203, 64, -1, 66, -1, + -1, -1, -1, -1, 18, -1, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + -1, 35, 36, -1, -1, -1, 40, 41, 42, 43, + 44, 45, -1, -1, -1, -1, -1, 51, 52, -1, + 54, 1, 56, 3, 4, 59, 60, 7, 8, -1, + 64, 65, 66, -1, -1, -1, -1, -1, 18, -1, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, -1, 35, 36, -1, -1, -1, + 40, 41, 42, 43, 44, 45, -1, -1, -1, -1, + -1, 51, 52, -1, 54, 1, 56, 3, 4, 59, + 60, 7, 8, -1, 64, 65, 66, -1, -1, -1, + -1, -1, 18, -1, 20, 21, 22, -1, -1, 25, + 26, 27, 28, 29, 30, 31, 32, 33, -1, 35, + 36, 11, -1, -1, 40, 41, 42, 43, -1, 45, + -1, -1, -1, -1, -1, 51, 52, -1, 54, -1, + 56, 9, -1, 59, 60, -1, 14, 9, 64, 65, + 66, 1, 14, 3, 4, -1, -1, 7, 8, -1, + 10, 51, 52, 53, 54, 55, -1, -1, 58, 37, + 38, 39, -1, -1, -1, 37, 38, 39, 46, 11, + -1, 49, 50, -1, 46, 35, 48, 49, 50, -1, + 40, 41, 42, 43, 44, 45, 12, 13, 66, 61, + -1, 51, 52, -1, 54, -1, 56, -1, -1, 59, + 60, 61, -1, 3, 4, -1, 66, 7, 8, 51, + 52, 53, 54, 55, 40, 41, 58, -1, 18, 45, + 20, 21, 22, -1, -1, 25, 26, 27, 28, 29, + 30, 31, 32, 33, -1, 35, 36, -1, -1, -1, + 40, 41, 42, 43, -1, 45, -1, -1, -1, -1, + -1, 51, 52, -1, 54, -1, 56, 3, 4, 59, + 60, 7, 8, -1, 64, -1, 66, -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 + 4, -1, -1, 7, 8, -1, -1, -1, -1, 35, + -1, -1, -1, -1, 40, 41, 42, 43, -1, 45, + -1, -1, -1, -1, -1, 51, 52, -1, 54, -1, + 56, 35, -1, 59, 60, -1, 40, 41, 42, 43, + 66, 45, -1, -1, 9, -1, -1, 51, 52, 14, + 54, -1, 56, -1, -1, 59, 60, 61, 1, -1, + 3, 4, -1, -1, 7, 8, -1, -1, -1, -1, + -1, -1, 37, 38, 39, -1, -1, -1, -1, -1, + 1, 46, 3, 4, 49, 50, 7, 8, -1, -1, + -1, -1, 35, -1, -1, -1, 61, 40, 41, 42, + 43, -1, 45, -1, -1, -1, -1, -1, 51, 52, + -1, 54, -1, 56, 35, -1, 59, 60, 9, 40, + 41, 42, 43, 14, 45, -1, -1, -1, -1, -1, + 51, 52, -1, 54, -1, 56, 3, 4, 59, 60, + 7, 8, -1, -1, -1, -1, 37, 38, 39, -1, + -1, -1, -1, -1, 21, 46, -1, 48, 49, 50, + -1, -1, -1, 30, 31, -1, -1, -1, 35, -1, + -1, -1, 9, 40, 41, 42, 43, 14, 45, -1, + -1, -1, -1, -1, 51, 52, -1, 54, -1, 56, + 3, 4, 59, 60, 7, 8, -1, -1, -1, -1, + 37, 38, 39, -1, -1, -1, -1, -1, 21, 46, + 47, -1, 49, 50, -1, -1, -1, 30, 31, 3, + 4, -1, 35, 7, 8, -1, -1, 40, 41, 42, + 43, -1, 45, -1, -1, -1, -1, -1, 51, 52, + -1, 54, -1, 56, -1, -1, 59, 60, 3, 4, + -1, 35, 7, 8, -1, -1, 40, 41, 42, 43, + -1, 45, -1, -1, -1, -1, -1, 51, 52, -1, + 54, -1, 56, -1, -1, 59, 60, 3, 4, -1, + 35, 7, 8, -1, -1, 40, 41, 42, 43, -1, + 45, -1, -1, -1, -1, -1, 51, 52, -1, 54, + -1, 56, -1, -1, 59, 60, -1, 9, -1, 35, + -1, -1, 14, -1, 40, 41, 42, 43, -1, -1, + -1, -1, -1, -1, -1, 51, 52, -1, -1, -1, + 56, -1, -1, 59, 60, 37, 38, 39, -1, -1, + -1, -1, -1, -1, 46, -1, -1, 49, 50 }; /* 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 + 0, 44, 68, 96, 97, 0, 44, 69, 1, 3, + 4, 7, 8, 16, 17, 34, 35, 40, 41, 42, + 43, 45, 51, 52, 54, 56, 59, 60, 70, 71, + 75, 77, 79, 97, 104, 108, 109, 110, 112, 60, + 62, 76, 111, 112, 112, 112, 60, 60, 56, 60, + 109, 112, 109, 77, 109, 110, 112, 1, 103, 104, + 64, 66, 72, 81, 96, 113, 117, 72, 78, 9, + 14, 37, 38, 39, 46, 48, 49, 50, 106, 107, + 109, 11, 51, 52, 53, 54, 55, 58, 12, 13, + 40, 41, 45, 105, 102, 103, 104, 103, 3, 4, + 42, 43, 73, 74, 49, 98, 102, 102, 104, 1, + 48, 61, 115, 119, 115, 97, 80, 97, 5, 104, + 4, 104, 104, 104, 104, 104, 35, 109, 109, 109, + 109, 109, 109, 13, 104, 115, 63, 60, 109, 115, + 115, 104, 97, 37, 1, 104, 1, 18, 20, 21, + 22, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 36, 65, 82, 84, 91, 95, 104, 113, 114, 117, + 47, 111, 1, 4, 99, 100, 4, 60, 83, 4, + 60, 60, 60, 97, 60, 81, 81, 81, 101, 104, + 81, 97, 81, 85, 80, 116, 117, 97, 104, 115, + 1, 119, 104, 101, 62, 4, 104, 104, 82, 4, + 84, 86, 81, 60, 92, 102, 114, 97, 97, 1, + 4, 115, 81, 103, 61, 115, 115, 25, 37, 117, + 104, 10, 93, 97, 63, 97, 97, 60, 4, 97, + 119, 94, 82, 113, 82, 104, 115, 104, 117, 103, + 108, 19, 87, 88, 115, 97, 117, 97, 115, 97, + 97, 1, 23, 24, 89, 97, 82, 97, 86, 82, + 114, 7, 8, 51, 52, 77, 90, 47, 118, 86, + 115, 7, 7, 118, 97, 115, 97, 97, 80, 97, + 82, 80, 82 }; #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) @@ -1509,14 +1564,14 @@ yyreduce: switch (yyn) { case 2: -#line 171 "awkgram.y" +#line 172 "awkgram.y" { check_funcs(); } break; case 4: -#line 179 "awkgram.y" +#line 180 "awkgram.y" { begin_or_end_rule = parsing_end_rule = FALSE; yyerrok; @@ -1524,15 +1579,14 @@ yyreduce: break; case 5: -#line 184 "awkgram.y" +#line 185 "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. + * stream of syntax error messages. */ - return; + /* yyerrok; */ } break; @@ -1736,16 +1790,21 @@ yyreduce: case 34: #line 369 "awkgram.y" - { yyval.nodeval = node(yyvsp[-3].nodeval, Node_K_while, yyvsp[0].nodeval); } + { yyval.nodeval = node(yyvsp[-6].nodeval, Node_K_switch, yyvsp[-2].nodeval); } break; case 35: #line 371 "awkgram.y" - { yyval.nodeval = node(yyvsp[-2].nodeval, Node_K_do, yyvsp[-5].nodeval); } + { yyval.nodeval = node(yyvsp[-3].nodeval, Node_K_while, yyvsp[0].nodeval); } break; case 36: #line 373 "awkgram.y" + { yyval.nodeval = node(yyvsp[-2].nodeval, Node_K_do, yyvsp[-5].nodeval); } + break; + + case 37: +#line 375 "awkgram.y" { /* * Efficiency hack. Recognize the special case of @@ -1767,10 +1826,12 @@ yyreduce: arr = yyvsp[0].nodeval->lnode; /* array var */ sub = yyvsp[0].nodeval->rnode->lnode; /* index var */ - if ( (arr->type == Node_var + if ( (arr->type == Node_var_new || arr->type == Node_var_array || arr->type == Node_param_list) - && (sub->type == Node_var || sub->type == Node_param_list) + && (sub->type == Node_var_new + || sub->type == Node_var + || sub->type == Node_param_list) && strcmp(yyvsp[-5].sval, sub->vname) == 0 && strcmp(yyvsp[-3].sval, arr->vname) == 0) { yyvsp[0].nodeval->type = Node_K_delete_loop; @@ -1787,33 +1848,33 @@ yyreduce: } break; - case 37: -#line 413 "awkgram.y" + case 38: +#line 417 "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 38: -#line 417 "awkgram.y" + case 39: +#line 421 "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 39: -#line 423 "awkgram.y" + case 40: +#line 427 "awkgram.y" { yyval.nodeval = node((NODE *) NULL, Node_K_break, (NODE *) NULL); } break; - case 40: -#line 426 "awkgram.y" + case 41: +#line 430 "awkgram.y" { yyval.nodeval = node((NODE *) NULL, Node_K_continue, (NODE *) NULL); } break; - case 41: -#line 428 "awkgram.y" + case 42: +#line 432 "awkgram.y" { NODETYPE type; if (begin_or_end_rule) @@ -1824,8 +1885,8 @@ yyreduce: } break; - case 42: -#line 437 "awkgram.y" + case 43: +#line 441 "awkgram.y" { if (do_traditional) { /* @@ -1847,31 +1908,31 @@ yyreduce: } break; - case 43: -#line 457 "awkgram.y" + case 44: +#line 461 "awkgram.y" { yyval.nodeval = node(yyvsp[-1].nodeval, Node_K_exit, (NODE *) NULL); } break; - case 44: -#line 459 "awkgram.y" + case 45: +#line 463 "awkgram.y" { if (! can_return) yyerror(_("`return' used outside function context")); } break; - case 45: -#line 464 "awkgram.y" + case 46: +#line 468 "awkgram.y" { yyval.nodeval = node(yyvsp[-1].nodeval, Node_K_return, (NODE *) NULL); } break; - case 47: -#line 477 "awkgram.y" + case 48: +#line 481 "awkgram.y" { in_print = TRUE; in_parens = 0; } break; - case 48: -#line 478 "awkgram.y" + case 49: +#line 482 "awkgram.y" { /* * Optimization: plain `print' has no expression list, so $3 is null. @@ -1904,13 +1965,13 @@ yyreduce: } break; - case 49: -#line 509 "awkgram.y" + case 50: +#line 513 "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" + case 51: +#line 515 "awkgram.y" { if (do_lint) lintwarn(_("`delete array' is a gawk extension")); @@ -1926,8 +1987,8 @@ yyreduce: } break; - case 51: -#line 525 "awkgram.y" + case 52: +#line 529 "awkgram.y" { /* this is for tawk compatibility. maybe the warnings should always be done. */ if (do_lint) @@ -1944,28 +2005,148 @@ yyreduce: } break; - case 52: -#line 540 "awkgram.y" + case 53: +#line 544 "awkgram.y" { yyval.nodeval = yyvsp[0].nodeval; } break; - case 53: -#line 545 "awkgram.y" + case 54: +#line 549 "awkgram.y" { yyval.nodeval = NULL; } break; - case 54: -#line 547 "awkgram.y" + case 55: +#line 551 "awkgram.y" { yyval.nodeval = yyvsp[0].nodeval; } break; + case 56: +#line 556 "awkgram.y" + { + if (yyvsp[0].nodeval == NULL) { + yyval.nodeval = NULL; + } else { + NODE *dflt = NULL; + NODE *head = yyvsp[0].nodeval; + NODE *curr; + + const char **case_values = NULL; + + int maxcount = 128; + int case_count = 0; + int i; + + emalloc(case_values, const char **, sizeof(char*) * maxcount, "switch_body"); + for (curr = yyvsp[0].nodeval; curr != NULL; curr = curr->rnode) { + /* Assure that case statement values are unique. */ + if (curr->lnode->type == Node_K_case) { + char *caseval; + + if (curr->lnode->lnode->type == Node_regex) + caseval = curr->lnode->lnode->re_exp->stptr; + else + caseval = force_string(tree_eval(curr->lnode->lnode))->stptr; + + for (i = 0; i < case_count; i++) + if (strcmp(caseval, case_values[i]) == 0) + yyerror(_("duplicate case values in switch body: %s"), caseval); + + if (case_count >= maxcount) { + maxcount += 128; + erealloc(case_values, const char **, sizeof(char*) * maxcount, "switch_body"); + } + case_values[case_count++] = caseval; + } else { + /* Otherwise save a pointer to the default node. */ + if (dflt != NULL) + yyerror(_("Duplicate `default' detected in switch body")); + dflt = curr; + } + } + + free(case_values); + + /* Create the switch body. */ + yyval.nodeval = node(head, Node_switch_body, dflt); + } + } + break; + + case 57: +#line 608 "awkgram.y" + { yyval.nodeval = NULL; } + break; + case 58: -#line 562 "awkgram.y" - { yyval.nodeval = node(yyvsp[-3].nodeval, Node_expression_list, yyvsp[-1].nodeval); } +#line 610 "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")); + if (yyvsp[-1].nodeval == NULL) + yyval.nodeval = node(yyvsp[0].nodeval, Node_case_list, (NODE *) NULL); + else + yyval.nodeval = append_right( + (yyvsp[-1].nodeval->type == Node_case_list ? yyvsp[-1].nodeval : node(yyvsp[-1].nodeval, Node_case_list, (NODE *) NULL)), + (yyvsp[0].nodeval->type == Node_case_list ? yyvsp[0].nodeval : node(yyvsp[0].nodeval, Node_case_list, (NODE *) NULL)) + ); + } + yyerrok; + } break; case 59: -#line 567 "awkgram.y" +#line 627 "awkgram.y" + { yyval.nodeval = NULL; } + break; + + case 60: +#line 632 "awkgram.y" + { yyval.nodeval = node(yyvsp[-3].nodeval, Node_K_case, yyvsp[0].nodeval); } + break; + + case 61: +#line 634 "awkgram.y" + { yyval.nodeval = node((NODE *) NULL, Node_K_default, yyvsp[0].nodeval); } + break; + + case 62: +#line 639 "awkgram.y" + { yyval.nodeval = yyvsp[0].nodeval; } + break; + + case 63: +#line 641 "awkgram.y" + { + yyvsp[0].nodeval->numbr = -(force_number(yyvsp[0].nodeval)); + yyval.nodeval = yyvsp[0].nodeval; + } + break; + + case 64: +#line 646 "awkgram.y" + { yyval.nodeval = yyvsp[0].nodeval; } + break; + + case 65: +#line 648 "awkgram.y" + { yyval.nodeval = yyvsp[0].nodeval; } + break; + + case 66: +#line 650 "awkgram.y" + { yyval.nodeval = yyvsp[0].nodeval; } + break; + + case 70: +#line 665 "awkgram.y" + { yyval.nodeval = node(yyvsp[-3].nodeval, Node_expression_list, yyvsp[-1].nodeval); } + break; + + case 71: +#line 670 "awkgram.y" { in_print = FALSE; in_parens = 0; @@ -1973,13 +2154,13 @@ yyreduce: } break; - case 60: -#line 572 "awkgram.y" + case 72: +#line 675 "awkgram.y" { in_print = FALSE; in_parens = 0; } break; - case 61: -#line 573 "awkgram.y" + case 73: +#line 676 "awkgram.y" { yyval.nodeval = node(yyvsp[0].nodeval, yyvsp[-2].nodetypeval, (NODE *) NULL); if (yyvsp[-2].nodetypeval == Node_redirect_twoway @@ -1989,92 +2170,92 @@ yyreduce: } break; - case 62: -#line 584 "awkgram.y" + case 74: +#line 687 "awkgram.y" { yyval.nodeval = node(yyvsp[-3].nodeval, Node_K_if, node(yyvsp[0].nodeval, Node_if_branches, (NODE *) NULL)); } break; - case 63: -#line 590 "awkgram.y" + case 75: +#line 693 "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" + case 80: +#line 709 "awkgram.y" { yyval.nodeval = NULL; } break; - case 69: -#line 608 "awkgram.y" + case 81: +#line 711 "awkgram.y" { yyval.nodeval = node(yyvsp[0].nodeval, Node_redirect_input, (NODE *) NULL); } break; - case 70: -#line 613 "awkgram.y" + case 82: +#line 716 "awkgram.y" { yyval.nodeval = NULL; } break; - case 71: -#line 615 "awkgram.y" + case 83: +#line 718 "awkgram.y" { yyval.nodeval = yyvsp[0].nodeval; } break; - case 72: -#line 620 "awkgram.y" + case 84: +#line 723 "awkgram.y" { yyval.nodeval = make_param(yyvsp[0].sval); } break; - case 73: -#line 622 "awkgram.y" + case 85: +#line 725 "awkgram.y" { yyval.nodeval = append_right(yyvsp[-2].nodeval, make_param(yyvsp[0].sval)); yyerrok; } break; - case 74: -#line 624 "awkgram.y" + case 86: +#line 727 "awkgram.y" { yyval.nodeval = NULL; } break; - case 75: -#line 626 "awkgram.y" + case 87: +#line 729 "awkgram.y" { yyval.nodeval = NULL; } break; - case 76: -#line 628 "awkgram.y" + case 88: +#line 731 "awkgram.y" { yyval.nodeval = NULL; } break; - case 77: -#line 634 "awkgram.y" + case 89: +#line 737 "awkgram.y" { yyval.nodeval = NULL; } break; - case 78: -#line 636 "awkgram.y" + case 90: +#line 739 "awkgram.y" { yyval.nodeval = yyvsp[0].nodeval; } break; - case 79: -#line 641 "awkgram.y" + case 91: +#line 744 "awkgram.y" { yyval.nodeval = NULL; } break; - case 80: -#line 643 "awkgram.y" + case 92: +#line 746 "awkgram.y" { yyval.nodeval = yyvsp[0].nodeval; } break; - case 81: -#line 648 "awkgram.y" + case 93: +#line 751 "awkgram.y" { yyval.nodeval = node(yyvsp[0].nodeval, Node_expression_list, (NODE *) NULL); } break; - case 82: -#line 650 "awkgram.y" + case 94: +#line 753 "awkgram.y" { yyval.nodeval = append_right(yyvsp[-2].nodeval, node(yyvsp[0].nodeval, Node_expression_list, (NODE *) NULL)); @@ -2082,28 +2263,28 @@ yyreduce: } break; - case 83: -#line 656 "awkgram.y" + case 95: +#line 759 "awkgram.y" { yyval.nodeval = NULL; } break; - case 84: -#line 658 "awkgram.y" + case 96: +#line 761 "awkgram.y" { yyval.nodeval = NULL; } break; - case 85: -#line 660 "awkgram.y" + case 97: +#line 763 "awkgram.y" { yyval.nodeval = NULL; } break; - case 86: -#line 662 "awkgram.y" + case 98: +#line 765 "awkgram.y" { yyval.nodeval = NULL; } break; - case 87: -#line 667 "awkgram.y" + case 99: +#line 770 "awkgram.y" { if (do_lint && yyvsp[0].nodeval->type == Node_regex) lintwarn(_("regular expression on right of assignment")); @@ -2111,18 +2292,18 @@ yyreduce: } break; - case 88: -#line 673 "awkgram.y" + case 100: +#line 776 "awkgram.y" { yyval.nodeval = node(yyvsp[-2].nodeval, Node_and, yyvsp[0].nodeval); } break; - case 89: -#line 675 "awkgram.y" + case 101: +#line 778 "awkgram.y" { yyval.nodeval = node(yyvsp[-2].nodeval, Node_or, yyvsp[0].nodeval); } break; - case 90: -#line 677 "awkgram.y" + case 102: +#line 780 "awkgram.y" { if (yyvsp[-2].nodeval->type == Node_regex) warning(_("regular expression on left of `~' or `!~' operator")); @@ -2130,13 +2311,13 @@ yyreduce: } break; - case 91: -#line 683 "awkgram.y" + case 103: +#line 786 "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" + case 104: +#line 788 "awkgram.y" { if (do_lint && yyvsp[0].nodeval->type == Node_regex) lintwarn(_("regular expression on right of comparison")); @@ -2144,53 +2325,53 @@ yyreduce: } break; - case 93: -#line 691 "awkgram.y" + case 105: +#line 794 "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" + case 106: +#line 796 "awkgram.y" { yyval.nodeval = yyvsp[0].nodeval; } break; - case 95: -#line 698 "awkgram.y" + case 107: +#line 801 "awkgram.y" { yyval.nodetypeval = yyvsp[0].nodetypeval; } break; - case 96: -#line 700 "awkgram.y" + case 108: +#line 803 "awkgram.y" { yyval.nodetypeval = yyvsp[0].nodetypeval; } break; - case 97: -#line 702 "awkgram.y" + case 109: +#line 805 "awkgram.y" { yyval.nodetypeval = Node_assign_quotient; } break; - case 98: -#line 707 "awkgram.y" + case 110: +#line 810 "awkgram.y" { yyval.nodetypeval = yyvsp[0].nodetypeval; } break; - case 99: -#line 709 "awkgram.y" + case 111: +#line 812 "awkgram.y" { yyval.nodetypeval = Node_less; } break; - case 101: -#line 714 "awkgram.y" + case 113: +#line 817 "awkgram.y" { yyval.nodetypeval = Node_greater; } break; - case 102: -#line 719 "awkgram.y" + case 114: +#line 822 "awkgram.y" { yyval.nodeval = yyvsp[0].nodeval; } break; - case 103: -#line 721 "awkgram.y" + case 115: +#line 824 "awkgram.y" { yyval.nodeval = node(node(make_number(0.0), Node_field_spec, @@ -2200,53 +2381,53 @@ yyreduce: } break; - case 104: -#line 729 "awkgram.y" + case 116: +#line 832 "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" + case 117: +#line 834 "awkgram.y" { yyval.nodeval = yyvsp[0].nodeval; } break; - case 106: -#line 733 "awkgram.y" + case 118: +#line 836 "awkgram.y" { yyval.nodeval = node(yyvsp[-1].nodeval, Node_concat, yyvsp[0].nodeval); } break; - case 108: -#line 740 "awkgram.y" + case 120: +#line 843 "awkgram.y" { yyval.nodeval = node(yyvsp[-2].nodeval, Node_exp, yyvsp[0].nodeval); } break; - case 109: -#line 742 "awkgram.y" + case 121: +#line 845 "awkgram.y" { yyval.nodeval = node(yyvsp[-2].nodeval, Node_times, yyvsp[0].nodeval); } break; - case 110: -#line 744 "awkgram.y" + case 122: +#line 847 "awkgram.y" { yyval.nodeval = node(yyvsp[-2].nodeval, Node_quotient, yyvsp[0].nodeval); } break; - case 111: -#line 746 "awkgram.y" + case 123: +#line 849 "awkgram.y" { yyval.nodeval = node(yyvsp[-2].nodeval, Node_mod, yyvsp[0].nodeval); } break; - case 112: -#line 748 "awkgram.y" + case 124: +#line 851 "awkgram.y" { yyval.nodeval = node(yyvsp[-2].nodeval, Node_plus, yyvsp[0].nodeval); } break; - case 113: -#line 750 "awkgram.y" + case 125: +#line 853 "awkgram.y" { yyval.nodeval = node(yyvsp[-2].nodeval, Node_minus, yyvsp[0].nodeval); } break; - case 114: -#line 752 "awkgram.y" + case 126: +#line 855 "awkgram.y" { if (do_lint && parsing_end_rule && yyvsp[0].nodeval == NULL) lintwarn(_("non-redirected `getline' undefined inside END action")); @@ -2254,46 +2435,46 @@ yyreduce: } break; - case 115: -#line 758 "awkgram.y" + case 127: +#line 861 "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" + case 128: +#line 866 "awkgram.y" { yyval.nodeval = node(yyvsp[-1].nodeval, Node_postincrement, (NODE *) NULL); } break; - case 117: -#line 765 "awkgram.y" + case 129: +#line 868 "awkgram.y" { yyval.nodeval = node(yyvsp[-1].nodeval, Node_postdecrement, (NODE *) NULL); } break; - case 118: -#line 770 "awkgram.y" + case 130: +#line 873 "awkgram.y" { yyval.nodeval = node(yyvsp[0].nodeval, Node_not, (NODE *) NULL); } break; - case 119: -#line 772 "awkgram.y" + case 131: +#line 875 "awkgram.y" { yyval.nodeval = yyvsp[-1].nodeval; } break; - case 120: -#line 775 "awkgram.y" + case 132: +#line 878 "awkgram.y" { yyval.nodeval = snode(yyvsp[-1].nodeval, Node_builtin, (int) yyvsp[-3].lval); } break; - case 121: -#line 777 "awkgram.y" + case 133: +#line 880 "awkgram.y" { yyval.nodeval = snode(yyvsp[-1].nodeval, Node_builtin, (int) yyvsp[-3].lval); } break; - case 122: -#line 779 "awkgram.y" + case 134: +#line 882 "awkgram.y" { if (do_lint) lintwarn(_("call of `length' without parentheses is not portable")); @@ -2303,8 +2484,8 @@ yyreduce: } break; - case 123: -#line 787 "awkgram.y" + case 135: +#line 890 "awkgram.y" { yyval.nodeval = node(yyvsp[-1].nodeval, Node_func_call, make_string(yyvsp[-3].sval, strlen(yyvsp[-3].sval))); yyval.nodeval->funcbody = NULL; @@ -2314,28 +2495,28 @@ yyreduce: } break; - case 125: -#line 796 "awkgram.y" + case 137: +#line 899 "awkgram.y" { yyval.nodeval = node(yyvsp[0].nodeval, Node_preincrement, (NODE *) NULL); } break; - case 126: -#line 798 "awkgram.y" + case 138: +#line 901 "awkgram.y" { yyval.nodeval = node(yyvsp[0].nodeval, Node_predecrement, (NODE *) NULL); } break; - case 127: -#line 800 "awkgram.y" + case 139: +#line 903 "awkgram.y" { yyval.nodeval = yyvsp[0].nodeval; } break; - case 128: -#line 802 "awkgram.y" + case 140: +#line 905 "awkgram.y" { yyval.nodeval = yyvsp[0].nodeval; } break; - case 129: -#line 805 "awkgram.y" + case 141: +#line 908 "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)); @@ -2345,8 +2526,8 @@ yyreduce: } break; - case 130: -#line 813 "awkgram.y" + case 142: +#line 916 "awkgram.y" { /* * was: $$ = $2 @@ -2356,56 +2537,65 @@ yyreduce: } break; - case 131: -#line 824 "awkgram.y" + case 143: +#line 927 "awkgram.y" { yyval.nodeval = NULL; } break; - case 132: -#line 826 "awkgram.y" + case 144: +#line 929 "awkgram.y" { yyval.nodeval = yyvsp[0].nodeval; } break; - case 133: -#line 831 "awkgram.y" - { yyval.nodeval = variable(yyvsp[0].sval, CAN_FREE, Node_var); } + case 145: +#line 934 "awkgram.y" + { yyval.nodeval = variable(yyvsp[0].sval, CAN_FREE, Node_var_new); } break; - case 134: -#line 833 "awkgram.y" + case 146: +#line 936 "awkgram.y" { - if (yyvsp[-1].nodeval == NULL) { + NODE *n; + + if ((n = lookup(yyvsp[-3].sval)) != NULL && ! isarray(n)) + yyerror(_("use of non-array as array")); + else if (yyvsp[-1].nodeval == NULL) { fatal(_("invalid subscript expression")); } else if (yyvsp[-1].nodeval->rnode == NULL) { yyval.nodeval = node(variable(yyvsp[-3].sval, CAN_FREE, Node_var_array), Node_subscript, yyvsp[-1].nodeval->lnode); freenode(yyvsp[-1].nodeval); } else yyval.nodeval = node(variable(yyvsp[-3].sval, CAN_FREE, Node_var_array), Node_subscript, yyvsp[-1].nodeval); - } + } break; - case 135: -#line 843 "awkgram.y" + case 147: +#line 950 "awkgram.y" { yyval.nodeval = node(yyvsp[0].nodeval, Node_field_spec, (NODE *) NULL); } break; - case 137: -#line 851 "awkgram.y" + case 149: +#line 958 "awkgram.y" { yyerrok; } break; - case 138: -#line 855 "awkgram.y" + case 150: +#line 962 "awkgram.y" { yyerrok; } break; - case 141: -#line 864 "awkgram.y" + case 153: +#line 971 "awkgram.y" { yyerrok; } break; - case 142: -#line 867 "awkgram.y" + case 154: +#line 975 "awkgram.y" + { yyerrok; } + break; + + case 155: +#line 978 "awkgram.y" { yyerrok; } break; @@ -2413,7 +2603,7 @@ yyreduce: } /* Line 991 of yacc.c. */ -#line 2414 "y.tab.c" +#line 2604 "y.tab.c" yyvsp -= yylen; yyssp -= yylen; @@ -2622,7 +2812,7 @@ yyreturn: } -#line 870 "awkgram.y" +#line 981 "awkgram.y" struct token { @@ -2655,12 +2845,18 @@ static const struct token tokentab[] = { {"atan2", Node_builtin, LEX_BUILTIN, NOT_OLD|A(2), do_atan2}, {"bindtextdomain", Node_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2), do_bindtextdomain}, {"break", Node_K_break, LEX_BREAK, 0, 0}, +#ifdef ALLOW_SWITCH +{"case", Node_K_case, LEX_CASE, GAWKX, 0}, +#endif {"close", Node_builtin, LEX_BUILTIN, NOT_OLD|A(1)|A(2), do_close}, {"compl", Node_builtin, LEX_BUILTIN, GAWKX|A(1), do_compl}, {"continue", Node_K_continue, LEX_CONTINUE, 0, 0}, {"cos", Node_builtin, LEX_BUILTIN, NOT_OLD|A(1), do_cos}, {"dcgettext", Node_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2)|A(3), do_dcgettext}, {"dcngettext", Node_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2)|A(3)|A(4)|A(5), do_dcngettext}, +#ifdef ALLOW_SWITCH +{"default", Node_K_default, LEX_DEFAULT, GAWKX, 0}, +#endif {"delete", Node_K_delete, LEX_DELETE, NOT_OLD, 0}, {"do", Node_K_do, LEX_DO, NOT_OLD, 0}, {"else", Node_illegal, LEX_ELSE, 0, 0}, @@ -2703,6 +2899,9 @@ static const struct token tokentab[] = { {"strtonum", Node_builtin, LEX_BUILTIN, GAWKX|A(1), do_strtonum}, {"sub", Node_builtin, LEX_BUILTIN, NOT_OLD|A(2)|A(3), do_sub}, {"substr", Node_builtin, LEX_BUILTIN, A(2)|A(3), do_substr}, +#ifdef ALLOW_SWITCH +{"switch", Node_K_switch, LEX_SWITCH, GAWKX, 0}, +#endif {"system", Node_builtin, LEX_BUILTIN, NOT_OLD|A(1), do_system}, {"systime", Node_builtin, LEX_BUILTIN, GAWKX|A(0), do_systime}, {"tolower", Node_builtin, LEX_BUILTIN, NOT_OLD|A(1), do_tolower}, @@ -3235,7 +3434,7 @@ yylex(void) case '\\': if ((c = nextc()) == EOF) { yyerror(_("unterminated regexp ends with `\\' at end of file")); - return lasttok = REGEXP; /* kludge */ + goto end_regexp; /* kludge */ } else if (c == '\n') { sourceline++; continue; @@ -3248,17 +3447,17 @@ yylex(void) case '/': /* end of the regexp */ if (in_brack > 0) break; - +end_regexp: tokadd('\0'); yylval.sval = tokstart; return lasttok = REGEXP; case '\n': pushback(); yyerror(_("unterminated regexp")); - return lasttok = REGEXP; /* kludge */ + goto end_regexp; /* kludge */ case EOF: yyerror(_("unterminated regexp at end of file")); - return lasttok = REGEXP; /* kludge */ + goto end_regexp; /* kludge */ } tokadd(c); } @@ -3807,8 +4006,6 @@ node_common(NODETYPE op) getnode(r); r->type = op; r->flags = MALLOC; - if (r->type == Node_var) - r->flags |= UNINITIALIZED; /* if lookahead is NL, lineno is 1 too high */ if (lexeme && *lexeme == '\n') r->source_line = sourceline - 1; @@ -3938,7 +4135,7 @@ snode(NODE *subn, NODETYPE op, int idx) else dumpintlstr(str->stptr, str->stlen); } else if (do_intl /* --gen-po */ - && r->builtin == do_dcngettext /* dcngettext(...) */ + && r->builtin == do_dcngettext /* dcngettext(...) */ && subn->lnode->type == Node_val /* 1st arg is constant */ && (subn->lnode->flags & STRCUR) != 0 /* it's a string constant */ && subn->rnode->lnode->type == Node_val /* 2nd arg is constant too */ @@ -4185,6 +4382,8 @@ dump_vars(const char *fname) fprintf(fp, "%.*s: ", (int) p->hlength, p->hname); if (p->hvalue->type == Node_var_array) fprintf(fp, "array, %ld elements\n", p->hvalue->table_size); + else if (p->hvalue->type == Node_var_new) + fprintf(fp, "unused variable\n"); else if (p->hvalue->type == Node_var) valinfo(p->hvalue->var_value, fp); else { @@ -4216,12 +4415,10 @@ release_all_vars() continue; else if (p->hvalue->type == Node_var_array) assoc_clear(p->hvalue); - else if (p->hvalue->type == Node_var) - unref(p->hvalue->var_value); - else { + else if (p->hvalue->type != Node_var_new) { NODE **lhs = get_lhs(p->hvalue, NULL, FALSE); - unref((*lhs)->var_value); + unref(*lhs); } unref(p); } @@ -4365,11 +4562,11 @@ append_right(NODE *list, NODE *new) return list; oldlist = list; - if (savefront == oldlist) { - savetail = savetail->rnode = new; - return oldlist; - } else + if (savefront == oldlist) + list = savetail; /* Be careful: maybe list->rnode != NULL */ + else savefront = oldlist; + while (list->rnode != NULL) list = list->rnode; savetail = list->rnode = new; @@ -4642,7 +4839,14 @@ variable(char *name, int can_free, NODETYPE type) /* * This is the only case in which we may not free the string. */ - return install(name, node(Nnull_string, type, (NODE *) NULL)); + NODE *n; + + if (type == Node_var) + n = node(Nnull_string, type, (NODE *) NULL); + else + n = node((NODE *) NULL, type, (NODE *) NULL); + + return install(name, n); } } if (can_free) @@ -4718,6 +4922,7 @@ isnoeffect(NODETYPE type) case Node_CONVFMT: case Node_BINMODE: case Node_LINT: + case Node_TEXTDOMAIN: return TRUE; default: break; /* keeps gcc -Wall happy */ @@ -4732,6 +4937,7 @@ static int isassignable(register NODE *n) { switch (n->type) { + case Node_var_new: case Node_var: case Node_FIELDWIDTHS: case Node_RS: @@ -4746,6 +4952,7 @@ isassignable(register NODE *n) case Node_OFS: case Node_LINT: case Node_BINMODE: + case Node_TEXTDOMAIN: case Node_field_spec: case Node_subscript: return TRUE; @@ -4834,4 +5041,25 @@ count_args(NODE *tree) save_tree->printf_count = count; } +/* isarray --- can this type be subscripted? */ + +static int +isarray(NODE *n) +{ + switch (n->type) { + case Node_var_new: + case Node_var_array: + return TRUE; + case Node_param_list: + return ((n->flags & FUNC) == 0); + case Node_array_ref: + cant_happen(); + break; + default: + break; /* keeps gcc -Wall happy */ + } + + return FALSE; +} + @@ -58,6 +58,7 @@ static int isassignable P((NODE *n)); static void dumpintlstr P((const char *str, size_t len)); static void dumpintlstr2 P((const char *str1, size_t len1, const char *str2, size_t len2)); static void count_args P((NODE *n)); +static int isarray P((NODE *n)); enum defref { FUNC_DEFINE, FUNC_USE }; static void func_use P((const char *name, enum defref how)); @@ -119,7 +120,7 @@ static char builtin_func[] = "@builtin"; %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> statements statement if_statement switch_body case_statements case_statement case_value opt_param_list %type <nodeval> simple_stmt opt_simple_stmt %type <nodeval> opt_exp opt_variable regexp %type <nodeval> input_redir output_redir @@ -134,7 +135,7 @@ static char builtin_func[] = "@builtin"; %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_SWITCH LEX_CASE LEX_DEFAULT LEX_WHILE LEX_DO LEX_FOR LEX_BREAK LEX_CONTINUE %token <nodetypeval> LEX_PRINT LEX_PRINTF LEX_NEXT LEX_EXIT LEX_FUNCTION %token <nodetypeval> LEX_GETLINE LEX_NEXTFILE %token <nodetypeval> LEX_IN @@ -183,12 +184,11 @@ program | 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. + * stream of syntax error messages. */ - return; + /* yyerrok; */ } ; @@ -365,6 +365,8 @@ statement { $$ = $2; } | if_statement { $$ = $1; } + | LEX_SWITCH '(' exp r_paren opt_nls l_brace switch_body opt_nls r_brace + { $$ = node($3, Node_K_switch, $7); } | LEX_WHILE '(' exp r_paren opt_nls statement { $$ = node($3, Node_K_while, $6); } | LEX_DO opt_nls statement LEX_WHILE '(' exp r_paren opt_nls @@ -391,10 +393,12 @@ statement arr = $8->lnode; /* array var */ sub = $8->rnode->lnode; /* index var */ - if ( (arr->type == Node_var + if ( (arr->type == Node_var_new || arr->type == Node_var_array || arr->type == Node_param_list) - && (sub->type == Node_var || sub->type == Node_param_list) + && (sub->type == Node_var_new + || sub->type == Node_var + || sub->type == Node_param_list) && strcmp($3, sub->vname) == 0 && strcmp($5, arr->vname) == 0) { $8->type = Node_K_delete_loop; @@ -547,6 +551,105 @@ opt_simple_stmt { $$ = $1; } ; +switch_body + : case_statements + { + if ($1 == NULL) { + $$ = NULL; + } else { + NODE *dflt = NULL; + NODE *head = $1; + NODE *curr; + + const char **case_values = NULL; + + int maxcount = 128; + int case_count = 0; + int i; + + emalloc(case_values, const char **, sizeof(char*) * maxcount, "switch_body"); + for (curr = $1; curr != NULL; curr = curr->rnode) { + /* Assure that case statement values are unique. */ + if (curr->lnode->type == Node_K_case) { + char *caseval; + + if (curr->lnode->lnode->type == Node_regex) + caseval = curr->lnode->lnode->re_exp->stptr; + else + caseval = force_string(tree_eval(curr->lnode->lnode))->stptr; + + for (i = 0; i < case_count; i++) + if (strcmp(caseval, case_values[i]) == 0) + yyerror(_("duplicate case values in switch body: %s"), caseval); + + if (case_count >= maxcount) { + maxcount += 128; + erealloc(case_values, const char **, sizeof(char*) * maxcount, "switch_body"); + } + case_values[case_count++] = caseval; + } else { + /* Otherwise save a pointer to the default node. */ + if (dflt != NULL) + yyerror(_("Duplicate `default' detected in switch body")); + dflt = curr; + } + } + + free(case_values); + + /* Create the switch body. */ + $$ = node(head, Node_switch_body, dflt); + } + } + ; + +case_statements + : /* empty */ + { $$ = NULL; } + | case_statements case_statement + { + if ($2 == NULL) + $$ = $1; + else { + if (do_lint && isnoeffect($2->type)) + lintwarn(_("statement may have no effect")); + if ($1 == NULL) + $$ = node($2, Node_case_list, (NODE *) NULL); + else + $$ = append_right( + ($1->type == Node_case_list ? $1 : node($1, Node_case_list, (NODE *) NULL)), + ($2->type == Node_case_list ? $2 : node($2, Node_case_list, (NODE *) NULL)) + ); + } + yyerrok; + } + | case_statements error + { $$ = NULL; } + ; + +case_statement + : LEX_CASE case_value colon opt_nls statements + { $$ = node($2, Node_K_case, $5); } + | LEX_DEFAULT colon opt_nls statements + { $$ = node((NODE *) NULL, Node_K_default, $4); } + ; + +case_value + : YNUMBER + { $$ = $1; } + | '-' YNUMBER %prec UNARY + { + $2->numbr = -(force_number($2)); + $$ = $2; + } + | '+' YNUMBER %prec UNARY + { $$ = $2; } + | YSTRING + { $$ = $1; } + | regexp + { $$ = $1; } + ; + print : LEX_PRINT | LEX_PRINTF @@ -828,17 +931,21 @@ opt_variable variable : NAME - { $$ = variable($1, CAN_FREE, Node_var); } + { $$ = variable($1, CAN_FREE, Node_var_new); } | NAME '[' expression_list ']' - { - if ($3 == NULL) { + { + NODE *n; + + if ((n = lookup($1)) != NULL && ! isarray(n)) + yyerror(_("use of non-array as array")); + else if ($3 == NULL) { fatal(_("invalid subscript expression")); } else if ($3->rnode == NULL) { $$ = node(variable($1, CAN_FREE, Node_var_array), Node_subscript, $3->lnode); freenode($3); } else $$ = node(variable($1, CAN_FREE, Node_var_array), Node_subscript, $3); - } + } | '$' non_post_simp_exp { $$ = node($2, Node_field_spec, (NODE *) NULL); } ; @@ -864,6 +971,10 @@ semi : ';' { yyerrok; } ; +colon + : ':' { yyerrok; } + ; + comma : ',' opt_nls { yyerrok; } ; @@ -899,12 +1010,18 @@ static const struct token tokentab[] = { {"atan2", Node_builtin, LEX_BUILTIN, NOT_OLD|A(2), do_atan2}, {"bindtextdomain", Node_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2), do_bindtextdomain}, {"break", Node_K_break, LEX_BREAK, 0, 0}, +#ifdef ALLOW_SWITCH +{"case", Node_K_case, LEX_CASE, GAWKX, 0}, +#endif {"close", Node_builtin, LEX_BUILTIN, NOT_OLD|A(1)|A(2), do_close}, {"compl", Node_builtin, LEX_BUILTIN, GAWKX|A(1), do_compl}, {"continue", Node_K_continue, LEX_CONTINUE, 0, 0}, {"cos", Node_builtin, LEX_BUILTIN, NOT_OLD|A(1), do_cos}, {"dcgettext", Node_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2)|A(3), do_dcgettext}, {"dcngettext", Node_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2)|A(3)|A(4)|A(5), do_dcngettext}, +#ifdef ALLOW_SWITCH +{"default", Node_K_default, LEX_DEFAULT, GAWKX, 0}, +#endif {"delete", Node_K_delete, LEX_DELETE, NOT_OLD, 0}, {"do", Node_K_do, LEX_DO, NOT_OLD, 0}, {"else", Node_illegal, LEX_ELSE, 0, 0}, @@ -947,6 +1064,9 @@ static const struct token tokentab[] = { {"strtonum", Node_builtin, LEX_BUILTIN, GAWKX|A(1), do_strtonum}, {"sub", Node_builtin, LEX_BUILTIN, NOT_OLD|A(2)|A(3), do_sub}, {"substr", Node_builtin, LEX_BUILTIN, A(2)|A(3), do_substr}, +#ifdef ALLOW_SWITCH +{"switch", Node_K_switch, LEX_SWITCH, GAWKX, 0}, +#endif {"system", Node_builtin, LEX_BUILTIN, NOT_OLD|A(1), do_system}, {"systime", Node_builtin, LEX_BUILTIN, GAWKX|A(0), do_systime}, {"tolower", Node_builtin, LEX_BUILTIN, NOT_OLD|A(1), do_tolower}, @@ -1479,7 +1599,7 @@ yylex(void) case '\\': if ((c = nextc()) == EOF) { yyerror(_("unterminated regexp ends with `\\' at end of file")); - return lasttok = REGEXP; /* kludge */ + goto end_regexp; /* kludge */ } else if (c == '\n') { sourceline++; continue; @@ -1492,17 +1612,17 @@ yylex(void) case '/': /* end of the regexp */ if (in_brack > 0) break; - +end_regexp: tokadd('\0'); yylval.sval = tokstart; return lasttok = REGEXP; case '\n': pushback(); yyerror(_("unterminated regexp")); - return lasttok = REGEXP; /* kludge */ + goto end_regexp; /* kludge */ case EOF: yyerror(_("unterminated regexp at end of file")); - return lasttok = REGEXP; /* kludge */ + goto end_regexp; /* kludge */ } tokadd(c); } @@ -2051,8 +2171,6 @@ node_common(NODETYPE op) getnode(r); r->type = op; r->flags = MALLOC; - if (r->type == Node_var) - r->flags |= UNINITIALIZED; /* if lookahead is NL, lineno is 1 too high */ if (lexeme && *lexeme == '\n') r->source_line = sourceline - 1; @@ -2182,7 +2300,7 @@ snode(NODE *subn, NODETYPE op, int idx) else dumpintlstr(str->stptr, str->stlen); } else if (do_intl /* --gen-po */ - && r->builtin == do_dcngettext /* dcngettext(...) */ + && r->builtin == do_dcngettext /* dcngettext(...) */ && subn->lnode->type == Node_val /* 1st arg is constant */ && (subn->lnode->flags & STRCUR) != 0 /* it's a string constant */ && subn->rnode->lnode->type == Node_val /* 2nd arg is constant too */ @@ -2429,6 +2547,8 @@ dump_vars(const char *fname) fprintf(fp, "%.*s: ", (int) p->hlength, p->hname); if (p->hvalue->type == Node_var_array) fprintf(fp, "array, %ld elements\n", p->hvalue->table_size); + else if (p->hvalue->type == Node_var_new) + fprintf(fp, "unused variable\n"); else if (p->hvalue->type == Node_var) valinfo(p->hvalue->var_value, fp); else { @@ -2460,12 +2580,10 @@ release_all_vars() continue; else if (p->hvalue->type == Node_var_array) assoc_clear(p->hvalue); - else if (p->hvalue->type == Node_var) - unref(p->hvalue->var_value); - else { + else if (p->hvalue->type != Node_var_new) { NODE **lhs = get_lhs(p->hvalue, NULL, FALSE); - unref((*lhs)->var_value); + unref(*lhs); } unref(p); } @@ -2609,11 +2727,11 @@ append_right(NODE *list, NODE *new) return list; oldlist = list; - if (savefront == oldlist) { - savetail = savetail->rnode = new; - return oldlist; - } else + if (savefront == oldlist) + list = savetail; /* Be careful: maybe list->rnode != NULL */ + else savefront = oldlist; + while (list->rnode != NULL) list = list->rnode; savetail = list->rnode = new; @@ -2886,7 +3004,14 @@ variable(char *name, int can_free, NODETYPE type) /* * This is the only case in which we may not free the string. */ - return install(name, node(Nnull_string, type, (NODE *) NULL)); + NODE *n; + + if (type == Node_var) + n = node(Nnull_string, type, (NODE *) NULL); + else + n = node((NODE *) NULL, type, (NODE *) NULL); + + return install(name, n); } } if (can_free) @@ -2962,6 +3087,7 @@ isnoeffect(NODETYPE type) case Node_CONVFMT: case Node_BINMODE: case Node_LINT: + case Node_TEXTDOMAIN: return TRUE; default: break; /* keeps gcc -Wall happy */ @@ -2976,6 +3102,7 @@ static int isassignable(register NODE *n) { switch (n->type) { + case Node_var_new: case Node_var: case Node_FIELDWIDTHS: case Node_RS: @@ -2990,6 +3117,7 @@ isassignable(register NODE *n) case Node_OFS: case Node_LINT: case Node_BINMODE: + case Node_TEXTDOMAIN: case Node_field_spec: case Node_subscript: return TRUE; @@ -3077,3 +3205,24 @@ count_args(NODE *tree) save_tree->printf_count = count; } + +/* isarray --- can this type be subscripted? */ + +static int +isarray(NODE *n) +{ + switch (n->type) { + case Node_var_new: + case Node_var_array: + return TRUE; + case Node_param_list: + return ((n->flags & FUNC) == 0); + case Node_array_ref: + cant_happen(); + break; + default: + break; /* keeps gcc -Wall happy */ + } + + return FALSE; +} diff --git a/awklib/ChangeLog b/awklib/ChangeLog index c0983b60..57eaf732 100644 --- a/awklib/ChangeLog +++ b/awklib/ChangeLog @@ -1,3 +1,7 @@ +Mon Jul 7 11:01:43 2003 Arnold D. Robbins <arnold@skeeve.com> + + * Release 3.1.3: Release tar file made. + Wed Mar 19 14:10:31 2003 Arnold D. Robbins <arnold@skeeve.com> This time for sure. diff --git a/awklib/Makefile.in b/awklib/Makefile.in index e4fed88a..9ae786a9 100644 --- a/awklib/Makefile.in +++ b/awklib/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.7.3 from Makefile.am. +# Makefile.in generated by automake 1.7.5 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 @@ -178,6 +178,7 @@ AUXAWK = passwd.awk group.awk nodist_grcat_SOURCES = grcat.c nodist_pwcat_SOURCES = pwcat.c subdir = awklib +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = @@ -213,7 +214,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --gnu awklib/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @@ -278,7 +279,7 @@ distclean-depend: .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ @am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ @am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ @am__fastdepCC_TRUE@ fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @@ -289,7 +290,7 @@ distclean-depend: .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ @am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ -@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ @am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ @am__fastdepCC_TRUE@ fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @@ -389,7 +390,6 @@ all-am: Makefile $(PROGRAMS) $(SCRIPTS) installdirs: $(mkinstalldirs) $(DESTDIR)$(libexecdir) $(DESTDIR)$(bindir) - install: install-am install-exec: install-exec-am install-data: install-data-am diff --git a/awklib/eg/lib/grcat.c b/awklib/eg/lib/grcat.c index c022dc7e..83567142 100644 --- a/awklib/eg/lib/grcat.c +++ b/awklib/eg/lib/grcat.c @@ -12,7 +12,7 @@ #if HAVE_CONFIG_H #include <config.h> #endif - + #if defined (STDC_HEADERS) #include <stdlib.h> #endif diff --git a/awklib/eg/lib/zerofile.awk b/awklib/eg/lib/zerofile.awk new file mode 100644 index 00000000..01926fdd --- /dev/null +++ b/awklib/eg/lib/zerofile.awk @@ -0,0 +1,19 @@ +# zerofile.awk --- library file to process empty input files +# +# Arnold Robbins, arnold@gnu.org, Public Domain +# June 2003 + +BEGIN { Argind = 0 } + +ARGIND > Argind + 1 { + for (Argind++; Argind < ARGIND; Argind++) + zerofile(ARGV[Argind], Argind) +} + +ARGIND != Argind { Argind = ARGIND } + +END { + if (ARGIND > Argind) + for (Argind++; Argind <= ARGIND; Argind++) + zerofile(ARGV[Argind], Argind) +} diff --git a/awklib/eg/network/coreserv.awk b/awklib/eg/network/coreserv.awk index e9e61710..348568e0 100644 --- a/awklib/eg/network/coreserv.awk +++ b/awklib/eg/network/coreserv.awk @@ -46,7 +46,7 @@ BEGIN { print "Content-length:", len |& HttpService print ORS Prompt |& HttpService # ignore all the header lines - while ((HttpService |& getline) > 0) + while ((HttpService |& getline) > 0) continue # stop talking to this client close(HttpService) @@ -75,7 +75,7 @@ function CGI_setup( method, uri, version, i) PARAM[i] = _CGI_decode(PARAM[i]) j = index(PARAM[i], "=") GETARG[substr(PARAM[i], 1, j-1)] = \ - substr(PARAM[i], j+1) + substr(PARAM[i], j+1) } } else { # there is no "?", no need for splitting PARAMs split(uri, MENU, "[/:]") diff --git a/awklib/eg/network/eliza.awk b/awklib/eg/network/eliza.awk index 2e022b41..75e353a7 100644 --- a/awklib/eg/network/eliza.awk +++ b/awklib/eg/network/eliza.awk @@ -72,7 +72,7 @@ function ElizaSays(YouSay) { if (w == "-") { # no keyword, take old subject w = wold subj = subjold - } else { # find subject + } else { # find subject subj = substr(q, index(q, w) + length(w)+1) wold = w subjold = subj # remember keyword and subject @@ -228,7 +228,7 @@ function SetUpEliza() { r[117] = "WHAT'S ABOUT ME ?" r[118] = "WHY DO YOU ALWAYS BRING UP MY NAME ?" # table for looking up answers that - # fit to a certain keyword + # fit to a certain keyword k["CAN YOU"] = "1 2 3" k["CAN I"] = "4 5" k["YOU ARE"] =\ diff --git a/awklib/eg/network/protbase.awk b/awklib/eg/network/protbase.awk index 16199e45..f4a911c9 100644 --- a/awklib/eg/network/protbase.awk +++ b/awklib/eg/network/protbase.awk @@ -4,7 +4,7 @@ END { BLASTService = "/inet/tcp/0/www.ncbi.nlm.nih.gov/80" printf "POST /cgi-bin/BLAST/nph-blast_report HTTP/1.0\n" |& BLASTService printf "Content-Length: " length(request) "\n\n" |& BLASTService - printf request |& BLASTService + printf request |& BLASTService while ((BLASTService |& getline) > 0) print $0 close(BLASTService) diff --git a/awklib/eg/network/remconf.awk b/awklib/eg/network/remconf.awk index f4f21e1a..ef922265 100644 --- a/awklib/eg/network/remconf.awk +++ b/awklib/eg/network/remconf.awk @@ -35,7 +35,7 @@ function HandleGET() { config[GETARG["Param"]] = GETARG["Value"] Document = (GETARG["Param"] " = " GETARG["Value"] ".") } else { - Document = "Parameter <b>" GETARG["Param"] "</b> is invalid." + Document = "Parameter <b>" GETARG["Param"] "</b> is invalid." } } else { Document = "<FORM method=GET><h4>Change one parameter</h4>\ diff --git a/awklib/eg/network/statist.awk b/awklib/eg/network/statist.awk index 8a583940..a4fc55cf 100644 --- a/awklib/eg/network/statist.awk +++ b/awklib/eg/network/statist.awk @@ -73,9 +73,9 @@ function HandleGET() { <TD><input type=text name=v2 value=" v2 " size=8></TD>\ <TD>2. Count </TD> <TD><input type=text name=n2 value=" n2 " size=8></TD>\ - </TR> <input type=submit value=\"Compute\">\ + </TR> <input type=submit value=\"Compute\">\ </TABLE></FORM><BR>" - } else if (MENU[2] ~ "Image") { + } else if (MENU[2] ~ "Image") { Reason = "OK" ORS "Content-type: image/png" #Reason = "OK" ORS "Content-type: application/x-postscript" #Reason = "OK" ORS "Content-type: image/gif" diff --git a/awklib/eg/network/stoxpred.awk b/awklib/eg/network/stoxpred.awk index 5cdc2a8d..62744c14 100644 --- a/awklib/eg/network/stoxpred.awk +++ b/awklib/eg/network/stoxpred.awk @@ -38,15 +38,15 @@ function Prediction() { for (stock = 1; stock <= StockCount; stock++) { if (data[1, stock] > data[2, stock]) { predict[stock] = "up" - } else if (data[1, stock] < data[2, stock]) { - predict[stock] = "down" + } else if (data[1, stock] < data[2, stock]) { + predict[stock] = "down" } else { predict[stock] = "neutral" } if ((data[1, stock] > data[2, stock]) && (data[2, stock] > data[3, stock])) hot[stock] = 1 if ((data[1, stock] < data[2, stock]) && (data[2, stock] < data[3, stock])) - avoid[stock] = 1 + avoid[stock] = 1 } # Do a plausibility check: how many predictions proved correct? for (s = 1; s <= StockCount; s++) { @@ -57,20 +57,20 @@ function Prediction() { DownCount++ } else { NeutralCount++ - } + } if (((data[d, s] > data[d+1, s]) && (data[d+1, s] > data[d+2, s])) || ((data[d, s] < data[d+1, s]) && (data[d+1, s] < data[d+2, s])) || ((data[d, s] == data[d+1, s]) && (data[d+1, s] == data[d+2, s]))) CorrectCount++ - } - } + } + } } function Report() { # Generate report report = "\nThis is your daily " report = report "stock market report for "strftime("%A, %B %d, %Y")".\n" report = report "Here are the predictions for today:\n\n" - for (stock = 1; stock <= StockCount; stock++) + for (stock = 1; stock <= StockCount; stock++) report = report "\t" name[stock] "\t" predict[stock] "\n" for (stock in hot) { if (HotCount++ == 0) @@ -83,7 +83,7 @@ function Report() { report = report "\nThe stock shares to avoid today are these:\n\n" report = report "\t" name[stock] "\t\thttp://biz.yahoo.com/n/" \ tolower(substr(name[stock], 1, 1)) "/" tolower(name[stock]) ".html\n" - } + } report = report "\nThis sums up to " HotCount+0 " winners and " AvoidCount+0 report = report " losers. When using this kind\nof prediction scheme for" report = report " the 12 months which lie behind us,\nwe get " UpCount @@ -97,8 +97,8 @@ function Report() { report = report "market, this report is, of course, complete nonsense.\n" report = report "If you are stupid enough to believe these predictions\n" report = report "you should visit a doctor who can treat your ailment." -} -function SendMail() { +} +function SendMail() { # send report to customers customer["uncle.scrooge@ducktown.gov"] = "Uncle Scrooge" customer["more@utopia.org" ] = "Sir Thomas More" @@ -113,4 +113,4 @@ function SendMail() { print report "\n.\n" | MailPipe close(MailPipe) } -} +} @@ -31,9 +31,35 @@ #undef HUGE #undef CHARBITS #undef INTBITS +#if HAVE_INTTYPES_H +# include <inttypes.h> +#else +# if HAVE_STDINT_H +# include <stdint.h> +# endif +#endif #include <math.h> #include "random.h" +#ifndef CHAR_BIT +# define CHAR_BIT 8 +#endif + +/* The extra casts work around common compiler bugs. */ +#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) +/* The outer cast is needed to work around a bug in Cray C 5.0.3.0. + It is necessary at least when t == time_t. */ +#define TYPE_MINIMUM(t) ((t) (TYPE_SIGNED (t) \ + ? ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1) : (t) 0)) +#define TYPE_MAXIMUM(t) ((t) (~ (t) 0 - TYPE_MINIMUM (t))) + +#ifndef INTMAX_MIN +# define INTMAX_MIN TYPE_MINIMUM (intmax_t) +#endif +#ifndef UINTMAX_MAX +# define UINTMAX_MAX TYPE_MAXIMUM (uintmax_t) +#endif + #ifndef SIZE_MAX /* C99 constant, can't rely on it everywhere */ #define SIZE_MAX ((size_t) -1) #endif @@ -528,7 +554,7 @@ format_tree( #ifdef sun386 /* Can't cast unsigned (int/long) from ptr->value */ long tmp_uval; /* on 386i 4.0.1 C compiler -- it just hangs */ #endif - unsigned long uval; + uintmax_t uval; int sgn; int base = 0; char cpbuf[30]; /* if we have numbers bigger than 30 */ @@ -843,17 +869,20 @@ check_pos: tmp_uval = arg->numbr; uval = (unsigned long) tmp_uval; #else - uval = (unsigned long) arg->numbr; + uval = (uintmax_t) arg->numbr; #endif cpbuf[0] = uval; prec = 1; cp = cpbuf; goto pr_tail; } - if (have_prec == FALSE) - prec = 1; - else if (prec > arg->stlen) - prec = arg->stlen; + /* + * As per POSIX, only output first character of a + * string value. Thus, we ignore any provided + * precision, forcing it to 1. (Didn't this + * used to work? 6/2003.) + */ + prec = 1; cp = arg->stptr; goto pr_tail; case 's': @@ -880,17 +909,16 @@ check_pos: goto pr_tail; if (tmpval < 0) { - if (tmpval < LONG_MIN) + if (tmpval < INTMAX_MIN) goto out_of_range; sgn = TRUE; - uval = - (unsigned long) (long) tmpval; + uval = - (uintmax_t) (intmax_t) tmpval; } else { - /* Use !, so that NaNs are out of range. - The cast avoids a SunOS 4.1.x cc bug. */ - if (! (tmpval <= (unsigned long) ULONG_MAX)) + /* Use !, so that NaNs are out of range. */ + if (! (tmpval <= UINTMAX_MAX)) goto out_of_range; sgn = FALSE; - uval = (unsigned long) tmpval; + uval = (uintmax_t) tmpval; } do { *--cp = (char) ('0' + uval % 10); @@ -958,15 +986,14 @@ check_pos: goto pr_tail; if (tmpval < 0) { - if (tmpval < LONG_MIN) + if (tmpval < INTMAX_MIN) goto out_of_range; - uval = (unsigned long) (long) tmpval; + uval = (uintmax_t) (intmax_t) tmpval; } else { - /* Use !, so that NaNs are out of range. - The cast avoids a SunOS 4.1.x cc bug. */ - if (! (tmpval <= (unsigned long) ULONG_MAX)) + /* Use !, so that NaNs are out of range. */ + if (! (tmpval <= UINTMAX_MAX)) goto out_of_range; - uval = (unsigned long) tmpval; + uval = (uintmax_t) tmpval; } /* * When to fill with zeroes is of course not simple. @@ -1024,6 +1051,9 @@ check_pos: out_of_range: /* out of range - emergency use of %g format */ + if (do_lint) + lintwarn(_("[s]printf: value %g is out of range for `%%%c' format"), + tmpval, cs1); cs1 = 'g'; goto format_float; @@ -1202,7 +1232,8 @@ do_substr(NODE *tree) d_index = force_number(t2); free_temp(t2); - if (d_index < 1.0) { + /* the weird `! (foo)' tests help catch NaN values. */ + if (! (d_index >= 1)) { if (do_lint) lintwarn(_("substr: start index %g is invalid, using 1"), d_index); @@ -1226,11 +1257,11 @@ do_substr(NODE *tree) t3 = tree_eval(tree->rnode->rnode->lnode); d_length = force_number(t3); free_temp(t3); - if (d_length <= 0.0) { + if (! (d_length >= 1)) { 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); + lintwarn(_("substr: length %g is not >= 1"), d_length); + else if (do_lint == LINT_INVALID && ! (d_length >= 0)) + lintwarn(_("substr: length %g is not >= 0"), d_length); free_temp(t1); return Nnull_string; } @@ -1245,7 +1276,7 @@ do_substr(NODE *tree) _("substr: length %g too big for string indexing, truncating to %g"), d_length, (double) SIZE_MAX); } - if (d_length <= SIZE_MAX) + if (d_length < SIZE_MAX) length = d_length; else length = SIZE_MAX; @@ -1545,6 +1576,10 @@ do_print_rec(register NODE *tree) (void) get_field(0L, NULL); /* rebuild record */ f0 = fields_arr[0]; + + if (do_lint && f0 == Nnull_string) + lintwarn(_("reference to uninitialized field `$%d'"), 0); + efwrite(f0->stptr, sizeof(char), f0->stlen, fp, "print", rp, FALSE); if (ORSlen > 0) @@ -1721,7 +1756,12 @@ do_rand(NODE *tree ATTRIBUTE_UNUSED) srandom(1); firstrand = FALSE; } - return tmp_number((AWKNUM) random() / GAWK_RANDOM_MAX); + /* + * Per historical practice and POSIX, return value N is + * + * 0 <= n < 1 + */ + return tmp_number((AWKNUM) (random() % GAWK_RANDOM_MAX) / GAWK_RANDOM_MAX); } /* do_srand --- seed the random number generator */ @@ -1777,15 +1817,11 @@ do_match(NODE *tree) rp = re_update(tree->lnode); dest = NULL; - if (tree->rnode != NULL) { /* 3rd optional arg for the subpatterns */ - dest = tree->rnode->lnode; - if (dest->type == Node_param_list) - dest = stack_ptr[dest->param_cnt]; - if (dest->type == Node_array_ref) - dest = dest->orig_array; - if (dest->type != Node_var && dest->type != Node_var_array) + if (tree->rnode != NULL) { /* 3rd optional arg for the subpatterns */ + dest = get_param(tree->rnode->lnode); + if (dest->type != Node_var_array) fatal(_("match: third argument is not an array")); - dest->type = Node_var_array; + assoc_clear(dest); } @@ -1799,44 +1835,49 @@ do_match(NODE *tree) 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); + for (ii = 0; ii < NUMSUBPATS(rp, t1->stptr); ii++) { /* - * assoc_lookup() does free_temp() on 2nd arg. + * Loop over all the subpats; some of them may have + * matched even if all of them did not. */ - *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"); + if ((s = SUBPATSTART(rp, t1->stptr, ii)) != -1) { + start = t1->stptr + s; + len = SUBPATEND(rp, t1->stptr, ii) - s; + + it = make_string(start, len); + /* + * 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; } - 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); @@ -2256,12 +2297,14 @@ do_gensub(NODE *tree) how_many = 1; } else { d = force_number(t); - if (d > 0) + if (d < 1) + how_many = 1; + else if (d < LONG_MAX) how_many = d; else - how_many = 1; + how_many = LONG_MAX; if (d == 0) - warning(_("gensub: 3rd argument of 0 treated as 1")); + warning(_("gensub: third argument of 0 treated as 1")); } free_temp(t); @@ -2354,15 +2397,13 @@ sgfmt(char *buf, /* return buffer; assumed big enough to hold result */ } #endif /* GFMT_WORKAROUND */ -#define BITS_PER_BYTE 8 /* if not true, you lose. too bad. */ - /* do_lshift --- perform a << operation */ NODE * do_lshift(NODE *tree) { NODE *s1, *s2; - unsigned long uval, ushift, res; + uintmax_t uval, ushift, res; AWKNUM val, shift; s1 = tree_eval(tree->lnode); @@ -2379,15 +2420,15 @@ do_lshift(NODE *tree) lintwarn(_("lshift(%lf, %lf): negative values will give strange results"), val, shift); if (double_to_int(val) != val || double_to_int(shift) != shift) lintwarn(_("lshift(%lf, %lf): fractional values will be truncated"), val, shift); - if (shift > (sizeof(unsigned long) * BITS_PER_BYTE)) + if (shift >= sizeof(uintmax_t) * CHAR_BIT) lintwarn(_("lshift(%lf, %lf): too large shift value will give strange results"), val, shift); } free_temp(s1); free_temp(s2); - uval = (unsigned long) val; - ushift = (unsigned long) shift; + uval = (uintmax_t) val; + ushift = (uintmax_t) shift; res = uval << ushift; return tmp_number((AWKNUM) res); @@ -2399,7 +2440,7 @@ NODE * do_rshift(NODE *tree) { NODE *s1, *s2; - unsigned long uval, ushift, res; + uintmax_t uval, ushift, res; AWKNUM val, shift; s1 = tree_eval(tree->lnode); @@ -2416,15 +2457,15 @@ do_rshift(NODE *tree) lintwarn(_("rshift(%lf, %lf): negative values will give strange results"), val, shift); if (double_to_int(val) != val || double_to_int(shift) != shift) lintwarn(_("rshift(%lf, %lf): fractional values will be truncated"), val, shift); - if (shift > (sizeof(unsigned long) * BITS_PER_BYTE)) + if (shift >= sizeof(uintmax_t) * CHAR_BIT) lintwarn(_("rshift(%lf, %lf): too large shift value will give strange results"), val, shift); } free_temp(s1); free_temp(s2); - uval = (unsigned long) val; - ushift = (unsigned long) shift; + uval = (uintmax_t) val; + ushift = (uintmax_t) shift; res = uval >> ushift; return tmp_number((AWKNUM) res); @@ -2436,7 +2477,7 @@ NODE * do_and(NODE *tree) { NODE *s1, *s2; - unsigned long uleft, uright, res; + uintmax_t uleft, uright, res; AWKNUM left, right; s1 = tree_eval(tree->lnode); @@ -2458,8 +2499,8 @@ do_and(NODE *tree) free_temp(s1); free_temp(s2); - uleft = (unsigned long) left; - uright = (unsigned long) right; + uleft = (uintmax_t) left; + uright = (uintmax_t) right; res = uleft & uright; return tmp_number((AWKNUM) res); @@ -2471,7 +2512,7 @@ NODE * do_or(NODE *tree) { NODE *s1, *s2; - unsigned long uleft, uright, res; + uintmax_t uleft, uright, res; AWKNUM left, right; s1 = tree_eval(tree->lnode); @@ -2493,8 +2534,8 @@ do_or(NODE *tree) free_temp(s1); free_temp(s2); - uleft = (unsigned long) left; - uright = (unsigned long) right; + uleft = (uintmax_t) left; + uright = (uintmax_t) right; res = uleft | uright; return tmp_number((AWKNUM) res); @@ -2506,7 +2547,7 @@ NODE * do_xor(NODE *tree) { NODE *s1, *s2; - unsigned long uleft, uright, res; + uintmax_t uleft, uright, res; AWKNUM left, right; s1 = tree_eval(tree->lnode); @@ -2528,8 +2569,8 @@ do_xor(NODE *tree) free_temp(s1); free_temp(s2); - uleft = (unsigned long) left; - uright = (unsigned long) right; + uleft = (uintmax_t) left; + uright = (uintmax_t) right; res = uleft ^ uright; return tmp_number((AWKNUM) res); @@ -2542,7 +2583,7 @@ do_compl(NODE *tree) { NODE *tmp; double d; - unsigned long uval; + uintmax_t uval; tmp = tree_eval(tree->lnode); d = force_number(tmp); @@ -2557,7 +2598,7 @@ do_compl(NODE *tree) lintwarn(_("compl(%lf): fractional value will be truncated"), d); } - uval = (unsigned long) d; + uval = (uintmax_t) d; uval = ~ uval; return tmp_number((AWKNUM) uval); } @@ -2572,7 +2613,9 @@ do_strtonum(NODE *tree) tmp = tree_eval(tree->lnode); - if (isnondecimal(tmp->stptr)) + if ((tmp->flags & (NUMBER|NUMCUR)) != 0) + d = (double) force_number(tmp); + else if (isnondecimal(tmp->stptr)) d = nondec2awknum(tmp->stptr, tmp->stlen); else d = (double) force_number(tmp); @@ -2790,7 +2833,7 @@ do_dcngettext(NODE *tree) { NODE *tmp, *t1, *t2, *t3; char *string1, *string2; - long number; + unsigned long number; char *the_result; #if ENABLE_NLS && HAVE_LC_MESSAGES && HAVE_DCGETTEXT int lc_cat; @@ -2806,7 +2849,7 @@ do_dcngettext(NODE *tree) string2 = t2->stptr; tmp = tree->rnode->rnode->lnode; /* third argument */ - number = (long) double_to_int(force_number(tree_eval(tmp))); + number = (unsigned long) double_to_int(force_number(tree_eval(tmp))); t3 = NULL; #if ENABLE_NLS && HAVE_LC_MESSAGES && HAVE_DCGETTEXT diff --git a/config.rpath b/config.rpath index 5ead7586..fa24bfc2 100755 --- a/config.rpath +++ b/config.rpath @@ -2,7 +2,7 @@ # Output a system dependent set of variables, describing how to set the # run time search path of shared libraries in an executable. # -# Copyright 1996-2002 Free Software Foundation, Inc. +# Copyright 1996-2003 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 # @@ -34,43 +34,57 @@ # # The set of defined variables is at the end of this script. +# Known limitations: +# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer +# than 256 bytes, otherwise the compiler driver will dump core. The only +# known workaround is to choose shorter directory names for the build +# directory and/or the installation directory. + # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). libext=a -shlibext= +shrext=.so host="$1" host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC. + wl= if test "$GCC" = yes; then wl='-Wl,' else case "$host_os" in - aix3* | aix4* | aix5*) + aix*) wl='-Wl,' ;; + mingw* | pw32* | os2*) + ;; hpux9* | hpux10* | hpux11*) wl='-Wl,' ;; - irix5* | irix6*) + irix5* | irix6* | nonstopux*) wl='-Wl,' ;; + newsos6) + ;; linux*) - echo '__INTEL_COMPILER' > conftest.$ac_ext - if $CC -E conftest.$ac_ext >/dev/null | grep __INTEL_COMPILER >/dev/null - then - : - else - # Intel icc - wl='-Qoption,ld,' - fi + case $CC in + icc|ecc) + wl='-Wl,' + ;; + ccc) + wl='-Wl,' + ;; + esac ;; osf3* | osf4* | osf5*) wl='-Wl,' ;; + sco3.2v5*) + ;; solaris*) wl='-Wl,' ;; @@ -78,15 +92,17 @@ else wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - if test "x$host_vendor" = xsni; then - wl='-LD' - else - wl='-Wl,' - fi + wl='-Wl,' + ;; + sysv4*MP*) + ;; + uts4*) ;; esac fi +# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS. + hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no @@ -110,8 +126,10 @@ ld_shlibs=yes if test "$with_gnu_ld" = yes; then case "$host_os" in aix3* | aix4* | aix5*) - # On AIX, the GNU linker is very broken - ld_shlibs=no + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + fi ;; amigaos*) hardcode_libdir_flag_spec='-L$libdir' @@ -135,6 +153,13 @@ if test "$with_gnu_ld" = yes; then # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + netbsd*) ;; solaris* | sysv5*) if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then @@ -157,6 +182,8 @@ if test "$with_gnu_ld" = yes; then ;; esac if test "$ld_shlibs" = yes; then + # Unlike libtool, we use -rpath here, not --rpath, since the documented + # option of GNU ld is called -rpath, not --rpath. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' fi else @@ -209,13 +236,27 @@ else fi esac fi + # Begin _LT_AC_SYS_LIBPATH_AIX. + echo 'int main () { return 0; }' > conftest.c + ${CC} ${LDFLAGS} conftest.c -o conftest + aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + fi + if test -z "$aix_libpath"; then + aix_libpath="/usr/lib:/lib" + fi + rm -f conftest.c conftest + # End _LT_AC_SYS_LIBPATH_AIX. if test "$aix_use_runtimelinking" = yes; then - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' else - hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib' + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" fi fi ;; @@ -225,6 +266,8 @@ else # see comment about different semantics on the GNU ld section ld_shlibs=no ;; + bsdi4*) + ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. @@ -234,7 +277,12 @@ else libext=lib ;; darwin* | rhapsody*) - hardcode_direct=yes + if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then + hardcode_direct=no + fi + ;; + dgux*) + hardcode_libdir_flag_spec='-L$libdir' ;; freebsd1*) ld_shlibs=no @@ -251,14 +299,41 @@ else hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; - hpux9* | hpux10* | hpux11*) + hpux9*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes - hardcode_minus_L=yes # Not in the search PATH, but as the default - # location of the library. + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes ;; - irix5* | irix6*) + hpux10* | hpux11*) + if test "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*) + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=no + ;; + ia64*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=no + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + *) + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + irix5* | irix6* | nonstopux*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; @@ -314,23 +389,20 @@ else hardcode_minus_L=yes ;; sysv4) - if test "x$host_vendor" = xsno; then - hardcode_direct=yes # is this really true??? - else - hardcode_direct=no # Motorola manual says yes, but my tests say they lie - fi + case $host_vendor in + sni) + hardcode_direct=yes # is this really true??? + ;; + siemens) + hardcode_direct=no + ;; + motorola) + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac ;; sysv4.3*) ;; - sysv5*) - hardcode_libdir_flag_spec= - ;; - uts4*) - hardcode_libdir_flag_spec='-L$libdir' - ;; - dgux*) - hardcode_libdir_flag_spec='-L$libdir' - ;; sysv4*MP*) if test -d /usr/nec; then ld_shlibs=yes @@ -340,7 +412,13 @@ else hardcode_direct=yes hardcode_minus_L=no ;; - sysv5uw7* | unixware7*) + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) + ;; + sysv5*) + hardcode_libdir_flag_spec= + ;; + uts4*) + hardcode_libdir_flag_spec='-L$libdir' ;; *) ld_shlibs=no @@ -349,134 +427,97 @@ else fi # Check dynamic linker characteristics +# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER. libname_spec='lib$name' -sys_lib_dlsearch_path_spec="/lib /usr/lib" -sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" case "$host_os" in aix3*) - shlibext=so ;; aix4* | aix5*) - shlibext=so ;; amigaos*) - shlibext=ixlibrary ;; beos*) - shlibext=so ;; bsdi4*) - shlibext=so - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" ;; cygwin* | mingw* | pw32*) - case $GCC,$host_os in - yes,cygwin*) - shlibext=dll.a - ;; - yes,mingw*) - shlibext=dll - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"` - ;; - yes,pw32*) - shlibext=dll - ;; - *) - shlibext=dll - ;; - esac + shrext=.dll ;; darwin* | rhapsody*) - shlibext=dylib + shrext=.dylib + ;; + dgux*) ;; freebsd1*) ;; freebsd*) - shlibext=so ;; gnu*) - shlibext=so ;; hpux9* | hpux10* | hpux11*) - shlibext=sl + case "$host_cpu" in + ia64*) + shrext=.so + ;; + hppa*64*) + shrext=.sl + ;; + *) + shrext=.sl + ;; + esac ;; - irix5* | irix6*) - shlibext=so + irix5* | irix6* | nonstopux*) case "$host_os" in - irix5*) + irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in - *-32|*"-32 ") libsuff= shlibsuff= ;; - *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 ;; - *-64|*"-64 ") libsuff=64 shlibsuff=64 ;; + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; *) libsuff= shlibsuff= ;; esac ;; esac - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" ;; - linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) + linux*oldld* | linux*aout* | linux*coff*) ;; - linux-gnu*) - shlibext=so + linux*) ;; netbsd*) - shlibext=so ;; newsos6) - shlibext=so + ;; + nto-qnx) ;; openbsd*) - shlibext=so ;; os2*) libname_spec='$name' - shlibext=dll + shrext=.dll ;; osf3* | osf4* | osf5*) - shlibext=so - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) - shlibext=so ;; solaris*) - shlibext=so ;; sunos4*) - shlibext=so ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - shlibext=so - case "$host_vendor" in - motorola) - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - uts4*) - shlibext=so - ;; - dgux*) - shlibext=so ;; sysv4*MP*) - if test -d /usr/nec; then - shlibext=so - fi + ;; + uts4*) ;; esac sed_quote_subst='s/\(["`$\\]\)/\\\1/g' escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` +shlibext=`echo "$shrext" | sed -e 's,^\.,,'` escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` -escaped_sys_lib_search_path_spec=`echo "X$sys_lib_search_path_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` -escaped_sys_lib_dlsearch_path_spec=`echo "X$sys_lib_dlsearch_path_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF @@ -504,10 +545,4 @@ hardcode_direct="$hardcode_direct" # resulting binary. hardcode_minus_L="$hardcode_minus_L" -# Compile-time system search path for libraries -sys_lib_search_path_spec="$escaped_sys_lib_search_path_spec" - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec="$escaped_sys_lib_dlsearch_path_spec" - EOF @@ -1,4 +1,7 @@ -/* configh.in. Generated from configure.in by autoheader. */ +/* configh.in. Generated from configure.ac by autoheader. */ + +/* switch statements are enabled in awk programs */ +#undef ALLOW_SWITCH /* 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. @@ -93,10 +96,6 @@ /* Define if <inttypes.h> exists and doesn't clash with <sys/types.h>. */ #undef HAVE_INTTYPES_H -/* 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 <langinfo.h> and nl_langinfo(CODESET). */ #undef HAVE_LANGINFO_CODESET @@ -118,6 +117,9 @@ /* Define to 1 if you have the <locale.h> header file. */ #undef HAVE_LOCALE_H +/* Define if you have the long long type. */ +#undef HAVE_LONG_LONG + /* Define to 1 if you have the <malloc.h> header file. */ #undef HAVE_MALLOC_H @@ -178,6 +180,9 @@ /* Define to 1 if you have the <signum.h> header file. */ #undef HAVE_SIGNUM_H +/* Define to 1 if you have the `snprintf' function. */ +#undef HAVE_SNPRINTF + /* we have sockets on this system */ #undef HAVE_SOCKETS @@ -190,10 +195,6 @@ /* 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 @@ -296,6 +297,12 @@ /* Define to 1 if you have the <wchar.h> header file. */ #undef HAVE_WCHAR_H +/* Define to 1 if you have the `wcrtomb' function. */ +#undef HAVE_WCRTOMB + +/* Define to 1 if you have the `wcscoll' function. */ +#undef HAVE_WCSCOLL + /* Define to 1 if you have the <wctype.h> header file. */ #undef HAVE_WCTYPE_H @@ -308,6 +315,9 @@ /* Define to 1 if you have the `__argz_stringify' function. */ #undef HAVE___ARGZ_STRINGIFY +/* Define to 1 if you have the `__fsetlocking' function. */ +#undef HAVE___FSETLOCKING + /* Define as const if the declaration of iconv() needs const. */ #undef ICONV_CONST @@ -417,6 +427,9 @@ if it is not supported. */ #undef inline +/* Define to widest signed type if <inttypes.h> doesn't define. */ +#undef intmax_t + /* Define to `long' if <sys/types.h> does not define. */ #undef off_t @@ -432,6 +445,5 @@ /* Define to `int' if <sys/types.h> doesn't define. */ #undef uid_t -/* Define to unsigned long or unsigned long long if <inttypes.h> and - <stdint.h> don't define. */ +/* Define to widest unsigned type if <inttypes.h> doesn't define. */ #undef uintmax_t @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.57 for GNU Awk 3.1.2. +# Generated by GNU Autoconf 2.57 for GNU Awk 3.1.3. # # Report bugs to <bug-gawk@gnu.org>. # @@ -268,8 +268,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='GNU Awk' PACKAGE_TARNAME='gawk' -PACKAGE_VERSION='3.1.2' -PACKAGE_STRING='GNU Awk 3.1.2' +PACKAGE_VERSION='3.1.3' +PACKAGE_STRING='GNU Awk 3.1.3' PACKAGE_BUGREPORT='bug-gawk@gnu.org' # Factoring default headers for most tests. @@ -309,7 +309,7 @@ ac_includes_default="\ # 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_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot EGREP YACC LN_S CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP RANLIB ac_ct_RANLIB U ANSI2KNR MKINSTALLDIRS USE_NLS MSGFMT GMSGFMT XGETTEXT MSGMERGE build build_cpu build_vendor build_os host host_cpu host_vendor host_os ALLOCA GLIBC21 LIBICONV LTLIBICONV INTLBISON BUILD_INCLUDED_LIBINTL USE_INCLUDED_LIBINTL CATOBJEXT DATADIRNAME INSTOBJEXT GENCAT INTLOBJS INTL_LIBTOOL_SUFFIX_PREFIX INTLLIBS LIBINTL LTLIBINTL POSUB LIBOBJS SOCKET_LIBS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -778,7 +778,7 @@ 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. +\`configure' configures GNU Awk 3.1.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -844,7 +844,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of GNU Awk 3.1.2:";; + short | recursive ) echo "Configuration of GNU Awk 3.1.3:";; esac cat <<\_ACEOF @@ -853,21 +853,22 @@ Optional Features: --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-portals Enable /p as path prefix for portals --disable-lint Disable gawk lint checking + --enable-switch Enable switch statements for awk programs --disable-dependency-tracking Speeds up one-time builds --enable-dependency-tracking Do not reject slow dependency extractors --disable-largefile omit support for large files - --disable-rpath do not hardcode runtime library paths --disable-nls do not use Native Language Support + --disable-rpath do not hardcode runtime library paths Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-whiny-user-strftime Force use of included version of strftime for deficient systems --with-gnu-ld assume the C compiler uses GNU ld default=no - --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib + --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 + --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: @@ -945,7 +946,7 @@ fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -GNU Awk configure 3.1.2 +GNU Awk configure 3.1.3 generated by GNU Autoconf 2.57 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 @@ -960,7 +961,7 @@ 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 +It was created by GNU Awk $as_me 3.1.3, which was generated by GNU Autoconf 2.57. Invocation command line was $ $0 $@ @@ -1587,7 +1588,7 @@ fi # Define the identity of the package. PACKAGE=gawk - VERSION=3.1.2 + VERSION=3.1.3 cat >>confdefs.h <<_ACEOF @@ -1717,11 +1718,15 @@ INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # Check whether --enable-portals or --disable-portals was given. if test "${enable_portals+set}" = set; then enableval="$enable_portals" + if test "$enableval" = yes + then cat >>confdefs.h <<\_ACEOF #define HAVE_PORTALS 1 _ACEOF + fi + fi; # Check whether --with-whiny-user-strftime or --without-whiny-user-strftime was given. @@ -1750,6 +1755,19 @@ _ACEOF fi fi; +# Check whether --enable-switch or --disable-switch was given. +if test "${enable_switch+set}" = set; then + enableval="$enable_switch" + if test "$enableval" = yes + then + +cat >>confdefs.h <<\_ACEOF +#define ALLOW_SWITCH 1 +_ACEOF + + fi + +fi; echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 @@ -2692,8 +2710,9 @@ DEPDIR="${am__leading_dot}deps" am_make=${MAKE-make} cat > confinc << 'END' -doit: +am__doit: @echo done +.PHONY: am__doit END # If we don't find an include directive, just comment out the code. echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 @@ -4544,7 +4563,6 @@ case `(uname) 2> /dev/null` in *CYGWIN*) with_libiconv_prefix=no with_libintl_prefix=no - LIBS="$LIBS /usr/lib/automode.o" ;; *) ;; @@ -4553,7 +4571,10 @@ esac MKINSTALLDIRS= if test -n "$ac_aux_dir"; then - MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" + case "$ac_aux_dir" in + /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;; + *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;; + esac fi if test -z "$MKINSTALLDIRS"; then MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" @@ -4561,9 +4582,52 @@ esac + echo "$as_me:$LINENO: checking whether NLS is requested" >&5 +echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6 + # Check whether --enable-nls or --disable-nls was given. +if test "${enable_nls+set}" = set; then + enableval="$enable_nls" + USE_NLS=$enableval +else + USE_NLS=yes +fi; + echo "$as_me:$LINENO: result: $USE_NLS" >&5 +echo "${ECHO_T}$USE_NLS" >&6 + + - # Extract the first word of "msgfmt", so it can be a program name with args. + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 @@ -4571,24 +4635,27 @@ if test "${ac_cv_path_MSGFMT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$MSGFMT" in - /*) - ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. - ;; + [\\/]* | ?:[\\/]*) + ac_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 && + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + if $ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then - ac_cv_path_MSGFMT="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" + ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" - ;; + ;; esac fi MSGFMT="$ac_cv_path_MSGFMT" @@ -4641,7 +4708,36 @@ echo "${ECHO_T}no" >&6 fi - # Extract the first word of "xgettext", so it can be a program name with args. + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 @@ -4649,24 +4745,27 @@ if test "${ac_cv_path_XGETTEXT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$XGETTEXT" in - /*) - ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. - ;; + [\\/]* | ?:[\\/]*) + ac_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" + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && + (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" - ;; + ;; esac fi XGETTEXT="$ac_cv_path_XGETTEXT" @@ -4680,7 +4779,36 @@ fi rm -f messages.po - # Extract the first word of "msgmerge", so it can be a program name with args. + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "msgmerge", so it can be a program name with args. set dummy msgmerge; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 @@ -4688,23 +4816,26 @@ if test "${ac_cv_path_MSGMERGE+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$MSGMERGE" in - /*) - ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. - ;; + [\\/]* | ?:[\\/]*) + ac_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" + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + if $ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1; then + ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" - ;; + ;; esac fi MSGMERGE="$ac_cv_path_MSGMERGE" @@ -4730,8 +4861,8 @@ echo "${ECHO_T}found $GMSGFMT program is not GNU msgfmt; ignore it" >&6 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 + if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && + (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then : ; else echo "$as_me:$LINENO: result: found xgettext program is not GNU xgettext; ignore it" >&5 @@ -5934,9 +6065,9 @@ _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 "$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 @@ -5946,51 +6077,52 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <sys/types.h> -#include <inttypes.h> +unsigned long long ull = 1; int i = 63; int main () { -uintmax_t i = (uintmax_t) -1; +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 -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +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_objext' + { 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 - jm_ac_cv_header_inttypes_h=yes + ac_cv_type_unsigned_long_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -jm_ac_cv_header_inttypes_h=no +ac_cv_type_unsigned_long_long=no fi -rm -f conftest.$ac_objext conftest.$ac_ext +rm -f conftest.$ac_objext conftest$ac_exeext 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 +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_INTTYPES_H_WITH_UINTMAX 1 +cat >>confdefs.h <<\_ACEOF +#define HAVE_UNSIGNED_LONG_LONG 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 "$as_me:$LINENO: checking for uintmax_t" >&5 +echo $ECHO_N "checking for uintmax_t... $ECHO_C" >&6 +if test "${ac_cv_type_uintmax_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -6000,12 +6132,14 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <sys/types.h> -#include <stdint.h> +$ac_includes_default int main () { -uintmax_t i = (uintmax_t) -1; +if ((uintmax_t *) 0) + return 0; +if (sizeof (uintmax_t)) + return 0; ; return 0; } @@ -6022,93 +6156,30 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - jm_ac_cv_header_stdint_h=yes + ac_cv_type_uintmax_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -jm_ac_cv_header_stdint_h=no +ac_cv_type_uintmax_t=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 +echo "$as_me:$LINENO: result: $ac_cv_type_uintmax_t" >&5 +echo "${ECHO_T}$ac_cv_type_uintmax_t" >&6 +if test $ac_cv_type_uintmax_t = yes; then + : else - 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' + 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 +fi + echo "$as_me:$LINENO: checking for inttypes.h" >&5 @@ -6252,6 +6323,19 @@ if test "${with_gnu_ld+set}" = set; then else with_gnu_ld=no fi; +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. @@ -6367,8 +6451,6 @@ echo "${ECHO_T}$acl_cv_rpath" >&6 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" @@ -6935,9 +7017,11 @@ 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 +strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next \ +__fsetlocking do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -7418,6 +7502,7 @@ echo "${ECHO_T}$ac_prog_version" >&6 + 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. @@ -7432,6 +7517,7 @@ echo "${ECHO_T}$USE_NLS" >&6 + BUILD_INCLUDED_LIBINTL=no USE_INCLUDED_LIBINTL=no @@ -8000,7 +8086,8 @@ echo "${ECHO_T}$gt_cv_func_gnugettext2_libintl" >&6 if test "$gt_cv_func_gnugettext2_libc" = "yes" \ || { test "$gt_cv_func_gnugettext2_libintl" = "yes" \ - && test "$PACKAGE" != gettext; }; then + && test "$PACKAGE" != gettext-runtime \ + && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else LIBINTL= @@ -8015,8 +8102,7 @@ echo "${ECHO_T}$gt_cv_func_gnugettext2_libintl" >&6 fi if test "$nls_cv_use_gnu_gettext" = "yes"; then - INTLOBJS="\$(GETTOBJS)" - BUILD_INCLUDED_LIBINTL=yes + BUILD_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes LIBINTL="\${top_builddir}/intl/libintl.a $LIBICONV" LTLIBINTL="\${top_builddir}/intl/libintl.a $LTLIBICONV" @@ -8041,6 +8127,26 @@ _ACEOF fi fi + echo "$as_me:$LINENO: checking whether to use NLS" >&5 +echo $ECHO_N "checking whether to use NLS... $ECHO_C" >&6 + echo "$as_me:$LINENO: result: $USE_NLS" >&5 +echo "${ECHO_T}$USE_NLS" >&6 + if test "$USE_NLS" = "yes"; then + echo "$as_me:$LINENO: checking where the gettext function comes from" >&5 +echo $ECHO_N "checking where the gettext function comes from... $ECHO_C" >&6 + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if test "$gt_cv_func_gnugettext2_libintl" = "yes"; then + gt_source="external libintl" + else + gt_source="libc" + fi + else + gt_source="included intl directory" + fi + echo "$as_me:$LINENO: result: $gt_source" >&5 +echo "${ECHO_T}$gt_source" >&6 + fi + if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then @@ -8090,7 +8196,7 @@ _ACEOF fi - if test "$PACKAGE" = gettext; then + if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then BUILD_INCLUDED_LIBINTL=yes fi @@ -8098,7 +8204,6 @@ _ACEOF - nls_cv_header_intl= nls_cv_header_libgt= @@ -8111,6 +8216,11 @@ _ACEOF GENCAT=gencat + if test "$USE_INCLUDED_LIBINTL" = yes; then + INTLOBJS="\$(GETTOBJS)" + fi + + INTL_LIBTOOL_SUFFIX_PREFIX= @@ -9156,6 +9266,240 @@ cat >>confdefs.h <<_ACEOF _ACEOF + + echo "$as_me:$LINENO: checking for long long" >&5 +echo $ECHO_N "checking for long long... $ECHO_C" >&6 +if test "${ac_cv_type_long_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +long long ll = 1; int i = 63; +int +main () +{ +long long llmax = (long long) -1; + return ll << i | ll >> i | llmax / ll | llmax % ll; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_long_long=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_long_long=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 +echo "${ECHO_T}$ac_cv_type_long_long" >&6 + if test $ac_cv_type_long_long = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LONG_LONG 1 +_ACEOF + + fi + + + echo "$as_me:$LINENO: checking for unsigned long long" >&5 +echo $ECHO_N "checking for unsigned long long... $ECHO_C" >&6 +if test "${ac_cv_type_unsigned_long_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +unsigned long long ull = 1; int i = 63; +int +main () +{ +unsigned long long ullmax = (unsigned long long) -1; + return ull << i | ull >> i | ullmax / ull | ullmax % ull; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_unsigned_long_long=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_unsigned_long_long=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long" >&5 +echo "${ECHO_T}$ac_cv_type_unsigned_long_long" >&6 + if test $ac_cv_type_unsigned_long_long = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_UNSIGNED_LONG_LONG 1 +_ACEOF + + fi + + + + echo "$as_me:$LINENO: checking for intmax_t" >&5 +echo $ECHO_N "checking for intmax_t... $ECHO_C" >&6 +if test "${ac_cv_type_intmax_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((intmax_t *) 0) + return 0; +if (sizeof (intmax_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_intmax_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_intmax_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_intmax_t" >&5 +echo "${ECHO_T}$ac_cv_type_intmax_t" >&6 +if test $ac_cv_type_intmax_t = yes; then + : +else + test $ac_cv_type_long_long = yes \ + && ac_type='long long' \ + || ac_type='long' + +cat >>confdefs.h <<_ACEOF +#define intmax_t $ac_type +_ACEOF + +fi + + + + + echo "$as_me:$LINENO: checking for uintmax_t" >&5 +echo $ECHO_N "checking for uintmax_t... $ECHO_C" >&6 +if test "${ac_cv_type_uintmax_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((uintmax_t *) 0) + return 0; +if (sizeof (uintmax_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uintmax_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_uintmax_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uintmax_t" >&5 +echo "${ECHO_T}$ac_cv_type_uintmax_t" >&6 +if test $ac_cv_type_uintmax_t = yes; then + : +else + test $ac_cv_type_unsigned_long_long = yes \ + && ac_type='unsigned long long' \ + || ac_type='unsigned long' + +cat >>confdefs.h <<_ACEOF +#define uintmax_t $ac_type +_ACEOF + +fi + + echo "$as_me:$LINENO: checking for ssize_t" >&5 echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6 if test "${ac_cv_type_ssize_t+set}" = set; then @@ -10257,9 +10601,12 @@ fi -for ac_func in getgrent getgroups memset memcpy memcmp fmod setlocale strchr \ - strerror strftime strncasecmp strtod system tzset mbrlen mbrtowc \ - grantpt + + + +for ac_func in fmod getgrent getgroups grantpt mbrlen mbrtowc memcmp \ + memcpy memset setlocale snprintf strchr strerror \ + strftime strncasecmp strtod system tzset wcrtomb wcscoll do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -11939,7 +12286,7 @@ _ASBOX } >&5 cat >&5 <<_CSEOF -This file was extended by GNU Awk $as_me 3.1.2, which was +This file was extended by GNU Awk $as_me 3.1.3, which was generated by GNU Autoconf 2.57. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -12002,7 +12349,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -GNU Awk config.status 3.1.2 +GNU Awk config.status 3.1.3 configured by $0, generated by GNU Autoconf 2.57, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" @@ -12106,7 +12453,7 @@ 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"' + eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" @@ -12258,6 +12605,7 @@ s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@U@,$U,;t t s,@ANSI2KNR@,$ANSI2KNR,;t t s,@MKINSTALLDIRS@,$MKINSTALLDIRS,;t t +s,@USE_NLS@,$USE_NLS,;t t s,@MSGFMT@,$MSGFMT,;t t s,@GMSGFMT@,$GMSGFMT,;t t s,@XGETTEXT@,$XGETTEXT,;t t @@ -12275,14 +12623,13 @@ 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,@INTLOBJS@,$INTLOBJS,;t t s,@INTL_LIBTOOL_SUFFIX_PREFIX@,$INTL_LIBTOOL_SUFFIX_PREFIX,;t t s,@INTLLIBS@,$INTLLIBS,;t t s,@LIBINTL@,$LIBINTL,;t t @@ -12915,17 +13262,22 @@ done rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" + POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. - if test -n "$ALL_LINGUAS"; then + if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assigment from automake. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" + else + # The set of available languages was given in configure.in. + eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi case "$ac_given_srcdir" in .) srcdirpre= ;; @@ -12974,7 +13326,7 @@ done done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" - sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in diff --git a/configure.in b/configure.ac index 3a020bcc..0fc2afb9 100644 --- a/configure.in +++ b/configure.ac @@ -1,5 +1,5 @@ dnl -dnl configure.in --- autoconf input file for gawk +dnl configure.ac --- autoconf input file for gawk dnl dnl Copyright (C) 1995-2003 the Free Software Foundation, Inc. dnl @@ -24,7 +24,7 @@ dnl dnl Process this file with autoconf to produce a configure script. dnl *** IMPORTANT ***: Fix version in both AC_INIT and AM_INIT_AUTOMAKE -AC_INIT([GNU Awk], 3.1.2, bug-gawk@gnu.org, gawk) +AC_INIT([GNU Awk], 3.1.3, bug-gawk@gnu.org, gawk) # This is a hack. Different versions of install on different systems # are just too different. Chuck it and use install-sh. @@ -42,10 +42,15 @@ 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) +AM_INIT_AUTOMAKE(gawk, 3.1.3) dnl Additional argument stuff -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_ENABLE(portals, [ --enable-portals Enable /p as path prefix for portals], + if test "$enableval" = yes + then + AC_DEFINE(HAVE_PORTALS, 1, [we have portals on /p on this system]) + fi +) AC_ARG_WITH(whiny-user-strftime, [ --with-whiny-user-strftime Force use of included version of strftime for deficient systems], if test "$withval" = yes then @@ -59,6 +64,12 @@ AC_ARG_ENABLE([lint], [ --disable-lint Disable gawk lint checking], AC_DEFINE(NO_LINT, 1, [disable lint checks]) fi ) +AC_ARG_ENABLE(switch, [ --enable-switch Enable switch statements for awk programs], + if test "$enableval" = yes + then + AC_DEFINE(ALLOW_SWITCH, 1, [switch statements are enabled in awk programs]) + fi +) dnl checks for programs AC_PROG_EGREP @@ -118,7 +129,6 @@ case `(uname) 2> /dev/null` in *CYGWIN*) with_libiconv_prefix=no with_libintl_prefix=no - LIBS="$LIBS /usr/lib/automode.o" ;; *) ;; @@ -126,7 +136,7 @@ esac dnl initialize GNU gettext AM_GNU_GETTEXT([no-libtool], [need-ngettext]) -AM_GNU_GETTEXT_VERSION(0.11.5) +AM_GNU_GETTEXT_VERSION(0.12.1) dnl checks for header files AC_HEADER_STDC @@ -149,6 +159,10 @@ AC_TYPE_PID_T AC_TYPE_SIGNAL AC_SIZE_T AC_TYPE_GETGROUPS +jm_AC_TYPE_LONG_LONG +jm_AC_TYPE_UNSIGNED_LONG_LONG +jm_AC_TYPE_INTMAX_T +jm_AC_TYPE_UINTMAX_T AC_CHECK_TYPE(ssize_t, int) AC_EGREP_HEADER([int.*sprintf], stdio.h, AC_DEFINE(SPRINTF_RET, int, [return type of sprintf]), @@ -172,9 +186,9 @@ yes) AC_DEFINE(HAVE_MKTIME, 1, [we have the mktime function]) esac AC_CHECK_LIB(m, fmod) -AC_CHECK_FUNCS(getgrent getgroups memset memcpy memcmp fmod setlocale strchr \ - strerror strftime strncasecmp strtod system tzset mbrlen mbrtowc \ - grantpt) +AC_CHECK_FUNCS(fmod getgrent getgroups grantpt mbrlen mbrtowc memcmp \ + memcpy memset setlocale snprintf strchr strerror \ + strftime strncasecmp strtod system tzset wcrtomb wcscoll) dnl check for dynamic linking dnl This is known to be very primitive @@ -11,7 +11,7 @@ */ /* - * 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. @@ -95,3 +95,10 @@ #ifdef USE_INCLUDED_STRFTIME #undef HAVE_STRFTIME #endif + +/* For HP/UX with gcc */ +#if defined(hpux) || defined(_HPUX_SOURCE) +#undef HAVE_TZSET +#define HAVE_TZSET 1 +#define _TZSET 1 +#endif diff --git a/doc/ChangeLog b/doc/ChangeLog index ef9a8860..d81e9e25 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,27 @@ +Mon Jul 7 11:01:43 2003 Arnold D. Robbins <arnold@skeeve.com> + + * Release 3.1.3: Release tar file made. + +Mon Jun 9 16:06:30 2003 Arnold D. Robbins <arnold@skeeve.com> + + * gawk.texi: Set automatic-xref-title and change all cross + references to be of the single-argument type. Made all + @node lines have just the node name. + + Should have done both of these years ago. + +Sun May 11 16:08:58 2003 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (html, gawk.html, gawkinet.html): New targets. + +Mon Mar 31 17:15:23 2003 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (install-data-hook, uninstall-hook): Added code to + hard link gawk.1 to pgawk.1 upon install and remove pgawk.1 upon + uninstall. Avoids MANPATH search problems, etc. etc. + (man_MANS): Removed pgawk.1 from the list. + * pgawk.1: Removed. + Wed Mar 19 14:10:31 2003 Arnold D. Robbins <arnold@skeeve.com> This time for sure. diff --git a/doc/Makefile.am b/doc/Makefile.am index c1665e6b..28f58bc3 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 pgawk.1 +man_MANS = gawk.1 igawk.1 EXTRA_DIST = ChangeLog README.card ad.block setter.outline \ awkcard.in awkforai.txt texinfo.tex cardfonts \ @@ -52,6 +52,22 @@ AWKCARD = awkcard.ps # to ensure that awkcard.tr is processed by tbl. #AWKCARD = awkcard.nc +# The following is patterned after the main Makefile.am. The point is to +# make pgawk.1 a link to gawk.1 in the installed man directory. + +# We want hard links for install-data-hook, below +LN= ln + +# Link gawk.1 to pgawk.1 +install-data-hook: + (cd $(DESTDIR)$(man1dir); \ + $(LN) gawk.1 pgawk.1 2>/dev/null ; \ + exit 0) + +# Undo the above when uninstalling +uninstall-hook: + cd $(DESTDIR)$(man1dir); rm -f pgawk.1 ; exit 0 + postscript: gawk.ps gawkinet.ps gawk.1.ps igawk.1.ps $(AWKCARD) gawk.ps: gawk.dvi @@ -75,7 +91,15 @@ awkcard.ps: $(CARDFILES) awkcard.nc: $(CARDFILES) $(TROFF) $(CARDSRC_N) | $(SEDME) | cat $(srcdir)/setter.outline - > awkcard.ps && touch awkcard.nc +html: gawk.html gawkinet.html + +gawk.html: gawk.texi + $(MAKEINFO) --html $< + +gawkinet.html: gawkinet.texi + $(MAKEINFO) --html $< + clean: - rm -f *.ps *~ awkcard.nc awkcard.tr + rm -f *.ps *~ awkcard.nc awkcard.tr *.html distclean: clean diff --git a/doc/Makefile.in b/doc/Makefile.in index 91b1a887..f6a9c33c 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.7.3 from Makefile.am. +# Makefile.in generated by automake 1.7.5 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 @@ -168,7 +168,7 @@ target_alias = @target_alias@ info_TEXINFOS = gawk.texi gawkinet.texi -man_MANS = gawk.1 igawk.1 pgawk.1 +man_MANS = gawk.1 igawk.1 EXTRA_DIST = ChangeLog README.card ad.block setter.outline \ awkcard.in awkforai.txt texinfo.tex cardfonts \ @@ -188,7 +188,20 @@ CARDFILES = $(CARDSRC) ad.block awkcard.in setter.outline # Use this if your troff can correctly handle macros from 'colors' file AWKCARD = awkcard.ps + +# Uncomment the following definition of AWKCARD if your troff can produce +# Postscript but still has troubles with macros from 'colors'. As this +# is not groff you will have to change TROFF macro as well. Do not forget +# to ensure that awkcard.tr is processed by tbl. +#AWKCARD = awkcard.nc + +# The following is patterned after the main Makefile.am. The point is to +# make pgawk.1 a link to gawk.1 in the installed man directory. + +# We want hard links for install-data-hook, below +LN = ln subdir = doc +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = @@ -207,7 +220,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .dvi .info .pdf .ps .texi -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @@ -382,7 +395,6 @@ all-am: Makefile $(INFO_DEPS) $(MANS) installdirs: $(mkinstalldirs) $(DESTDIR)$(infodir) $(DESTDIR)$(man1dir) - install: install-am install-exec: install-exec-am install-data: install-data-am @@ -424,6 +436,8 @@ info: info-am info-am: $(INFO_DEPS) install-data-am: install-info-am install-man + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-exec-am: @@ -477,6 +491,8 @@ ps: ps-am ps-am: $(PSS) uninstall-am: uninstall-info-am uninstall-man + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) uninstall-hook uninstall-man: uninstall-man1 @@ -491,11 +507,15 @@ uninstall-man: uninstall-man1 uninstall-info-am uninstall-man uninstall-man1 -# Uncomment the following definition of AWKCARD if your troff can produce -# Postscript but still has troubles with macros from 'colors'. As this -# is not groff you will have to change TROFF macro as well. Do not forget -# to ensure that awkcard.tr is processed by tbl. -#AWKCARD = awkcard.nc +# Link gawk.1 to pgawk.1 +install-data-hook: + (cd $(DESTDIR)$(man1dir); \ + $(LN) gawk.1 pgawk.1 2>/dev/null ; \ + exit 0) + +# Undo the above when uninstalling +uninstall-hook: + cd $(DESTDIR)$(man1dir); rm -f pgawk.1 ; exit 0 postscript: gawk.ps gawkinet.ps gawk.1.ps igawk.1.ps $(AWKCARD) @@ -520,8 +540,16 @@ awkcard.ps: $(CARDFILES) awkcard.nc: $(CARDFILES) $(TROFF) $(CARDSRC_N) | $(SEDME) | cat $(srcdir)/setter.outline - > awkcard.ps && touch awkcard.nc +html: gawk.html gawkinet.html + +gawk.html: gawk.texi + $(MAKEINFO) --html $< + +gawkinet.html: gawkinet.texi + $(MAKEINFO) --html $< + clean: - rm -f *.ps *~ awkcard.nc awkcard.tr + rm -f *.ps *~ awkcard.nc awkcard.tr *.html distclean: clean # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/doc/awkcard.in b/doc/awkcard.in index 9694cc55..9bbf29c5 100644 --- a/doc/awkcard.in +++ b/doc/awkcard.in @@ -766,6 +766,19 @@ matches the closest \*(FCif\*(FR. .ti -.2i \*(CL\*(FCnextfile\*(FR \*(CR(not \*(MK) \*(CLsee \fHInput Control.\fP\*(CD .ti -.2i +.\" --- Start switch statement +\*(CB\*(FCswitch (\*(FIexpression\*(FC) { +.br + case [\*(FIvalue\*(FC|\*(FIregular expression\*(FC] : \*(FIstatement(s)\*(FC +.br + default: \*(FIstatement(s)\*(FC +.br +}\*(FR +.br +switch on \*(FIexpression\*(FR, execute \*(FIcase\*(FR if matched, default if not. +For 3.1.x, requires \*(FC\-\^\-enable\-switch\*(FR option to \*(FCconfigure\*(FR.\*(CD +.ti -.2i +.\" --- End switch statement \*(FCwhile (\*(FIcondition\*(FC) \*(FIstatement \*(FR .br while \*(FIcondition\*(FR is true, execute \*(FIstatement\*(FR. @@ -1466,7 +1479,7 @@ l lw(2i). \*(FCexp(\*(FIexpr\*(FC)\*(FR the exponential function (\*(FIe \*(FC^ \*(FIx\*(FR). \*(FCint(\*(FIexpr\*(FC)\*(FR truncates to integer. \*(FClog(\*(FIexpr\*(FC)\*(FR the natural logarithm function (base \*(FIe\^\*(FR). -\*(FCrand()\fP a random number between 0 and 1. +\*(FCrand()\fP a random number between 0 and 1 (0 \(<= \*(FIN\fP < 1). \*(FCsin(\*(FIexpr\*(FC)\*(FR the sine of \*(FIexpr\fP, which is in radians. \*(FCsqrt(\*(FIexpr\*(FC)\*(FR the square root function. \&\*(FCsrand(\*(FR[\*(FIexpr\^\*(FR]\*(FC)\*(FR T{ @@ -1881,7 +1894,7 @@ to use the current domain.\*(CB .ES .nf \*(CDHost: \*(FCftp.gnu.org\*(FR -File: \*(FC/gnu/gawk/gawk-3.1.2.tar.gz\fP +File: \*(FC/gnu/gawk/gawk-3.1.3.tar.gz\fP .in +.2i .fi GNU \*(AK (\*(GK). There may be a later version. @@ -14,7 +14,7 @@ . if \w'\(rq' .ds rq "\(rq . \} .\} -.TH GAWK 1 "February 3 2003" "Free Software Foundation" "Utility Commands" +.TH GAWK 1 "June 25 2003" "Free Software Foundation" "Utility Commands" .SH NAME gawk \- pattern scanning and processing language .SH SYNOPSIS @@ -1678,6 +1678,7 @@ as follows: \fBdo \fIstatement \fBwhile (\fIcondition\fB)\fR \fBfor (\fIexpr1\fB; \fIexpr2\fB; \fIexpr3\fB) \fIstatement\fR \fBfor (\fIvar \fBin\fI array\fB) \fIstatement\fR +.\" \fBswitch (\fIexpression\fB) { \fBcase [\fIvalue\fB|\fIregex\fB] : \fIstatement \fBdefault: \fIstatement \fB}\fR \fBbreak\fR \fBcontinue\fR \fBdelete \fIarray\^\fB[\^\fIindex\^\fB]\fR @@ -1928,6 +1929,22 @@ A single .B % character; no argument is converted. .PP +.BR NOTE : +When using the integer format-control letters for values that are +outside the range of a C +.B long +integer, +.I gawk +switches to the +.B %g +format specifier. If +.B \-\^\-lint +is provided on the command line +.I gawk +warns about this. Other versions of +.I awk +may print invalid values or do something else entirely. +.PP Optional, additional parameters may lie between the .B % and the control letter: @@ -2193,7 +2210,10 @@ Truncates to integer. The natural logarithm function. .TP .B rand() -Returns a random number between 0 and 1. +Returns a random number +.IR N , +between 0 and 1, +such that 0 \(<= \fIN\fP < 1. .TP .BI sin( expr ) Returns the sine of @@ -3319,7 +3339,7 @@ and Martin Brown provided the BeOS port. .SH VERSION INFORMATION This man page documents .IR gawk , -version 3.1.0. +version 3.1.3. .SH BUG REPORTS If you find a bug in .IR gawk , diff --git a/doc/gawk.info b/doc/gawk.info index 3c290463..a5ef90b9 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -14,7 +14,7 @@ Copyright (C) 1989, 1991, 1992, 1993, 1996, 1997, 1998, 1999, 2000, This is Edition 3 of `GAWK: Effective AWK Programming: A User's -Guide for GNU Awk', for the 3.1.2 (or later) version of the GNU +Guide for GNU Awk', for the 3.1.3 (or later) version of the GNU implementation of AWK. Permission is granted to copy, distribute and/or modify this document @@ -32,7 +32,7 @@ texts being (a) (see below), and with the Back-Cover Texts being (b) funds for GNU development." -File: gawk.info, Node: Top, Next: Foreword, Prev: (dir), Up: (dir) +File: gawk.info, Node: Top, Next: Foreword, Up: (dir) General Introduction ******************** @@ -45,7 +45,7 @@ Copyright (C) 1989, 1991, 1992, 1993, 1996, 1997, 1998, 1999, 2000, This is Edition 3 of `GAWK: Effective AWK Programming: A User's -Guide for GNU Awk', for the 3.1.2 (or later) version of the GNU +Guide for GNU Awk', for the 3.1.3 (or later) version of the GNU implementation of AWK. Permission is granted to copy, distribute and/or modify this document @@ -252,6 +252,8 @@ texts being (a) (see below), and with the Back-Cover Texts being (b) some condition is satisfied. * For Statement:: Another looping statement, that provides initialization and increment clauses. +* Switch Statement:: Switch/case evaluation for conditional + execution of statements based on a value. * Break Statement:: Immediately exit the innermost enclosing loop. * Continue Statement:: Skip to the end of the innermost enclosing @@ -348,6 +350,7 @@ texts being (a) (see below), and with the Back-Cover Texts being (b) transitions. * Rewind Function:: A function for rereading the current file. * File Checking:: Checking that data files are readable. +* Empty Files:: Checking for zero-length files. * Ignoring Assigns:: Treating assignments as file names. * Getopt Function:: A function for processing command-line arguments. @@ -401,10 +404,12 @@ texts being (a) (see below), and with the Back-Cover Texts being (b) * PC Installation:: Installing and Compiling `gawk' on MS-DOS and OS/2. * PC Binary Installation:: Installing a prepared distribution. -* PC Compiling:: Compiling `gawk' for MS-DOS, Win32, +* PC Compiling:: Compiling `gawk' for MS-DOS, Windows32, and OS/2. -* PC Using:: Running `gawk' on MS-DOS, Win32 and +* PC Using:: Running `gawk' on MS-DOS, Windows32 and OS/2. +* PC Dynamic:: Compiling `gawk' for dynamic + libraries. * Cygwin:: Building and running `gawk' for Cygwin. * VMS Installation:: Installing `gawk' on VMS. @@ -616,7 +621,7 @@ operating system, you still need to be familiar with the ideas of I/O redirection and pipes. -File: gawk.info, Node: History, Next: Names, Prev: Preface, Up: Preface +File: gawk.info, Node: History, Next: Names, Up: Preface History of `awk' and `gawk' =========================== @@ -659,8 +664,8 @@ Internetworking with `gawk'' (a separate document, available as part of the `gawk' distribution). His code finally became part of the main `gawk' distribution with `gawk' version 3.1. - *Note Major Contributors to `gawk': Contributors, for a complete -list of those who made important contributions to `gawk'. + *Note Contributors::, for a complete list of those who made +important contributions to `gawk'. File: gawk.info, Node: Names, Next: This Manual, Prev: History, Up: Preface @@ -669,9 +674,8 @@ A Rose by Any Other Name ======================== The `awk' language has evolved over the years. Full details are -provided in *Note The Evolution of the `awk' Language: Language History. -The language described in this Info file is often referred to as "new -`awk'" (`nawk'). +provided in *Note Language History::. The language described in this +Info file is often referred to as "new `awk'" (`nawk'). Because of this, many systems have multiple versions of `awk'. Some systems have an `awk' utility that implements the original version of @@ -730,82 +734,76 @@ illustrates the concept currently being described is shown. While this Info file is aimed principally at people who have not been exposed to `awk', there is a lot of information here that even the `awk' expert should find useful. In particular, the description of POSIX -`awk' and the example programs in *Note A Library of `awk' Functions: -Library Functions, and in *Note Practical `awk' Programs: Sample -Programs, should be of interest. +`awk' and the example programs in *Note Library Functions::, and in +*Note Sample Programs::, should be of interest. - *Note Getting Started with `awk': Getting Started, provides the -essentials you need to know to begin using `awk'. + *Note Getting Started::, provides the essentials you need to know to +begin using `awk'. - *Note Regular Expressions: Regexp, introduces regular expressions in -general, and in particular the flavors supported by POSIX `awk' and -`gawk'. + *Note Regexp::, introduces regular expressions in general, and in +particular the flavors supported by POSIX `awk' and `gawk'. - *Note Reading Input Files: Reading Files, describes how `awk' reads -your data. It introduces the concepts of records and fields, as well -as the `getline' command. I/O redirection is first described here. + *Note Reading Files::, describes how `awk' reads your data. It +introduces the concepts of records and fields, as well as the `getline' +command. I/O redirection is first described here. - *Note Printing Output: Printing, describes how `awk' programs can -produce output with `print' and `printf'. + *Note Printing::, describes how `awk' programs can produce output +with `print' and `printf'. *Note Expressions::, describes expressions, which are the basic building blocks for getting most things done in a program. - *Note Patterns Actions and Variables: Patterns and Actions, -describes how to write patterns for matching records, actions for doing -something when a record is matched, and the built-in variables `awk' -and `gawk' use. + *Note Patterns and Actions::, describes how to write patterns for +matching records, actions for doing something when a record is matched, +and the built-in variables `awk' and `gawk' use. - *Note Arrays in `awk': Arrays, covers `awk''s one-and-only data -structure: associative arrays. Deleting array elements and whole -arrays is also described, as well as sorting arrays in `gawk'. + *Note Arrays::, covers `awk''s one-and-only data structure: +associative arrays. Deleting array elements and whole arrays is also +described, as well as sorting arrays in `gawk'. *Note Functions::, describes the built-in functions `awk' and `gawk' provide, as well as how to define your own functions. - *Note Internationalization with `gawk': Internationalization, -describes special features in `gawk' for translating program messages -into different languages at runtime. + *Note Internationalization::, describes special features in `gawk' +for translating program messages into different languages at runtime. - *Note Advanced Features of `gawk': Advanced Features, describes a -number of `gawk'-specific advanced features. Of particular note are -the abilities to have two-way communications with another process, -perform TCP/IP networking, and profile your `awk' programs. + *Note Advanced Features::, describes a number of `gawk'-specific +advanced features. Of particular note are the abilities to have +two-way communications with another process, perform TCP/IP networking, +and profile your `awk' programs. - *Note Running `awk' and `gawk': Invoking Gawk, describes how to run -`gawk', the meaning of its command-line options, and how it finds `awk' -program source files. + *Note Invoking Gawk::, describes how to run `gawk', the meaning of +its command-line options, and how it finds `awk' program source files. - *Note A Library of `awk' Functions: Library Functions, and *Note -Practical `awk' Programs: Sample Programs, provide many sample `awk' -programs. Reading them allows you to see `awk' solving real problems. + *Note Library Functions::, and *Note Sample Programs::, provide many +sample `awk' programs. Reading them allows you to see `awk' solving +real problems. - *Note The Evolution of the `awk' Language: Language History, -describes how the `awk' language has evolved since first release to -present. It also describes how `gawk' has acquired features over time. + *Note Language History::, describes how the `awk' language has +evolved since first release to present. It also describes how `gawk' +has acquired features over time. - *Note Installing `gawk': Installation, describes how to get `gawk', -how to compile it under Unix, and how to compile and use it on different -non-Unix systems. It also describes how to report bugs in `gawk' and -where to get three other freely available implementations of `awk'. + *Note Installation::, describes how to get `gawk', how to compile it +under Unix, and how to compile and use it on different non-Unix +systems. It also describes how to report bugs in `gawk' and where to +get three other freely available implementations of `awk'. - *Note Implementation Notes: Notes, describes how to disable `gawk''s -extensions, as well as how to contribute new code to `gawk', how to -write extension libraries, and some possible future directions for -`gawk' development. + *Note Notes::, describes how to disable `gawk''s extensions, as well +as how to contribute new code to `gawk', how to write extension +libraries, and some possible future directions for `gawk' development. - *Note Basic Programming Concepts: Basic Concepts, provides some very -cursory background material for those who are completely unfamiliar -with computer programming. Also centralized there is a discussion of -some of the issues surrounding floating-point numbers. + *Note Basic Concepts::, provides some very cursory background +material for those who are completely unfamiliar with computer +programming. Also centralized there is a discussion of some of the +issues surrounding floating-point numbers. The *Note Glossary::, defines most, if not all, the significant terms used throughout the book. If you find terms that you aren't familiar with, try looking them up here. - *Note GNU General Public License: Copying, and *Note GNU Free -Documentation License::, present the licenses that cover the `gawk' -source code and this Info file, respectively. + *Note Copying::, and *Note GNU Free Documentation License::, present +the licenses that cover the `gawk' source code and this Info file, +respectively. ---------- Footnotes ---------- @@ -875,11 +873,11 @@ Software Foundation to create a complete, freely distributable, POSIX-compliant computing environment. The FSF uses the "GNU General Public License" (GPL) to ensure that their software's source code is always available to the end user. A copy of the GPL is included for -your reference (*note GNU General Public License: Copying.). The GPL -applies to the C language source code for `gawk'. To find out more -about the FSF and the GNU Project online, see the GNU Project's home -page (http://www.gnu.org). This Info file may also be read from their -web site (http://www.gnu.org/manual/gawk/). +your reference (*note Copying::). The GPL applies to the C language +source code for `gawk'. To find out more about the FSF and the GNU +Project online, see the GNU Project's home page (http://www.gnu.org). +This Info file may also be read from their web site +(http://www.gnu.org/manual/gawk/). A shell, an editor (Emacs), highly portable optimizing C, C++, and Objective-C compilers, a symbolic debugger and dozens of large and @@ -913,18 +911,15 @@ Guide'. This edition maintains the basic structure of Edition 1.0, but with significant additional material, reflecting the host of new features in -`gawk' version 3.1. Of particular note is *Note Sorting Array Values -and Indices with `gawk': Array Sorting, as well as *Note Using `gawk''s -Bit Manipulation Functions: Bitwise Functions, *Note -Internationalization with `gawk': Internationalization, and also *Note -Advanced Features of `gawk': Advanced Features, and *Note Adding New -Built-in Functions to `gawk': Dynamic Extensions. +`gawk' version 3.1. Of particular note is *Note Array Sorting::, as +well as *Note Bitwise Functions::, *Note Internationalization::, and +also *Note Advanced Features::, and *Note Dynamic Extensions::. `GAWK: Effective AWK Programming' will undoubtedly continue to evolve. An electronic version comes with the `gawk' distribution from the FSF. If you find an error in this Info file, please report it! -*Note Reporting Problems and Bugs: Bugs, for information on submitting -problem reports electronically, or write to me in care of the publisher. +*Note Bugs::, for information on submitting problem reports +electronically, or write to me in care of the publisher. ---------- Footnotes ---------- @@ -1054,9 +1049,8 @@ often refreshingly easy to read and write. When you run `awk', you specify an `awk' "program" that tells `awk' what to do. The program consists of a series of "rules". (It may also contain "function definitions", an advanced feature that we will ignore -for now. *Note User-Defined Functions: User-defined.) Each rule -specifies one pattern to search for and one action to perform upon -finding the pattern. +for now. *Note User-defined::.) Each rule specifies one pattern to +search for and one action to perform upon finding the pattern. Syntactically, a rule consists of a pattern followed by an action. The action is enclosed in curly braces to separate it from the pattern. @@ -1084,7 +1078,7 @@ like this: other things. -File: gawk.info, Node: Running gawk, Next: Sample Data Files, Prev: Getting Started, Up: Getting Started +File: gawk.info, Node: Running gawk, Next: Sample Data Files, Up: Getting Started How to Run `awk' Programs ========================= @@ -1117,7 +1111,7 @@ variations of each. * Quoting:: More discussion of shell quoting issues. -File: gawk.info, Node: One-shot, Next: Read Terminal, Prev: Running gawk, Up: Running gawk +File: gawk.info, Node: One-shot, Next: Read Terminal, Up: Running gawk One-Shot Throwaway `awk' Programs --------------------------------- @@ -1143,8 +1137,7 @@ programs from shell scripts, because it avoids the need for a separate file for the `awk' program. A self-contained shell script is more reliable because there are no other files to misplace. - *Note Some Simple Examples: Very Simple, presents several short, -self-contained programs. + *Note Very Simple::, presents several short, self-contained programs. File: gawk.info, Node: Read Terminal, Next: Long, Prev: One-shot, Up: Running gawk @@ -1223,13 +1216,12 @@ does the same thing as this one: awk "BEGIN { print \"Don't Panic!\" }" -This was explained earlier (*note Running `awk' Without Input Files: -Read Terminal.). Note that you don't usually need single quotes around -the file name that you specify with `-f', because most file names don't -contain any of the shell's special characters. Notice that in -`advice', the `awk' program did not have single quotes around it. The -quotes are only needed for programs that are provided on the `awk' -command line. +This was explained earlier (*note Read Terminal::). Note that you +don't usually need single quotes around the file name that you specify +with `-f', because most file names don't contain any of the shell's +special characters. Notice that in `advice', the `awk' program did not +have single quotes around it. The quotes are only needed for programs +that are provided on the `awk' command line. If you want to identify your `awk' program files clearly as such, you can add the extension `.awk' to the file name. This doesn't affect @@ -1326,15 +1318,15 @@ programs, but this usually isn't very useful; the purpose of a comment is to help you or another person understand the program when reading it at a later time. - *Caution:* As mentioned in *Note One-Shot Throwaway `awk' Programs: -One-shot, you can enclose small to medium programs in single quotes, in -order to keep your shell scripts self-contained. When doing so, -_don't_ put an apostrophe (i.e., a single quote) into a comment (or -anywhere else in your program). The shell interprets the quote as the -closing quote for the entire program. As a result, usually the shell -prints a message about mismatched quotes, and if `awk' actually runs, -it will probably print strange messages about syntax errors. For -example, look at the following: + *Caution:* As mentioned in *Note One-shot::, you can enclose small +to medium programs in single quotes, in order to keep your shell +scripts self-contained. When doing so, _don't_ put an apostrophe +(i.e., a single quote) into a comment (or anywhere else in your +program). The shell interprets the quote as the closing quote for the +entire program. As a result, usually the shell prints a message about +mismatched quotes, and if `awk' actually runs, it will probably print +strange messages about syntax errors. For example, look at the +following: $ awk '{ print "hello" } # let's be cute' > @@ -1384,8 +1376,7 @@ Bourne-Again Shell). If you use `csh', you're on your own. quotes. The shell does no interpretation of the quoted text, passing it on verbatim to the command. It is _impossible_ to embed a single quote inside single-quoted text. Refer back to - *Note Comments in `awk' Programs: Comments, for an example of what - happens if you try. + *Note Comments::, for an example of what happens if you try. * Double quotes protect most things between the opening and closing quotes. The shell does at least variable and command substitution @@ -1397,8 +1388,8 @@ Bourne-Again Shell). If you use `csh', you're on your own. the characters `$', ``', `\', and `"', all of which must be preceded by a backslash within double-quoted text if they are to be passed on literally to the program. (The leading backslash is - stripped first.) Thus, the example seen in *Note Running `awk' - Without Input Files: Read Terminal, is applicable: + stripped first.) Thus, the example seen in *Note Read Terminal::, + is applicable: $ awk "BEGIN { print \"Don't Panic!\" }" -| Don't Panic! @@ -1516,10 +1507,9 @@ Miscellaneous File Operations: (emacs)Misc File Ops, for more information). Using this information, create your own `BBS-list' and `inventory-shipped' files and practice what you learn in this Info file. - If you are using the stand-alone version of Info, see *Note -Extracting Programs from Texinfo Source Files: Extract Program, for an -`awk' program that extracts these data files from `gawk.texi', the -Texinfo source file for this Info file. + If you are using the stand-alone version of Info, see *Note Extract +Program::, for an `awk' program that extracts these data files from +`gawk.texi', the Texinfo source file for this Info file. File: gawk.info, Node: Very Simple, Next: Two Rules, Prev: Sample Data Files, Up: Getting Started @@ -1542,10 +1532,10 @@ the same thing, so we could have written that instead.) You will notice that slashes (`/') surround the string `foo' in the `awk' program. The slashes indicate that `foo' is the pattern to search for. This type of pattern is called a "regular expression", -which is covered in more detail later (*note Regular Expressions: -Regexp.). The pattern is allowed to match parts of words. There are -single quotes around the `awk' program so that the shell won't -interpret any of it as special shell characters. +which is covered in more detail later (*note Regexp::). The pattern is +allowed to match parts of words. There are single quotes around the +`awk' program so that the shell won't interpret any of it as special +shell characters. Here is what this program prints: @@ -1650,11 +1640,10 @@ appear in the `awk' program. If no patterns match, then no actions are run. After processing all the rules that match the line (and perhaps -there are none), `awk' reads the next line. (However, *note The `next' -Statement: Next Statement., and also *note Using `gawk''s `nextfile' -Statement: Nextfile Statement.). This continues until the program -reaches the end of the file. For example, the following `awk' program -contains two rules: +there are none), `awk' reads the next line. (However, *note Next +Statement::, and also *note Nextfile Statement::). This continues +until the program reaches the end of the file. For example, the +following `awk' program contains two rules: /12/ { print $0 } /21/ { print $0 } @@ -1742,22 +1731,21 @@ variables are automatically initialized to zero.) 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 -advanced `awk' programming, you have to know how `awk' interprets your -input and displays your output. By manipulating fields and using -`print' statements, you can produce some very useful and -impressive-looking reports. +(*note Action Overview::). Before you can move on to more advanced +`awk' programming, you have to know how `awk' interprets your input and +displays your output. By manipulating fields and using `print' +statements, you can produce some very useful and impressive-looking +reports. ---------- Footnotes ---------- (1) In the C shell (`csh'), you need to type a semicolon and then a -backslash at the end of the first line; see *Note `awk' Statements -Versus Lines: Statements/Lines, for an explanation. In a -POSIX-compliant shell, such as the Bourne shell or `bash', you can type -the example as shown. If the command `echo $path' produces an empty -output line, you are most likely using a POSIX-compliant shell. -Otherwise, you are probably using the C shell or a shell derived from -it. +backslash at the end of the first line; see *Note Statements/Lines::, +for an explanation. In a POSIX-compliant shell, such as the Bourne +shell or `bash', you can type the example as shown. If the command +`echo $path' produces an empty output line, you are most likely using a +POSIX-compliant shell. Otherwise, you are probably using the C shell +or a shell derived from it. (2) On some very old systems, you may need to use `ls -lg' to get this output. @@ -1868,10 +1856,9 @@ action. ---------- Footnotes ---------- (1) The `?' and `:' referred to here is the three-operand -conditional expression described in *Note Conditional Expressions: -Conditional Exp. Splitting lines after `?' and `:' is a minor `gawk' -extension; if `--posix' is specified (*note Command-Line Options: -Options.), then this extension is disabled. +conditional expression described in *Note Conditional Exp::. Splitting +lines after `?' and `:' is a minor `gawk' extension; if `--posix' is +specified (*note Options::), then this extension is disabled. File: gawk.info, Node: Other Features, Next: When, Prev: Statements/Lines, Up: Getting Started @@ -1891,8 +1878,7 @@ manipulation, and for runtime string translation. As we develop our presentation of the `awk' language, we introduce most of the variables and many of the functions. They are defined -systematically in *Note Built-in Variables::, and *Note Built-in -Functions: Built-in. +systematically in *Note Built-in Variables::, and *Note Built-in::. File: gawk.info, Node: When, Prev: Other Features, Up: Getting Started @@ -1906,7 +1892,7 @@ patterns, field separators, arithmetic statements, and other selection criteria, you can produce much more complex output. The `awk' language is very useful for producing reports from large amounts of raw data, such as summarizing information from the output of other utility -programs like `ls'. (*Note A More Complex Example: More Complex.) +programs like `ls'. (*Note More Complex::.) Programs written with `awk' are usually much smaller than they would be in other languages. This makes `awk' programs easy to compose and @@ -1964,7 +1950,7 @@ you specify more complicated classes of strings. * Locales:: How the locale affects things. -File: gawk.info, Node: Regexp Usage, Next: Escape Sequences, Prev: Regexp, Up: Regexp +File: gawk.info, Node: Regexp Usage, Next: Escape Sequences, Up: Regexp How to Use Regular Expressions ============================== @@ -1988,7 +1974,7 @@ string to match against; it need not be the entire current input record. The two operators `~' and `!~' perform regular expression comparisons. Expressions using these operators can be used as patterns, or in `if', `while', `for', and `do' statements. (*Note -Control Statements in Actions: Statements.) For example: +Statements::.) For example: EXP ~ /REGEXP/ @@ -2110,14 +2096,14 @@ apply to both string constants and regexp constants: string. In `gawk', a number of additional two-character sequences that begin -with a backslash have special meaning in regexps. *Note -`gawk'-Specific Regexp Operators: GNU Regexp Operators. +with a backslash have special meaning in regexps. *Note GNU Regexp +Operators::. In a regexp, a backslash before any character that is not in the -previous list and not listed in *Note `gawk'-Specific Regexp Operators: -GNU Regexp Operators, means that the next character should be taken -literally, even if it would normally be a regexp operator. For -example, `/a\+b/' matches the three characters `a+b'. +previous list and not listed in *Note GNU Regexp Operators::, means +that the next character should be taken literally, even if it would +normally be a regexp operator. For example, `/a\+b/' matches the three +characters `a+b'. For complete portability, do not use a backslash before any character not shown in the previous list. @@ -2129,9 +2115,8 @@ character not shown in the previous list. early, as soon as `awk' reads your program. * `gawk' processes both regexp constants and dynamic regexps (*note - Using Dynamic Regexps: Computed Regexps.), for the special - operators listed in *Note `gawk'-Specific Regexp Operators: GNU - Regexp Operators. + Computed Regexps::), for the special operators listed in *Note GNU + Regexp Operators::. * A backslash before any other character means to treat that character literally. @@ -2159,16 +2144,15 @@ Advanced Notes: Escape Sequences for Metacharacters --------------------------------------------------- Suppose you use an octal or hexadecimal escape to represent a regexp -metacharacter. (See *Note Regular Expression Operators: Regexp -Operators.) Does `awk' treat the character as a literal character or -as a regexp operator? +metacharacter. (See *Note Regexp Operators::.) Does `awk' treat the +character as a literal character or as a regexp operator? Historically, such characters were taken literally. (d.c.) However, the POSIX standard indicates that they should be treated as real metacharacters, which is what `gawk' does. In compatibility mode -(*note Command-Line Options: Options.), `gawk' treats the characters -represented by octal and hexadecimal escape sequences literally when -used in regexp constants. Thus, `/a\52b/' is equivalent to `/a\*b/'. +(*note Options::), `gawk' treats the characters represented by octal +and hexadecimal escape sequences literally when used in regexp +constants. Thus, `/a\52b/' is equivalent to `/a\*b/'. File: gawk.info, Node: Regexp Operators, Next: Character Lists, Prev: Escape Sequences, Up: Regexp @@ -2220,18 +2204,17 @@ sequences and that are not listed in the table stand for themselves: regular expression such as `U.A', which matches any three-character sequence that begins with `U' and ends with `A'. - In strict POSIX mode (*note Command-Line Options: Options.), `.' - does not match the NUL character, which is a character with all - bits equal to zero. Otherwise, NUL is just another character. - Other versions of `awk' may not be able to match the NUL character. + In strict POSIX mode (*note Options::), `.' does not match the NUL + character, which is a character with all bits equal to zero. + Otherwise, NUL is just another character. Other versions of `awk' + may not be able to match the NUL character. `[...]' This is called a "character list".(1) It matches any _one_ of the characters that are enclosed in the square brackets. For example, `[MVX]' matches any one of the characters `M', `V', or `X' in a string. A full discussion of what can be inside the square - brackets of a character list is given in *Note Using Character - Lists: Character Lists. + brackets of a character list is given in *Note Character Lists::. `[^ ...]' This is a "complemented character list". The first character after @@ -2312,8 +2295,8 @@ sequences and that are not listed in the table stand for themselves: However, because old programs may use `{' and `}' in regexp constants, by default `gawk' does _not_ match interval expressions in regexps. If either `--posix' or `--re-interval' are specified - (*note Command-Line Options: Options.), then interval expressions - are allowed in regexps. + (*note Options::), then interval expressions are allowed in + regexps. For new programs that use `{' and `}' in regexp constants, it is good practice to always escape them with a backslash. Then the @@ -2330,9 +2313,9 @@ themselves when there is nothing in the regexp that precedes them. For example, `/+/' matches a literal plus sign. However, many other versions of `awk' treat such a usage as a syntax error. - If `gawk' is in compatibility mode (*note Command-Line Options: -Options.), POSIX character classes and interval expressions are not -available in regular expressions. + If `gawk' is in compatibility mode (*note Options::), POSIX +character classes and interval expressions are not available in regular +expressions. ---------- Footnotes ---------- @@ -2497,14 +2480,13 @@ would have been to require two backslashes in the GNU operators, but this was deemed too confusing. The current method of using `\y' for the GNU `\b' appears to be the lesser of two evils. - The various command-line options (*note Command-Line Options: -Options.) control how `gawk' interprets characters in regexps: + The various command-line options (*note Options::) control how +`gawk' interprets characters in regexps: No options In the default case, `gawk' provides all the facilities of POSIX - regexps and the GNU regexp operators described in *Note Regular - Expression Operators: Regexp Operators. However, interval - expressions are not supported. + regexps and the GNU regexp operators described in *Note Regexp + Operators::. However, interval expressions are not supported. `--posix' Only POSIX regexps are supported; the GNU operators are not special @@ -2543,8 +2525,7 @@ read. There are two alternatives that you might prefer. One way to perform a case-insensitive match at a particular point in the program is to convert the data to a single case, using the `tolower' or `toupper' built-in string functions (which we haven't -discussed yet; *note String Manipulation Functions: String Functions.). -For example: +discussed yet; *note String Functions::). For example: tolower($1) ~ /foo/ { ... } @@ -2573,10 +2554,9 @@ particular rule.(1) To do this, use either character lists or dynamically turn case-sensitivity on or off for all the rules at once. `IGNORECASE' can be set on the command line or in a `BEGIN' rule -(*note Other Command-Line Arguments: Other Arguments.; also *note -Startup and Cleanup Actions: Using BEGIN/END.). Setting `IGNORECASE' -from the command line is a way to make a program case-insensitive -without having to edit it. +(*note Other Arguments::; also *note Using BEGIN/END::). Setting +`IGNORECASE' from the command line is a way to make a program +case-insensitive without having to edit it. Prior to `gawk' 3.0, the value of `IGNORECASE' affected regexp operations only. It did not affect string comparison with `==', `!=', @@ -2590,8 +2570,8 @@ ASCII characters, which also provides a number of characters suitable for use with European languages. The value of `IGNORECASE' has no effect if `gawk' is in -compatibility mode (*note Command-Line Options: Options.). Case is -always significant in compatibility mode. +compatibility mode (*note Options::). Case is always significant in +compatibility mode. ---------- Footnotes ---------- @@ -2611,9 +2591,9 @@ How Much Text Matches? echo aaaabcd | awk '{ sub(/a+/, "<A>"); print }' This example uses the `sub' function (which we haven't discussed yet; -*note String Manipulation Functions: String Functions.) to make a -change to the input record. Here, the regexp `/a+/' indicates "one or -more `a' characters," and the replacement text is `<A>'. +*note String Functions::) to make a change to the input record. Here, +the regexp `/a+/' indicates "one or more `a' characters," and the +replacement text is `<A>'. The input contains four `a' characters. `awk' (and POSIX) regular expressions always match the leftmost, _longest_ sequence of input @@ -2625,12 +2605,10 @@ with `<A>' in this example: For simple match/no-match tests, this is not so important. But when doing text matching and substitutions with the `match', `sub', `gsub', -and `gensub' functions, it is very important. *Note String -Manipulation Functions: String Functions, for more information on these -functions. Understanding this principle is also important for -regexp-based record and field splitting (*note How Input Is Split into -Records: Records., and also *note Specifying How Fields Are Separated: -Field Separators.). +and `gensub' functions, it is very important. *Note String Functions::, +for more information on these functions. Understanding this principle +is also important for regexp-based record and field splitting (*note +Records::, and also *note Field Separators::). File: gawk.info, Node: Computed Regexps, Next: Locales, Prev: Leftmost Longest, Up: Regexp @@ -2724,8 +2702,8 @@ 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: +replacement (*note String Functions::). Here, the intent is to remove +trailing uppercase characters: $ echo something1234abc | gawk '{ sub("[A-Z]*$", ""); print }' -| something1234 @@ -2745,6 +2723,18 @@ statements: manner, where case distinctions do matter. You may wish to put these statements into your shell startup file, e.g., `$HOME/.profile'. + Similar considerations apply to other ranges. For example, `["-/]' +is perfectly valid in ASCII, but is not valid in many Unicode locales, +such as `en_US.UTF-8'. (In general, such ranges should be avoided; +either list the characters individually, or use a POSIX character class +such as `[[:punct:]]'.) + + For the normal case of `RS = "\n"', the locale is largely irrelevant. +For other single byte record separators, using `LC_ALL=C' will give you +much better performance when reading records. Otherwise, `gawk' has to +make several function calls, _per input character_ to find the record +terminator. + File: gawk.info, Node: Reading Files, Next: Printing, Prev: Regexp, Up: Top @@ -2768,8 +2758,7 @@ parts of a record. On rare occasions, you may need to use the `getline' command. The `getline' command is valuable, both because it can do explicit input from any number of files, and because the files used with it do not -have to be named on the `awk' command line (*note Explicit Input with -`getline': Getline.). +have to be named on the `awk' command line (*note Getline::). * Menu: @@ -2784,7 +2773,7 @@ have to be named on the `awk' command line (*note Explicit Input with using the `getline' function. -File: gawk.info, Node: Records, Next: Fields, Prev: Reading Files, Up: Reading Files +File: gawk.info, Node: Records, Next: Fields, Up: Reading Files How Input Is Split into Records =============================== @@ -2805,13 +2794,12 @@ built-in variable `RS'. Like any other variable, the value of `RS' can be changed in the `awk' program with the assignment operator, `=' (*note Assignment -Expressions: Assignment Ops.). The new record-separator character -should be enclosed in quotation marks, which indicate a string -constant. Often the right time to do this is at the beginning of -execution, before any input is processed, so that the very first record -is read with the proper separator. To do this, use the special `BEGIN' -pattern (*note The `BEGIN' and `END' Special Patterns: BEGIN/END.). -For example: +Ops::). The new record-separator character should be enclosed in +quotation marks, which indicate a string constant. Often the right +time to do this is at the beginning of execution, before any input is +processed, so that the very first record is read with the proper +separator. To do this, use the special `BEGIN' pattern (*note +BEGIN/END::). For example: awk 'BEGIN { RS = "/" } { print $0 }' BBS-list @@ -2854,8 +2842,8 @@ newline. Here are the results of running the program on `BBS-list': -| Note that the entry for the `camelot' BBS is not split. In the -original data file (*note Data Files for the Examples: Sample Data -Files.), the line looks like this: +original data file (*note Sample Data Files::), the line looks like +this: camelot 555-0542 300 C @@ -2866,8 +2854,7 @@ separating them in the output is the original newline in the data file, not the one added by `awk' when it printed the record! Another way to change the record separator is on the command line, -using the variable-assignment feature (*note Other Command-Line -Arguments: Other Arguments.): +using the variable-assignment feature (*note Other Arguments::): awk '{ print $0 }' RS="/" BBS-list @@ -2889,8 +2876,8 @@ record, even if the last character in the file is not the character in The empty string `""' (a string without any characters) has a special meaning as the value of `RS'. It means that records are -separated by one or more blank lines and nothing else. *Note -Multiple-Line Records: Multiple Line, for more details. +separated by one or more blank lines and nothing else. *Note Multiple +Line::, for more details. If you change the value of `RS' in the middle of an `awk' run, the new value is used to delimit subsequent records, but the record @@ -2900,15 +2887,14 @@ affected. After the end of the record has been determined, `gawk' sets the variable `RT' to the text in the input that matched `RS'. When using `gawk', the value of `RS' is not limited to a one-character string. It -can be any regular expression (*note Regular Expressions: Regexp.). In -general, each record ends at the next string that matches the regular -expression; the next record starts at the end of the matching string. -This general rule is actually at work in the usual case, where `RS' -contains just a newline: a record ends at the beginning of the next -matching string (the next newline in the input), and the following -record starts just after the end of this string (at the first character -of the following line). The newline, because it matches `RS', is not -part of either record. +can be any regular expression (*note Regexp::). In general, each record +ends at the next string that matches the regular expression; the next +record starts at the end of the matching string. This general rule is +actually at work in the usual case, where `RS' contains just a newline: +a record ends at the beginning of the next matching string (the next +newline in the input), and the following record starts just after the +end of this string (at the first character of the following line). The +newline, because it matches `RS', is not part of either record. When `RS' is a single character, `RT' contains the same single character. However, when `RS' is a regular expression, `RT' contains @@ -2929,8 +2915,8 @@ trailing whitespace: The final line of output has an extra blank line. This is because the 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'. +terminating newline. *Note 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 @@ -2942,9 +2928,8 @@ 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 -character of the value of `RS' is used to determine the end of the -record. +Options::). In compatibility mode, only the first character of the +value of `RS' is used to determine the end of the record. Advanced Notes: `RS = "\0"' Is Not Portable ------------------------------------------- @@ -3031,9 +3016,8 @@ are not interested in specific fields. Here are some more examples: This example prints each record in the file `BBS-list' whose first field contains the string `foo'. The operator `~' is called a -"matching operator" (*note How to Use Regular Expressions: Regexp -Usage.); it tests whether a string (here, the field `$1') matches a -given regular expression. +"matching operator" (*note Regexp Usage::); it tests whether a string +(here, the field `$1') matches a given regular expression. By contrast, the following example looks for `foo' in _the entire record_ and prints the first field and the last field for each matching @@ -3081,7 +3065,7 @@ necessary whenever there is a binary operator in the field-number expression. This example, then, prints the hours of operation (the fourth field) for every line of the file `BBS-list'. (All of the `awk' operators are listed, in order of decreasing precedence, in *Note -Operator Precedence (How Operators Nest): Precedence.) +Precedence::.) If the field number you compute is zero, you get the entire record. Thus, `$(2-2)' has the same value as `$0'. Negative field numbers are @@ -3090,11 +3074,11 @@ not allowed; trying to reference one usually terminates the program. negative field number. `gawk' notices this and terminates your program. Other `awk' implementations may behave differently.) - As mentioned in *Note Examining Fields: Fields, `awk' stores the -current record's number of fields in the built-in variable `NF' (also -*note Built-in Variables::). The expression `$NF' is not a special -feature--it is the direct consequence of evaluating `NF' and using its -value as a field number. + As mentioned in *Note Fields::, `awk' stores the current record's +number of fields in the built-in variable `NF' (also *note Built-in +Variables::). The expression `$NF' is not a special feature--it is the +direct consequence of evaluating `NF' and using its value as a field +number. File: gawk.info, Node: Changing Fields, Next: Field Separators, Prev: Nonconstant Fields, Up: Reading Files @@ -3117,17 +3101,15 @@ input file.) Consider the following example and its output: The program first saves the original value of field three in the variable `nboxes'. The `-' sign represents subtraction, so this program reassigns field three, `$3', as the original value of field -three minus ten: `$3 - 10'. (*Note Arithmetic Operators: Arithmetic -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.) +three minus ten: `$3 - 10'. (*Note Arithmetic 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 `$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 -becomes field three. *Note Conversion of Strings and Numbers: -Conversion. +becomes field three. *Note Conversion::. When the value of a field is changed (as perceived by `awk'), the text of the input record is recalculated to contain the new field where @@ -3163,11 +3145,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.). 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::). +fields; *note 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 @@ -3179,10 +3161,9 @@ out-of-range field only produces an empty string. For example: print "everything is normal" should print `everything is normal', because `NF+1' is certain to be -out of range. (*Note The `if'-`else' Statement: If Statement, for more -information about `awk''s `if-else' statements. *Note Variable Typing -and Comparison Expressions: Typing and Comparison, for more information -about the `!=' operator.) +out of range. (*Note If Statement::, for more information about +`awk''s `if-else' statements. *Note Typing and Comparison::, for more +information about the `!=' operator.) It is important to note that making an assignment to an existing field changes the value of `$0' but does not change the value of `NF', @@ -3231,7 +3212,7 @@ as we've shown here. 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.). +String Functions::). File: gawk.info, Node: Field Separators, Next: Constant Size, Prev: Changing Fields, Up: Reading Files @@ -3267,12 +3248,12 @@ is used by the POSIX-compliant shells (such as the Unix Bourne shell, `sh', or `bash'). The value of `FS' can be changed in the `awk' program with the -assignment operator, `=' (*note Assignment Expressions: Assignment -Ops.). Often the right time to do this is at the beginning of execution -before any input has been processed, so that the very first record is -read with the proper separator. To do this, use the special `BEGIN' -pattern (*note The `BEGIN' and `END' Special Patterns: BEGIN/END.). -For example, here we set the value of `FS' to the string `","': +assignment operator, `=' (*note Assignment Ops::). Often the right +time to do this is at the beginning of execution before any input has +been processed, so that the very first record is read with the proper +separator. To do this, use the special `BEGIN' pattern (*note +BEGIN/END::). For example, here we set the value of `FS' to the string +`","': awk 'BEGIN { FS = "," } ; { print $2 }' @@ -3314,7 +3295,7 @@ space character is the only single character that does not follow these rules. -File: gawk.info, Node: Regexp Field Splitting, Next: Single Character Fields, Prev: Field Separators, Up: Field Separators +File: gawk.info, Node: Regexp Field Splitting, Next: Single Character Fields, Up: Field Separators Using Regular Expressions to Separate Fields -------------------------------------------- @@ -3335,8 +3316,7 @@ of similar escape sequences.) For a less trivial example of a regular expression, try using single spaces to separate fields the way single commas are used. `FS' can be set to `"[ ]"' (left bracket, space, right bracket). This regular -expression matches a single space and nothing else (*note Regular -Expressions: Regexp.). +expression matches a single space and nothing else (*note Regexp::). There is an important difference between the two cases of `FS = " "' (a single space) and `FS = "[ \t\n]+"' (a regular expression matching @@ -3396,8 +3376,8 @@ the record becomes a separate field. For example: Traditionally, the behavior of `FS' equal to `""' was not defined. In this case, most versions of Unix `awk' simply treat the entire record as only having one field. (d.c.) In compatibility mode (*note -Command-Line Options: Options.), if `FS' is the null string, then -`gawk' also behaves this way. +Options::), if `FS' is the null string, then `gawk' also behaves this +way. File: gawk.info, Node: Command Line Field Separator, Next: Field Splitting Summary, Prev: Single Character Fields, Up: Field Separators @@ -3431,13 +3411,12 @@ Because `\' is used for quoting in the shell, `awk' sees `-F\\'. Then Sequences::), finally yielding a single `\' to use for the field separator. - As a special case, in compatibility mode (*note Command-Line -Options: Options.), if the argument to `-F' is `t', then `FS' is set to -the TAB character. If you type `-F\t' at the shell, without any -quotes, the `\' gets deleted, so `awk' figures that you really want -your fields to be separated with tabs and not `t's. Use `-v FS="t"' or -`-F"[t]"' on the command line if you really do want to separate your -fields with `t's. + As a special case, in compatibility mode (*note Options::), if the +argument to `-F' is `t', then `FS' is set to the TAB character. If you +type `-F\t' at the shell, without any quotes, the `\' gets deleted, so +`awk' figures that you really want your fields to be separated with +tabs and not `t's. Use `-v FS="t"' or `-F"[t]"' on the command line if +you really do want to separate your fields with `t's. For example, let's use an `awk' program file called `baud.awk' that contains the pattern `/300/' and the action `print $1': @@ -3555,10 +3534,10 @@ like: 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: + The `IGNORECASE' variable (*note 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 @@ -3594,9 +3573,8 @@ anticipate the use of their output as input for other programs. up by the use of a variable number of spaces and _empty fields are just spaces_. Clearly, `awk''s normal field splitting based on `FS' does not work well in this case. Although a portable `awk' program can use -a series of `substr' calls on `$0' (*note String Manipulation -Functions: String Functions.), this is awkward and inefficient for a -large number of fields. +a series of `substr' calls on `$0' (*note String Functions::), this is +awkward and inefficient for a large number of fields. The splitting of an input record into fixed-width fields is specified by assigning a string containing space-separated numbers to @@ -3666,10 +3644,9 @@ run on a system with card readers is another story!) Assigning a value to `FS' causes `gawk' to use `FS' for field splitting again. Use `FS = FS' to make this happen, without having to know the current value of `FS'. In order to tell which kind of field -splitting is in effect, use `PROCINFO["FS"]' (*note Built-in Variables -That Convey Information: Auto-set.). The value is `"FS"' if regular -field splitting is being used, or it is `"FIELDWIDTHS"' if fixed-width -field splitting is being used: +splitting is in effect, use `PROCINFO["FS"]' (*note Auto-set::). The +value is `"FS"' if regular field splitting is being used, or it is +`"FIELDWIDTHS"' if fixed-width field splitting is being used: if (PROCINFO["FS"] == "FS") REGULAR FIELD SPLITTING ... @@ -3678,8 +3655,8 @@ field splitting is being used: This information is useful when writing a function that needs to temporarily change `FS' or `FIELDWIDTHS', read some records, and then -restore the original settings (*note Reading the User Database: Passwd -Functions., for an example of such a function). +restore the original settings (*note Passwd Functions::, for an example +of such a function). File: gawk.info, Node: Multiple Line, Next: Getline, Prev: Constant Size, Up: Reading Files @@ -3711,10 +3688,10 @@ empty; lines that contain only whitespace do not count.) `"\n\n+"' to `RS'. This regexp matches the newline at the end of the record and one or more blank lines after the record. In addition, a regular expression always matches the longest possible sequence when -there is a choice (*note How Much Text Matches?: Leftmost Longest.). -So the next record doesn't start until the first nonblank line that -follows--no matter how many blank lines appear in a row, they are -considered one record separator. +there is a choice (*note Leftmost Longest::). So the next record +doesn't start until the first nonblank line that follows--no matter how +many blank lines appear in a row, they are considered one record +separator. There is an important difference between `RS = ""' and `RS = "\n\n+"'. In the first case, leading newlines in the input data file @@ -3735,12 +3712,11 @@ provide useful behavior in the default case (i.e., `FS' is equal to `" "'). This feature can be a problem if you really don't want the 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.). 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 = "[%]"'. +function to break up the record manually (*note 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"'. @@ -3786,10 +3762,9 @@ A simple program to process this file is as follows: -| ... - *Note Printing Mailing Labels: Labels Program, for a more realistic -program that deals with address lists. The following table summarizes -how records are split, based on the value of `RS'. (`==' means "is -equal to.") + *Note Labels Program::, for a more realistic program that deals with +address lists. The following table summarizes how records are split, +based on the value of `RS'. (`==' means "is equal to.") `RS == "\n"' Records are separated by the newline character (`\n'). In effect, @@ -3866,7 +3841,7 @@ represents a shell command. * Getline Summary:: Summary of `getline' Variants. -File: gawk.info, Node: Plain Getline, Next: Getline/Variable, Prev: Getline, Up: Getline +File: gawk.info, Node: Plain Getline, Next: Getline/Variable, Up: Getline Using `getline' with No Arguments --------------------------------- @@ -3913,8 +3888,7 @@ value of `$0'. subsequent rules. The original value of `$0' that triggered the rule that executed `getline' is lost. By contrast, the `next' statement reads a new record but immediately begins processing it normally, -starting with the first rule in the program. *Note The `next' -Statement: Next Statement. +starting with the first rule in the program. *Note Next Statement::. File: gawk.info, Node: Getline/Variable, Next: Getline/File, Prev: Plain Getline, Up: Getline @@ -3988,8 +3962,7 @@ EXPRESSION contains unparenthesized operators other than `$'; for example, `getline < dir "/" file' is ambiguous because the concatenation operator is not parenthesized. You should write it as `getline < (dir "/" file)' if you want your program to be portable to -other `awk' implementations. (It happens that `gawk' gets it right, -but you should not rely on this. Parentheses make it easier to read.) +other `awk' implementations. File: gawk.info, Node: Getline/Variable/File, Next: Getline/Pipe, Prev: Getline/File, Up: Getline @@ -4023,14 +3996,12 @@ second field on the `@include' line. The `close' function is called to ensure that if two identical `@include' lines appear in the input, the entire specified file is -included twice. *Note Closing Input and Output Redirections: Close -Files And Pipes. +included twice. *Note Close Files And Pipes::. One deficiency of this program is that it does not process nested `@include' statements (i.e., `@include' statements in included files) -the way a true macro preprocessor would. *Note An Easy Way to Use -Library Functions: Igawk Program, for a program that does handle nested -`@include' statements. +the way a true macro preprocessor would. *Note Igawk Program::, for a +program that does handle nested `@include' statements. File: gawk.info, Node: Getline/Pipe, Next: Getline/Variable/Pipe, Prev: Getline/Variable/File, Up: Getline @@ -4058,8 +4029,7 @@ produced by running the rest of the line as a shell command: The `close' function is called to ensure that if two identical `@execute' lines appear in the input, the command is run for each one. -*Note Closing Input and Output Redirections: Close Files And Pipes. -Given the input: +*Note Close Files And Pipes::. Given the input: foo bar @@ -4090,9 +4060,7 @@ EXPRESSION contains unparenthesized operators other than `$'--for example, `"echo " "date" | getline' is ambiguous because the concatenation operator is not parenthesized. You should write it as `("echo " "date") | getline' if you want your program to be portable to -other `awk' implementations. (It happens that `gawk' gets it right, -but you should not rely on this. Parentheses make it easier to read, -anyway.) +other `awk' implementations. File: gawk.info, Node: Getline/Variable/Pipe, Next: Getline/Coprocess, Prev: Getline/Pipe, Up: Getline @@ -4119,9 +4087,7 @@ EXPRESSION contains unparenthesized operators other than `$'; for example, `"echo " "date" | getline VAR' is ambiguous because the concatenation operator is not parenthesized. You should write it as `("echo " "date") | getline VAR' if you want your program to be -portable to other `awk' implementations. (It happens that `gawk' gets -it right, but you should not rely on this. Parentheses make it easier -to read, anyway.) +portable to other `awk' implementations. File: gawk.info, Node: Getline/Coprocess, Next: Getline/Variable/Coprocess, Prev: Getline/Variable/Pipe, Up: Getline @@ -4150,9 +4116,8 @@ normal manner, thus changing the values of `$0', of the other fields, and of `NF'. Coprocesses are an advanced feature. They are discussed here only -because this is the minor node on `getline'. *Note Two-Way -Communications with Another Process: Two-way I/O, where coprocesses are -discussed in more detail. +because this is the minor node on `getline'. *Note Two-way I/O::, +where coprocesses are discussed in more detail. File: gawk.info, Node: Getline/Variable/Coprocess, Next: Getline Notes, Prev: Getline/Coprocess, Up: Getline @@ -4169,9 +4134,8 @@ changed and the record is not split into fields. The only variable changed is VAR. Coprocesses are an advanced feature. They are discussed here only -because this is the minor node on `getline'. *Note Two-Way -Communications with Another Process: Two-way I/O, where coprocesses are -discussed in more detail. +because this is the minor node on `getline'. *Note Two-way I/O::, +where coprocesses are discussed in more detail. File: gawk.info, Node: Getline Notes, Next: Getline Summary, Prev: Getline/Variable/Coprocess, Up: Getline @@ -4198,9 +4162,7 @@ bear in mind: `getline' command causes `awk' to set the value of `FILENAME'. Normally, `FILENAME' does not have a value inside `BEGIN' rules, because you have not yet started to process the command-line data - files. (d.c.) (*Note The `BEGIN' and `END' Special Patterns: - BEGIN/END, also *note Built-in Variables That Convey Information: - Auto-set..) + files. (d.c.) (*Note BEGIN/END::, also *note Auto-set::.) * Using `FILENAME' with `getline' (`getline < FILENAME') is likely to be a source for confusion. `awk' opens a separate input stream @@ -4241,9 +4203,8 @@ statement is not limited when computing _which_ values to print. However, with two exceptions, you cannot specify _how_ to print them--how many columns, whether to use exponential notation or not, and so on. (For the exceptions, *note Output Separators::, and *Note -Controlling Numeric Output with `print': OFMT.) For printing with -specifications, you need the `printf' statement (*note Using `printf' -Statements for Fancier Printing: Printf.). +OFMT::.) For printing with specifications, you need the `printf' +statement (*note Printf::). Besides basic and formatted printing, this major node also covers I/O redirections to files and pipes, introduces the special file names @@ -4265,7 +4226,7 @@ function. * Close Files And Pipes:: Closing Input and Output Files and Pipes. -File: gawk.info, Node: Print, Next: Print Examples, Prev: Printing, Up: Printing +File: gawk.info, Node: Print, Next: Print Examples, Up: Printing The `print' Statement ===================== @@ -4280,7 +4241,7 @@ spaces, followed by a newline. The statement looks like this: The entire list of items may be optionally enclosed in parentheses. The parentheses are necessary if any of the item expressions uses the `>' relational operator; otherwise it could be confused with a redirection -(*note Redirecting Output of `print' and `printf': Redirection.). +(*note Redirection::). The items to print can be constant strings or numbers, fields of the current record (such as `$1'), variables, or any `awk' expression. @@ -4341,8 +4302,7 @@ Here is the same program, without the comma: example's output makes much sense. A heading line at the beginning would make it clearer. Let's add some headings to our table of months (`$1') and green crates shipped (`$2'). We do this using the `BEGIN' -pattern (*note The `BEGIN' and `END' Special Patterns: BEGIN/END.) so -that the headings are only printed once: +pattern (*note BEGIN/END::) so that the headings are only printed once: awk 'BEGIN { print "Month Crates" print "----- ------" } @@ -4368,13 +4328,11 @@ fields: Lining up columns this way can get pretty complicated when there are many columns to fix. Counting spaces for two or three columns is simple, but any more than this can take up a lot of time. This is why -the `printf' statement was created (*note Using `printf' Statements for -Fancier Printing: Printf.); one of its specialties is lining up columns -of data. +the `printf' statement was created (*note Printf::); one of its +specialties is lining up columns of data. *Note:* You can continue either a `print' or `printf' statement -simply by putting a newline after any comma (*note `awk' Statements -Versus Lines: Statements/Lines.). +simply by putting a newline after any comma (*note Statements/Lines::). File: gawk.info, Node: Output Separators, Next: OFMT, Prev: Print Examples, Up: Printing @@ -4398,11 +4356,10 @@ Thus, each `print' statement normally makes a separate line. In order to change how output fields and records are separated, assign new values to the variables `OFS' and `ORS'. The usual place to -do this is in the `BEGIN' rule (*note The `BEGIN' and `END' Special -Patterns: BEGIN/END.), so that it happens before any input is -processed. It can also be done with assignments on the command line, -before the names of the input files, or using the `-v' command-line -option (*note Command-Line Options: Options.). The following example +do this is in the `BEGIN' rule (*note BEGIN/END::), so that it happens +before any input is processed. It can also be done with assignments on +the command line, before the names of the input files, or using the +`-v' command-line option (*note Options::). The following example prints the first and second fields of each input record, separated by a semicolon, with a blank line added after each newline: @@ -4427,12 +4384,11 @@ Controlling Numeric Output with `print' When the `print' statement is used to print numeric values, `awk' internally converts the number to a string of characters and prints that string. `awk' uses the `sprintf' function to do this conversion -(*note String Manipulation Functions: String Functions.). For now, it -suffices to say that the `sprintf' function accepts a "format -specification" that tells it how to format numbers (or strings), and -that there are a number of different ways in which numbers can be -formatted. The different format specifications are discussed more -fully in *Note Format-Control Letters: Control Letters. +(*note String Functions::). For now, it suffices to say that the +`sprintf' function accepts a "format specification" that tells it how +to format numbers (or strings), and that there are a number of +different ways in which numbers can be formatted. The different format +specifications are discussed more fully in *Note Control Letters::. The built-in variable `OFMT' contains the default format specification that `print' uses with `sprintf' when it wants to convert @@ -4473,7 +4429,7 @@ arguments. * Printf Examples:: Several examples. -File: gawk.info, Node: Basic Printf, Next: Control Letters, Prev: Printf, Up: Printf +File: gawk.info, Node: Basic Printf, Next: Control Letters, Up: Printf Introduction to the `printf' Statement -------------------------------------- @@ -4485,8 +4441,7 @@ Introduction to the `printf' Statement The entire list of arguments may optionally be enclosed in parentheses. The parentheses are necessary if any of the item expressions use the `>' relational operator; otherwise, it can be confused with a -redirection (*note Redirecting Output of `print' and `printf': -Redirection.). +redirection (*note Redirection::). The difference between `printf' and `print' is the FORMAT argument. This is an expression whose value is taken as a string; it specifies @@ -4583,9 +4538,11 @@ width. Here is a list of the format-control letters: it ignores any modifiers. *Note:* When using the integer format-control letters for values -that are outside the range of a C `long' integer, `gawk' switches to the -`%g' format specifier. Other versions of `awk' may print invalid values -or do something else entirely. (d.c.) +that are outside the range of the widest C integer type, `gawk' +switches to the the `%g' format specifier. If `--lint' is provided on +the command line (*note Options::), `gawk' warns about this. Other +versions of `awk' may print invalid values or do something else +entirely. (d.c.) File: gawk.info, Node: Format Modifiers, Next: Printf Examples, Prev: Control Letters, Up: Printf @@ -4615,9 +4572,9 @@ which they may appear: At first glance, this feature doesn't seem to be of much use. It is in fact a `gawk' extension, intended for use in translating - messages at runtime. *Note Rearranging `printf' Arguments: Printf - Ordering, which describes how and why to use positional specifiers. - For now, we will not use them. + messages at runtime. *Note Printf Ordering::, which describes how + and why to use positional specifiers. For now, we will not use + them. `-' The minus sign, used before the width modifier (see later on in @@ -4727,9 +4684,9 @@ This is not particularly easy to read but it does work. C programmers may be used to supplying additional `l', `L', and `h' modifiers in `printf' format strings. These are not valid in `awk'. Most `awk' implementations silently ignore these modifiers. If -`--lint' is provided on the command line (*note Command-Line Options: -Options.), `gawk' warns about their use. If `--posix' is supplied, -their use is a fatal error. +`--lint' is provided on the command line (*note Options::), `gawk' +warns about their use. If `--posix' is supplied, their use is a fatal +error. File: gawk.info, Node: Printf Examples, Prev: Format Modifiers, Up: Printf @@ -4770,9 +4727,9 @@ they are last on their lines. They don't need to have spaces after them. The table could be made to look even nicer by adding headings to the -tops of the columns. This is done using the `BEGIN' pattern (*note The -`BEGIN' and `END' Special Patterns: BEGIN/END.) so that the headers -are only printed once, at the beginning of the `awk' program: +tops of the columns. This is done using the `BEGIN' pattern (*note +BEGIN/END::) so that the headers are only printed once, at the +beginning of the `awk' program: awk 'BEGIN { print "Name Number" print "---- ------" } @@ -4800,7 +4757,7 @@ be emphasized by storing it in a variable, like this: At this point, it would be a worthwhile exercise to use the `printf' statement to line up the headings and table data for the `inventory-shipped' example that was covered earlier in the minor node -on the `print' statement (*note The `print' Statement: Print.). +on the `print' statement (*note Print::). File: gawk.info, Node: Redirection, Next: Special Files, Prev: Printf, Up: Printing @@ -4889,12 +4846,11 @@ work identically for `printf': The message is built using string concatenation and saved in the variable `m'. It's then sent down the pipeline to the `mail' program. (The parentheses group the items to concatenate--see - *Note String Concatenation: Concatenation.) + *Note Concatenation::.) The `close' function is called here because it's a good idea to close the pipe as soon as all the intended output has been sent to - it. *Note Closing Input and Output Redirections: Close Files And - Pipes, for more information. + it. *Note Close Files And Pipes::, for more information. This example also illustrates the use of a variable to represent a FILE or COMMAND--it is not necessary to always use a string @@ -4910,8 +4866,7 @@ work identically for `printf': the `awk' program. This feature is a `gawk' extension, and is not available in POSIX - `awk'. *Note Two-Way Communications with Another Process: Two-way - I/O, for a more complete discussion. + `awk'. *Note Two-way I/O::, for a more complete discussion. Redirecting output using `>', `>>', `|', or `|&' asks the system to open a file, pipe, or coprocess only if the particular FILE or COMMAND @@ -4951,10 +4906,9 @@ all lowercase. The following program is both simple and efficient: END { close("sh") } The `tolower' function returns its argument string with all -uppercase characters converted to lowercase (*note String Manipulation -Functions: String Functions.). The program builds up a list of command -lines, using the `mv' utility to rename the files. It then sends the -list to the shell for execution. +uppercase characters converted to lowercase (*note String Functions::). +The program builds up a list of command lines, using the `mv' utility +to rename the files. It then sends the list to the shell for execution. File: gawk.info, Node: Special Files, Next: Close Files And Pipes, Prev: Redirection, Up: Printing @@ -4974,7 +4928,7 @@ descriptors, process-related information, and TCP/IP networking. * Special Caveats:: Things to watch out for. -File: gawk.info, Node: Special FD, Next: Special Process, Prev: Special Files, Up: Special Files +File: gawk.info, Node: Special FD, Next: Special Process, Up: Special Files Special Files for Standard Descriptors -------------------------------------- @@ -5049,9 +5003,8 @@ Special Files for Process-Related Information `gawk' also provides special file names that give access to information about the running `gawk' process. Each of these "files" provides a single record of information. To read them more than once, -they must first be closed with the `close' function (*note Closing -Input and Output Redirections: Close Files And Pipes.). The file names -are: +they must first be closed with the `close' function (*note Close Files +And Pipes::). The file names are: `/dev/pid' Reading this file returns the process ID of the current process, @@ -5098,8 +5051,7 @@ may not be used as source files with the `-f' option. are now considered obsolete and will disappear entirely in the next release of `gawk'. `gawk' prints a warning message every time you use one of these files. To obtain process-related information, use the -`PROCINFO' array. *Note Built-in Variables That Convey Information: -Auto-set. +`PROCINFO' array. *Note Auto-set::. File: gawk.info, Node: Special Network, Next: Special Caveats, Prev: Special Process, Up: Special Files @@ -5116,11 +5068,9 @@ is done using a special file name of the form: The PROTOCOL is one of `tcp', `udp', or `raw', and the other fields represent the other essential pieces of information for making a networking connection. These file names are used with the `|&' -operator for communicating with a coprocess (*note Two-Way -Communications with Another Process: Two-way I/O.). This is an -advanced feature, mentioned here only for completeness. Full -discussion is delayed until *Note Using `gawk' for Network Programming: -TCP/IP Networking. +operator for communicating with a coprocess (*note Two-way I/O::). +This is an advanced feature, mentioned here only for completeness. +Full discussion is delayed until *Note TCP/IP Networking::. File: gawk.info, Node: Special Caveats, Prev: Special Network, Up: Special Files @@ -5132,7 +5082,7 @@ Special File Name Caveats names that `gawk' provides: * Recognition of these special file names is disabled if `gawk' is in - compatibility mode (*note Command-Line Options: Options.). + compatibility mode (*note Options::). * The special files that provide process-related information are now considered obsolete and will disappear entirely in the next @@ -5165,11 +5115,10 @@ Closing Input and Output Redirections If the same file name or the same shell command is used with `getline' more than once during the execution of an `awk' program -(*note Explicit Input with `getline': Getline.), the file is opened (or -the command is executed) the first time only. At that time, the first -record of input is read from that file or command. The next time the -same file or command is used with `getline', another record is read -from it, and so on. +(*note Getline::), the file is opened (or the command is executed) the +first time only. At that time, the first record of input is read from +that file or command. The next time the same file or command is used +with `getline', another record is read from it, and so on. Similarly, when a file or pipe is opened for output, the file name or command associated with it is remembered by `awk', and subsequent @@ -5282,9 +5231,8 @@ to `close'. As in any other call to `close', the first argument is the name of the command or special file used to start the coprocess. The second argument should be a string, with either of the values `"to"' or `"from"'. Case does not matter. As this is an advanced feature, a -more complete discussion is delayed until *Note Two-Way Communications -with Another Process: Two-way I/O, which discusses it in more detail -and gives an example. +more complete discussion is delayed until *Note Two-way I/O::, which +discusses it in more detail and gives an example. Advanced Notes: Using `close''s Return Value -------------------------------------------- @@ -5309,22 +5257,10 @@ 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. - - For POSIX-compliant systems, if the exit status is a number above -128, then the program was terminated by a signal. Subtract 128 to get -the signal number: - - exit_val = close(command) - if (exit_val > 128) - print command, "died with signal", exit_val - 128 - else - print command, "exited with code", exit_val - - Currently, in `gawk', this only works for commands piping into -`getline'. For commands piped into from `print' or `printf', the -return value from `close' is that of the library's `pclose' function. + The POSIX standard is very vague; it says that `close' returns zero +on success and non-zero otherwise. In general, different +implementations vary in what they report when closing pipes; thus the +return value cannot be used portably. (d.c.) ---------- Footnotes ---------- @@ -5380,7 +5316,7 @@ operators. * Precedence:: How various operators nest. -File: gawk.info, Node: Constants, Next: Using Constant Regexps, Prev: Expressions, Up: Expressions +File: gawk.info, Node: Constants, Next: Using Constant Regexps, Up: Expressions Constant Expressions ==================== @@ -5400,7 +5336,7 @@ forms, but are stored identically internally. * Regexp Constants:: Regular Expression constants. -File: gawk.info, Node: Scalar Constants, Next: Nondecimal-numbers, Prev: Constants, Up: Constants +File: gawk.info, Node: Scalar Constants, Next: Nondecimal-numbers, Up: Constants Numeric and String Constants ---------------------------- @@ -5477,13 +5413,12 @@ of various sorts. program text. However, such numbers in the input data are not treated differently; doing so by default would break old programs. (If you really need to do this, use the `--non-decimal-data' command-line -option; *note Allowing Nondecimal Input Data: Nondecimal Data..) If -you have octal or hexadecimal data, you can use the `strtonum' function -(*note String Manipulation Functions: String Functions.) to convert -the data into a number. Most of the time, you will want to use octal -or hexadecimal constants when working with the built-in bit -manipulation functions; see *Note Using `gawk''s Bit Manipulation -Functions: Bitwise Functions, for more information. +option; *note Nondecimal Data::.) If you have octal or hexadecimal +data, you can use the `strtonum' function (*note String Functions::) to +convert the data into a number. Most of the time, you will want to use +octal or hexadecimal constants when working with the built-in bit +manipulation functions; see *Note Bitwise Functions::, for more +information. Unlike some early C implementations, `8' and `9' are not valid in octal constants; e.g., `gawk' treats `018' as decimal 18: @@ -5493,8 +5428,8 @@ octal constants; e.g., `gawk' treats `018' as decimal 18: -| 18 Octal and hexadecimal source code constants are a `gawk' extension. -If `gawk' is in compatibility mode (*note Command-Line Options: -Options.), they are not available. +If `gawk' is in compatibility mode (*note Options::), they are not +available. Advanced Notes: A Constant's Base Does Not Affect Its Value ----------------------------------------------------------- @@ -5530,8 +5465,8 @@ regexp constant merely stands for the regexp that is to be matched. However, regexp constants (such as `/foo/') may be used like simple expressions. When a regexp constant appears by itself, it has the same meaning as if it appeared in a pattern, i.e., `($0 ~ /foo/)' (d.c.) -*Note Expressions as Patterns: Expression Patterns. This means that -the following two code segments: +*Note Expression Patterns::. This means that the following two code +segments: if ($0 ~ /barfly/ || $0 ~ /camelot/) print "found" @@ -5566,12 +5501,12 @@ has never been well documented until the POSIX specification. Constant regular expressions are also used as the first argument for the `gensub', `sub', and `gsub' functions, and as the second argument -of the `match' function (*note String Manipulation Functions: String -Functions.). Modern implementations of `awk', including `gawk', allow -the third argument of `split' to be a regexp constant, but some older -implementations do not. (d.c.) This can lead to confusion when -attempting to use regexp constants as arguments to user-defined -functions (*note User-Defined Functions: User-defined.). For example: +of the `match' function (*note String Functions::). Modern +implementations of `awk', including `gawk', allow the third argument of +`split' to be a regexp constant, but some older implementations do not. +(d.c.) This can lead to confusion when attempting to use regexp +constants as arguments to user-defined functions (*note User-defined::). +For example: function mysub(pat, repl, str, global) { @@ -5616,7 +5551,7 @@ on the `awk' command line. advanced method of input. -File: gawk.info, Node: Using Variables, Next: Assignment Options, Prev: Variables, Up: Variables +File: gawk.info, Node: Using Variables, Next: Assignment Options, Up: Variables Using Variables in a Program ---------------------------- @@ -5630,7 +5565,7 @@ it may not begin with a digit. Case is significant in variable names; A variable name is a valid expression by itself; it represents the variable's current value. Variables are given new values with "assignment operators", "increment operators", and "decrement -operators". *Note Assignment Expressions: Assignment Ops. +operators". *Note Assignment Ops::. A few variables have special built-in meanings, such as `FS' (the field separator), and `NF' (the number of fields in the current input @@ -5655,8 +5590,7 @@ Assigning Variables on the Command Line Any `awk' variable can be set by including a "variable assignment" among the arguments on the command line when `awk' is invoked (*note -Other Command-Line Arguments: Other Arguments.). Such an assignment -has the following form: +Other Arguments::). Such an assignment has the following form: VARIABLE=TEXT @@ -5668,11 +5602,11 @@ option, as in the following: the variable is set at the very beginning, even before the `BEGIN' rules are run. The `-v' option and its assignment must precede all the -file name arguments, as well as the program text. (*Note Command-Line -Options: Options, for more information about the `-v' option.) -Otherwise, the variable assignment is performed at a time determined by -its position among the input file arguments--after the processing of the -preceding input file argument. For example: +file name arguments, as well as the program text. (*Note Options::, +for more information about the `-v' option.) Otherwise, the variable +assignment is performed at a time determined by its position among the +input file arguments--after the processing of the preceding input file +argument. For example: awk '{ print $n }' n=4 inventory-shipped n=2 BBS-list @@ -5692,9 +5626,9 @@ second field is printed in lines from `BBS-list': ... Command-line arguments are made available for explicit examination by -the `awk' program in the `ARGV' array (*note Using `ARGC' and `ARGV': -ARGC and ARGV.). `awk' processes the values of command-line -assignments for escape sequences (*note Escape Sequences::). (d.c.) +the `awk' program in the `ARGV' array (*note ARGC and ARGV::). `awk' +processes the values of command-line assignments for escape sequences +(*note Escape Sequences::). (d.c.) File: gawk.info, Node: Conversion, Next: Arithmetic Ops, Prev: Variables, Up: Expressions @@ -5728,8 +5662,7 @@ interpreted as valid numbers convert to zero. The exact manner in which numbers are converted into strings is controlled by the `awk' built-in variable `CONVFMT' (*note Built-in Variables::). Numbers are converted using the `sprintf' function with -`CONVFMT' as the format specifier (*note String Manipulation Functions: -String Functions.). +`CONVFMT' as the format specifier (*note String Functions::). `CONVFMT''s default value is `"%.6g"', which prints a value with at least six significant digits. For some applications, you might want to @@ -5760,8 +5693,41 @@ printing. Both `CONVFMT' and `OFMT' have the same default value: change their behavior. However, these semantics for `OFMT' are something to keep in mind if you must port your new style program to older implementations of `awk'. We recommend that instead of changing -your programs, just port `gawk' itself. *Note The `print' Statement: -Print, for more information on the `print' statement. +your programs, just port `gawk' itself. *Note Print::, for more +information on the `print' statement. + + Finally, once again, where you are can matter when it comes to +converting between numbers and strings. In *Note Locales::, we +mentioned that the local character set and language (the locale) can +affect how `gawk' matches characters. The locale also affects numeric +formats. In particular, for `awk' programs, it affects the decimal +point character. The `"C"' locale, and most English-language locales, +use the period character (`.') as the decimal point. However, many (if +not most) European and non-English locales use the comma (`,') as the +decimal point character. + + The POSIX standard says that `awk' always uses the period as the +decimal point when reading the `awk' program source code, and for +command-line variable assignments (*note Other Arguments::). However, +when interpreting input data, for `print' and `printf' output, and for +number to string conversion, the local decimal point character is used. +As of version 3.1.3, `gawk' fully complies with this aspect of the +standard. Here are some examples indicating the difference in behavior, +on a GNU/Linux system: + + $ gawk 'BEGIN { printf "%g\n", 3.1415927 }' + -| 3.14159 + $ LC_ALL=en_DK gawk 'BEGIN { printf "%g\n", 3.1415927 }' + -| 3,14159 + $ echo 4,321 | gawk '{ print $1 + 1 }' + -| 5 + $ echo 4,321 | LC_ALL=en_DK gawk '{ print $1 + 1 }' + -| 5,321 + +The `en_DK' locale is for English in Denmark, where the comma acts as +the decimal point separator. In the normal `"C"' locale, `gawk' treats +`4,321' as `4', while in the Danish locale, it's treated as the full +number, `4.321'. ---------- Footnotes ---------- @@ -5966,13 +5932,12 @@ if you ignore it, the assignment still makes itself felt through the alteration of the variable. We call this a "side effect". The lefthand operand of an assignment need not be a variable (*note -Variables::); it can also be a field (*note Changing the Contents of a -Field: Changing Fields.) or an array element (*note Arrays in `awk': -Arrays.). These are all called "lvalues", which means they can appear -on the lefthand side of an assignment operator. The righthand operand -may be any expression; it produces the new value that the assignment -stores in the specified variable, field, or array element. (Such values -are called "rvalues".) +Variables::); it can also be a field (*note Changing Fields::) or an +array element (*note Arrays::). These are all called "lvalues", which +means they can appear on the lefthand side of an assignment operator. +The righthand operand may be any expression; it produces the new value +that the assignment stores in the specified variable, field, or array +element. (Such values are called "rvalues".) It is important to note that variables do _not_ have permanent types. A variable's type is simply the type of whatever value it happens to @@ -6046,12 +6011,12 @@ righthand expression. For example: The indices of `bar' are practically guaranteed to be different, because `rand' returns different values each time it is called. (Arrays and -the `rand' function haven't been covered yet. *Note Arrays in `awk': -Arrays, and see *Note Numeric Functions::, for more information). This -example illustrates an important fact about assignment operators: the -lefthand expression is only evaluated _once_. It is up to the -implementation as to which expression is evaluated first, the lefthand -or the righthand. Consider this example: +the `rand' function haven't been covered yet. *Note Arrays::, and see +*Note Numeric Functions::, for more information). This example +illustrates an important fact about assignment operators: the lefthand +expression is only evaluated _once_. It is up to the implementation as +to which expression is evaluated first, the lefthand or the righthand. +Consider this example: i = 1 a[i += 2] = i + 1 @@ -6092,8 +6057,7 @@ A workaround is: awk '/[=]=/' /dev/null `gawk' does not have this problem, nor do the other freely available -versions described in *Note Other Freely Available `awk' -Implementations: Other Versions. +versions described in *Note Other Versions::. File: gawk.info, Node: Increment Ops, Next: Truth Values, Prev: Assignment Ops, Up: Expressions @@ -6314,8 +6278,7 @@ them: Comparison expressions have the value one if true and zero if false. When comparing operands of mixed types, numeric operands are converted -to strings using the value of `CONVFMT' (*note Conversion of Strings -and Numbers: Conversion.). +to strings using the value of `CONVFMT' (*note Conversion::). Strings are compared by comparing the first character of each, then the second character of each, and so on. Thus, `"10"' is less than @@ -6386,8 +6349,7 @@ I!"'. The righthand operand of the `~' and `!~' operators may be either a regexp constant (`/.../') or an ordinary expression. In the latter case, the value of the expression as a string is used as a dynamic -regexp (*note How to Use Regular Expressions: Regexp Usage.; also *note -Using Dynamic Regexps: Computed Regexps.). +regexp (*note Regexp Usage::; also *note Computed Regexps::). In modern implementations of `awk', a constant regular expression in slashes by itself is also an expression. The regexp `/REGEXP/' is an @@ -6397,8 +6359,7 @@ abbreviation for the following comparison expression: One special place where `/foo/' is _not_ an abbreviation for `$0 ~ /foo/' is when it is the righthand operand of `~' or `!~'. *Note Using -Regular Expression Constants: Using Constant Regexps, where this is -discussed in more detail. +Constant Regexps::, where this is discussed in more detail. ---------- Footnotes ---------- @@ -6421,10 +6382,9 @@ also referred to as "logical expressions". The terms are equivalent. Boolean expressions can be used wherever comparison and matching expressions can be used. They can be used in `if', `while', `do', and -`for' statements (*note Control Statements in Actions: Statements.). -They have numeric values (one if true, zero if false) that come into -play if the result of the Boolean expression is stored in a variable or -used in arithmetic. +`for' statements (*note Statements::). They have numeric values (one +if true, zero if false) that come into play if the result of the +Boolean expression is stored in a variable or used in arithmetic. In addition, every Boolean expression is also a valid pattern, so you can use one as a pattern to control the execution of rules. The @@ -6462,8 +6422,7 @@ Boolean operators are: BEGIN { if (! ("HOME" in ENVIRON)) print "no home!" } - (The `in' operator is described in *Note Referring to an Array - Element: Reference to Elements.) + (The `in' operator is described in *Note Reference to Elements::.) The `&&' and `||' operators are called "short-circuit" operators because of the way they work. Evaluation of the full expression is @@ -6472,8 +6431,8 @@ evaluation. Statements that use `&&' or `||' can be continued simply by putting a newline after them. But you cannot put a newline in front of either -of these operators without using backslash continuation (*note `awk' -Statements Versus Lines: Statements/Lines.). +of these operators without using backslash continuation (*note +Statements/Lines::). The actual value of an expression using the `!' operator is either one or zero, depending upon the truth value of the expression it is @@ -6493,11 +6452,10 @@ using `!'. The next rule prints lines as long as `interested' is true. When a line is seen whose first field is `END', `interested' is toggled back to false. - *Note:* The `next' statement is discussed in *Note The `next' -Statement: Next Statement. `next' tells `awk' to skip the rest of the -rules, get the next record, and start processing the rules over again -at the top. The reason it's there is to avoid printing the bracketing -`START' and `END' lines. + *Note:* The `next' statement is discussed in *Note Next Statement::. +`next' tells `awk' to skip the rest of the rules, get the next record, +and start processing the rules over again at the top. The reason it's +there is to avoid printing the bracketing `START' and `END' lines. File: gawk.info, Node: Conditional Exp, Next: Function Calls, Prev: Boolean Ops, Up: Expressions @@ -6531,14 +6489,13 @@ array `b', and increments `i': This is guaranteed to increment `i' exactly once, because each time only one of the two increment expressions is executed and the other is -not. *Note Arrays in `awk': Arrays, for more information about arrays. +not. *Note Arrays::, for more information about arrays. As a minor `gawk' extension, a statement that uses `?:' can be continued simply by putting a newline after either character. However, putting a newline in front of either character does not work without -using backslash continuation (*note `awk' Statements Versus Lines: -Statements/Lines.). If `--posix' is specified (*note Command-Line -Options: Options.), then this extension is disabled. +using backslash continuation (*note Statements/Lines::). If `--posix' +is specified (*note Options::), then this extension is disabled. File: gawk.info, Node: Function Calls, Next: Precedence, Prev: Conditional Exp, Up: Expressions @@ -6552,10 +6509,9 @@ the function `sqrt' computes the square root of a number. A fixed set of functions are "built-in", which means they are available in every `awk' program. The `sqrt' function is one of these. -*Note Built-in Functions: Built-in, for a list of built-in functions -and their descriptions. In addition, you can define functions for use -in your program. *Note User-Defined Functions: User-defined, for -instructions on how to do this. +*Note Built-in::, for a list of built-in functions and their +descriptions. In addition, you can define functions for use in your +program. *Note User-defined::, for instructions on how to do this. The way to use a function is with a "function call" expression, which consists of the function name followed immediately by a list of @@ -6585,10 +6541,10 @@ square root: Some of the built-in functions have one or more optional arguments. If those arguments are not supplied, the functions use a reasonable -default value. *Note Built-in Functions: Built-in, for full details. -If arguments are omitted in calls to user-defined functions, then those -arguments are treated as local variables and initialized to the empty -string (*note User-Defined Functions: User-defined.). +default value. *Note Built-in::, for full details. If arguments are +omitted in calls to user-defined functions, then those arguments are +treated as local variables and initialized to the empty string (*note +User-defined::). Like every other expression, the function call has a value, which is computed by the function based on the arguments you give it. In this @@ -6664,8 +6620,7 @@ presents `awk''s operators, in order of highest to lowest precedence: `String Concatenation' No special symbol is used to indicate concatenation. The operands - are simply written side by side (*note String Concatenation: - Concatenation.). + are simply written side by side (*note Concatenation::). `< <= == !=' `> >= >> | |&' @@ -6731,7 +6686,7 @@ top of. Now it's time to start building something useful. * Built-in Variables:: Summarizes the built-in variables. -File: gawk.info, Node: Pattern Overview, Next: Using Shell Variables, Prev: Patterns and Actions, Up: Patterns and Actions +File: gawk.info, Node: Pattern Overview, Next: Using Shell Variables, Up: Patterns and Actions Pattern Elements ================ @@ -6750,31 +6705,27 @@ summary of the types of `awk' patterns: `/REGULAR EXPRESSION/' A regular expression. It matches when the text of the input record - fits the regular expression. (*Note Regular Expressions: Regexp.) + fits the regular expression. (*Note Regexp::.) `EXPRESSION' A single expression. It matches when its value is nonzero (if a - number) or non-null (if a string). (*Note Expressions as - Patterns: Expression Patterns.) + number) or non-null (if a string). (*Note Expression Patterns::.) `PAT1, PAT2' A pair of patterns separated by a comma, specifying a range of records. The range includes both the initial record that matches - PAT1 and the final record that matches PAT2. (*Note Specifying - Record Ranges with Patterns: Ranges.) + PAT1 and the final record that matches PAT2. (*Note Ranges::.) `BEGIN' `END' Special patterns for you to supply startup or cleanup actions for - your `awk' program. (*Note The `BEGIN' and `END' Special - Patterns: BEGIN/END.) + your `awk' program. (*Note BEGIN/END::.) `EMPTY' - The empty pattern matches every input record. (*Note The Empty - Pattern: Empty.) + The empty pattern matches every input record. (*Note Empty::.) -File: gawk.info, Node: Regexp Patterns, Next: Expression Patterns, Prev: Pattern Overview, Up: Pattern Overview +File: gawk.info, Node: Regexp Patterns, Next: Expression Patterns, Up: Pattern Overview Regular Expressions as Patterns ------------------------------- @@ -6802,14 +6753,14 @@ otherwise, it depends on only what has happened so far in the execution of the `awk' program. Comparison expressions, using the comparison operators described in -*Note Variable Typing and Comparison Expressions: Typing and Comparison, -are a very common kind of pattern. Regexp matching and nonmatching are -also very common expressions. The left operand of the `~' and `!~' -operators is a string. The right operand is either a constant regular -expression enclosed in slashes (`/REGEXP/'), or any expression whose -string value is used as a dynamic regular expression (*note Using -Dynamic Regexps: Computed Regexps.). The following example prints the -second field of each input record whose first field is precisely `foo': +*Note Typing and Comparison::, are a very common kind of pattern. +Regexp matching and nonmatching are also very common expressions. The +left operand of the `~' and `!~' operators is a string. The right +operand is either a constant regular expression enclosed in slashes +(`/REGEXP/'), or any expression whose string value is used as a dynamic +regular expression (*note Computed Regexps::). The following example +prints the second field of each input record whose first field is +precisely `foo': $ awk '$1 == "foo" { print $2 }' BBS-list @@ -6903,10 +6854,9 @@ executed for just that record. For example, suppose there is text between two identical markers (e.g., the `%' symbol), each on its own line, that should be ignored. A first attempt would be to combine a range pattern that describes the delimited text with the `next' -statement (not discussed yet, *note The `next' Statement: Next -Statement.). This causes `awk' to skip any further processing of the -current record and start over again with the next input record. Such a -program looks like this: +statement (not discussed yet, *note Next Statement::). This causes +`awk' to skip any further processing of the current record and start +over again with the next input record. Such a program looks like this: /^%$/,/^%$/ { next } { print } @@ -6955,7 +6905,7 @@ rules are often referred to as "`BEGIN' and `END' blocks" by long-time * I/O And BEGIN/END:: I/O issues in BEGIN/END rules. -File: gawk.info, Node: Using BEGIN/END, Next: I/O And BEGIN/END, Prev: BEGIN/END, Up: BEGIN/END +File: gawk.info, Node: Using BEGIN/END, Next: I/O And BEGIN/END, Up: BEGIN/END Startup and Cleanup Actions ........................... @@ -6998,10 +6948,9 @@ functions, because each library file can have its own `BEGIN' and/or which library functions are named on the command line controls the order in which their `BEGIN' and `END' rules are executed. Therefore, you have to be careful when writing such rules in library files so that -the order in which they are executed doesn't matter. *Note -Command-Line Options: Options, for more information on using library -functions. *Note A Library of `awk' Functions: Library Functions, for -a number of useful library functions. +the order in which they are executed doesn't matter. *Note Options::, +for more information on using library functions. *Note Library +Functions::, for a number of useful library functions. If an `awk' program has only a `BEGIN' rule and no other rules, then the program exits after the `BEGIN' rule is run.(1) However, if an @@ -7027,8 +6976,8 @@ any input is read, there simply is no input record, and therefore no fields, when executing `BEGIN' rules. References to `$0' and the fields yield a null string or zero, depending upon the context. One way to give `$0' a real value is to execute a `getline' command without a -variable (*note Explicit Input with `getline': Getline.). Another way -is simply to assign a value to `$0'. +variable (*note Getline::). Another way is simply to assign a value to +`$0'. The second point is similar to the first but from the other direction. Traditionally, due largely to implementation issues, `$0' @@ -7054,8 +7003,8 @@ explicitly. `BEGIN' rule, because the implicit read-a-record-and-match-against-the-rules loop has not started yet. Similarly, those statements are not valid in an `END' rule, since all -the input has been read. (*Note The `next' Statement: Next Statement, -and see *Note Using `gawk''s `nextfile' Statement: Nextfile Statement.) +the input has been read. (*Note Next Statement::, and see *Note +Nextfile Statement::.) File: gawk.info, Node: Empty, Prev: BEGIN/END, Up: Pattern Overview @@ -7098,14 +7047,13 @@ inside the quotes. The second part is single-quoted. Variable substitution via quoting works, but can be potentially messy. It requires a good understanding of the shell's quoting rules -(*note Shell Quoting Issues: Quoting.), and it's often difficult to -correctly match up the quotes when reading the program. +(*note Quoting::), and it's often difficult to correctly match up the +quotes when reading the program. A better method is to use `awk''s variable assignment feature (*note -Assigning Variables on the Command Line: Assignment Options.) to -assign the shell variable's value to an `awk' variable's value. Then -use dynamic regexps to match the pattern (*note Using Dynamic Regexps: -Computed Regexps.). The following shows how to redo the previous +Assignment Options::) to assign the shell variable's value to an `awk' +variable's value. Then use dynamic regexps to match the pattern (*note +Computed Regexps::). The following shows how to redo the previous example using this technique: echo -n "Enter search pattern: " @@ -7130,11 +7078,10 @@ Actions An `awk' program or script consists of a series of rules and function definitions interspersed. (Functions are described later. -*Note User-Defined Functions: User-defined.) A rule contains a pattern -and an action, either of which (but not both) may be omitted. The -purpose of the "action" is to tell `awk' what to do once a match for -the pattern is found. Thus, in outline, an `awk' program generally -looks like this: +*Note User-defined::.) A rule contains a pattern and an action, either +of which (but not both) may be omitted. The purpose of the "action" is +to tell `awk' what to do once a match for the pattern is found. Thus, +in outline, an `awk' program generally looks like this: [PATTERN] [{ ACTION }] [PATTERN] [{ ACTION }] @@ -7159,13 +7106,12 @@ Expressions Call functions or assign values to variables (*note Expressions::). Executing this kind of statement simply computes the value of the expression. This is useful when the expression - has side effects (*note Assignment Expressions: Assignment Ops.). + has side effects (*note Assignment Ops::). Control statements Specify the control flow of `awk' programs. The `awk' language gives you C-like constructs (`if', `for', `while', and `do') as - well as a few special ones (*note Control Statements in Actions: - Statements.). + well as a few special ones (*note Statements::). Compound statements Consist of one or more statements enclosed in curly braces. A @@ -7173,17 +7119,15 @@ Compound statements together in the body of an `if', `while', `do', or `for' statement. Input statements - Use the `getline' command (*note Explicit Input with `getline': - Getline.). Also supplied in `awk' are the `next' statement (*note - The `next' Statement: Next Statement.), and the `nextfile' - statement (*note Using `gawk''s `nextfile' Statement: Nextfile - Statement.). + Use the `getline' command (*note Getline::). Also supplied in + `awk' are the `next' statement (*note Next Statement::), and the + `nextfile' statement (*note Nextfile Statement::). Output statements - Such as `print' and `printf'. *Note Printing Output: Printing. + Such as `print' and `printf'. *Note Printing::. Deletion statements - For deleting array elements. *Note The `delete' Statement: Delete. + For deleting array elements. *Note Delete::. File: gawk.info, Node: Statements, Next: Built-in Variables, Prev: Action Overview, Up: Patterns and Actions @@ -7212,6 +7156,8 @@ with curly braces, separating them with newlines or semicolons. condition is satisfied. * For Statement:: Another looping statement, that provides initialization and increment clauses. +* Switch Statement:: Switch/case evaluation for conditional + execution of statements based on a value. * Break Statement:: Immediately exit the innermost enclosing loop. * Continue Statement:: Skip to the end of the innermost enclosing loop. @@ -7220,7 +7166,7 @@ with curly braces, separating them with newlines or semicolons. * Exit Statement:: Stop execution of `awk'. -File: gawk.info, Node: If Statement, Next: While Statement, Prev: Statements, Up: Statements +File: gawk.info, Node: If Statement, Next: While Statement, Up: Statements The `if'-`else' Statement ------------------------- @@ -7342,7 +7288,7 @@ just as well. This situation reflects actual experience; only occasionally is there a real use for a `do' statement. -File: gawk.info, Node: For Statement, Next: Break Statement, Prev: Do Statement, Up: Statements +File: gawk.info, Node: For Statement, Next: Switch Statement, Prev: Do Statement, Up: Statements The `for' Statement ------------------- @@ -7404,10 +7350,10 @@ as shown here: INCREMENT } -The only exception is when the `continue' statement (*note The -`continue' Statement: Continue Statement.) is used inside the loop. -Changing a `for' statement to a `while' statement in this way can -change the effect of the `continue' statement inside the loop. +The only exception is when the `continue' statement (*note Continue +Statement::) is used inside the loop. Changing a `for' statement to a +`while' statement in this way can change the effect of the `continue' +statement inside the loop. The `awk' language has a `for' statement in addition to a `while' statement because a `for' loop is often both less work to type and more @@ -7421,11 +7367,65 @@ all the indices of an array: for (i in array) DO SOMETHING WITH array[i] -*Note Scanning All Elements of an Array: Scanning an Array, for more -information on this version of the `for' loop. +*Note Scanning an Array::, for more information on this version of the +`for' loop. -File: gawk.info, Node: Break Statement, Next: Continue Statement, Prev: For Statement, Up: Statements +File: gawk.info, Node: Switch Statement, Next: Break Statement, Prev: For Statement, Up: Statements + +The `switch' Statement +---------------------- + + *NOTE:* This node describes an experimental feature added in `gawk' +3.1.3. It is _not_ enabled by default. To enable it, use the +`--enable-switch' option to `configure' when `gawk' is being configured +and built. *Note Additional Configuration Options::, for more +information. + + The `switch' statement allows the evaluation of an expression and +the execution of statements based on a `case' match. Case statements +are checked for a match in the order they are defined. If no suitable +`case' is found, the `default' section is executed, if supplied. The +general form of the `switch' statement looks like this: + + switch (EXPRESSION) { + case VALUE OR REGULAR EXPRESSION: + CASE-BODY + default: + DEFAULT-BODY + } + + The `switch' statement works as it does in C. Once a match to a given +case is made, case statement bodies are executed until a `break', +`continue', `next', `nextfile' or `exit' is encountered, or the end of +the `switch' statement itself. For example: + + switch (NR * 2 + 1) { + case 3: + case "11": + print NR - 1 + break + + case /2[[:digit:]]+/: + print NR + + default: + print NR + 1 + + case -1: + print NR * -1 + } + + Note that if none of the statements specified above halt execution +of a matched `case' statement, execution falls through to the next +`case' until execution halts. In the above example, for any case value +starting with `2' followed by one or more digits, the `print' statement +is executed and then falls through into the `default' section, +executing its `print' statement. In turn, the -1 case will also be +executed since the `default' does not halt execution. + + +File: gawk.info, Node: Break Statement, Next: Continue Statement, Prev: Switch Statement, Up: Statements The `break' Statement --------------------- @@ -7450,8 +7450,8 @@ divisor of any integer, and also identifies prime numbers: immediately "breaks out" of the containing `for' loop. This means that `awk' proceeds immediately to the statement following the loop and continues processing. (This is very different from the `exit' -statement, which stops the entire `awk' program. *Note The `exit' -Statement: Exit Statement.) +statement, which stops the entire `awk' program. *Note Exit +Statement::.) Th following program illustrates how the CONDITION of a `for' or `while' statement could be replaced with a `break' inside an `if': @@ -7474,13 +7474,12 @@ Statement: Exit Statement.) The `break' statement has no meaning when used outside the body of a loop. However, although it was never documented, historical implementations of `awk' treated the `break' statement outside of a -loop as if it were a `next' statement (*note The `next' Statement: Next -Statement.). Recent versions of Unix `awk' no longer allow this usage. -`gawk' supports this use of `break' only if `--traditional' has been -specified on the command line (*note Command-Line Options: Options.). -Otherwise, it is treated as an error, since the POSIX standard -specifies that `break' should only be used inside the body of a loop. -(d.c.) +loop as if it were a `next' statement (*note Next Statement::). Recent +versions of Unix `awk' no longer allow this usage. `gawk' supports +this use of `break' only if `--traditional' has been specified on the +command line (*note Options::). Otherwise, it is treated as an error, +since the POSIX standard specifies that `break' should only be used +inside the body of a loop. (d.c.) File: gawk.info, Node: Continue Statement, Next: Next Statement, Prev: Break Statement, Up: Statements @@ -7528,12 +7527,12 @@ This program loops forever once `x' reaches 5. The `continue' statement has no meaning when used outside the body of a loop. Historical versions of `awk' treated a `continue' statement outside a loop the same way they treated a `break' statement outside a -loop: as if it were a `next' statement (*note The `next' Statement: -Next Statement.). Recent versions of Unix `awk' no longer work this -way, and `gawk' allows it only if `--traditional' is specified on the -command line (*note Command-Line Options: Options.). Just like the -`break' statement, the POSIX standard specifies that `continue' should -only be used inside the body of a loop. (d.c.) +loop: as if it were a `next' statement (*note Next Statement::). +Recent versions of Unix `awk' no longer work this way, and `gawk' +allows it only if `--traditional' is specified on the command line +(*note Options::). Just like the `break' statement, the POSIX standard +specifies that `continue' should only be used inside the body of a loop. +(d.c.) File: gawk.info, Node: Next Statement, Next: Nextfile Statement, Prev: Continue Statement, Up: Statements @@ -7547,10 +7546,9 @@ further rules are executed for the current record, and the rest of the current rule's action isn't executed. Contrast this with the effect of the `getline' function (*note -Explicit Input with `getline': Getline.). That also causes `awk' to -read the next record immediately, but it does not alter the flow of -control in any way (i.e., the rest of the current action executes with -a new input record). +Getline::). That also causes `awk' to read the next record +immediately, but it does not alter the flow of control in any way +(i.e., the rest of the current action executes with a new input record). At the highest level, `awk' program execution is a loop that reads an input record and then tests each rule's pattern against it. If you @@ -7573,18 +7571,17 @@ beginning, in the following manner: Because of the `next' statement, the program's subsequent rules won't see the bad record. The error message is redirected to the standard error output stream, as error messages should be. For more detail see -*Note Special File Names in `gawk': Special Files. +*Note Special Files::. According to the POSIX standard, the behavior is undefined if the `next' statement is used in a `BEGIN' or `END' rule. `gawk' treats it as a syntax error. Although POSIX permits it, some other `awk' implementations don't allow the `next' statement inside function bodies -(*note User-Defined Functions: User-defined.). Just as with any other -`next' statement, a `next' statement inside a function body reads the -next record and starts processing it with the first rule in the program. -If the `next' statement causes the end of the input to be reached, then -the code in any `END' rules is executed. *Note The `BEGIN' and `END' -Special Patterns: BEGIN/END. +(*note User-defined::). Just as with any other `next' statement, a +`next' statement inside a function body reads the next record and +starts processing it with the first rule in the program. If the `next' +statement causes the end of the input to be reached, then the code in +any `END' rules is executed. *Note BEGIN/END::. File: gawk.info, Node: Nextfile Statement, Next: Exit Statement, Prev: Next Statement, Up: Statements @@ -7599,7 +7596,7 @@ processing the current data file. The `nextfile' statement is a `gawk' extension. In most other `awk' implementations, or if `gawk' is in compatibility mode (*note -Command-Line Options: Options.), `nextfile' is not special. +Options::), `nextfile' is not special. Upon execution of the `nextfile' statement, `FILENAME' is updated to the name of the next data file listed on the command line, `FNR' is @@ -7607,7 +7604,7 @@ reset to one, `ARGIND' is incremented, and processing starts over with the first rule in the program. (`ARGIND' hasn't been introduced yet. *Note Built-in Variables::.) If the `nextfile' statement causes the end of the input to be reached, then the code in any `END' rules is -executed. *Note The `BEGIN' and `END' Special Patterns: BEGIN/END. +executed. *Note BEGIN/END::. The `nextfile' statement is useful when there are many data files to process but it isn't necessary to process every record in every file. @@ -7622,17 +7619,15 @@ not related to the main processing that `awk' does with the files listed in `ARGV'. If it's necessary to use an `awk' version that doesn't support -`nextfile', see *Note Implementing `nextfile' as a Function: Nextfile -Function, for a user-defined function that simulates the `nextfile' -statement. +`nextfile', see *Note Nextfile Function::, for a user-defined function +that simulates the `nextfile' statement. The current version of the Bell Laboratories `awk' (*note Other -Freely Available `awk' Implementations: Other Versions.) also supports -`nextfile'. However, it doesn't allow the `nextfile' statement inside -function bodies (*note User-Defined Functions: User-defined.). `gawk' -does; a `nextfile' inside a function body reads the next record and -starts processing it with the first rule in the program, just as any -other `nextfile' statement. +Versions::) also supports `nextfile'. However, it doesn't allow the +`nextfile' statement inside function bodies (*note User-defined::). +`gawk' does; a `nextfile' inside a function body reads the next record +and starts processing it with the first rule in the program, just as +any other `nextfile' statement. *Caution:* Versions of `gawk' prior to 3.0 used two words (`next file') for the `nextfile' statement. In version 3.0, this was changed @@ -7656,9 +7651,9 @@ ignored. The `exit' statement is written as follows: When an `exit' statement is executed from a `BEGIN' rule, the program stops processing everything immediately. No input records are read. However, if an `END' rule is present, as part of executing the -`exit' statement, the `END' rule is executed (*note The `BEGIN' and -`END' Special Patterns: BEGIN/END.). If `exit' is used as part of an -`END' rule, it causes the program to stop immediately. +`exit' statement, the `END' rule is executed (*note BEGIN/END::). If +`exit' is used as part of an `END' rule, it causes the program to stop +immediately. An `exit' statement that is not part of a `BEGIN' or `END' rule stops the execution of any further automatic rules for the current @@ -7667,8 +7662,8 @@ record, skips reading any remaining input records, and executes the In such a case, if you don't want the `END' rule to do its job, set a variable to nonzero before the `exit' statement and check that -variable in the `END' rule. *Note Assertions: Assert Function, for an -example that does this. +variable in the `END' rule. *Note Assert Function::, for an example +that does this. If an argument is supplied to `exit', its value is used as the exit status code for the `awk' process. If no argument is supplied, `exit' @@ -7719,7 +7714,7 @@ activity. * ARGC and ARGV:: Ways to use `ARGC' and `ARGV'. -File: gawk.info, Node: User-modified, Next: Auto-set, Prev: Built-in Variables, Up: Built-in Variables +File: gawk.info, Node: User-modified, Next: Auto-set, Up: Built-in Variables Built-in Variables That Control `awk' ------------------------------------- @@ -7737,20 +7732,17 @@ specific to `gawk' are marked with a pound sign (`#'). use binary I/O. A string value of `"rw"' or `"wr"' indicates that all files should use binary I/O. Any other string value is equivalent to `"rw"', but `gawk' generates a warning message. - `BINMODE' is described in more detail in *Note Using `gawk' on PC - Operating Systems: PC Using. + `BINMODE' is described in more detail in *Note PC Using::. This variable is a `gawk' extension. In other `awk' - implementations (except `mawk', *note Other Freely Available `awk' - Implementations: Other Versions.), or if `gawk' is in - compatibility mode (*note Command-Line Options: Options.), it is - not special. + implementations (except `mawk', *note Other Versions::), or if + `gawk' is in compatibility mode (*note Options::), it is not + special. `CONVFMT' This string controls conversion of numbers to strings (*note - Conversion of Strings and Numbers: Conversion.). It works by - being passed, in effect, as the first argument to the `sprintf' - function (*note String Manipulation Functions: String Functions.). + Conversion::). It works by being passed, in effect, as the first + argument to the `sprintf' function (*note String Functions::). Its default value is `"%.6g"'. `CONVFMT' was introduced by the POSIX standard. @@ -7758,22 +7750,20 @@ specific to `gawk' are marked with a pound sign (`#'). This is a space-separated list of columns that tells `gawk' how to split input with fixed columnar boundaries. Assigning a value to `FIELDWIDTHS' overrides the use of `FS' for field splitting. - *Note Reading Fixed-Width Data: Constant Size, for more - information. + *Note Constant Size::, for more information. - If `gawk' is in compatibility mode (*note Command-Line Options: - Options.), then `FIELDWIDTHS' has no special meaning, and - field-splitting operations occur based exclusively on the value of - `FS'. + If `gawk' is in compatibility mode (*note Options::), then + `FIELDWIDTHS' has no special meaning, and field-splitting + operations occur based exclusively on the value of `FS'. `FS' - This is the input field separator (*note Specifying How Fields Are - Separated: Field Separators.). The value is a single-character - string or a multi-character regular expression that matches the - separations between fields in an input record. If the value is - the null string (`""'), then each character in the record becomes - a separate field. (This behavior is a `gawk' extension. POSIX - `awk' does not specify the behavior when `FS' is the null string.) + This is the input field separator (*note Field Separators::). The + value is a single-character string or a multi-character regular + expression that matches the separations between fields in an input + record. If the value is the null string (`""'), then each + character in the record becomes a separate field. (This behavior + is a `gawk' extension. POSIX `awk' does not specify the behavior + when `FS' is the null string.) The default value is `" "', a string consisting of a single space. As a special exception, this value means that any sequence of @@ -7800,22 +7790,20 @@ specific to `gawk' are marked with a pound sign (`#'). case when doing their particular regexp operations. However, the 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. + field separator. *Note Case-sensitivity::. - If `gawk' is in compatibility mode (*note Command-Line Options: - Options.), then `IGNORECASE' has no special meaning. Thus, string - and regexp operations are always case-sensitive. + If `gawk' is in compatibility mode (*note Options::), then + `IGNORECASE' has no special meaning. Thus, string and regexp + operations are always case-sensitive. `LINT #' 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. 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. + Options::). With a value of `"fatal"', lint 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. This variable is a `gawk' extension. It is not special in other `awk' implementations. Unlike the other special variables, @@ -7827,10 +7815,9 @@ specific to `gawk' are marked with a pound sign (`#'). `OFMT' This string controls conversion of numbers to strings (*note - Conversion of Strings and Numbers: Conversion.) for printing with - the `print' statement. It works by being passed as the first - argument to the `sprintf' function (*note String Manipulation - Functions: String Functions.). Its default value is `"%.6g"'. + Conversion::) for printing with the `print' statement. It works + by being passed as the first argument to the `sprintf' function + (*note String Functions::). Its default value is `"%.6g"'. Earlier versions of `awk' also used `OFMT' to specify the format for converting numbers to strings in general expressions; this is now done by `CONVFMT'. @@ -7851,32 +7838,30 @@ specific to `gawk' are marked with a pound sign (`#'). input record consists of a single line of text. It can also be the null string, in which case records are separated by runs of blank lines. If it is a regexp, records are separated by matches - of the regexp in the input text. (*Note How Input Is Split into - Records: Records.) + of the regexp in the input text. (*Note Records::.) The ability for `RS' to be a regular expression is a `gawk' extension. In most other `awk' implementations, or if `gawk' is - in compatibility mode (*note Command-Line Options: Options.), just - the first character of `RS''s value is used. + in compatibility mode (*note Options::), just the first character + of `RS''s value is used. `SUBSEP' This is the subscript separator. It has the default value of `"\034"' and is used to separate the parts of the indices of a multidimensional array. Thus, the expression `foo["A", "B"]' - really accesses `foo["A\034B"]' (*note Multidimensional Arrays: - Multi-dimensional.). + really accesses `foo["A\034B"]' (*note Multi-dimensional::). `TEXTDOMAIN #' This variable is used for internationalization of programs at the `awk' level. It sets the default text domain for specially marked string constants in the source text, as well as for the `dcgettext', `dcngettext' and `bindtextdomain' functions (*note - Internationalization with `gawk': Internationalization.). The - default value of `TEXTDOMAIN' is `"messages"'. + Internationalization::). The default value of `TEXTDOMAIN' is + `"messages"'. This variable is a `gawk' extension. In other `awk' implementations, or if `gawk' is in compatibility mode (*note - Command-Line Options: Options.), it is not special. + Options::), it is not special. ---------- Footnotes ---------- @@ -7896,9 +7881,9 @@ with a pound sign (`#'). `ARGC, ARGV' The command-line arguments available to `awk' programs are stored in an array called `ARGV'. `ARGC' is the number of command-line - arguments present. *Note Other Command-Line Arguments: Other - Arguments. Unlike most `awk' arrays, `ARGV' is indexed from 0 to - `ARGC' - 1. In the following example: + arguments present. *Note Other Arguments::. Unlike most `awk' + arrays, `ARGV' is indexed from 0 to `ARGC' - 1. In the following + example: $ awk 'BEGIN { > for (i = 0; i < ARGC; i++) @@ -7919,9 +7904,8 @@ with a pound sign (`#'). The value of `ARGV[0]' can vary from system to system. Also, you should note that the program text is _not_ included in `ARGV', nor - are any of `awk''s command-line options. *Note Using `ARGC' and - `ARGV': ARGC and ARGV, for information about how `awk' uses these - variables. + are any of `awk''s command-line options. *Note ARGC and ARGV::, + for information about how `awk' uses these variables. `ARGIND #' The index in `ARGV' of the current file being processed. Every @@ -7941,7 +7925,7 @@ with a pound sign (`#'). This variable is a `gawk' extension. In other `awk' implementations, or if `gawk' is in compatibility mode (*note - Command-Line Options: Options.), it is not special. + Options::), it is not special. `ENVIRON' An associative array that contains the values of the environment. @@ -7953,8 +7937,7 @@ with a pound sign (`#'). Some operating systems may not have environment variables. On such systems, the `ENVIRON' array is empty (except for - `ENVIRON["AWKPATH"]', *note The `AWKPATH' Environment Variable: - AWKPATH Variable.). + `ENVIRON["AWKPATH"]', *note AWKPATH Variable::). `ERRNO #' If a system error occurs during a redirection for `getline', @@ -7963,41 +7946,38 @@ with a pound sign (`#'). This variable is a `gawk' extension. In other `awk' implementations, or if `gawk' is in compatibility mode (*note - Command-Line Options: Options.), it is not special. + Options::), it is not special. `FILENAME' The name of the file that `awk' is currently reading. When no data files are listed on the command line, `awk' reads from the standard input and `FILENAME' is set to `"-"'. `FILENAME' is - changed each time a new file is read (*note Reading Input Files: - Reading Files.). Inside a `BEGIN' rule, the value of `FILENAME' is - `""', since there are no input files being processed yet.(1) - (d.c.) Note, though, that using `getline' (*note Explicit Input - with `getline': Getline.) inside a `BEGIN' rule can give - `FILENAME' a value. + changed each time a new file is read (*note Reading Files::). + Inside a `BEGIN' rule, the value of `FILENAME' is `""', since + there are no input files being processed yet.(1) (d.c.) Note, + though, that using `getline' (*note Getline::) inside a `BEGIN' + rule can give `FILENAME' a value. `FNR' The current record number in the current file. `FNR' is - incremented each time a new record is read (*note Explicit Input - with `getline': Getline.). It is reinitialized to zero each time - a new input file is started. + incremented each time a new record is read (*note Getline::). It + is reinitialized to zero each time a new input file is started. `NF' The number of fields in the current input record. `NF' is set each time a new record is read, when a new field is created or - when `$0' changes (*note Examining Fields: Fields.). + when `$0' changes (*note 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. + Fields::. `NR' The number of input records `awk' has processed since the - beginning of the program's execution (*note How Input Is Split - into Records: Records.). `NR' is incremented each time a new - record is read. + beginning of the program's execution (*note Records::). `NR' is + incremented each time a new record is read. `PROCINFO #' The elements of this array provide access to information about the @@ -8033,25 +8013,24 @@ with a pound sign (`#'). On some systems, there may be elements in the array, `"group1"' through `"groupN"' for some N. N is the number of supplementary groups that the process has. Use the `in' operator to test for - these elements (*note Referring to an Array Element: Reference to - Elements.). + these elements (*note Reference to Elements::). This array is a `gawk' extension. In other `awk' implementations, - or if `gawk' is in compatibility mode (*note Command-Line Options: - Options.), it is not special. + or if `gawk' is in compatibility mode (*note Options::), it is not + special. `RLENGTH' The length of the substring matched by the `match' function (*note - String Manipulation Functions: String Functions.). `RLENGTH' is - set by invoking the `match' function. Its value is the length of - the matched string, or -1 if no match is found. + String Functions::). `RLENGTH' is set by invoking the `match' + function. Its value is the length of the matched string, or -1 if + no match is found. `RSTART' The start-index in characters of the substring that is matched by - the `match' function (*note String Manipulation Functions: String - Functions.). `RSTART' is set by invoking the `match' function. - Its value is the position of the string where the matched - substring starts, or zero if no match was found. + the `match' function (*note String Functions::). `RSTART' is set + by invoking the `match' function. Its value is the position of + the string where the matched substring starts, or zero if no match + was found. `RT #' This is set each time a record is read. It contains the input text @@ -8059,7 +8038,7 @@ with a pound sign (`#'). This variable is a `gawk' extension. In other `awk' implementations, or if `gawk' is in compatibility mode (*note - Command-Line Options: Options.), it is not special. + Options::), it is not special. Advanced Notes: Changing `NR' and `FNR' --------------------------------------- @@ -8080,10 +8059,9 @@ in the following example: -| 18 -| 19 -Before `FNR' was added to the `awk' language (*note Major Changes -Between V7 and SVR3.1: V7/SVR3.1.), many `awk' programs used this -feature to track the number of records in a file by resetting `NR' to -zero when `FILENAME' changed. +Before `FNR' was added to the `awk' language (*note V7/SVR3.1::), many +`awk' programs used this feature to track the number of records in a +file by resetting `NR' to zero when `FILENAME' changed. ---------- Footnotes ---------- @@ -8097,9 +8075,8 @@ File: gawk.info, Node: ARGC and ARGV, Prev: Auto-set, Up: Built-in Variables Using `ARGC' and `ARGV' ----------------------- - *Note Built-in Variables That Convey Information: Auto-set, -presented the following program describing the information contained in -`ARGC' and `ARGV': + *Note Auto-set::, presented the following program describing the +information contained in `ARGC' and `ARGV': $ awk 'BEGIN { > for (i = 0; i < ARGC; i++) @@ -8114,9 +8091,8 @@ In this example, `ARGV[0]' contains `awk', `ARGV[1]' contains the `awk' program is not entered in `ARGV'. The other special command-line options, with their arguments, are also not entered. This includes variable assignments done with the `-v' option (*note -Command-Line Options: Options.). Normal variable assignments on the -command line _are_ treated as arguments and do show up in the `ARGV' -array: +Options::). Normal variable assignments on the command line _are_ +treated as arguments and do show up in the `ARGV' array: $ cat showargs.awk -| BEGIN { @@ -8148,14 +8124,13 @@ other than file names. string (`""') into `ARGV' in place of the file's name. As a special feature, `awk' ignores file names that have been replaced with the null string. Another option is to use the `delete' statement to remove -elements from `ARGV' (*note The `delete' Statement: Delete.). +elements from `ARGV' (*note Delete::). All of these actions are typically done in the `BEGIN' rule, before -actual processing of the input begins. *Note Splitting a Large File -into Pieces: Split Program, and see *Note Duplicating Output into -Multiple Files: Tee Program, for examples of each way of removing -elements from `ARGV'. The following fragment processes `ARGV' in order -to examine, and then remove, command-line options: +actual processing of the input begins. *Note Split Program::, and see +*Note Tee Program::, for examples of each way of removing elements from +`ARGV'. The following fragment processes `ARGV' in order to examine, +and then remove, command-line options: BEGIN { for (i = 1; i < ARGC; i++) { @@ -8208,9 +8183,9 @@ about array usage. The major node finishes with a discussion of `gawk''s facility for sorting an array based on its indices. `awk' maintains a single set of names that may be used for naming -variables, arrays, and functions (*note User-Defined Functions: -User-defined.). Thus, you cannot have a variable and an array with the -same name in the same `awk' program. +variables, arrays, and functions (*note User-defined::). Thus, you +cannot have a variable and an array with the same name in the same +`awk' program. * Menu: @@ -8232,7 +8207,7 @@ same name in the same `awk' program. * Array Sorting:: Sorting array values and indices. -File: gawk.info, Node: Array Intro, Next: Reference to Elements, Prev: Arrays, Up: Arrays +File: gawk.info, Node: Array Intro, Next: Reference to Elements, Up: Arrays Introduction to Arrays ====================== @@ -8315,16 +8290,15 @@ from English to French: Here we decided to translate the number one in both spelled-out and numeric form--thus illustrating that a single array can have both numbers and strings as indices. In fact, array subscripts are always -strings; this is discussed in more detail in *Note Using Numbers to -Subscript Arrays: Numeric Array Subscripts. Here, the number `1' isn't -double-quoted, since `awk' automatically converts it to a string. +strings; this is discussed in more detail in *Note Numeric Array +Subscripts::. Here, the number `1' isn't double-quoted, since `awk' +automatically converts it to a string. The value of `IGNORECASE' has no effect upon array subscripting. The identical string value used to store an array element must be used to retrieve it. When `awk' creates an array (e.g., with the `split' built-in function), that array's indices are consecutive integers -starting at one. (*Note String Manipulation Functions: String -Functions.) +starting at one. (*Note String Functions::.) `awk''s arrays are efficient--the time to access an element is independent of the number of elements in the array. @@ -8350,10 +8324,9 @@ array `foo' at index `4.3'. A reference to an array element that has no recorded value yields a value of `""', the null string. This includes elements that have not been assigned any value as well as elements that have been deleted -(*note The `delete' Statement: Delete.). Such a reference -automatically creates that array element, with the null string as its -value. (In some cases, this is unfortunate, because it might waste -memory inside `awk'.) +(*note Delete::). Such a reference automatically creates that array +element, with the null string as its value. (In some cases, this is +unfortunate, because it might waste memory inside `awk'.) To determine whether an element exists in an array at a certain index, use the following expression: @@ -8473,8 +8446,8 @@ least once) in the input, by storing a one into the array `used' with the word as index. The second rule scans the elements of `used' to find all the distinct words that appear in the input. It prints each word that is more than 10 characters long and also prints the number of -such words. *Note String Manipulation Functions: String Functions, for -more information on the built-in function `length'. +such words. *Note String Functions::, for more information on the +built-in function `length'. # Record a 1 for each word that is used at least once { @@ -8492,8 +8465,7 @@ more information on the built-in function `length'. print num_long_words, "words longer than 10 characters" } -*Note Generating Word Usage Counts: Word Sorting, for a more detailed -example of this type. +*Note Word Sorting::, for a more detailed example of this type. The order in which elements of the array are accessed by this statement is determined by the internal arrangement of the array @@ -8539,9 +8511,9 @@ as assigning it a null value (the empty string, `""'). For example: print "This is printed, even though foo[4] is empty" It is not an error to delete an element that does not exist. If -`--lint' is provided on the command line (*note Command-Line Options: -Options.), `gawk' issues a warning message when an element that is not -in the array is deleted. +`--lint' is provided on the command line (*note Options::), `gawk' +issues a warning message when an element that is not in the array is +deleted. All the elements of an array may be deleted with a single statement by leaving off the subscript in the `delete' statement, as follows: @@ -8549,7 +8521,7 @@ by leaving off the subscript in the `delete' statement, as follows: delete ARRAY This ability is a `gawk' extension; it is not available in -compatibility mode (*note Command-Line Options: Options.). +compatibility mode (*note Options::). Using this version of the `delete' statement is about three times more efficient than the equivalent loop that deletes each element one @@ -8560,10 +8532,10 @@ clear out an array:(1) split("", array) - The `split' function (*note String Manipulation Functions: String -Functions.) clears out the target array first. This call asks it to -split apart the null string. Because there is no data to split out, the -function simply clears the array and then returns. + The `split' function (*note String Functions::) clears out the +target array first. This call asks it to split apart the null string. +Because there is no data to split out, the function simply clears the +array and then returns. *Caution:* Deleting an array does not change its type; you cannot delete an array and then use the array's name as a scalar (i.e., a @@ -8584,9 +8556,9 @@ Using Numbers to Subscript Arrays An important aspect about arrays to remember is that _array subscripts are always strings_. When a numeric value is used as a subscript, it is converted to a string value before being used for -subscripting (*note Conversion of Strings and Numbers: Conversion.). -This means that the value of the built-in variable `CONVFMT' can affect -how your program accesses elements of an array. For example: +subscripting (*note Conversion::). This means that the value of the +built-in variable `CONVFMT' can affect how your program accesses +elements of an array. For example: xyz = 12.153 data[xyz] = 1 @@ -8606,20 +8578,20 @@ assigned the value one. The program then changes the value of two significant digits. This test fails, since `"12.15"' is a different string from `"12.153"'. - According to the rules for conversions (*note Conversion of Strings -and Numbers: Conversion.), integer values are always converted to -strings as integers, no matter what the value of `CONVFMT' may happen -to be. So the usual case of the following works: + According to the rules for conversions (*note Conversion::), integer +values are always converted to strings as integers, no matter what the +value of `CONVFMT' may happen to be. So the usual case of the +following works: for (i = 1; i <= maxsub; i++) do something with array[i] The "integer values always convert to strings as integers" rule has an additional consequence for array indexing. Octal and hexadecimal -constants (*note Octal and Hexadecimal Numbers: Nondecimal-numbers.) -are converted internally into numbers, and their original form is -forgotten. This means, for example, that `array[17]', `array[021]', and -`array[0x11]' all refer to the same element! +constants (*note Nondecimal-numbers::) are converted internally into +numbers, and their original form is forgotten. This means, for +example, that `array[17]', `array[021]', and `array[0x11]' all refer to +the same element! As with many things in `awk', the majority of the time things work as one would expect them to. But it is useful to have a precise @@ -8671,7 +8643,7 @@ subscript. Even though it is somewhat unusual, the null string (`""') is a valid array subscript. (d.c.) `gawk' warns about the use of the null string as a subscript if `--lint' is provided on the command line -(*note Command-Line Options: Options.). +(*note Options::). File: gawk.info, Node: Multi-dimensional, Next: Multi-scanning, Prev: Uninitialized Subscripts, Up: Arrays @@ -8687,12 +8659,11 @@ two-dimensional array named `grid' is with `grid[X,Y]'. Multidimensional arrays are supported in `awk' through concatenation of indices into one string. `awk' converts the indices into strings -(*note Conversion of Strings and Numbers: Conversion.) and concatenates -them together, with a separator between them. This creates a single -string that describes the values of the separate indices. The combined -string is used as a single index into an ordinary, one-dimensional -array. The separator used is the value of the built-in variable -`SUBSEP'. +(*note Conversion::) and concatenates them together, with a separator +between them. This creates a single string that describes the values +of the separate indices. The combined string is used as a single index +into an ordinary, one-dimensional array. The separator used is the +value of the built-in variable `SUBSEP'. For example, suppose we evaluate the expression `foo[5,12] = "value"' when the value of `SUBSEP' is `"@"'. The numbers 5 and 12 are @@ -8769,10 +8740,9 @@ multidimensional _way of accessing_ an array. However, if your program has an array that is always accessed as multidimensional, you can get the effect of scanning it by combining -the scanning `for' statement (*note Scanning All Elements of an Array: -Scanning an Array.) with the built-in `split' function (*note String -Manipulation Functions: String Functions.). It works in the following -manner: +the scanning `for' statement (*note Scanning an Array::) with the +built-in `split' function (*note String Functions::). It works in the +following manner: for (combined in array) { split(combined, separate, SUBSEP) @@ -8808,8 +8778,8 @@ 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' and -`asorti' functions (*note String Manipulation Functions: String -Functions.) for sorting arrays. For example: +`asorti' functions (*note String Functions::) for sorting arrays. For +example: POPULATE THE ARRAY data n = asort(data) @@ -8820,8 +8790,7 @@ Functions.) for sorting arrays. For example: some number N, the total number of elements in `data'. (This count is `asort''s return value.) `data[1]' <= `data[2]' <= `data[3]', and so on. The comparison of array elements is done using `gawk''s usual -comparison rules (*note Variable Typing and Comparison Expressions: -Typing and Comparison.). +comparison rules (*note Typing and Comparison::). An important side effect of calling `asort' is that _the array's original indices are irrevocably lost_. As this isn't always @@ -8904,7 +8873,7 @@ major node describes these "user-defined" functions. * User-defined:: Describes User-defined functions in detail. -File: gawk.info, Node: Built-in, Next: User-defined, Prev: Functions, Up: Functions +File: gawk.info, Node: Built-in, Next: User-defined, Up: Functions Built-in Functions ================== @@ -8927,7 +8896,7 @@ for your convenience. * I18N Functions:: Functions for string translation. -File: gawk.info, Node: Calling Built-in, Next: Numeric Functions, Prev: Built-in, Up: Built-in +File: gawk.info, Node: Calling Built-in, Next: Numeric Functions, Up: Built-in Calling Built-in Functions -------------------------- @@ -9011,7 +8980,7 @@ brackets ([ ]): `rand()' This returns a random number. The values of `rand' are uniformly - distributed between zero and one. The value is never zero and + distributed between zero and one. The value could be zero but is never one.(1) Often random integers are needed instead. Following is a @@ -9125,10 +9094,9 @@ with a pound sign (`#'): a[2] = "de" a[3] = "sac" - The `asort' function is described in more detail in *Note Sorting - Array Values and Indices with `gawk': Array Sorting. `asort' is a - `gawk' extension; it is not available in compatibility mode (*note - Command-Line Options: Options.). + The `asort' function is described in more detail in *Note Array + Sorting::. `asort' is a `gawk' extension; it is not available in + compatibility mode (*note Options::). `asorti(SOURCE [, DEST]) #' `asorti' is a `gawk'-specific extension, returning the number of @@ -9138,11 +9106,10 @@ with a pound sign (`#'): 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.). + The `asorti' function is described in more detail in *Note Array + Sorting::. It was added in `gawk' 3.1.2. `asorti' is a `gawk' + extension; it is not available in compatibility mode (*note + Options::). `index(IN, FIND)' This searches the string IN for the first occurrence of the string @@ -9181,9 +9148,9 @@ with a pound sign (`#'): 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. + treated as a regexp to be matched. *Note 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' @@ -9251,9 +9218,14 @@ with a pound sign (`#'): -| 1 5 -| 9 7 + There may not be subscripts for the start and index for every + parenthesized subexpressions, since they may not all have matched + text; thus they should be tested for with the `in' operator (*note + Reference to Elements::). + 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. + compatibility mode (*note Options::), using a third argument is a + fatal error. `split(STRING, ARRAY [, FIELDSEP])' This function divides STRING into pieces separated by FIELDSEP and @@ -9292,17 +9264,17 @@ with a pound sign (`#'): 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. *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. + (d.c.) The POSIX standard allows this as well. *Note 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 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.) + 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 @@ -9310,8 +9282,8 @@ with a pound sign (`#'): `sprintf(FORMAT, EXPRESSION1, ...)' This returns (without printing) the string that `printf' would - have printed out with the same arguments (*note Using `printf' - Statements for Fancier Printing: Printf.). For example: + have printed out with the same arguments (*note Printf::). For + example: pival = sprintf("pi = %.2f (approx.)", 22/7) @@ -9332,7 +9304,7 @@ with a pound sign (`#'): only for decimal data, not for octal or hexadecimal.(1) `strtonum' is a `gawk' extension; it is not available in - compatibility mode (*note Command-Line Options: Options.). + compatibility mode (*note Options::). `sub(REGEXP, REPLACEMENT [, TARGET])' The `sub' function alters the value of TARGET. It searches this @@ -9343,9 +9315,9 @@ with a pound sign (`#'): 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. + treated as a regexp to be matched. *Note 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 @@ -9381,7 +9353,7 @@ with a pound sign (`#'): This shows how `&' can represent a nonconstant string and also illustrates the "leftmost, longest" rule in regexp matching (*note - How Much Text Matches?: Leftmost Longest.). + Leftmost Longest::). The effect of this special character (`&') can be turned off by putting a backslash before it in the string. As usual, to insert @@ -9476,7 +9448,7 @@ with a pound sign (`#'): original unchanged value of TARGET. `gensub' is a `gawk' extension; it is not available in - compatibility mode (*note Command-Line Options: Options.). + compatibility mode (*note Options::). `substr(STRING, START [, LENGTH])' This returns a LENGTH-character-long substring of STRING, starting @@ -9535,8 +9507,7 @@ with a pound sign (`#'): ---------- Footnotes ---------- (1) Unless you use the `--non-decimal-data' option, which isn't -recommended. *Note Allowing Nondecimal Input Data: Nondecimal Data, -for more information. +recommended. *Note Nondecimal Data::, for more information. (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 @@ -9547,7 +9518,7 @@ a "no-op" such as `sub(/^/, "")'. is number zero. -File: gawk.info, Node: Gory Details, Prev: String Functions, Up: String Functions +File: gawk.info, Node: Gory Details, Up: String Functions More About `\' and `&' with `sub', `gsub', and `gensub' ....................................................... @@ -9699,17 +9670,16 @@ parameters are enclosed in square brackets ([ ]): Close the file FILENAME for input or output. Alternatively, the argument may be a shell command that was used for creating a coprocess, or for redirecting to or from a pipe; then the - coprocess or pipe is closed. *Note Closing Input and Output - Redirections: Close Files And Pipes, for more information. + coprocess or pipe is closed. *Note Close Files And Pipes::, for + more information. When closing a coprocess, it is occasionally useful to first close one end of the two-way pipe and then to close the other. This is done by providing a second argument to `close'. This second argument should be one of the two string values `"to"' or `"from"', indicating which end of the pipe to close. Case in the string does - not matter. *Note Two-Way Communications with Another Process: - Two-way I/O, which discusses this feature in more detail and gives - an example. + not matter. *Note Two-way I/O::, which discusses this feature in + more detail and gives an example. `fflush([FILENAME])' Flush any buffered output associated with FILENAME, which is @@ -9730,7 +9700,7 @@ parameters are enclosed in square brackets ([ ]): `fflush' was added to the Bell Laboratories research version of `awk' in 1994; it is not part of the POSIX standard and is not available if `--posix' has been specified on the command line - (*note Command-Line Options: Options.). + (*note Options::). `gawk' extends the `fflush' function in two ways. The first is to allow no argument at all. In this case, the buffer for the @@ -9937,10 +9907,10 @@ file. The `strftime' function allows you to easily turn a timestamp into human-readable information. It is similar in nature to the `sprintf' -function (*note String Manipulation Functions: String Functions.), in -that it copies nonformat specification characters verbatim to the -returned string, while substituting date and time values for format -specifications in the FORMAT string. +function (*note String Functions::), in that it copies nonformat +specification characters verbatim to the returned string, while +substituting date and time values for format specifications in the +FORMAT string. `strftime' is guaranteed by the 1999 ISO C standard(4) to support the following date format specifications: @@ -10098,8 +10068,8 @@ of what most C programmers are used to. A public-domain C version of `strftime' is supplied with `gawk' for systems that are not yet fully standards-compliant. It supports all of the just listed format specifications. If that version is used to -compile `gawk' (*note Installing `gawk': Installation.), then the -following additional format specifications are available: +compile `gawk' (*note Installation::), then the following additional +format specifications are available: `%k' The hour (24-hour clock) as a decimal number (0-23). Single-digit @@ -10180,7 +10150,7 @@ necessarily supports all of the conversions listed here. (5) If you don't understand any of this, don't worry about it; these facilities are meant to make it easier to "internationalize" programs. Other internationalization features are described in *Note -Internationalization with `gawk': Internationalization. +Internationalization::. (6) This is because ISO C leaves the behavior of the C version of `strftime' undefined and `gawk' uses the system's version of `strftime' @@ -10235,13 +10205,13 @@ bitwise operations just described. They are: `rshift(VAL, COUNT)' Returns the value of VAL, shifted right by COUNT bits. For all of these functions, first the double-precision -floating-point value is converted to a C `unsigned long', then the -bitwise operation is performed and then the result is converted back -into a C `double'. (If you don't understand this paragraph, don't worry -about it.) +floating-point value is converted to the widest C unsigned integer +type, then the bitwise operation is performed and then the result is +converted back into a C `double'. (If you don't understand this +paragraph, don't worry about it.) - Here is a user-defined function (*note User-Defined Functions: -User-defined.) that illustrates the use of these functions: + Here is a user-defined function (*note User-defined::) that +illustrates the use of these functions: # bits2str --- turn a byte into readable 1's and 0's @@ -10295,9 +10265,9 @@ at the end, it pads the value with zeros to represent multiples of 8-bit quantities. This is typical in modern computers. The main code in the `BEGIN' rule shows the difference between the -decimal and octal values for the same numbers (*note Octal and -Hexadecimal Numbers: Nondecimal-numbers.), and then demonstrates the -results of the `compl', `lshift', and `rshift' functions. +decimal and octal values for the same numbers (*note +Nondecimal-numbers::), and then demonstrates the results of the +`compl', `lshift', and `rshift' functions. ---------- Footnotes ---------- @@ -10313,9 +10283,9 @@ Using `gawk''s String-Translation Functions `gawk' provides facilities for internationalizing `awk' programs. These include the functions described in the following list. The -descriptions here are purposely brief. *Note Internationalization with -`gawk': Internationalization, for the full story. Optional parameters -are enclosed in square brackets ([ ]): +descriptions here are purposely brief. *Note Internationalization::, +for the full story. Optional parameters are enclosed in square +brackets ([ ]): `dcgettext(STRING [, DOMAIN [, CATEGORY]])' This function returns the translation of STRING in text domain @@ -10362,7 +10332,7 @@ i.e., to tell `awk' what they should do. * Dynamic Typing:: How variable types can change at runtime. -File: gawk.info, Node: Definition Syntax, Next: Function Example, Prev: User-defined, Up: User-defined +File: gawk.info, Node: Definition Syntax, Next: Function Example, Up: User-defined Function Definition Syntax -------------------------- @@ -10438,8 +10408,7 @@ act of a function calling itself is called "recursion". `function' may be abbreviated `func'. However, POSIX only specifies the use of the keyword `function'. This actually has some practical implications. If `gawk' is in POSIX-compatibility mode (*note -Command-Line Options: Options.), then the following statement does -_not_ define a function: +Options::), then the following statement does _not_ define a function: func foo() { a = sqrt($1) ; print a } @@ -10494,11 +10463,10 @@ this program, using our function to format the results, prints: When working with arrays, it is often necessary to delete all the elements in an array and start over with a new list of elements (*note -The `delete' Statement: Delete.). Instead of having to repeat this -loop everywhere that you need to clear out an array, your program can -just call `delarray'. (This guarantees portability. The use of -`delete ARRAY' to delete the contents of an entire array is a -nonstandard extension.) +Delete::). Instead of having to repeat this loop everywhere that you +need to clear out an array, your program can just call `delarray'. +(This guarantees portability. The use of `delete ARRAY' to delete the +contents of an entire array is a nonstandard extension.) The following is an example of a recursive function. It takes a string as an input parameter and returns the string in backwards order. @@ -10523,8 +10491,8 @@ way: The C `ctime' function takes a timestamp and returns it in a string, formatted in a well-known fashion. The following example uses the -built-in `strftime' function (*note Using `gawk''s Timestamp Functions: -Time Functions.) to create an `awk' version of `ctime': +built-in `strftime' function (*note Time Functions::) to create an +`awk' version of `ctime': # ctime.awk # @@ -10634,12 +10602,12 @@ Because the `if' statement will never be true, it is not really a problem that `foo' has not been defined. Usually, though, it is a problem if a program calls an undefined function. - If `--lint' is specified (*note Command-Line Options: Options.), -`gawk' reports calls to undefined functions. + If `--lint' is specified (*note Options::), `gawk' reports calls to +undefined functions. Some `awk' implementations generate a runtime error if you use the -`next' statement (*note The `next' Statement: Next Statement.) inside -a user-defined function. `gawk' does not have this limitation. +`next' statement (*note Next Statement::) inside a user-defined +function. `gawk' does not have this limitation. File: gawk.info, Node: Return Statement, Next: Dynamic Typing, Prev: Function Caveats, Up: User-defined @@ -10780,7 +10748,7 @@ requirement. * Gawk I18N:: `gawk' is also internationalized. -File: gawk.info, Node: I18N and L10N, Next: Explaining gettext, Prev: Internationalization, Up: Internationalization +File: gawk.info, Node: I18N and L10N, Next: Explaining gettext, Up: Internationalization Internationalization and Localization ===================================== @@ -10891,7 +10859,7 @@ defined locale categories that `gettext' knows about are: Character-type information (alphabetic, digit, upper- or lowercase, and so on). This information is accessed via the POSIX character classes in regular expressions, such as `/[[:alnum:]]/' - (*note Regular Expression Operators: Regexp Operators.). + (*note Regexp Operators::). `LC_MONETARY' Monetary information, such as the currency symbol, and whether the @@ -10950,9 +10918,9 @@ internationalization: for CATEGORY is `"LC_MESSAGES"'. If you supply a value for CATEGORY, it must be a string equal to - one of the known locale categories described in *Note GNU - `gettext': Explaining gettext. You must also supply a text - domain. Use `TEXTDOMAIN' if you want to use the current domain. + one of the known locale categories described in *Note Explaining + gettext::. You must also supply a text domain. Use `TEXTDOMAIN' + if you want to use the current domain. *Caution:* The order of arguments to the `awk' version of the `dcgettext' function is purposely different from the order for the @@ -10980,12 +10948,11 @@ internationalization: binding for the given DOMAIN. To use these facilities in your `awk' program, follow the steps -outlined in *Note GNU `gettext': Explaining gettext, like so: +outlined in *Note Explaining gettext::, like so: 1. Set the variable `TEXTDOMAIN' to the text domain of your program. - This is best done in a `BEGIN' rule (*note The `BEGIN' and `END' - Special Patterns: BEGIN/END.), or it can also be done via the `-v' - command-line option (*note Command-Line Options: Options.): + This is best done in a `BEGIN' rule (*note BEGIN/END::), or it can + also be done via the `-v' command-line option (*note Options::): BEGIN { TEXTDOMAIN = "guide" @@ -11027,9 +10994,8 @@ outlined in *Note GNU `gettext': Explaining gettext, like so: } - *Note A Simple Internationalization Example: I18N Example, for an -example program showing the steps to create and use translations from -`awk'. + *Note I18N Example::, for an example program showing the steps to +create and use translations from `awk'. File: gawk.info, Node: Translator i18n, Next: I18N Example, Prev: Programmer i18n, Up: Internationalization @@ -11053,7 +11019,7 @@ for `printf' arguments at runtime is covered. * I18N Portability:: `awk'-level portability issues. -File: gawk.info, Node: String Extraction, Next: Printf Ordering, Prev: Translator i18n, Up: Translator i18n +File: gawk.info, Node: String Extraction, Next: Printf Ordering, Up: Translator i18n Extracting Marked Strings ------------------------- @@ -11070,9 +11036,8 @@ Instead, it parses it as usual and prints all marked strings to standard output in the format of a GNU `gettext' Portable Object file. Also included in the output are any constant strings that appear as the first argument to `dcgettext' or as the first and second argument to -`dcngettext'.(1) *Note A Simple Internationalization Example: I18N -Example, for the full list of steps to go through to create and test -translations for `guide'. +`dcngettext'.(1) *Note I18N Example::, for the full list of steps to go +through to create and test translations for `guide'. ---------- Footnotes ---------- @@ -11085,9 +11050,8 @@ File: gawk.info, Node: Printf Ordering, Next: I18N Portability, Prev: String Rearranging `printf' Arguments ------------------------------ - Format strings for `printf' and `sprintf' (*note Using `printf' -Statements for Fancier Printing: Printf.) present a special problem -for translation. Consider the following:(1) + Format strings for `printf' and `sprintf' (*note Printf::) present a +special problem for translation. Consider the following:(1) printf(_"String `%s' has %d characters\n", string, length(string))) @@ -11298,9 +11262,8 @@ proper directory so that `gawk' can find it: -| Pardon me, Zaphod who? If the three replacement functions for `dcgettext', `dcngettext' and -`bindtextdomain' (*note `awk' Portability Issues: I18N Portability.) -are in a file named `libintl.awk', then we can run `guide.awk' -unchanged as follows: +`bindtextdomain' (*note I18N Portability::) are in a file named +`libintl.awk', then we can run `guide.awk' unchanged as follows: $ gawk --posix -f guide.awk -f libintl.awk -| Don't Panic @@ -11350,10 +11313,9 @@ full detail, along with the basics of TCP/IP networking and BSD portal files. Finally, `gawk' can "profile" an `awk' program, making it possible to tune it for performance. - *Note Adding New Built-in Functions to `gawk': Dynamic Extensions, -discusses the ability to dynamically add new built-in functions to -`gawk'. As this feature is still immature and likely to change, its -description is relegated to an appendix. + *Note Dynamic Extensions::, discusses the ability to dynamically add +new built-in functions to `gawk'. As this feature is still immature +and likely to change, its description is relegated to an appendix. * Menu: @@ -11364,7 +11326,7 @@ description is relegated to an appendix. * Profiling:: Profiling your `awk' programs. -File: gawk.info, Node: Nondecimal Data, Next: Two-way I/O, Prev: Advanced Features, Up: Advanced Features +File: gawk.info, Node: Nondecimal Data, Next: Two-way I/O, Up: Advanced Features Allowing Nondecimal Input Data ============================== @@ -11401,9 +11363,9 @@ request it. *Caution:* _Use of this option is not recommended._ It can break old programs very badly. Instead, use the `strtonum' function to convert -your data (*note Octal and Hexadecimal Numbers: Nondecimal-numbers.). -This makes your programs easier to write and easier to read, and leads -to less surprising results. +your data (*note Nondecimal-numbers::). This makes your programs +easier to write and easier to read, and leads to less surprising +results. File: gawk.info, Node: Two-way I/O, Next: TCP/IP Networking, Prev: Nondecimal Data, Up: Advanced Features @@ -11485,10 +11447,9 @@ or pipeline of programs, that can be started by the shell. It is possible to close just one end of the two-way pipe to a coprocess, by supplying a second argument to the `close' function of -either `"to"' or `"from"' (*note Closing Input and Output Redirections: -Close Files And Pipes.). These strings tell `gawk' to close the end of -the pipe that sends data to the process or the end that reads from it, -respectively. +either `"to"' or `"from"' (*note Close Files And Pipes::). These +strings tell `gawk' to close the end of the pipe that sends data to the +process or the end that reads from it, respectively. This is particularly necessary in order to use the system `sort' utility as part of a coprocess; `sort' must read _all_ of its input @@ -11526,8 +11487,7 @@ 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: +the `PROCINFO' array (*note Auto-set::), like so: command = "sort -nr" # command, saved in variable for convenience PROCINFO[command, "pty"] = 1 # update PROCINFO @@ -11556,9 +11516,9 @@ Using `gawk' for Network Programming is busy hung or dead. In addition to being able to open a two-way pipeline to a coprocess -on the same system (*note Two-Way Communications with Another Process: -Two-way I/O.), it is possible to make a two-way connection to another -process on another system across an IP networking connection. +on the same system (*note Two-way I/O::), it is possible to make a +two-way connection to another process on another system across an IP +networking connection. You can think of this as just a _very long_ two-way pipeline to a coprocess. The way `gawk' decides that you want to use TCP/IP @@ -11618,9 +11578,8 @@ Using `gawk' with BSD Portals ============================= Similar to the `/inet' special files, if `gawk' is configured with -the `--enable-portals' option (*note Compiling `gawk' for Unix: Quick -Installation.), then `gawk' treats files whose pathnames begin with -`/p' as 4.4 BSD-style portals. +the `--enable-portals' option (*note Quick Installation::), then `gawk' +treats files whose pathnames begin with `/p' as 4.4 BSD-style portals. When used with the `|&' operator, `gawk' opens the file for two-way communications. The operating system's portal mechanism then manages @@ -11877,7 +11836,7 @@ full details. * Known Bugs:: Known Bugs in `gawk'. -File: gawk.info, Node: Command Line, Next: Options, Prev: Invoking Gawk, Up: Invoking Gawk +File: gawk.info, Node: Command Line, Next: Options, Up: Invoking Gawk Invoking `awk' ============== @@ -11921,8 +11880,7 @@ options and their meanings are as follows: `-F FS' `--field-separator FS' - Sets the `FS' variable to FS (*note Specifying How Fields Are - Separated: Field Separators.). + Sets the `FS' variable to FS (*note Field Separators::). `-f SOURCE-FILE' `--file SOURCE-FILE' @@ -11933,8 +11891,7 @@ options and their meanings are as follows: `--assign VAR=VAL' Sets the variable VAR to the value VAL _before_ execution of the program begins. Such variable values are available inside the - `BEGIN' rule (*note Other Command-Line Arguments: Other - Arguments.). + `BEGIN' rule (*note Other Arguments::). The `-v' option can only set one variable, but it can be used more than once, setting another variable each time, like this: `awk @@ -11984,10 +11941,8 @@ The following list describes `gawk'-specific options: Specifies "compatibility mode", in which the GNU extensions to the `awk' language are disabled, so that `gawk' behaves just like the Bell Laboratories research version of Unix `awk'. `--traditional' - is the preferred form of this option. *Note Extensions in `gawk' - Not in POSIX `awk': POSIX/GNU, which summarizes the extensions. - Also see *Note Downward Compatibility and Debugging: Compatibility - Mode. + is the preferred form of this option. *Note POSIX/GNU::, which + summarizes the extensions. Also see *Note Compatibility Mode::. `-W copyright' `--copyright' @@ -12017,8 +11972,8 @@ The following list describes `gawk'-specific options: `--gen-po' Analyzes the source program and generates a GNU `gettext' Portable Object file on standard output for all string constants that have - been marked for translation. *Note Internationalization with - `gawk': Internationalization, for information about this option. + been marked for translation. *Note Internationalization::, for + information about this option. `-W help' `-W usage' @@ -12042,14 +11997,12 @@ The following list describes `gawk'-specific options: `-W lint-old' `--lint-old' Warns about constructs that are not available in the original - version of `awk' from Version 7 Unix (*note Major Changes Between - V7 and SVR3.1: V7/SVR3.1.). + version of `awk' from Version 7 Unix (*note V7/SVR3.1::). `-W non-decimal-data' `--non-decimal-data' Enable automatic interpretation of octal and hexadecimal values in - input data (*note Allowing Nondecimal Input Data: Nondecimal - Data.). + input data (*note Nondecimal Data::). *Caution:* This option can severely break old programs. Use with care. @@ -12064,26 +12017,24 @@ The following list describes `gawk'-specific options: Sequences::). * Newlines do not act as whitespace to separate fields when - `FS' is equal to a single space (*note Examining Fields: - Fields.). + `FS' is equal to a single space (*note Fields::). * Newlines are not allowed after `?' or `:' (*note Conditional - Expressions: Conditional Exp.). + Exp::). * The synonym `func' for the keyword `function' is not - recognized (*note Function Definition Syntax: Definition - Syntax.). + recognized (*note Definition Syntax::). * The `**' and `**=' operators cannot be used in place of `^' - and `^=' (*note Arithmetic Operators: Arithmetic Ops., and - also *note Assignment Expressions: Assignment Ops.). + and `^=' (*note Arithmetic Ops::, and also *note Assignment + Ops::). * Specifying `-Ft' on the command-line does not set the value - of `FS' to be a single TAB character (*note Specifying How - Fields Are Separated: Field Separators.). + of `FS' to be a single TAB character (*note Field + Separators::). - * The `fflush' built-in function is not supported (*note - Input/Output Functions: I/O Functions.). + * The `fflush' built-in function is not supported (*note I/O + Functions::). If you supply both `--traditional' and `--posix' on the command line, `--posix' takes precedence. `gawk' also issues a warning if @@ -12091,10 +12042,10 @@ The following list describes `gawk'-specific options: `-W profile[=FILE]' `--profile[=FILE]' - Enable profiling of `awk' programs (*note Profiling Your `awk' - Programs: Profiling.). By default, profiles are created in a file - named `awkprof.out'. The optional FILE argument allows you to - specify a different file name for the profile file. + Enable profiling of `awk' programs (*note Profiling::). By + default, profiles are created in a file named `awkprof.out'. The + optional FILE argument allows you to specify a different file name + for the profile file. When run with `gawk', the profile is just a "pretty printed" version of the program. When run with `pgawk', the profile @@ -12103,10 +12054,10 @@ The following list describes `gawk'-specific options: `-W re-interval' `--re-interval' - Allows interval expressions (*note Regular Expression Operators: - Regexp Operators.) in regexps. Because interval expressions were - traditionally not available in `awk', `gawk' does not provide them - by default. This prevents old `awk' programs from breaking. + Allows interval expressions (*note Regexp Operators::) in regexps. + Because interval expressions were traditionally not available in + `awk', `gawk' does not provide them by default. This prevents old + `awk' programs from breaking. `-W source PROGRAM-TEXT' `--source PROGRAM-TEXT' @@ -12114,15 +12065,14 @@ The following list describes `gawk'-specific options: enter on the command line. Program source code is taken from the PROGRAM-TEXT. This is particularly useful when you have library functions that you want to use from your command-line programs - (*note The `AWKPATH' Environment Variable: AWKPATH Variable.). + (*note AWKPATH Variable::). `-W version' `--version' Prints version information for this particular copy of `gawk'. This allows you to determine if your copy of `gawk' is up to date with respect to whatever the Free Software Foundation is currently - distributing. It is also useful for bug reports (*note Reporting - Problems and Bugs: Bugs.). + distributing. It is also useful for bug reports (*note Bugs::). As long as program text has been supplied, any other options are flagged as invalid with a warning message but are otherwise ignored. @@ -12130,7 +12080,7 @@ flagged as invalid with a warning message but are otherwise ignored. In compatibility mode, as a special case, if the value of FS supplied to the `-F' option is `t', then `FS' is set to the TAB character (`"\t"'). This is true only for `--traditional' and not for `--posix' -(*note Specifying How Fields Are Separated: Field Separators.). +(*note Field Separators::). The `-f' option may be used more than once on the command line. If it is, `awk' reads its program source from all of the named files, as @@ -12138,8 +12088,7 @@ if they had been concatenated together into one big file. This is useful for creating libraries of `awk' functions. These functions can be written once and then retrieved from a standard place, instead of having to be included into each individual program. (As mentioned in -*Note Function Definition Syntax: Definition Syntax, function names -must be unique.) +*Note Definition Syntax::, function names must be unique.) Library functions can still be used, even if the program is entered at the terminal, by specifying `-f /dev/tty'. After typing your @@ -12152,8 +12101,7 @@ source of data.) source file and command-line `awk' programs, `gawk' provides the `--source' option. This does not require you to pre-empt the standard input for your source code; it allows you to easily mix command-line -and library source code (*note The `AWKPATH' Environment Variable: -AWKPATH Variable.). +and library source code (*note AWKPATH Variable::). If no `-f' or `--source' option is specified, then `gawk' uses the first non-option command-line argument as the text of the program @@ -12195,8 +12143,7 @@ Other Command-Line Arguments input files to be processed in the order specified. However, an argument that has the form `VAR=VALUE', assigns the value VALUE to the variable VAR--it does not specify a file at all. (This was discussed -earlier in *Note Assigning Variables on the Command Line: Assignment -Options.) +earlier in *Note Assignment Options::.) All these arguments are made available to your `awk' program in the `ARGV' array (*note Built-in Variables::). Command-line options and @@ -12214,9 +12161,8 @@ reading a file. Therefore, the variables actually receive the given values after all previously specified files have been read. In particular, the values of variables assigned in this fashion are _not_ available inside a `BEGIN' -rule (*note The `BEGIN' and `END' Special Patterns: BEGIN/END.), -because such rules are run before `awk' begins scanning the argument -list. +rule (*note BEGIN/END::), because such rules are run before `awk' +begins scanning the argument list. The variable values given on the command line are processed for escape sequences (*note Escape Sequences::). (d.c.) @@ -12271,10 +12217,10 @@ command line with a short file name. Otherwise, the full file name would have to be typed for each file. By using both the `--source' and `-f' options, your command-line -`awk' programs can use facilities in `awk' library files (*note A -Library of `awk' Functions: Library Functions.). Path searching is not -done if `gawk' is in compatibility mode. This is true for both -`--traditional' and `--posix'. *Note Command-Line Options: Options. +`awk' programs can use facilities in `awk' library files (*note Library +Functions::). Path searching is not done if `gawk' is in compatibility +mode. This is true for both `--traditional' and `--posix'. *Note +Options::. *Note:* If you want files in the current directory to be found, you must include the current directory in the path, either by including `.' @@ -12320,12 +12266,11 @@ options from the previous version of `gawk'. The use of `next file' worked. Starting with version 3.1, the two-word usage is no longer accepted. - The process-related special files described in *Note Special Files -for Process-Related Information: Special Process, work as described, but -are now considered deprecated. `gawk' prints a warning message every -time they are used. (Use `PROCINFO' instead; see *Note Built-in -Variables That Convey Information: Auto-set.) They will be removed -from the next release of `gawk'. + The process-related special files described in *Note Special +Process::, work as described, but are now considered deprecated. +`gawk' prints a warning message every time they are used. (Use +`PROCINFO' instead; see *Note Auto-set::.) They will be removed from +the next release of `gawk'. File: gawk.info, Node: Undocumented, Next: Known Bugs, Prev: Obsolete, Up: Invoking Gawk @@ -12344,10 +12289,9 @@ File: gawk.info, Node: Known Bugs, Prev: Undocumented, Up: Invoking Gawk Known Bugs in `gawk' ==================== - * The `-F' option for changing the value of `FS' (*note Command-Line - Options: Options.) is not necessary given the command-line - variable assignment feature; it remains only for backward - compatibility. + * The `-F' option for changing the value of `FS' (*note Options::) + is not necessary given the command-line variable assignment + feature; it remains only for backward compatibility. * Syntactically invalid single-character programs tend to overflow the parse stack, generating a rather unhelpful message. Such @@ -12360,46 +12304,42 @@ File: gawk.info, Node: Library Functions, Next: Sample Programs, Prev: Invoki A Library of `awk' Functions **************************** - *Note User-Defined Functions: User-defined, describes how to write -your own `awk' functions. Writing functions is important, because it -allows you to encapsulate algorithms and program tasks in a single -place. It simplifies programming, making program development more -manageable, and making programs more readable. + *Note User-defined::, describes how to write your own `awk' +functions. Writing functions is important, because it allows you to +encapsulate algorithms and program tasks in a single place. It +simplifies programming, making program development more manageable, and +making programs more readable. One valuable way to learn a new programming language is to _read_ programs in that language. To that end, this major node and *Note -Practical `awk' Programs: Sample Programs, provide a good-sized body of -code for you to read, and hopefully, to learn from. +Sample Programs::, provide a good-sized body of code for you to read, +and hopefully, to learn from. This major node presents a library of useful `awk' functions. Many of the sample programs presented later in this Info file use these functions. The functions are presented here in a progression from simple to complex. - *Note Extracting Programs from Texinfo Source Files: Extract Program, -presents a program that you can use to extract the source code for -these example library functions and programs from the Texinfo source -for this Info file. (This has already been done as part of the `gawk' -distribution.) + *Note Extract Program::, presents a program that you can use to +extract the source code for these example library functions and +programs from the Texinfo source for this Info file. (This has already +been done as part of the `gawk' distribution.) If you have written one or more useful, general-purpose `awk' functions and would like to contribute them to the author's collection -of `awk' programs, see *Note How to Contribute: How To Contribute, for -more information. +of `awk' programs, see *Note How To Contribute::, for more information. - The programs in this major node and in *Note Practical `awk' -Programs: Sample Programs, freely use features that are `gawk'-specific. -Rewriting these programs for different implementations of awk is pretty -straightforward. + The programs in this major node and in *Note Sample Programs::, +freely use features that are `gawk'-specific. Rewriting these programs +for different implementations of awk is pretty straightforward. Diagnostic error messages are sent to `/dev/stderr'. Use `| "cat 1>&2"' instead of `> "/dev/stderr"' if your system does not have a `/dev/stderr', or if you cannot use `gawk'. - A number of programs use `nextfile' (*note Using `gawk''s `nextfile' -Statement: Nextfile Statement.) to skip any remaining input in the -input file. *Note Implementing `nextfile' as a Function: Nextfile -Function, shows you how to write a function that does the same thing. + A number of programs use `nextfile' (*note Nextfile Statement::) to +skip any remaining input in the input file. *Note Nextfile Function::, +shows you how to write a function that does the same thing. Finally, some of the programs choose to ignore upper- and lowercase distinctions in their input. They do so by assigning one to @@ -12431,7 +12371,7 @@ will be in all lowercase, while `IGNORECASE' preserves the original contents of the input record. -File: gawk.info, Node: Library Names, Next: General Functions, Prev: Library Functions, Up: Library Functions +File: gawk.info, Node: Library Names, Next: General Functions, Up: Library Functions Naming Library Function Global Variables ======================================== @@ -12443,9 +12383,9 @@ specific function). There is no intermediate state analogous to Library functions often need to have global variables that they can use to preserve state information between calls to the function--for -example, `getopt''s variable `_opti' (*note Processing Command-Line -Options: Getopt Function.). Such variables are called "private", since -the only functions that need to use them are the ones in the library. +example, `getopt''s variable `_opti' (*note Getopt Function::). Such +variables are called "private", since the only functions that need to +use them are the ones in the library. When writing a library function, you should try to choose names for your private variables that will not conflict with any variables used by @@ -12461,20 +12401,19 @@ will be accidentally shared with the user's program. In addition, several of the library functions use a prefix that helps indicate what function or set of functions use the variables--for -example, `_pw_byname' in the user database routines (*note Reading the -User Database: Passwd Functions.). This convention is recommended, -since it even further decreases the chance of inadvertent conflict -among variable names. Note that this convention is used equally well -for variable names and for private function names as well.(1) +example, `_pw_byname' in the user database routines (*note Passwd +Functions::). This convention is recommended, since it even further +decreases the chance of inadvertent conflict among variable names. +Note that this convention is used equally well for variable names and +for private function names as well.(1) As a final note on variable naming, if a function makes global variables available for use by a main program, it is a good convention to start that variable's name with a capital letter--for example, -`getopt''s `Opterr' and `Optind' variables (*note Processing -Command-Line Options: Getopt Function.). The leading capital letter -indicates that it is global, while the fact that the variable name is -not all capital letters indicates that the variable is not one of -`awk''s built-in variables, such as `FS'. +`getopt''s `Opterr' and `Optind' variables (*note Getopt Function::). +The leading capital letter indicates that it is global, while the fact +that the variable name is not all capital letters indicates that the +variable is not one of `awk''s built-in variables, such as `FS'. It is also important that _all_ variables in library functions that do not need to save state are, in fact, declared local.(2) If this is @@ -12492,10 +12431,10 @@ program, leading to bugs that are very difficult to track down: single associative array to hold the values needed by the library function(s), or "package." This significantly decreases the number of actual global names in use. For example, the functions described in -*Note Reading the User Database: Passwd Functions, might have used -array elements `PW_data["inited"]', `PW_data["total"]', -`PW_data["count"]', and `PW_data["awklib"]', instead of `_pw_inited', -`_pw_awklib', `_pw_total', and `_pw_count'. +*Note Passwd Functions::, might have used array elements +`PW_data["inited"]', `PW_data["total"]', `PW_data["count"]', and +`PW_data["awklib"]', instead of `_pw_inited', `_pw_awklib', `_pw_total', +and `_pw_count'. The conventions presented in this minor node are exactly that: conventions. You are not required to write your programs this way--we @@ -12535,17 +12474,16 @@ programming use. * Gettimeofday Function:: A function to get formatted times. -File: gawk.info, Node: Nextfile Function, Next: Assert Function, Prev: General Functions, Up: General Functions +File: gawk.info, Node: Nextfile Function, Next: Assert Function, Up: General Functions Implementing `nextfile' as a Function ------------------------------------- - The `nextfile' statement, presented in *Note Using `gawk''s -`nextfile' Statement: Nextfile Statement, is a `gawk'-specific -extension--it is not available in most other implementations of `awk'. -This minor node shows two versions of a `nextfile' function that you -can use to simulate `gawk''s `nextfile' statement if you cannot use -`gawk'. + The `nextfile' statement, presented in *Note Nextfile Statement::, +is a `gawk'-specific extension--it is not available in most other +implementations of `awk'. This minor node shows two versions of a +`nextfile' function that you can use to simulate `gawk''s `nextfile' +statement if you cannot use `gawk'. A first attempt at writing a `nextfile' function is as follows: @@ -12561,8 +12499,7 @@ current data file's name (which is always in the `FILENAME' variable) to a private variable named `_abandon_'. If the file name matches, then the action part of the rule executes a `next' statement to go on to the next record. (The use of `_' in the variable name is a convention. It -is discussed more fully in *Note Naming Library Function Global -Variables: Library Names.) +is discussed more fully in *Note Library Names::.) The use of the `next' statement effectively creates a loop that reads all the records from the current data file. The end of the file is @@ -12703,8 +12640,8 @@ rule is automatically added to the program calling `assert'. Normally, if a program consists of just a `BEGIN' rule, the input files and/or standard input are not read. However, now that the program has an `END' rule, `awk' attempts to read the input data files or standard input -(*note Startup and Cleanup Actions: Using BEGIN/END.), most likely -causing the program to hang as it waits for input. +(*note Using BEGIN/END::), most likely causing the program to hang as +it waits for input. There is a simple workaround to this: make sure the `BEGIN' rule always ends with an `exit' statement. @@ -12715,16 +12652,15 @@ File: gawk.info, Node: Round Function, Next: Cliff Random Function, Prev: Ass Rounding Numbers ---------------- - The way `printf' and `sprintf' (*note Using `printf' Statements for -Fancier Printing: Printf.) perform rounding often depends upon the -system's C `sprintf' subroutine. On many machines, `sprintf' rounding -is "unbiased," which means it doesn't always round a trailing `.5' up, -contrary to naive expectations. In unbiased rounding, `.5' rounds to -even, rather than always up, so 1.5 rounds to 2 but 4.5 rounds to 4. -This means that if you are using a format that does rounding (e.g., -`"%.0f"'), you should check what your system does. The following -function does traditional rounding; it might be useful if your awk's -`printf' does unbiased rounding: + The way `printf' and `sprintf' (*note Printf::) perform rounding +often depends upon the system's C `sprintf' subroutine. On many +machines, `sprintf' rounding is "unbiased," which means it doesn't +always round a trailing `.5' up, contrary to naive expectations. In +unbiased rounding, `.5' rounds to even, rather than always up, so 1.5 +rounds to 2 but 4.5 rounds to 4. This means that if you are using a +format that does rounding (e.g., `"%.0f"'), you should check what your +system does. The following function does traditional rounding; it +might be useful if your awk's `printf' does unbiased rounding: # round.awk --- do normal rounding function round(x, ival, aval, fraction) @@ -12886,16 +12822,14 @@ Merging an Array into a String When doing string processing, it is often useful to be able to join all the strings in an array into one long string. The following function, `join', accomplishes this task. It is used later in several -of the application programs (*note Practical `awk' Programs: Sample -Programs.). +of the application programs (*note Sample Programs::). Good function design is important; this function needs to be general but it should also have a reasonable default behavior. It is called with an array as well as the beginning and ending indices of the elements in the array to be merged. This assumes that the array indices are numeric--a reasonable assumption since the array was likely -created with `split' (*note String Manipulation Functions: String -Functions.): +created with `split' (*note String Functions::): # join.awk --- join an array into a string function join(array, start, end, sep, result, i) @@ -12931,12 +12865,11 @@ File: gawk.info, Node: Gettimeofday Function, Prev: Join Function, Up: Genera Managing the Time of Day ------------------------ - The `systime' and `strftime' functions described in *Note Using -`gawk''s Timestamp Functions: Time Functions, provide the minimum -functionality necessary for dealing with the time of day in human -readable form. While `strftime' is extensive, the control formats are -not necessarily easy to remember or intuitively obvious when reading a -program. + The `systime' and `strftime' functions described in *Note Time +Functions::, provide the minimum functionality necessary for dealing +with the time of day in human readable form. While `strftime' is +extensive, the control formats are not necessarily easy to remember or +intuitively obvious when reading a program. The following function, `gettimeofday', populates a user-supplied array with preformatted time information. It returns a string with the @@ -13004,10 +12937,9 @@ current time formatted in the same way as the `date' utility: The string indices are easier to use and read than the various formats required by `strftime'. The `alarm' program presented in *Note -An Alarm Clock Program: Alarm Program, uses this function. A more -general design for the `gettimeofday' function would have allowed the -user to supply an optional timestamp value to use instead of the -current time. +Alarm Program::, uses this function. A more general design for the +`gettimeofday' function would have allowed the user to supply an +optional timestamp value to use instead of the current time. File: gawk.info, Node: Data File Management, Next: Getopt Function, Prev: General Functions, Up: Library Functions @@ -13023,23 +12955,23 @@ command-line data files. * Filetrans Function:: A function for handling data file transitions. * Rewind Function:: A function for rereading the current file. * File Checking:: Checking that data files are readable. +* Empty Files:: Checking for zero-length files. * Ignoring Assigns:: Treating assignments as file names. -File: gawk.info, Node: Filetrans Function, Next: Rewind Function, Prev: Data File Management, Up: Data File Management +File: gawk.info, Node: Filetrans Function, Next: Rewind Function, Up: Data File Management Noting Data File Boundaries --------------------------- The `BEGIN' and `END' rules are each executed exactly once at the -beginning and end of your `awk' program, respectively (*note The -`BEGIN' and `END' Special Patterns: BEGIN/END.). We (the `gawk' -authors) once had a user who mistakenly thought that the `BEGIN' rule -is executed at the beginning of each data file and the `END' rule is -executed at the end of each data file. When informed that this was not -the case, the user requested that we add new special patterns to -`gawk', named `BEGIN_FILE' and `END_FILE', that would have the desired -behavior. He even supplied us the code to do so. +beginning and end of your `awk' program, respectively (*note +BEGIN/END::). We (the `gawk' authors) once had a user who mistakenly +thought that the `BEGIN' rule is executed at the beginning of each data +file and the `END' rule is executed at the end of each data file. When +informed that this was not the case, the user requested that we add new +special patterns to `gawk', named `BEGIN_FILE' and `END_FILE', that +would have the desired behavior. He even supplied us the code to do so. Adding these special patterns to `gawk' wasn't necessary; the job can be done cleanly in `awk' itself, as illustrated by the following @@ -13087,11 +13019,10 @@ supplied in the "main" program, `endfile' is called first. Once again the value of multiple `BEGIN' and `END' rules should be clear. This version has same problem as the first version of `nextfile' -(*note Implementing `nextfile' as a Function: Nextfile Function.). If -the same data file occurs twice in a row on the command line, then -`endfile' and `beginfile' are not executed at the end of the first pass -and at the beginning of the second pass. The following version solves -the problem: +(*note Nextfile Function::). If the same data file occurs twice in a +row on the command line, then `endfile' and `beginfile' are not +executed at the end of the first pass and at the beginning of the +second pass. The following version solves the problem: # ftrans.awk --- handle data file transitions # @@ -13105,8 +13036,8 @@ the problem: END { endfile(_filename_) } - *Note Counting Things: Wc Program, shows how this library function -can be used and how it simplifies writing the main program. + *Note Wc Program::, shows how this library function can be used and +how it simplifies writing the main program. File: gawk.info, Node: Rewind Function, Next: File Checking, Prev: Filetrans Function, Up: Data File Management @@ -13116,8 +13047,8 @@ Rereading the Current File Another request for a new built-in function was for a `rewind' function that would make it possible to reread the current file. The -requesting user didn't want to have to use `getline' (*note Explicit -Input with `getline': Getline.) inside a loop. +requesting user didn't want to have to use `getline' (*note Getline::) +inside a loop. However, as long as you are not in the `END' rule, it is quite easy to arrange to immediately close the current input file and then start @@ -13141,19 +13072,17 @@ over with it from the top. For lack of a better name, we'll call it nextfile } - This code relies on the `ARGIND' variable (*note Built-in Variables -That Convey Information: Auto-set.), which is specific to `gawk'. If -you are not using `gawk', you can use ideas presented in *Note Noting -Data File Boundaries: Filetrans Function, to either update `ARGIND' on + This code relies on the `ARGIND' variable (*note Auto-set::), which +is specific to `gawk'. If you are not using `gawk', you can use ideas +presented in *Note Filetrans Function::, to either update `ARGIND' on your own or modify this code as appropriate. The `rewind' function also relies on the `nextfile' keyword (*note -Using `gawk''s `nextfile' Statement: Nextfile Statement.). *Note -Implementing `nextfile' as a Function: Nextfile Function, for a -function version of `nextfile'. +Nextfile Statement::). *Note Nextfile Function::, for a function +version of `nextfile'. -File: gawk.info, Node: File Checking, Next: Ignoring Assigns, Prev: Rewind Function, Up: Data File Management +File: gawk.info, Node: File Checking, Next: Empty Files, Prev: Rewind Function, Up: Data File Management Checking for Readable Data Files -------------------------------- @@ -13181,16 +13110,71 @@ force). Removing the element from `ARGV' with `delete' skips the file (since it's no longer in the list). -File: gawk.info, Node: Ignoring Assigns, Prev: File Checking, Up: Data File Management +File: gawk.info, Node: Empty Files, Next: Ignoring Assigns, Prev: File Checking, Up: Data File Management + +Checking For Zero-length Files +------------------------------ + + All known `awk' implementations silently skip over zero-length files. +This is a by-product of `awk''s implicit +read-a-record-and-match-against-the-rules loop: when `awk' tries to +read a record from an empty file, it immediately receives an end of +file indication, closes the file, and proceeds on to the next +command-line data file, _without_ executing any user-level `awk' +program code. + + Using `gawk''s `ARGIND' variable (*note Built-in Variables::), it is +possible to detect when an empty data file has been skipped. Similar +to the library file presented in *Note Filetrans Function::, the +following library file calls a function named `zerofile' that the user +must provide. The arguments passed are the file name and the position +in `ARGV' where it was found: + + # zerofile.awk --- library file to process empty input files + BEGIN { Argind = 0 } + + ARGIND > Argind + 1 { + for (Argind++; Argind < ARGIND; Argind++) + zerofile(ARGV[Argind], Argind) + } + + ARGIND != Argind { Argind = ARGIND } + + END { + if (ARGIND > Argind) + for (Argind++; Argind <= ARGIND; Argind++) + zerofile(ARGV[Argind], Argind) + } + + The user-level variable `Argind' allows the `awk' program to track +its progress through `ARGV'. Whenever the program detects that +`ARGIND' is greater than `Argind + 1', it means that one or more empty +files were skipped. The action then calls `zerofile' for each such +file, incrementing `Argind' along the way. + + The `Argind != ARGIND' rule simply keeps `Argind' up to date in the +normal case. + + Finally, the `END' rule catches the case of any empty files at the +end of the command-line arguments. Note that the test in the condition +of the `for' loop uses the `<=' operator, not `<'. + + As an exercise, you might consider whether this same problem can be +solved without relying on `gawk''s `ARGIND' variable. + + As a second exercise, revise this code to handle the case where an +intervening value in `ARGV' is a variable assignment. + + +File: gawk.info, Node: Ignoring Assigns, Prev: Empty Files, Up: Data File Management Treating Assignments as File Names ---------------------------------- Occasionally, you might not want `awk' to process command-line -variable assignments (*note Assigning Variables on the Command Line: -Assignment Options.). In particular, if you have file names that -contain an `=' character, `awk' treats the file name as an assignment, -and does not process it. +variable assignments (*note Assignment Options::). In particular, if +you have file names that contain an `=' character, `awk' treats the +file name as an assignment, and does not process it. Some users have suggested an additional command-line option for `gawk' to disable command-line assignments. However, some simple @@ -13232,11 +13216,11 @@ Processing Command-Line Options Most utilities on POSIX compatible systems take options, or "switches," on the command line that can be used to change the way a program behaves. `awk' is an example of such a program (*note -Command-Line Options: Options.). Often, options take "arguments"; -i.e., data that the program needs to correctly obey the command-line -option. For example, `awk''s `-F' option requires a string to use as -the field separator. The first occurrence on the command line of -either `--' or a string that does not begin with `-' ends the options. +Options::). Often, options take "arguments"; i.e., data that the +program needs to correctly obey the command-line option. For example, +`awk''s `-F' option requires a string to use as the field separator. +The first occurrence on the command line of either `--' or a string +that does not begin with `-' ends the options. Modern Unix systems provide a C function named `getopt' for processing command-line arguments. The programmer provides a string @@ -13318,15 +13302,14 @@ command-line arguments for `awk': } As a side point, `gawk' actually uses the GNU `getopt_long' function -to process both normal and GNU-style long options (*note Command-Line -Options: Options.). +to process both normal and GNU-style long options (*note Options::). The abstraction provided by `getopt' is very useful and is quite handy in `awk' programs as well. Following is an `awk' version of `getopt'. This function highlights one of the greatest weaknesses in `awk', which is that it is very poor at manipulating single characters. Repeated calls to `substr' are necessary for accessing individual -characters (*note String Manipulation Functions: String Functions.).(1) +characters (*note String Functions::).(1) The discussion that follows walks through the code a bit at a time: @@ -13499,8 +13482,8 @@ result of two sample runs of the test program: In both runs, the first `--' terminates the arguments to `awk', so that it does not try to interpret the `-a', etc., as its own options. -Several of the sample programs presented in *Note Practical `awk' -Programs: Sample Programs, use `getopt' to process their arguments. +Several of the sample programs presented in *Note Sample Programs::, +use `getopt' to process their arguments. ---------- Footnotes ---------- @@ -13521,8 +13504,8 @@ are numbers, they do not provide very useful information to the average user. There needs to be some way to find the user information associated with the user and group ID numbers. This minor node presents a suite of functions for retrieving information from the user -database. *Note Reading the Group Database: Group Functions, for a -similar suite that retrieves information from the group database. +database. *Note Group Functions::, for a similar suite that retrieves +information from the group database. The POSIX standard does not define the file where user information is kept. Instead, it provides the `<pwd.h>' header file and several C @@ -13727,8 +13710,7 @@ once. If you are worried about squeezing every last cycle out of your this is not necessary, since most `awk' programs are I/O-bound, and it clutters up the code. - The `id' program in *Note Printing out User Information: Id Program, -uses these functions. + The `id' program in *Note Id Program::, uses these functions. ---------- Footnotes ---------- @@ -13741,14 +13723,14 @@ File: gawk.info, Node: Group Functions, Prev: Passwd Functions, Up: Library F Reading the Group Database ========================== - Much of the discussion presented in *Note Reading the User Database: -Passwd Functions, applies to the group database as well. Although -there has traditionally been a well-known file (`/etc/group') in a -well-known format, the POSIX standard only provides a set of C library -routines (`<grp.h>' and `getgrent') for accessing the information. -Even though this file may exist, it likely does not have complete -information. Therefore, as with the user database, it is necessary to -have a small C program that generates the group database as its output. + Much of the discussion presented in *Note Passwd Functions::, +applies to the group database as well. Although there has traditionally +been a well-known file (`/etc/group') in a well-known format, the POSIX +standard only provides a set of C library routines (`<grp.h>' and +`getgrent') for accessing the information. Even though this file may +exist, it likely does not have complete information. Therefore, as +with the user database, it is necessary to have a small C program that +generates the group database as its output. `grcat', a C program that "cats" the group database, is as follows: @@ -13872,11 +13854,11 @@ routine, we have chosen to put it in `/usr/local/libexec/awk'. You might want it to be in a different directory on your system. These routines follow the same general outline as the user database -routines (*note Reading the User Database: Passwd Functions.). The -`_gr_inited' variable is used to ensure that the database is scanned no -more than once. The `_gr_init' function first saves `FS', -`FIELDWIDTHS', `RS', and `$0', and then sets `FS' and `RS' to the -correct values for scanning the group information. +routines (*note Passwd Functions::). The `_gr_inited' variable is used +to ensure that the database is scanned no more than once. The +`_gr_init' function first saves `FS', `FIELDWIDTHS', `RS', and `$0', +and then sets `FS' and `RS' to the correct values for scanning the +group information. The group information is stored is several associative arrays. The arrays are indexed by group name (`_gr_byname'), by group ID number @@ -13965,8 +13947,7 @@ body of `_gr_init' into a `BEGIN' rule). associative arrays. The functions that the user calls are themselves very simple, relying on `awk''s associative arrays to do work. - The `id' program in *Note Printing out User Information: Id Program, -uses these functions. + The `id' program in *Note Id Program::, uses these functions. File: gawk.info, Node: Sample Programs, Next: Language History, Prev: Library Functions, Up: Top @@ -13974,13 +13955,13 @@ File: gawk.info, Node: Sample Programs, Next: Language History, Prev: Library Practical `awk' Programs ************************ - *Note A Library of `awk' Functions: Library Functions, presents the -idea that reading programs in a language contributes to learning that -language. This major node continues that theme, presenting a potpourri -of `awk' programs for your reading enjoyment. + *Note Library Functions::, presents the idea that reading programs +in a language contributes to learning that language. This major node +continues that theme, presenting a potpourri of `awk' programs for your +reading enjoyment. Many of these programs use the library functions presented in *Note -A Library of `awk' Functions: Library Functions. +Library Functions::. * Menu: @@ -13989,7 +13970,7 @@ A Library of `awk' Functions: Library Functions. * Miscellaneous Programs:: Some interesting `awk' programs. -File: gawk.info, Node: Running Examples, Next: Clones, Prev: Sample Programs, Up: Sample Programs +File: gawk.info, Node: Running Examples, Next: Clones, Up: Sample Programs Running the Example Programs ============================ @@ -14003,8 +13984,7 @@ OPTIONS are any command-line options for the program that start with a `-', and FILES are the actual data files. If your system supports the `#!' executable interpreter mechanism -(*note Executable `awk' Programs: Executable Scripts.), you can instead -run your program directly: +(*note Executable Scripts::), you can instead run your program directly: cut.awk -c1-8 myfiles > results @@ -14042,7 +14022,7 @@ tasks. * Wc Program:: The `wc' utility. -File: gawk.info, Node: Cut Program, Next: Egrep Program, Prev: Clones, Up: Clones +File: gawk.info, Node: Cut Program, Next: Egrep Program, Up: Clones Cutting out Fields and Columns ------------------------------ @@ -14078,9 +14058,8 @@ pipeline generates a sorted, unique list of the logged-on users: Suppress printing of lines that do not contain the field delimiter. The `awk' implementation of `cut' uses the `getopt' library function -(*note Processing Command-Line Options: Getopt Function.) and the -`join' library function (*note Merging an Array into a String: Join -Function.). +(*note Getopt Function::) and the `join' library function (*note Join +Function::). The program begins with a comment describing the options, the library functions needed, and a `usage' function that prints out a usage @@ -14208,9 +14187,9 @@ The program lets `awk' handle the job of doing the field splitting: } The `set_charlist' function is more complicated than `set_fieldlist'. -The idea here is to use `gawk''s `FIELDWIDTHS' variable (*note Reading -Fixed-Width Data: Constant Size.), which describes constant-width -input. When using a character list, that is exactly what we have. +The idea here is to use `gawk''s `FIELDWIDTHS' variable (*note Constant +Size::), which describes constant-width input. When using a character +list, that is exactly what we have. Setting up `FIELDWIDTHS' is more complicated than simply listing the fields that need to be printed. We have to keep track of the fields to @@ -14292,10 +14271,9 @@ out between the fields: This version of `cut' relies on `gawk''s `FIELDWIDTHS' variable to do the character-based cutting. While it is possible in other `awk' -implementations to use `substr' (*note String Manipulation Functions: -String Functions.), it is also extremely painful. The `FIELDWIDTHS' -variable supplies an elegant solution to the problem of picking the -input line apart by characters. +implementations to use `substr' (*note String Functions::), it is also +extremely painful. The `FIELDWIDTHS' variable supplies an elegant +solution to the problem of picking the input line apart by characters. File: gawk.info, Node: Egrep Program, Next: Id Program, Prev: Cut Program, Up: Clones @@ -14305,8 +14283,7 @@ Searching for Regular Expressions in Files The `egrep' utility searches files for patterns. It uses regular expressions that are almost identical to those available in `awk' -(*note Regular Expressions: Regexp.). It is used in the following -manner: +(*note Regexp::). It is used in the following manner: egrep [ OPTIONS ] 'PATTERN' FILES ... @@ -14343,10 +14320,9 @@ a colon. Use PATTERN as the regexp to match. The purpose of the `-e' option is to allow patterns that start with a `-'. - This version uses the `getopt' library function (*note Processing -Command-Line Options: Getopt Function.) and the file transition -library program (*note Noting Data File Boundaries: Filetrans -Function.). + This version uses the `getopt' library function (*note Getopt +Function::) and the file transition library program (*note Filetrans +Function::). The program begins with a descriptive comment and then a `BEGIN' rule that processes the command-line arguments with `getopt'. The `-i' @@ -14549,9 +14525,8 @@ array (*note Built-in Variables::). However, the `id' utility provides a more palatable output than just individual numbers. Here is a simple version of `id' written in `awk'. It uses the user -database library functions (*note Reading the User Database: Passwd -Functions.) and the group database library functions (*note Reading -the Group Database: Group Functions.): +database library functions (*note Passwd Functions::) and the group +database library functions (*note Group Functions::): The program is fairly straightforward. All the work is done in the `BEGIN' rule. The user and group ID numbers are obtained from @@ -14657,8 +14632,7 @@ to something like `myfileaa', `myfileab', and so on, supply an additional argument that specifies the file name prefix. Here is a version of `split' in `awk'. It uses the `ord' and `chr' -functions presented in *Note Translating Between Characters and -Numbers: Ordinal Functions. +functions presented in *Note Ordinal Functions::. The program first sets its defaults, and then tests to make sure there are not too many arguments. It then looks at each argument in @@ -14870,9 +14844,8 @@ usage is as follows: Normally `uniq' behaves as if both the `-d' and `-u' options are provided. - `uniq' uses the `getopt' library function (*note Processing -Command-Line Options: Getopt Function.) and the `join' library function -(*note Merging an Array into a String: Join Function.). + `uniq' uses the `getopt' library function (*note Getopt Function::) +and the `join' library function (*note Join Function::). The program begins with a `usage' function and then a brief outline of the options and their meanings in a comment. The `BEGIN' rule deals @@ -14955,13 +14928,13 @@ characters. If no field count and no character count are specified, `are_equal' simply returns one or zero depending upon the result of a simple string comparison of `last' and `$0'. Otherwise, things get more complicated. If fields have to be skipped, each line is broken into an -array using `split' (*note String Manipulation Functions: String -Functions.); the desired fields are then joined back into a line using -`join'. The joined lines are stored in `clast' and `cline'. If no -fields are skipped, `clast' and `cline' are set to `last' and `$0', -respectively. Finally, if characters are skipped, `substr' is used to -strip off the leading `charcount' characters in `clast' and `cline'. -The two strings are then compared and `are_equal' returns the result: +array using `split' (*note String Functions::); the desired fields are +then joined back into a line using `join'. The joined lines are stored +in `clast' and `cline'. If no fields are skipped, `clast' and `cline' +are set to `last' and `$0', respectively. Finally, if characters are +skipped, `substr' is used to strip off the leading `charcount' +characters in `clast' and `cline'. The two strings are then compared +and `are_equal' returns the result: function are_equal( n, m, clast, cline, alast, aline) { @@ -15076,9 +15049,8 @@ a lot of the work for us; it splits lines into words (i.e., fields) and counts them, it counts lines (i.e., records), and it can easily tell us how long a line is. - This uses the `getopt' library function (*note Processing -Command-Line Options: Getopt Function.) and the file-transition -functions (*note Noting Data File Boundaries: Filetrans Function.). + This uses the `getopt' library function (*note Getopt Function::) +and the file-transition functions (*note Filetrans Function::). This version has one notable difference from traditional versions of `wc': it always prints the counts in the order lines, words, and @@ -15182,9 +15154,8 @@ this line: ---------- Footnotes ---------- (1) `wc' can't just use the value of `FNR' in `endfile'. If you -examine the code in *Note Noting Data File Boundaries: Filetrans -Function you will see that `FNR' has already been reset by the time -`endfile' is called. +examine the code in *Note Filetrans Function:: you will see that `FNR' +has already been reset by the time `endfile' is called. File: gawk.info, Node: Miscellaneous Programs, Prev: Clones, Up: Sample Programs @@ -15211,7 +15182,7 @@ hope you find them both interesting and enjoyable. files. -File: gawk.info, Node: Dupword Program, Next: Alarm Program, Prev: Miscellaneous Programs, Up: Miscellaneous Programs +File: gawk.info, Node: Dupword Program, Next: Alarm Program, Up: Miscellaneous Programs Finding Duplicated Words in a Document -------------------------------------- @@ -15273,8 +15244,8 @@ prints the message on the standard output. In addition, you can give it the number of times to repeat the message as well as a delay between repetitions. - This program uses the `gettimeofday' function from *Note Managing -the Time of Day: Gettimeofday Function. + This program uses the `gettimeofday' function from *Note +Gettimeofday Function::. All the work is done in the `BEGIN' rule. The first part is argument checking and setting of defaults: the delay, the count, and the message @@ -15360,13 +15331,13 @@ alarm: exit 1 } - Finally, the program uses the `system' function (*note Input/Output -Functions: I/O Functions.) to call the `sleep' utility. The `sleep' -utility simply pauses for the given number of seconds. If the exit -status is not zero, the program assumes that `sleep' was interrupted -and exits. If `sleep' exited with an OK status (zero), then the program -prints the message in a loop, again using `sleep' to delay for however -many seconds are necessary: + Finally, the program uses the `system' function (*note I/O +Functions::) to call the `sleep' utility. The `sleep' utility simply +pauses for the given number of seconds. If the exit status is not zero, +the program assumes that `sleep' was interrupted and exits. If `sleep' +exited with an OK status (zero), then the program prints the message in +a loop, again using `sleep' to delay for however many seconds are +necessary: # zzzzzz..... go away if interrupted if (system(sprintf("sleep %d", naptime)) != 0) @@ -15413,9 +15384,8 @@ most of the job. The `translate' program demonstrates one of the few weaknesses of standard `awk': dealing with individual characters is very painful, requiring repeated use of the `substr', `index', and `gsub' built-in -functions (*note String Manipulation Functions: String Functions.).(2) -There are two functions. The first, `stranslate', takes three -arguments: +functions (*note String Functions::).(2) There are two functions. The +first, `stranslate', takes three arguments: `from' A list of characters from which to translate. @@ -15488,11 +15458,10 @@ record: function, it is not necessarily efficient, and we (the `gawk' authors) started to consider adding a built-in function. However, shortly after writing this program, we learned that the System V Release 4 `awk' had -added the `toupper' and `tolower' functions (*note String Manipulation -Functions: String Functions.). These functions handle the vast -majority of the cases where character transliteration is necessary, and -so we chose to simply add those functions to `gawk' as well and then -leave well enough alone. +added the `toupper' and `tolower' functions (*note String Functions::). +These functions handle the vast majority of the cases where character +transliteration is necessary, and so we chose to simply add those +functions to `gawk' as well and then leave well enough alone. An obvious improvement to this program would be to set up the `t_ar' array only once, in a `BEGIN' rule. However, this assumes that the @@ -15527,9 +15496,9 @@ of filling the `line' array and printing the page when 20 labels have been read. The `BEGIN' rule simply sets `RS' to the empty string, so that `awk' -splits records at blank lines (*note How Input Is Split into Records: -Records.). It sets `MAXLINES' to 100, since 100 is the maximum number -of lines on the page (20 * 5 = 100). +splits records at blank lines (*note Records::). It sets `MAXLINES' to +100, since 100 is the maximum number of lines on the page (20 * 5 = +100). Most of the work is done in the `printpage' function. The label lines are stored sequentially in the `line' array. But they have to @@ -15641,11 +15610,11 @@ program listing: This program has two rules. The first rule, because it has an empty pattern, is executed for every input line. It uses `awk''s -field-accessing mechanism (*note Examining Fields: Fields.) to pick out -the individual words from the line, and the built-in variable `NF' -(*note Built-in Variables::) to know how many fields are available. -For each input word, it increments an element of the array `freq' to -reflect that the word has been seen an additional time. +field-accessing mechanism (*note Fields::) to pick out the individual +words from the line, and the built-in variable `NF' (*note Built-in +Variables::) to know how many fields are available. For each input +word, it increments an element of the array `freq' to reflect that the +word has been seen an additional time. The second rule, because it has the pattern `END', is not executed until the input has been exhausted. It prints out the contents of the @@ -15726,8 +15695,8 @@ File: gawk.info, Node: History Sorting, Next: Extract Program, Prev: Word Sor Removing Duplicates from Unsorted Text -------------------------------------- - The `uniq' program (*note Printing Nonduplicated Lines of Text: Uniq -Program.), removes duplicate lines from _sorted_ data. + The `uniq' program (*note Uniq Program::), removes duplicate lines +from _sorted_ data. Suppose, however, you need to remove duplicate lines from a data file but that you want to preserve the order the lines are in. A good @@ -15772,12 +15741,11 @@ File: gawk.info, Node: Extract Program, Next: Simple Sed, Prev: History Sorti Extracting Programs from Texinfo Source Files --------------------------------------------- - The nodes *Note A Library of `awk' Functions: Library Functions, and -*Note Practical `awk' Programs: Sample Programs, are the top level -nodes for a large number of `awk' programs. If you want to experiment -with these programs, it is tedious to have to type them in by hand. -Here we present a program that can extract parts of a Texinfo input -file into separate files. + The nodes *Note Library Functions::, and *Note Sample Programs::, +are the top level nodes for a large number of `awk' programs. If you +want to experiment with these programs, it is tedious to have to type +them in by hand. Here we present a program that can extract parts of a +Texinfo input file into separate files. This Info file is written in Texinfo, the GNU project's document formatting language. A single Texinfo source file can be used to @@ -15803,14 +15771,13 @@ input files: The following program, `extract.awk', reads through a Texinfo source file and does two things, based on the special comments. Upon seeing `@c system ...', it runs a command, by extracting the command text from -the control line and passing it on to the `system' function (*note -Input/Output Functions: I/O Functions.). Upon seeing `@c file -FILENAME', each subsequent line is sent to the file FILENAME, until `@c -endfile' is encountered. The rules in `extract.awk' match either `@c' -or `@comment' by letting the `omment' part be optional. Lines -containing `@group' and `@end group' are simply removed. `extract.awk' -uses the `join' library function (*note Merging an Array into a String: -Join Function.). +the control line and passing it on to the `system' function (*note I/O +Functions::). Upon seeing `@c file FILENAME', each subsequent line is +sent to the file FILENAME, until `@c endfile' is encountered. The +rules in `extract.awk' match either `@c' or `@comment' by letting the +`omment' part be optional. Lines containing `@group' and `@end group' +are simply removed. `extract.awk' uses the `join' library function +(*note Join Function::). The example programs in the online Texinfo source for `GAWK: Effective AWK Programming' (`gawk.texi') have all been bracketed inside @@ -15877,21 +15844,21 @@ redirection for printing the contents, keeping open file management simple. The `for' loop does the work. It reads lines using `getline' (*note -Explicit Input with `getline': Getline.). For an unexpected end of -file, it calls the `unexpected_eof' function. If the line is an -"endfile" line, then it breaks out of the loop. If the line is an -`@group' or `@end group' line, then it ignores it and goes on to the -next line. Similarly, comments within examples are also ignored. +Getline::). For an unexpected end of file, it calls the +`unexpected_eof' function. If the line is an "endfile" line, then it +breaks out of the loop. If the line is an `@group' or `@end group' +line, then it ignores it and goes on to the next line. Similarly, +comments within examples are also ignored. Most of the work is in the following few lines. If the line has no `@' symbols, the program can print it directly. Otherwise, each leading `@' must be stripped off. To remove the `@' symbols, the line is split into separate elements of the array `a', using the `split' -function (*note String Manipulation Functions: String Functions.). The -`@' symbol is used as the separator character. Each element of `a' -that is empty indicates two successive `@' symbols in the original -line. For each two empty elements (`@@' in the original file), we have -to add a single `@' symbol back in. +function (*note String Functions::). The `@' symbol is used as the +separator character. Each element of `a' that is empty indicates two +successive `@' symbols in the original line. For each two empty +elements (`@@' in the original file), we have to add a single `@' +symbol back in. When the processing of the array is finished, `join' is called with the value of `SUBSEP', to rejoin the pieces back into a single line. @@ -15939,11 +15906,11 @@ That line is then printed to the output file: An important thing to note is the use of the `>' redirection. Output done with `>' only opens the file once; it stays open and -subsequent output is appended to the file (*note Redirecting Output of -`print' and `printf': Redirection.). This makes it easy to mix program -text and explanatory prose for the same sample source file (as has been -done here!) without any hassle. The file is only closed when a new -data file name is encountered or at the end of the input file. +subsequent output is appended to the file (*note Redirection::). This +makes it easy to mix program text and explanatory prose for the same +sample source file (as has been done here!) without any hassle. The +file is only closed when a new data file name is encountered or at the +end of the input file. Finally, the function `unexpected_eof' prints an appropriate error message and then exits. The `END' rule handles the final cleanup, @@ -15978,7 +15945,7 @@ the middle of a pipeline: Here, `s/old/new/g' tells `sed' to look for the regexp `old' on each input line and globally replace it with the text `new', i.e., all the occurrences on a line. This is similar to `awk''s `gsub' function -(*note String Manipulation Functions: String Functions.). +(*note String Functions::). The following program, `awksed.awk', accepts at least two command-line arguments: the pattern to look for and the text to replace @@ -16015,7 +15982,7 @@ process. If none are provided, the standard input is used: The program relies on `gawk''s ability to have `RS' be a regexp, as well as on the setting of `RT' to the actual text that terminates the -record (*note How Input Is Split into Records: Records.). +record (*note Records::). The idea is to have `RS' be the pattern to look for. `gawk' automatically sets `$0' to the text between matches of the pattern. @@ -16028,14 +15995,13 @@ record doesn't end with text that matches `RS'. Using a `print' statement unconditionally prints the replacement text, which is not correct. However, if the file did not end in text that matches `RS', `RT' is set to the null string. In this case, we can print `$0' using -`printf' (*note Using `printf' Statements for Fancier Printing: -Printf.). +`printf' (*note Printf::). The `BEGIN' rule handles the setup, checking for the right number of arguments and calling `usage' if there is a problem. Then it sets `RS' and `ORS' from the command-line arguments and sets `ARGV[1]' and `ARGV[2]' to the null string, so that they are not treated as file names -(*note Using `ARGC' and `ARGV': ARGC and ARGV.). +(*note ARGC and ARGV::). The `usage' function prints an error message and exits. Finally, the single rule handles the printing scheme outlined above, using @@ -16053,9 +16019,8 @@ smaller and therefore clearer. However, using library functions is only easy when writing `awk' programs; it is painful when running them, requiring multiple `-f' options. If `gawk' is unavailable, then so too is the `AWKPATH' environment variable and the ability to put `awk' -functions into a library directory (*note Command-Line Options: -Options.). It would be nice to be able to write programs in the -following manner: +functions into a library directory (*note Options::). It would be nice +to be able to write programs in the following manner: # library functions @include getopt.awk @@ -16237,24 +16202,23 @@ 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. +at a time, using `getline' (*note 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' -environment variable (*note The `AWKPATH' Environment Variable: AWKPATH -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.(2) -If the file can be read, it is closed and the file name is returned: +environment variable (*note AWKPATH 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.(2) If the file can be read, it +is closed and the file name is returned: expand_prog=' @@ -16460,7 +16424,7 @@ you can find more information. * Contributors:: The major contributors to `gawk'. -File: gawk.info, Node: V7/SVR3.1, Next: SVR4, Prev: Language History, Up: Language History +File: gawk.info, Node: V7/SVR3.1, Next: SVR4, Up: Language History Major Changes Between V7 and SVR3.1 =================================== @@ -16470,61 +16434,53 @@ Version 7 Unix (1978) and the new version that was first made generally available in System V Release 3.1 (1987). This minor node summarizes the changes, with cross-references to further details: - * The requirement for `;' to separate rules on a line (*note `awk' - Statements Versus Lines: Statements/Lines.). + * The requirement for `;' to separate rules on a line (*note + Statements/Lines::). * User-defined functions and the `return' statement (*note - User-Defined Functions: User-defined.). + User-defined::). - * The `delete' statement (*note The `delete' Statement: Delete.). + * The `delete' statement (*note Delete::). - * The `do'-`while' statement (*note The `do'-`while' Statement: Do - Statement.). + * The `do'-`while' statement (*note Do Statement::). * The built-in functions `atan2', `cos', `sin', `rand', and `srand' (*note Numeric Functions::). * The built-in functions `gsub', `sub', and `match' (*note String - Manipulation Functions: String Functions.). + Functions::). - * The built-in functions `close' and `system' (*note Input/Output - Functions: I/O Functions.). + * The built-in functions `close' and `system' (*note I/O + Functions::). * The `ARGC', `ARGV', `FNR', `RLENGTH', `RSTART', and `SUBSEP' built-in variables (*note Built-in Variables::). * The conditional expression using the ternary operator `?:' (*note - Conditional Expressions: Conditional Exp.). + Conditional Exp::). - * The exponentiation operator `^' (*note Arithmetic Operators: - Arithmetic Ops.) and its assignment operator form `^=' (*note - Assignment Expressions: Assignment Ops.). + * The exponentiation operator `^' (*note Arithmetic Ops::) and its + assignment operator form `^=' (*note Assignment Ops::). * C-compatible operator precedence, which breaks some old `awk' - programs (*note Operator Precedence (How Operators Nest): - Precedence.). + programs (*note Precedence::). - * Regexps as the value of `FS' (*note Specifying How Fields Are - Separated: Field Separators.) and as the third argument to the - `split' function (*note String Manipulation Functions: String - Functions.). + * Regexps as the value of `FS' (*note Field Separators::) and as the + third argument to the `split' function (*note String Functions::). * Dynamic regexps as operands of the `~' and `!~' operators (*note - How to Use Regular Expressions: Regexp Usage.). + Regexp Usage::). * The escape sequences `\b', `\f', and `\r' (*note Escape Sequences::). (Some vendors have updated their old versions of `awk' to recognize `\b', `\f', and `\r', but this is not something you can rely on.) - * Redirection of input for the `getline' function (*note Explicit - Input with `getline': Getline.). + * Redirection of input for the `getline' function (*note Getline::). - * Multiple `BEGIN' and `END' rules (*note The `BEGIN' and `END' - Special Patterns: BEGIN/END.). + * Multiple `BEGIN' and `END' rules (*note BEGIN/END::). - * Multidimensional arrays (*note Multidimensional Arrays: - Multi-dimensional.). + * Multidimensional arrays (*note Multi-dimensional::). File: gawk.info, Node: SVR4, Next: POSIX, Prev: V7/SVR3.1, Up: Language History @@ -16537,11 +16493,10 @@ features (some of which originated in `gawk'): * The `ENVIRON' variable (*note Built-in Variables::). - * Multiple `-f' options on the command line (*note Command-Line - Options: Options.). + * Multiple `-f' options on the command line (*note Options::). * The `-v' option for assigning variables before program execution - begins (*note Command-Line Options: Options.). + begins (*note Options::). * The `--' option for terminating command-line options. @@ -16552,24 +16507,21 @@ features (some of which originated in `gawk'): Numeric Functions::). * The `toupper' and `tolower' built-in string functions for case - translation (*note String Manipulation Functions: String - Functions.). + translation (*note String Functions::). * A cleaner specification for the `%c' format-control letter in the - `printf' function (*note Format-Control Letters: Control Letters.). + `printf' function (*note Control Letters::). * The ability to dynamically pass the field width and precision (`"%*.*d"') in the argument list of the `printf' function (*note - Format-Control Letters: Control Letters.). + Control Letters::). * The use of regexp constants, such as `/foo/', as expressions, where they are equivalent to using the matching operator, as in `$0 ~ - /foo/' (*note Using Regular Expression Constants: Using Constant - Regexps.). + /foo/' (*note Using Constant Regexps::). * Processing of escape sequences inside command-line variable - assignments (*note Assigning Variables on the Command Line: - Assignment Options.). + assignments (*note Assignment Options::). File: gawk.info, Node: POSIX, Next: BTL, Prev: SVR4, Up: Language History @@ -16581,14 +16533,13 @@ Changes Between SVR4 and POSIX `awk' introduced the following changes into the language: * The use of `-W' for implementation-specific options (*note - Command-Line Options: Options.). + Options::). * The use of `CONVFMT' for controlling the conversion of numbers to - strings (*note Conversion of Strings and Numbers: Conversion.). + strings (*note Conversion::). * The concept of a numeric string and tighter comparison rules to go - with it (*note Variable Typing and Comparison Expressions: Typing - and Comparison.). + with it (*note Typing and Comparison::). * More complete documentation of many of the previously undocumented features of the language. @@ -16600,24 +16551,22 @@ standard: Sequences::). * Newlines do not act as whitespace to separate fields when `FS' is - equal to a single space (*note Examining Fields: Fields.). + equal to a single space (*note Fields::). * Newlines are not allowed after `?' or `:' (*note Conditional - Expressions: Conditional Exp.). + Exp::). * The synonym `func' for the keyword `function' is not recognized - (*note Function Definition Syntax: Definition Syntax.). + (*note Definition Syntax::). * The operators `**' and `**=' cannot be used in place of `^' and - `^=' (*note Arithmetic Operators: Arithmetic Ops., and *Note - Assignment Expressions: Assignment Ops). + `^=' (*note Arithmetic Ops::, and *Note Assignment Ops::). * Specifying `-Ft' on the command line does not set the value of - `FS' to be a single TAB character (*note Specifying How Fields Are - Separated: Field Separators.). + `FS' to be a single TAB character (*note Field Separators::). - * The `fflush' built-in function is not supported (*note - Input/Output Functions: I/O Functions.). + * The `fflush' built-in function is not supported (*note I/O + Functions::). File: gawk.info, Node: BTL, Next: POSIX/GNU, Prev: POSIX, Up: Language History @@ -16626,25 +16575,24 @@ Extensions in the Bell Laboratories `awk' ========================================= Brian Kernighan, one of the original designers of Unix `awk', has -made his version available via his home page (*note Other Freely -Available `awk' Implementations: Other Versions.). This minor node -describes extensions in his version of `awk' that are not in POSIX -`awk': +made his version available via his home page (*note Other Versions::). +This minor node describes extensions in his version of `awk' that are +not in POSIX `awk': * The `-mf N' and `-mr N' command-line options to set the maximum number of fields and the maximum record size, respectively (*note - Command-Line Options: Options.). As a side note, his `awk' no - longer needs these options; it continues to accept them to avoid - breaking old programs. + Options::). As a side note, his `awk' no longer needs these + options; it continues to accept them to avoid breaking old + programs. * The `fflush' built-in function for flushing buffered output (*note - Input/Output Functions: I/O Functions.). + I/O Functions::). - * The `**' and `**=' operators (*note Arithmetic Operators: - Arithmetic Ops. and *Note Assignment Expressions: Assignment Ops). + * The `**' and `**=' operators (*note Arithmetic Ops:: and *Note + Assignment Ops::). * The use of `func' as an abbreviation for `function' (*note - Function Definition Syntax: Definition Syntax.). + Definition Syntax::). The Bell Laboratories `awk' also incorporates the following @@ -16653,17 +16601,15 @@ extensions, originally developed for `gawk': * The `\x' escape sequence (*note Escape Sequences::). * The `/dev/stdin', `/dev/stdout', and `/dev/stderr' special files - (*note Special File Names in `gawk': Special Files.). + (*note Special Files::). * The ability for `FS' and for the third argument to `split' to be - null strings (*note Making Each Character a Separate Field: Single - Character Fields.). + null strings (*note Single Character Fields::). - * The `nextfile' statement (*note Using `gawk''s `nextfile' - Statement: Nextfile Statement.). + * The `nextfile' statement (*note Nextfile Statement::). * The ability to delete all of an array at once with `delete ARRAY' - (*note The `delete' Statement: Delete.). + (*note Delete::). File: gawk.info, Node: POSIX/GNU, Next: Contributors, Prev: BTL, Up: Language History @@ -16674,44 +16620,38 @@ Extensions in `gawk' Not in POSIX `awk' The GNU implementation, `gawk', adds a large number of features. This minor node lists them in the order they were added to `gawk'. They can all be disabled with either the `--traditional' or `--posix' -options (*note Command-Line Options: Options.). +options (*note Options::). Version 2.10 of `gawk' introduced the following features: * The `AWKPATH' environment variable for specifying a path search for - the `-f' command-line option (*note Command-Line Options: - Options.). + the `-f' command-line option (*note Options::). - * The `IGNORECASE' variable and its effects (*note Case Sensitivity - in Matching: Case-sensitivity.). + * The `IGNORECASE' variable and its effects (*note + Case-sensitivity::). * The `/dev/stdin', `/dev/stdout', `/dev/stderr' and `/dev/fd/N' - special file names (*note Special File Names in `gawk': Special - Files.). + special file names (*note Special Files::). Version 2.13 of `gawk' introduced the following features: - * The `FIELDWIDTHS' variable and its effects (*note Reading - Fixed-Width Data: Constant Size.). + * The `FIELDWIDTHS' variable and its effects (*note Constant Size::). * The `systime' and `strftime' built-in functions for obtaining and - printing timestamps (*note Using `gawk''s Timestamp Functions: - Time Functions.). + printing timestamps (*note Time Functions::). * The `-W lint' option to provide error and portability checking for - both the source code and at runtime (*note Command-Line Options: - Options.). + both the source code and at runtime (*note Options::). * The `-W compat' option to turn off the GNU extensions (*note - Command-Line Options: Options.). + Options::). - * The `-W posix' option for full POSIX compliance (*note - Command-Line Options: Options.). + * The `-W posix' option for full POSIX compliance (*note Options::). Version 2.14 of `gawk' introduced the following feature: * The `next file' statement for skipping to the next data file - (*note Using `gawk''s `nextfile' Statement: Nextfile Statement.). + (*note Nextfile Statement::). Version 2.15 of `gawk' introduced the following features: @@ -16722,74 +16662,65 @@ options (*note Command-Line Options: Options.). `getline' returns -1 or `close' fails (*note Built-in Variables::). * The `/dev/pid', `/dev/ppid', `/dev/pgrpid', and `/dev/user' file - name interpretation (*note Special File Names in `gawk': Special - Files.). + name interpretation (*note Special Files::). * The ability to delete all of an array at once with `delete ARRAY' - (*note The `delete' Statement: Delete.). + (*note Delete::). * The ability to use GNU-style long-named options that start with - `--' (*note Command-Line Options: Options.). + `--' (*note Options::). * The `--source' option for mixing command-line and library-file - source code (*note Command-Line Options: Options.). + source code (*note Options::). Version 3.0 of `gawk' introduced the following features: * `IGNORECASE' changed, now applying to string comparison as well as - regexp operations (*note Case Sensitivity in Matching: - Case-sensitivity.). + regexp operations (*note Case-sensitivity::). * The `RT' variable that contains the input text that matched `RS' - (*note How Input Is Split into Records: Records.). + (*note Records::). - * Full support for both POSIX and GNU regexps (*note Regular - Expressions: Regexp.). + * Full support for both POSIX and GNU regexps (*note Regexp::). * The `gensub' function for more powerful text manipulation (*note - String Manipulation Functions: String Functions.). + String Functions::). * The `strftime' function acquired a default time format, allowing - it to be called with no arguments (*note Using `gawk''s Timestamp - Functions: Time Functions.). + it to be called with no arguments (*note Time Functions::). * The ability for `FS' and for the third argument to `split' to be - null strings (*note Making Each Character a Separate Field: Single - Character Fields.). + null strings (*note Single Character Fields::). - * The ability for `RS' to be a regexp (*note How Input Is Split into - Records: Records.). + * The ability for `RS' to be a regexp (*note Records::). - * The `next file' statement became `nextfile' (*note Using `gawk''s - `nextfile' Statement: Nextfile Statement.). + * The `next file' statement became `nextfile' (*note Nextfile + Statement::). * The `--lint-old' option to warn about constructs that are not available in the original Version 7 Unix version of `awk' (*note - Major Changes Between V7 and SVR3.1: V7/SVR3.1.). + V7/SVR3.1::). * The `-m' option and the `fflush' function from the Bell - Laboratories research version of `awk' (*note Command-Line - Options: Options.; also *note Input/Output Functions: I/O - Functions.). + Laboratories research version of `awk' (*note Options::; also + *note I/O Functions::). * The `--re-interval' option to provide interval expressions in - regexps (*note Regular Expression Operators: Regexp Operators.). + regexps (*note Regexp Operators::). * The `--traditional' option was added as a better name for - `--compat' (*note Command-Line Options: Options.). + `--compat' (*note Options::). * The use of GNU Autoconf to control the configuration process - (*note Compiling `gawk' for Unix: Quick Installation.). + (*note Quick Installation::). - * Amiga support (*note Installing `gawk' on an Amiga: Amiga - Installation.). + * Amiga support (*note Amiga Installation::). Version 3.1 of `gawk' introduced the following features: * The `BINMODE' special variable for non-POSIX systems, which allows - binary I/O for input and/or output files (*note Using `gawk' on PC - Operating Systems: PC Using.). + binary I/O for input and/or output files (*note PC Using::). * The `LINT' special variable, which dynamically controls lint warnings (*note Built-in Variables::). @@ -16799,88 +16730,81 @@ options (*note Command-Line Options: Options.). * The `TEXTDOMAIN' special variable for setting an application's internationalization text domain (*note Built-in Variables::, and - *Note Internationalization with `gawk': Internationalization). + *Note Internationalization::). * The ability to use octal and hexadecimal constants in `awk' - program source code (*note Octal and Hexadecimal Numbers: - Nondecimal-numbers.). + program source code (*note Nondecimal-numbers::). - * The `|&' operator for two-way I/O to a coprocess (*note Two-Way - Communications with Another Process: Two-way I/O.). + * The `|&' operator for two-way I/O to a coprocess (*note Two-way + I/O::). * The `/inet' special files for TCP/IP networking using `|&' (*note - Using `gawk' for Network Programming: TCP/IP Networking.). + TCP/IP Networking::). * The optional second argument to `close' that allows closing one end - of a two-way pipe to a coprocess (*note Two-Way Communications - with Another Process: Two-way I/O.). + of a two-way pipe to a coprocess (*note Two-way I/O::). * The optional third argument to the `match' function for capturing text-matching subexpressions within a regexp (*note String - Manipulation Functions: String Functions.). + Functions::). * Positional specifiers in `printf' formats for making translations - easier (*note Rearranging `printf' Arguments: Printf Ordering.). + easier (*note Printf Ordering::). - * The `asort' and `asorti' functions for sorting arrays (*note - Sorting Array Values and Indices with `gawk': Array Sorting.). + * The `asort' and `asorti' functions for sorting arrays (*note Array + Sorting::). * The `bindtextdomain', `dcgettext' and `dcngettext' functions for - internationalization (*note Internationalizing `awk' Programs: - Programmer i18n.). + internationalization (*note Programmer i18n::). * The `extension' built-in function and the ability to add new - built-in functions dynamically (*note Adding New Built-in - Functions to `gawk': Dynamic Extensions.). + built-in functions dynamically (*note Dynamic Extensions::). - * The `mktime' built-in function for creating timestamps (*note - Using `gawk''s Timestamp Functions: Time Functions.). + * The `mktime' built-in function for creating timestamps (*note Time + Functions::). * The `and', `or', `xor', `compl', `lshift', `rshift', and - `strtonum' built-in functions (*note Using `gawk''s Bit - Manipulation Functions: Bitwise Functions.). + `strtonum' built-in functions (*note Bitwise Functions::). * The support for `next file' as two words was removed completely - (*note Using `gawk''s `nextfile' Statement: Nextfile Statement.). + (*note Nextfile Statement::). * The `--dump-variables' option to print a list of all global - variables (*note Command-Line Options: Options.). + variables (*note Options::). * The `--gen-po' command-line option and the use of a leading - underscore to mark strings that should be translated (*note - Extracting Marked Strings: String Extraction.). + underscore to mark strings that should be translated (*note String + Extraction::). * The `--non-decimal-data' option to allow non-decimal input data - (*note Allowing Nondecimal Input Data: Nondecimal Data.). + (*note Nondecimal Data::). * The `--profile' option and `pgawk', the profiling version of `gawk', for producing execution profiles of `awk' programs (*note - Profiling Your `awk' Programs: Profiling.). + Profiling::). * The `--enable-portals' configuration option to enable special treatment of pathnames that begin with `/p' as BSD portals (*note - Using `gawk' with BSD Portals: Portal Files.). + Portal Files::). * The use of GNU Automake to help in standardizing the configuration - process (*note Compiling `gawk' for Unix: Quick Installation.). + process (*note Quick Installation::). * The use of GNU `gettext' for `gawk''s own message output (*note - `gawk' Can Speak Your Language: Gawk I18N.). + Gawk I18N::). - * BeOS support (*note Installing `gawk' on BeOS: BeOS Installation.). + * BeOS support (*note BeOS Installation::). - * Tandem support (*note Installing `gawk' on a Tandem: Tandem - Installation.). + * Tandem support (*note Tandem Installation::). - * The Atari port became officially unsupported (*note Installing - `gawk' on the Atari ST: Atari Installation.). + * The Atari port became officially unsupported (*note Atari + Installation::). * 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.). + at compile time (*note Additional Configuration Options::). @@ -16937,7 +16861,7 @@ Info file, in approximate chronological order: * Scott Deifik currently maintains the MS-DOS port. - * Juan Grigera maintains the port to Win32 systems. + * Juan Grigera maintains the port to Windows32 systems. * Dr. Darrel Hankerson acts as coordinator for the various ports to different PC platforms and creates binary distributions for @@ -16968,6 +16892,12 @@ Info file, in approximate chronological order: Isamu Hasegawa, of IBM in Japan, contributed support for multibyte characters. + Michael Benzinger contributed the initial code for `switch' + statements. + + Patrick T.J. McPhee contributed the code for dynamic loading in + Windows32 environments. + * Arnold Robbins has been working on `gawk' since 1988, at first helping David Trueman, and as the primary maintainer since around 1994. @@ -16981,8 +16911,8 @@ Installing `gawk' This appendix provides instructions for installing `gawk' on the various platforms that are supported by the developers. The primary developer supports GNU/Linux (and Unix), whereas the other ports are -contributed. *Note Reporting Problems and Bugs: Bugs, for the -electronic mail addresses of the people who did the respective ports. +contributed. *Note Bugs::, for the electronic mail addresses of the +people who did the respective ports. * Menu: @@ -16996,7 +16926,7 @@ electronic mail addresses of the people who did the respective ports. implementations. -File: gawk.info, Node: Gawk Distribution, Next: Unix Installation, Prev: Installation, Up: Installation +File: gawk.info, Node: Gawk Distribution, Next: Unix Installation, Up: Installation The `gawk' Distribution ======================= @@ -17011,7 +16941,7 @@ extract it, and then what is in the various files and subdirectories. * Distribution contents:: What is in the distribution. -File: gawk.info, Node: Getting, Next: Extracting, Prev: Gawk Distribution, Up: Gawk Distribution +File: gawk.info, Node: Getting, Next: Extracting, Up: Gawk Distribution Getting the `gawk' Distribution ------------------------------- @@ -17053,20 +16983,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.2.tar.gz'), + Once you have the distribution (for example, `gawk-3.1.3.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.2.tar.gz | tar -xvpf - + gzip -d -c gawk-3.1.3.tar.gz | tar -xvpf - -This creates a directory named `gawk-3.1.2' in the current directory. +This creates a directory named `gawk-3.1.3' 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 2, but when retrieving distributions, you should get the +level is 3, 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 @@ -17082,9 +17012,8 @@ Contents of the `gawk' Distribution The `gawk' distribution has a number of C source files, documentation files, subdirectories, and files related to the -configuration process (*note Compiling and Installing `gawk' on Unix: -Unix Installation.), as well as several subdirectories related to -different non-Unix operating systems: +configuration process (*note Unix Installation::), as well as several +subdirectories related to different non-Unix operating systems: Various `.c', `.y', and `.h' files The actual `gawk' source code. @@ -17161,8 +17090,7 @@ Various `.c', `.y', and `.h' files `doc/igawk.1' The `troff' source for a manual page describing the `igawk' - program presented in *Note An Easy Way to Use Library Functions: - Igawk Program. + program presented in *Note Igawk Program::. `doc/Makefile.in' The input file used during the configuration process to generate @@ -17184,8 +17112,8 @@ Various `.c', `.y', and `.h' files `missing_d/*' `m4/*' These files and subdirectories are used when configuring `gawk' - for various Unix systems. They are explained in *Note Compiling - and Installing `gawk' on Unix: Unix Installation. + for various Unix systems. They are explained in *Note Unix + Installation::. `intl/*' `po/*' @@ -17198,38 +17126,35 @@ Various `.c', `.y', and `.h' files `awklib/Makefile.in' `awklib/eg/*' The `awklib' directory contains a copy of `extract.awk' (*note - Extracting Programs from Texinfo Source Files: Extract Program.), - which can be used to extract the sample programs from the Texinfo - source file for this Info file. It also contains a `Makefile.in' - file, which `configure' uses to generate a `Makefile'. - `Makefile.am' is used by GNU Automake to create `Makefile.in'. - The library functions from *Note A Library of `awk' Functions: - Library Functions, and the `igawk' program from *Note An Easy Way - to Use Library Functions: Igawk Program, are included as - ready-to-use files in the `gawk' distribution. They are installed - as part of the installation process. The rest of the programs in - this Info file are available in appropriate subdirectories of - `awklib/eg'. + Extract Program::), which can be used to extract the sample + programs from the Texinfo source file for this Info file. It also + contains a `Makefile.in' file, which `configure' uses to generate + a `Makefile'. `Makefile.am' is used by GNU Automake to create + `Makefile.in'. The library functions from *Note Library + Functions::, and the `igawk' program from *Note Igawk Program::, + are included as ready-to-use files in the `gawk' distribution. + They are installed as part of the installation process. The rest + of the programs in this Info file are available in appropriate + subdirectories of `awklib/eg'. `unsupported/atari/*' - Files needed for building `gawk' on an Atari ST (*note Installing - `gawk' on the Atari ST: Atari Installation., for details). + Files needed for building `gawk' on an Atari ST (*note Atari + Installation::, for details). `unsupported/tandem/*' - Files needed for building `gawk' on a Tandem (*note Installing - `gawk' on a Tandem: Tandem Installation., for details). + Files needed for building `gawk' on a Tandem (*note Tandem + Installation::, for details). `posix/*' Files needed for building `gawk' on POSIX-compliant systems. `pc/*' Files needed for building `gawk' under MS-DOS, MS Windows and OS/2 - (*note Installation on PC Operating Systems: PC Installation., for - details). + (*note PC Installation::, for details). `vms/*' - Files needed for building `gawk' under VMS (*note How to Compile - and Install `gawk' on VMS: VMS Installation., for details). + Files needed for building `gawk' under VMS (*note VMS + Installation::, for details). `test/*' A test suite for `gawk'. You can use `make check' from the @@ -17254,13 +17179,13 @@ configure `gawk' for your system yourself. * Configuration Philosophy:: How it's all supposed to work. -File: gawk.info, Node: Quick Installation, Next: Additional Configuration Options, Prev: Unix Installation, Up: Unix Installation +File: gawk.info, Node: Quick Installation, Next: Additional Configuration Options, Up: Unix Installation Compiling `gawk' for Unix ------------------------- After you have extracted the `gawk' distribution, `cd' to -`gawk-3.1.2'. Like most GNU software, `gawk' is configured +`gawk-3.1.3'. 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 @@ -17295,7 +17220,7 @@ run `make check'. All of the tests should succeed. If these steps do not work, or if any of the tests fail, check the files in the `README_d' directory to see if you've found a known problem. If the failure is not described there, please send in a bug report (*note -Reporting Problems and Bugs: Bugs..) +Bugs::.) File: gawk.info, Node: Additional Configuration Options, Next: Configuration Philosophy, Prev: Quick Installation, Up: Unix Installation @@ -17308,8 +17233,11 @@ command line when compiling `gawk' from scratch, including: `--enable-portals' Treat pathnames that begin with `/p' as BSD portal files when - doing two-way I/O with the `|&' operator (*note Using `gawk' with - BSD Portals: Portal Files.). + doing two-way I/O with the `|&' operator (*note Portal Files::). + +`--enable-switch' + Enable the recognition and execution of C-style `switch' statements + in `awk' programs (*note Switch Statement::.) `--with-included-gettext' Use the version of the `gettext' library that comes with `gawk'. @@ -17319,10 +17247,9 @@ command line when compiling `gawk' from scratch, including: `--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. + `--lint' and `--lint-old' options (*note Options::) are accepted, + but silently do nothing. Similarly, setting the `LINT' variable + (*note 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 @@ -17380,10 +17307,9 @@ is automatically included by `config.h'. `autoconf' will not work on your system in some other fashion. If you do have a problem, the file `configure.in' is the input for `autoconf'. You may be able to change this file and generate a new version of -`configure' that works on your system (*note Reporting Problems and -Bugs: Bugs., for information on how to report problems in configuring -`gawk'). The same mechanism may be used to send in updates to -`configure.in' and/or `custom.h'. +`configure' that works on your system (*note Bugs::, for information on +how to report problems in configuring `gawk'). The same mechanism may +be used to send in updates to `configure.in' and/or `custom.h'. File: gawk.info, Node: Non-Unix Installation, Next: Unsupported, Prev: Unix Installation, Up: Installation @@ -17403,7 +17329,7 @@ systems. * VMS Installation:: Installing `gawk' on VMS. -File: gawk.info, Node: Amiga Installation, Next: BeOS Installation, Prev: Non-Unix Installation, Up: Non-Unix Installation +File: gawk.info, Node: Amiga Installation, Next: BeOS Installation, Up: Non-Unix Installation Installing `gawk' on an Amiga ----------------------------- @@ -17433,8 +17359,7 @@ running `configure': configure -v m68k-amigaos Then run `make' and you should be all set! If these steps do not -work, please send in a bug report (*note Reporting Problems and Bugs: -Bugs.). +work, please send in a bug report (*note Bugs::). File: gawk.info, Node: BeOS Installation, Next: PC Installation, Prev: Amiga Installation, Up: Non-Unix Installation @@ -17466,7 +17391,7 @@ then `make install': BeOS uses `bash' as its shell; thus, you use `gawk' the same way you would under Unix. If these steps do not work, please send in a bug -report (*note Reporting Problems and Bugs: Bugs.). +report (*note Bugs::). File: gawk.info, Node: PC Installation, Next: VMS Installation, Prev: BeOS Installation, Up: Non-Unix Installation @@ -17476,26 +17401,28 @@ Installation on PC Operating Systems This minor node covers installation and usage of `gawk' on x86 machines running DOS, any version of Windows, or OS/2. In this minor -node, the term "Win32" refers to any of Windows-95/98/ME/NT/2000. +node, the term "Windows32" refers to any of Windows-95/98/ME/NT/2000. The limitations of DOS (and DOS shells under Windows or OS/2) has meant that various "DOS extenders" are often used with programs such as -`gawk'. The varying capabilities of Microsoft Windows 3.1 and Win32 -can add to the confusion. For an overview of the considerations, -please refer to `README_d/README.pc' in the distribution. +`gawk'. The varying capabilities of Microsoft Windows 3.1 and +Windows32 can add to the confusion. For an overview of the +considerations, please refer to `README_d/README.pc' in the +distribution. * Menu: * PC Binary Installation:: Installing a prepared distribution. -* PC Compiling:: Compiling `gawk' for MS-DOS, Win32, +* PC Compiling:: Compiling `gawk' for MS-DOS, Windows32, and OS/2. -* PC Using:: Running `gawk' on MS-DOS, Win32 and +* PC Dynamic:: Compiling `gawk' for dynamic libraries. +* PC Using:: Running `gawk' on MS-DOS, Windows32 and OS/2. * Cygwin:: Building and running `gawk' for Cygwin. -File: gawk.info, Node: PC Binary Installation, Next: PC Compiling, Prev: PC Installation, Up: PC Installation +File: gawk.info, Node: PC Binary Installation, Next: PC Compiling, Up: PC Installation Installing a Prepared Distribution for PC Systems ................................................. @@ -17533,23 +17460,23 @@ set properly. additional or more detailed installation instructions. -File: gawk.info, Node: PC Compiling, Next: PC Using, Prev: PC Binary Installation, Up: PC Installation +File: gawk.info, Node: PC Compiling, Next: PC Dynamic, Prev: PC Binary Installation, Up: PC Installation Compiling `gawk' for PC Operating Systems ......................................... - `gawk' can be compiled for MS-DOS, Win32, and OS/2 using the GNU + `gawk' can be compiled for MS-DOS, Windows32, and OS/2 using the GNU 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. (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 +Mattes (EMX; MS-DOS, Windows32 and OS/2). Microsoft Visual C/C++ can +be used to build a Windows32 version, and Microsoft C/C++ can be used +to build 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 + To build `gawk' for MS-DOS, Windows32, 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 @@ -17557,9 +17484,9 @@ 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 -`make' command is given without a target. As an example, to build `gawk' -using the DJGPP tools, enter `make djgpp'. +MS-DOS, Windows32, and OS/2 versions. A list of targets is printed if +the `make' command is given without a target. As an example, to build +`gawk' using the DJGPP tools, enter `make djgpp'. Using `make' to run the standard tests and to install `gawk' requires additional Unix-like tools, including `sh', `sed', and `cp'. @@ -17641,22 +17568,67 @@ 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 +File: gawk.info, Node: PC Dynamic, Next: PC Using, Prev: PC Compiling, Up: PC Installation + +Compiling `gawk' For Dynamic Libraries +...................................... + + To compile `gawk' with dynamic extension support, uncomment the +definitions of `DYN_FLAGS', `DYN_EXP', `DYN_OBJ', and `DYN_MAKEXP' in +the configuration section of the `Makefile'. There are two definitions +for `DYN_MAKEXP': pick the one that matches your target. + + To build some of the example extension libraries, `cd' to the +extension directory and copy `Makefile.pc' to `Makefile'. You can then +build using the same two targets. To run the example `awk' scripts, +you'll need to either change the call to the `extension' function to +match the name of the library (for instance, change `"./ordchr.so"' to +`"ordchr.dll"' or simply `"ordchr"'), or rename the library to match +the call (for instance, rename `ordchr.dll' to `ordchr.so'). + + If you build `gawk.exe' with one compiler but want to build an +extension library with the other, you need to copy the import library. +Visual C uses a library called `gawk.lib', while MinGW uses a library +called `libgawk.a'. These files are equivalent and will interoperate if +you give them the correct name. The resulting shared libraries are +also interoperable. + + To create your own extension library, you can use the examples as +models, but you're essentially on your own. Post to `comp.lang.awk' or +send electronic mail to <ptjm@interlog.com> if you have problems getting +started. If you need to access functions or variables which are not +exported by `gawk.exe', add them to `gawkw32.def' and rebuild. You +should also add `ATTRIBUTE_EXPORTED' to the declaration in `awk.h' of +any variables you add to `gawkw32.def'. + + Note that extension libraries have the name of the `awk' executable +embedded in them at link time, so they will work only with `gawk.exe'. +In particular, they won't work if you rename `gawk.exe' to `awk.exe' or +if you try to use `pgawk.exe'. You can perform profiling by temporarily +renaming `pgawk.exe' to `gawk.exe'. You can resolve this problem by +changing the program name in the definition of `DYN_MAKEXP' for your +compiler. + + On Windows32, libraries are sought first in the current directory, +then in the directory containing `gawk.exe', and finally through the +`PATH' environment variable. + + +File: gawk.info, Node: PC Using, Next: Cygwin, Prev: PC Dynamic, Up: PC Installation Using `gawk' on PC Operating Systems .................................... With the exception of the Cygwin environment, the `|&' operator and -TCP/IP networking (*note Using `gawk' for Network Programming: TCP/IP -Networking.) are not supported for MS-DOS or MS-Windows. EMX (OS/2 -only) does support at least the `|&' operator. +TCP/IP networking (*note TCP/IP Networking::) are not supported for +MS-DOS or MS-Windows. EMX (OS/2 only) does support at least the `|&' +operator. The OS/2 and MS-DOS versions of `gawk' search for program files as -described in *Note The `AWKPATH' Environment Variable: AWKPATH Variable. -However, semicolons (rather than colons) separate elements in the -`AWKPATH' variable. If `AWKPATH' is not set or is empty, then the -default search path for OS/2 (16 bit) and MS-DOS versions is -`".;c:/lib/awk;c:/gnu/lib/awk"'. +described in *Note AWKPATH Variable::. However, semicolons (rather +than colons) separate elements in the `AWKPATH' variable. If `AWKPATH' +is not set or is empty, then the default search path for OS/2 (16 bit) +and MS-DOS versions is `".;c:/lib/awk;c:/gnu/lib/awk"'. The search path for OS/2 (32 bit, EMX) is determined by the prefix directory (most likely `/usr' or `c:/usr') that has been specified as @@ -17706,16 +17678,16 @@ accomplished by using an appropriate `-v BINMODE=N' option on the command line. `BINMODE' is set at the time a file or pipe is opened and cannot be changed mid-stream. - The name `BINMODE' was chosen to match `mawk' (*note Other Freely -Available `awk' Implementations: Other Versions.). Both `mawk' and -`gawk' handle `BINMODE' similarly; however, `mawk' adds a `-W -BINMODE=N' option and an environment variable that can set `BINMODE', -`RS', and `ORS'. The files `binmode[1-3].awk' (under `gnu/lib/awk' in -some of the prepared distributions) have been chosen to match `mawk''s -`-W BINMODE=N' option. These can be changed or discarded; in -particular, the setting of `RS' giving the fewest "surprises" is open -to debate. `mawk' uses `RS = "\r\n"' if binary mode is set on read, -which is appropriate for files with the DOS-style end-of-line. + The name `BINMODE' was chosen to match `mawk' (*note Other +Versions::). Both `mawk' and `gawk' handle `BINMODE' similarly; +however, `mawk' adds a `-W BINMODE=N' option and an environment +variable that can set `BINMODE', `RS', and `ORS'. The files +`binmode[1-3].awk' (under `gnu/lib/awk' in some of the prepared +distributions) have been chosen to match `mawk''s `-W BINMODE=N' +option. These can be changed or discarded; in particular, the setting +of `RS' giving the fewest "surprises" is open to debate. `mawk' uses +`RS = "\r\n"' if binary mode is set on read, which is appropriate for +files with the DOS-style end-of-line. To illustrate, the following examples set binary mode on writes for standard output and other files, and set `ORS' as the "usual" DOS-style @@ -17752,8 +17724,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.2.tar.gz - cd gawk-3.1.2 + tar -xvpzf gawk-3.1.3.tar.gz + cd gawk-3.1.3 ./configure make @@ -17761,10 +17733,9 @@ and installation for Cygwin is the same as for a Unix system: on Cygwin takes considerably longer. However, it does finish, and then the `make' proceeds as usual. - *Note:* The `|&' operator and TCP/IP networking (*note Using `gawk' -for Network Programming: TCP/IP Networking.) are fully supported in -the Cygwin environment. This is not true for any other environment for -MS-DOS or MS-Windows. + *Note:* The `|&' operator and TCP/IP networking (*note TCP/IP +Networking::) are fully supported in the Cygwin environment. This is +not true for any other environment for MS-DOS or MS-Windows. ---------- Footnotes ---------- @@ -17786,7 +17757,7 @@ How to Compile and Install `gawk' on VMS * VMS POSIX:: Alternate instructions for VMS POSIX. -File: gawk.info, Node: VMS Compilation, Next: VMS Installation Details, Prev: VMS Installation, Up: VMS Installation +File: gawk.info, Node: VMS Compilation, Next: VMS Installation Details, Up: VMS Installation Compiling `gawk' on VMS ....................... @@ -17950,7 +17921,7 @@ longer supported. * Tandem Installation:: Installing `gawk' on a Tandem. -File: gawk.info, Node: Atari Installation, Next: Tandem Installation, Prev: Unsupported, Up: Unsupported +File: gawk.info, Node: Atari Installation, Next: Tandem Installation, Up: Unsupported Installing `gawk' on the Atari ST --------------------------------- @@ -17967,12 +17938,12 @@ exactly right). In order to use `gawk', you need to have a shell, either text or graphics, that does not map all the characters of a command line to uppercase. Maintaining case distinction in option flags is very -important (*note Command-Line Options: Options.). These days this is -the default and it may only be a problem for some very old machines. -If your system does not preserve the case of option flags, you need to -upgrade your tools. Support for I/O redirection is necessary to make -it easy to import `awk' programs from other environments. Pipes are -nice to have but not vital. +important (*note Options::). These days this is the default and it may +only be a problem for some very old machines. If your system does not +preserve the case of option flags, you need to upgrade your tools. +Support for I/O redirection is necessary to make it easy to import +`awk' programs from other environments. Pipes are nice to have but not +vital. * Menu: @@ -17980,7 +17951,7 @@ nice to have but not vital. * Atari Using:: Running `gawk' on Atari. -File: gawk.info, Node: Atari Compiling, Next: Atari Using, Prev: Atari Installation, Up: Atari Installation +File: gawk.info, Node: Atari Compiling, Next: Atari Using, Up: Atari Installation Compiling `gawk' on the Atari ST ................................ @@ -18008,7 +17979,7 @@ versions and possibly make adjustments. `atarist'. This basically assumes the TOS environment with `gcc'. Modify these sections as appropriate if they are not right for your environment. Also see the remarks about `AWKPATH' and `envsep' in -*Note Running `gawk' on the Atari ST: Atari Using. +*Note Atari Using::. As shipped, the sample `config.h' claims that the `system' function is missing from the libraries, which is not true, and an alternative @@ -18036,17 +18007,17 @@ nor `TMPDIR' are found, then `gawk' uses the current directory for its temporary files. The ST version of `gawk' searches for its program files, as -described in *Note The `AWKPATH' Environment Variable: AWKPATH Variable. -The default value for the `AWKPATH' variable is taken from `DEFPATH' -defined in `Makefile'. The sample `gcc'/TOS `Makefile' for the ST in -the distribution sets `DEFPATH' to `".,c:\lib\awk,c:\gnu\lib\awk"'. -The search path can be modified by explicitly setting `AWKPATH' to -whatever you want. Note that colons cannot be used on the ST to -separate elements in the `AWKPATH' variable, since they have another -reserved meaning. Instead, you must use a comma to separate elements -in the path. When recompiling, the separating character can be -modified by initializing the `envsep' variable in -`unsupported/atari/gawkmisc.atr' to another value. +described in *Note AWKPATH Variable::. The default value for the +`AWKPATH' variable is taken from `DEFPATH' defined in `Makefile'. The +sample `gcc'/TOS `Makefile' for the ST in the distribution sets +`DEFPATH' to `".,c:\lib\awk,c:\gnu\lib\awk"'. The search path can be +modified by explicitly setting `AWKPATH' to whatever you want. Note +that colons cannot be used on the ST to separate elements in the +`AWKPATH' variable, since they have another reserved meaning. Instead, +you must use a comma to separate elements in the path. When +recompiling, the separating character can be modified by initializing +the `envsep' variable in `unsupported/atari/gawkmisc.atr' to another +value. Although `awk' allows great flexibility in doing I/O redirections from within a program, this facility should be used with care on the ST @@ -18081,10 +18052,9 @@ no longer has access to a Tandem system. The Tandem port was done on a Cyclone machine running D20. The port is pretty clean and all facilities seem to work except for the I/O -piping facilities (*note Using `getline' from a Pipe: Getline/Pipe., -*Note Using `getline' into a Variable from a Pipe: -Getline/Variable/Pipe, and *Note Redirecting Output of `print' and -`printf': Redirection), which is just too foreign a concept for Tandem. +piping facilities (*note Getline/Pipe::, *Note Getline/Variable/Pipe::, +and *Note Redirection::), which is just too foreign a concept for +Tandem. To build a Tandem executable from source, download all of the files so that the file names on the Tandem box conform to the restrictions of @@ -18103,10 +18073,10 @@ filename/' must be used instead of the usual Unix `<' and `>' for file redirection. (Redirection options on `getline', `print' etc., are supported.) - The `-mr VAL' option (*note Command-Line Options: Options.) has -been "stolen" to enable Tandem users to process fixed-length records -with no "end-of-line" character. That is, `-mr 74' tells `gawk' to read -the input file as fixed 74-byte records. + The `-mr VAL' option (*note Options::) has been "stolen" to enable +Tandem users to process fixed-length records with no "end-of-line" +character. That is, `-mr 74' tells `gawk' to read the input file as +fixed 74-byte records. File: gawk.info, Node: Bugs, Next: Other Versions, Prev: Unsupported, Up: Installation @@ -18208,13 +18178,13 @@ Unix `awk' This version requires an ISO C (1990 standard) compiler; the C compiler from GCC (the GNU Compiler Collection) works quite nicely. - *Note Extensions in the Bell Laboratories `awk': BTL, for a list - of extensions in this `awk' that are not in POSIX `awk'. + *Note BTL::, for a list of extensions in this `awk' that are not + in POSIX `awk'. `mawk' Michael Brennan has written an independent implementation of `awk', - called `mawk'. It is available under the GPL (*note GNU General - Public License: Copying.), just as `gawk' is. + called `mawk'. It is available under the GPL (*note Copying::), + just as `gawk' is. You can get it via anonymous `ftp' to the host `ftp.whidbey.net'. Change directory to `/pub/brennan'. Use "binary" or "image" mode, @@ -18222,39 +18192,35 @@ Unix `awk' there). `gunzip' may be used to decompress this file. Installation is - similar to `gawk''s (*note Compiling and Installing `gawk' on - Unix: Unix Installation.). + similar to `gawk''s (*note Unix Installation::). `mawk' has the following extensions that are not in POSIX `awk': * The `fflush' built-in function for flushing buffered output - (*note Input/Output Functions: I/O Functions.). + (*note I/O Functions::). - * The `**' and `**=' operators (*note Arithmetic Operators: - Arithmetic Ops. and also see *Note Assignment Expressions: - Assignment Ops). + * The `**' and `**=' operators (*note Arithmetic Ops:: and also + see *Note Assignment Ops::). * The use of `func' as an abbreviation for `function' (*note - Function Definition Syntax: Definition Syntax.). + Definition Syntax::). * The `\x' escape sequence (*note Escape Sequences::). * The `/dev/stdout', and `/dev/stderr' special files (*note - Special File Names in `gawk': Special Files.). Use `"-"' - instead of `"/dev/stdin"' with `mawk'. + Special Files::). Use `"-"' instead of `"/dev/stdin"' with + `mawk'. * The ability for `FS' and for the third argument to `split' to - be null strings (*note Making Each Character a Separate - Field: Single Character Fields.). + be null strings (*note Single Character Fields::). * The ability to delete all of an array at once with `delete - ARRAY' (*note The `delete' Statement: Delete.). + ARRAY' (*note Delete::). - * The ability for `RS' to be a regexp (*note How Input Is Split - into Records: Records.). + * The ability for `RS' to be a regexp (*note Records::). * The `BINMODE' special variable for non-Unix operating systems - (*note Using `gawk' on PC Operating Systems: PC Using.). + (*note PC Using::). The next version of `mawk' will support `nextfile'. @@ -18273,10 +18239,9 @@ Unix `awk' `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 + different from `pgawk' (*note 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'. @@ -18304,15 +18269,15 @@ specifically to `gawk' and not to other implementations. * Future Extensions:: New features that may be implemented one day. -File: gawk.info, Node: Compatibility Mode, Next: Additions, Prev: Notes, Up: Notes +File: gawk.info, Node: Compatibility Mode, Next: Additions, Up: Notes Downward Compatibility and Debugging ==================================== - *Note Extensions in `gawk' Not in POSIX `awk': POSIX/GNU, for a -summary of the GNU extensions to the `awk' language and program. All -of these features can be turned off by invoking `gawk' with the -`--traditional' option or with the `--posix' option. + *Note POSIX/GNU::, for a summary of the GNU extensions to the `awk' +language and program. All of these features can be turned off by +invoking `gawk' with the `--traditional' option or with the `--posix' +option. If `gawk' is compiled for debugging with `-DDEBUG', then there is one more option available on the command line: @@ -18335,7 +18300,7 @@ Making Additions to `gawk' If you find that you want to enhance `gawk' in a significant fashion, you are perfectly free to do so. That is the point of having free software; the source code is available and you are free to change -it as you want (*note GNU General Public License: Copying.). +it as you want (*note Copying::). This minor node discusses the ways you might want to change `gawk' as well as any considerations you should bear in mind. @@ -18348,7 +18313,7 @@ as well as any considerations you should bear in mind. system. -File: gawk.info, Node: Adding Code, Next: New Ports, Prev: Additions, Up: Additions +File: gawk.info, Node: Adding Code, Next: New Ports, Up: Additions Adding New Features ------------------- @@ -18359,16 +18324,15 @@ distribution, there are several steps that you need to take in order to make it possible for me to include your changes: 1. Before building the new feature into `gawk' itself, consider - writing it as an extension module (*note Adding New Built-in - Functions to `gawk': Dynamic Extensions.). If that's not - possible, continue with the rest of the steps in this list. + writing it as an extension module (*note Dynamic Extensions::). + If that's not possible, continue with the rest of the steps in + this list. 2. Get the latest version. It is much easier for me to integrate changes if they are relative to the most recent distributed version of `gawk'. If your version of `gawk' is very old, I may - not be able to integrate them at all. (*Note Getting the `gawk' - Distribution: Getting, for information on getting the latest - version of `gawk'.) + not be able to integrate them at all. (*Note Getting::, for + information on getting the latest version of `gawk'.) 3. See *note (Version)Top:: standards, GNU Coding Standards. This document describes how GNU software should be written. If you @@ -18443,8 +18407,8 @@ make it possible for me to include your changes: changes in the public domain and submit a signed statement to that effect, or assign the copyright in your changes to the FSF. Both of these actions are easy to do and _many_ people have done so - already. If you have questions, please contact me (*note Reporting - Problems and Bugs: Bugs.), or <gnu@gnu.org>. + already. If you have questions, please contact me (*note Bugs::), + or <gnu@gnu.org>. 6. Update the documentation. Along with your new code, please supply new sections and/or chapters for this Info file. If at all @@ -18463,8 +18427,8 @@ make it possible for me to include your changes: with your version. (I find context diffs to be more readable but unified diffs are more compact.) I recommend using the GNU version of `diff'. Send the output produced by either run of - `diff' to me when you submit your changes. (*Note Reporting - Problems and Bugs: Bugs, for the electronic mail information.) + `diff' to me when you submit your changes. (*Note Bugs::, for the + electronic mail information.) Using this format makes it easy for me to apply your changes to the master version of the `gawk' source code (using `patch'). If I @@ -18489,8 +18453,8 @@ Porting `gawk' to a New Operating System If you want to port `gawk' to a new operating system, there are several steps: - 1. Follow the guidelines in *Note Adding New Features: Adding Code, - concerning coding style, submission of diffs, and so on. + 1. Follow the guidelines in *Note Adding Code::, concerning coding + style, submission of diffs, and so on. 2. When doing a port, bear in mind that your code must coexist peacefully with the rest of `gawk' and the other ports. Avoid @@ -18501,8 +18465,7 @@ several steps: If the changes needed for a particular system affect too much of the code, I probably will not accept them. In such a case, you can, of course, distribute your changes on your own, as long as - you comply with the GPL (*note GNU General Public License: - Copying.). + you comply with the GPL (*note Copying::). 3. A number of the files that come with `gawk' are maintained by other people at the Free Software Foundation. Thus, you should not @@ -18589,7 +18552,7 @@ have to re-do everything, perhaps from scratch, upon the next release. * Sample Library:: A example of new functions. -File: gawk.info, Node: Internals, Next: Sample Library, Prev: Dynamic Extensions, Up: Dynamic Extensions +File: gawk.info, Node: Internals, Next: Sample Library, Up: Dynamic Extensions A Minimal Introduction to `gawk' Internals ------------------------------------------ @@ -18718,8 +18681,10 @@ when writing extensions. The next minor node shows how they are used: An argument that is supposed to be an array needs to be handled with some extra code, in case the array being passed in is actually from a -function parameter. The following boilerplate code shows how to do -this: +function parameter. + + In versions of `gawk' up to and including 3.1.2, the following +boilerplate code shows how to do this: NODE *the_arg; @@ -18741,6 +18706,20 @@ this: the_arg->type = Node_var_array; assoc_clear(the_arg); + For versions 3.1.3 and later, the internals changed. In particular, +the interface was actually _simplified_ drastically. The following +boilerplate code now suffices: + + NODE *the_arg; + + the_arg = get_argument(tree, 2); /* assume need 3rd arg, 0-based */ + + /* force it to be an array: */ + the_arg = get_array(the_arg); + + /* if necessary, clear it: */ + assoc_clear(the_arg); + Again, you should spend time studying the `gawk' internals; don't just blindly copy this code. @@ -18762,7 +18741,7 @@ implements these functions for `gawk' in an external extension library. * Using Internal File Ops:: How to use an external extension. -File: gawk.info, Node: Internal File Description, Next: Internal File Ops, Prev: Sample Library, Up: Sample Library +File: gawk.info, Node: Internal File Description, Next: Internal File Ops, Up: Sample Library Using `chdir' and `stat' ........................ @@ -18833,7 +18812,7 @@ fails. It fills in the following elements: `"ctime"' The file's last access, modification, and inode update times, respectively. These are numeric timestamps, suitable for - formatting with `strftime' (*note Built-in Functions: Built-in.). + formatting with `strftime' (*note Built-in::). `"pmode"' The file's "printable mode." This is a string representation of @@ -18866,8 +18845,8 @@ fails. It fills in the following elements: Several additional elements may be present depending upon the operating system and the type of the file. You can test for them in -your `awk' program by using the `in' operator (*note Referring to an -Array Element: Reference to Elements.): +your `awk' program by using the `in' operator (*note Reference to +Elements::): `"blksize"' The preferred block size for I/O to the file. This field is not @@ -19174,13 +19153,13 @@ More `lint' warnings source code easier to work with: Loadable module mechanics - The current extension mechanism works (*note Adding New Built-in - Functions to `gawk': Dynamic Extensions.), but is rather - primitive. It requires a fair amount of manual work to create and - integrate a loadable module. Nor is the current mechanism as - portable as might be desired. The GNU `libtool' package provides - a number of features that would make using loadable modules much - easier. `gawk' should be changed to use `libtool'. + The current extension mechanism works (*note Dynamic Extensions::), + but is rather primitive. It requires a fair amount of manual work + to create and integrate a loadable module. Nor is the current + mechanism as portable as might be desired. The GNU `libtool' + package provides a number of features that would make using + loadable modules much easier. `gawk' should be changed to use + `libtool'. Loadable module internals The API to its internals that `gawk' "exports" should be revised. @@ -19222,8 +19201,8 @@ Compilation of `awk' programs Finally, the programs in the test suite could use documenting in this Info file. - *Note Making Additions to `gawk': Additions, if you are interested -in tackling any of these projects. + *Note Additions::, if you are interested in tackling any of these +projects. File: gawk.info, Node: Basic Concepts, Next: Glossary, Prev: Notes, Up: Top @@ -19245,7 +19224,7 @@ other introductory texts that you should refer to instead.) * Floating Point Issues:: Stuff to know about floating-point numbers. -File: gawk.info, Node: Basic High Level, Next: Basic Data Typing, Prev: Basic Concepts, Up: Basic Concepts +File: gawk.info, Node: Basic High Level, Next: Basic Data Typing, Up: Basic Concepts What a Program Does =================== @@ -19282,7 +19261,7 @@ Initialization These are the things you do before actually starting to process data, such as checking arguments, initializing any data you need to work with, and so on. This step corresponds to `awk''s `BEGIN' - rule (*note The `BEGIN' and `END' Special Patterns: BEGIN/END.). + rule (*note BEGIN/END::). If you were baking a cake, this might consist of laying out all the mixing bowls and the baking pan, and making sure you have all the @@ -19295,8 +19274,7 @@ Processing In most programming languages, you have to manually manage the reading of data, checking to see if there is more each time you read a chunk. `awk''s pattern-action paradigm (*note Getting - Started with `awk': Getting Started.) handles the mechanics of - this for you. + Started::) handles the mechanics of this for you. In baking a cake, the processing corresponds to the actual labor: breaking eggs, mixing the flour, water, and other ingredients, and @@ -19305,7 +19283,7 @@ Processing Clean Up Once you've processed all the data, you may have things you need to do before exiting. This step corresponds to `awk''s `END' rule - (*note The `BEGIN' and `END' Special Patterns: BEGIN/END.). + (*note BEGIN/END::). After the cake comes out of the oven, you still have to wrap it in plastic wrap to keep anyone from tasting it, as well as wash the @@ -19381,8 +19359,7 @@ larger range of values. The disadvantage is that there are numbers that they cannot represent exactly. `awk' uses "double-precision" floating-point numbers, which can hold more digits than "single-precision" floating-point numbers. Floating-point issues are -discussed more fully in *Note Floating-Point Number Caveats: Floating -Point Issues. +discussed more fully in *Note Floating Point Issues::. At the very lowest level, computers store values as groups of binary digits, or "bits". Modern computers group bits into groups of eight, @@ -19405,8 +19382,8 @@ or "binary", base 8 or "octal", and base 16 or "hexadecimal". In binary, each column represents two times the value in the column to its right. Each column may contain either a 0 or a 1. Thus, binary 1010 represents 1 times 8, plus 0 times 4, plus 1 times 2, plus 0 times 1, -or decimal 10. Octal and hexadecimal are discussed more in *Note Octal -and Hexadecimal Numbers: Nondecimal-numbers. +or decimal 10. Octal and hexadecimal are discussed more in *Note +Nondecimal-numbers::. Programs are written in programming languages. Hundreds, if not thousands, of programming languages exist. One of the most popular is @@ -19446,9 +19423,9 @@ but it does require a background in computer science. Internally, `awk' keeps both the numeric value (double-precision floating-point) and the string value for a variable. Separately, `awk' -keeps track of what type the variable has (*note Variable Typing and -Comparison Expressions: Typing and Comparison.), which plays a role in -how variables are used in comparisons. +keeps track of what type the variable has (*note Typing and +Comparison::), which plays a role in how variables are used in +comparisons. It is important to note that the string value for a number may not reflect the full value (all the digits) that the numeric value actually @@ -19543,8 +19520,8 @@ Glossary Action A series of `awk' statements attached to a rule. If the rule's pattern matches an input record, `awk' executes the rule's action. - Actions are always enclosed in curly braces. (*Note Actions: - Action Overview.) + Actions are always enclosed in curly braces. (*Note Action + Overview::.) Amazing `awk' Assembler Henry Spencer at the University of Toronto wrote a retargetable @@ -19584,7 +19561,7 @@ Assignment An `awk' expression that changes the value of some `awk' variable or data object. An object that you can assign to is called an "lvalue". The assigned values are called "rvalues". *Note - Assignment Expressions: Assignment Ops. + Assignment Ops::. Associative Array Arrays in which the indices may be numbers or strings, not just @@ -19616,8 +19593,7 @@ Bit floating-point numbers, character data, addresses of other memory objects, or other data. `awk' lets you work with floating-point numbers and strings. `gawk' lets you manipulate bit values with - the built-in functions described in *Note Using `gawk''s Bit - Manipulation Functions: Bitwise Functions. + the built-in functions described in *Note Bitwise Functions::. Computers are often defined by how many bits they use to represent integer values. Typical systems are 32-bit systems, but 64-bit @@ -19640,7 +19616,7 @@ Built-in Function `sqrt' (for the square root of a number) and `substr' (for a substring of a string). `gawk' provides functions for timestamp management, bit manipulation, and runtime string translation. - (*Note Built-in Functions: Built-in.) + (*Note Built-in::.) Built-in Variable `ARGC', `ARGV', `CONVFMT', `ENVIRON', `FILENAME', `FNR', `FS', @@ -19698,29 +19674,26 @@ Compiler Compound Statement A series of `awk' statements, enclosed in curly braces. Compound - statements may be nested. (*Note Control Statements in Actions: - Statements.) + statements may be nested. (*Note Statements::.) Concatenation Concatenating two strings means sticking them together, one after another, producing a new string. For example, the string `foo' concatenated with the string `bar' gives the string `foobar'. - (*Note String Concatenation: Concatenation.) + (*Note Concatenation::.) Conditional Expression An expression using the `?:' ternary operator, such as `EXPR1 ? EXPR2 : EXPR3'. The expression EXPR1 is evaluated; if the result is true, the value of the whole expression is the value of EXPR2; otherwise the value is EXPR3. In either case, only one of EXPR2 - and EXPR3 is evaluated. (*Note Conditional Expressions: - Conditional Exp.) + and EXPR3 is evaluated. (*Note Conditional Exp::.) Comparison Expression A relation that is either true or false, such as `(a < b)'. Comparison expressions are used in `if', `while', `do', and `for' statements, and in patterns to select which input records to - process. (*Note Variable Typing and Comparison Expressions: - Typing and Comparison.) + process. (*Note Typing and Comparison::.) Curly Braces The characters `{' and `}'. Curly braces are used in `awk' for @@ -19740,7 +19713,7 @@ Data Driven Data Objects These are numbers and strings of characters. Numbers are converted into strings and vice versa, as needed. (*Note - Conversion of Strings and Numbers: Conversion.) + Conversion::.) Deadlock The situation in which two communicating processes are each waiting @@ -19757,7 +19730,7 @@ Dynamic Regular Expression A dynamic regular expression is a regular expression written as an ordinary expression. It could be a string constant, such as `"foo"', but it may also be an expression whose value can vary. - (*Note Using Dynamic Regexps: Computed Regexps.) + (*Note Computed Regexps::.) Environment A collection of strings, of the form NAME`='VAL, that each program @@ -19791,8 +19764,7 @@ Field change by setting the built-in variable `FS'). Such pieces are called fields. If the pieces are of fixed length, you can use the built-in variable `FIELDWIDTHS' to describe their lengths. (*Note - Specifying How Fields Are Separated: Field Separators, and *Note - Reading Fixed-Width Data: Constant Size.) + Field Separators::, and *Note Constant Size::.) Flag A variable whose truth value indicates the existence or @@ -19808,8 +19780,7 @@ Format `strftime' and `sprintf' functions, and are used in the `printf' statement as well. Also, data conversions from numbers to strings are controlled by the format string contained in the built-in - variable `CONVFMT'. (*Note Format-Control Letters: Control - Letters.) + variable `CONVFMT'. (*Note Control Letters::.) Free Documentation License This document describes the terms under which this Info file is @@ -19835,8 +19806,7 @@ Free Software Foundation General Public License This document describes the terms under which `gawk' and its source - code may be distributed. (*Note GNU General Public License: - Copying.) + code may be distributed. (*Note Copying::.) GMT "Greenwich Mean Time." This is the old term for UTC. It is the @@ -19872,8 +19842,8 @@ I/O Input Record A single chunk of data that is read in by `awk'. Usually, an - `awk' input record consists of one line of text. (*Note How Input - Is Split into Records: Records.) + `awk' input record consists of one line of text. (*Note + Records::.) Integer A whole number, i.e., a number that does not have a fractional @@ -19975,7 +19945,7 @@ Pattern input is tested. If the condition is satisfied, the pattern is said to "match" the input record. A typical pattern might compare the input record against a regular expression. (*Note Pattern - Elements: Pattern Overview.) + Overview::.) POSIX The name for a series of standards that specify a Portable @@ -19994,12 +19964,12 @@ Private Variables and/or functions that are meant for use exclusively by library functions and not for the main `awk' program. Special care must be taken when naming such variables and functions. (*Note - Naming Library Function Global Variables: Library Names.) + Library Names::.) Range (of input lines) A sequence of consecutive lines from the input file(s). A pattern can specify ranges of input lines for `awk' to process or it can - specify single lines. (*Note Pattern Elements: Pattern Overview.) + specify single lines. (*Note Pattern Overview::.) Recursion When a function calls itself, either directly or indirectly. If @@ -20013,9 +19983,8 @@ Redirection You can redirect the output of the `print' and `printf' statements to a file or a system command, using the `>', `>>', `|', and `|&' operators. You can redirect input to the `getline' statement using - the `<', `|', and `|&' operators. (*Note Redirecting Output of - `print' and `printf': Redirection, and *Note Explicit Input with - `getline': Getline.) + the `<', `|', and `|&' operators. (*Note Redirection::, and *Note + Getline::.) Regexp Short for "regular expression". A regexp is a pattern that @@ -20023,7 +19992,7 @@ Regexp the regexp `R.*xp' matches any string starting with the letter `R' and ending with the letters `xp'. In `awk', regexps are used in patterns and in conditional expressions. Regexps may contain - escape sequences. (*Note Regular Expressions: Regexp.) + escape sequences. (*Note Regexp::.) Regular Expression See "regexp." @@ -20032,7 +20001,7 @@ Regular Expression Constant A regular expression constant is a regular expression written within slashes, such as `/foo/'. This regular expression is chosen when you write the `awk' program and cannot be changed during its - execution. (*Note How to Use Regular Expressions: Regexp Usage.) + execution. (*Note Regexp Usage::.) Rule A segment of an `awk' program that specifies how to process single @@ -20071,13 +20040,13 @@ Short-Circuit The nature of the `awk' logical operators `&&' and `||'. If the value of the entire expression is determinable from evaluating just the lefthand side of these operators, the righthand side is not - evaluated. (*Note Boolean Expressions: Boolean Ops.) + evaluated. (*Note Boolean Ops::.) Side Effect A side effect occurs when an expression has an effect aside from merely producing a value. Assignment expressions, increment and decrement expressions, and function calls have side effects. - (*Note Assignment Expressions: Assignment Ops.) + (*Note Assignment Ops::.) Single-Precision An internal representation of numbers that can have fractional @@ -20093,8 +20062,7 @@ Space Special File A file name interpreted internally by `gawk', instead of being handed directly to the underlying operating system--for example, - `/dev/stderr'. (*Note Special File Names in `gawk': Special - Files.) + `/dev/stderr'. (*Note Special Files::.) Stream Editor A program that reads records from an input stream and processes @@ -21016,6 +20984,7 @@ Index * --dump-variables option: Options. * --enable-portals configuration option <1>: Additional Configuration Options. * --enable-portals configuration option: Portal Files. +* --enable-switch configuration option: Additional Configuration Options. * --field-separator option: Options. * --file option: Options. * --gen-po option <1>: Options. @@ -21362,6 +21331,7 @@ Index * BEGIN pattern, TEXTDOMAIN variable and: Programmer i18n. * beginfile user-defined function: Filetrans Function. * Bell Laboratories awk extensions: BTL. +* Benzinger, Michael: Contributors. * BeOS: BeOS Installation. * Berry, Karl: Acknowledgments. * binary input/output: User-modified. @@ -21421,6 +21391,7 @@ Index * caret (^), ^= operator <2>: Precedence. * caret (^), ^= operator: Assignment Ops. * caret (^), in character lists: Character Lists. +* case keyword: Switch Statement. * case sensitivity, array indices and: Array Intro. * case sensitivity, converting case: String Functions. * case sensitivity, example programs: Library Functions. @@ -21497,6 +21468,7 @@ Index * configuration option, --disable-lint: Additional Configuration Options. * configuration option, --disable-nls: Additional Configuration Options. * configuration option, --enable-portals: Additional Configuration Options. +* configuration option, --enable-switch: Additional Configuration Options. * configuration option, --with-included-gettext <1>: Additional Configuration Options. * configuration option, --with-included-gettext: Gawk I18N. * configuration options, gawk: Additional Configuration Options. @@ -21579,6 +21551,7 @@ Index * debugging gawk: Known Bugs. * debugging gawk, bug reports: Bugs. * decrement operators: Increment Ops. +* default keyword: Switch Statement. * Deifik, Scott <1>: Bugs. * Deifik, Scott <2>: Contributors. * Deifik, Scott: Acknowledgments. @@ -22219,6 +22192,7 @@ Index * matching, leftmost longest: Multiple Line. * matching, null strings: Gory Details. * mawk program: Other Versions. +* McPhee, Patrick: Contributors. * memory, releasing: Internals. * memory, setting limits: Options. * message object files: Explaining gettext. @@ -22473,7 +22447,6 @@ Index * POSIX awk, OFMT variable and <1>: Conversion. * POSIX awk, OFMT variable and: OFMT. * POSIX awk, period (.), using: Regexp Operators. -* POSIX awk, pipes, closing: Close Files And Pipes. * POSIX awk, printf format strings and: Format Modifiers. * POSIX awk, regular expressions and: Regexp Operators. * POSIX awk, timestamps and: Time Functions. @@ -22791,6 +22764,7 @@ Index * SUBSEP variable, multidimensional arrays: Multi-dimensional. * substr function: String Functions. * Sumner, Andrew: Other Versions. +* switch statement: Switch Statement. * syntactic ambiguity: /= operator vs. /=.../ regexp constant: Assignment Ops. * system function: I/O Functions. * systime function (gawk): Time Functions. @@ -22957,6 +22931,7 @@ Index * xor function (gawk): Bitwise Functions. * Zaretskii, Eli: Acknowledgments. * zero, negative vs. positive: Floating Point Issues. +* zerofile.awk program: Empty Files. * Zoulas, Christos: Contributors. * {} (braces), actions and: Action Overview. * {} (braces), pgawk program: Profiling. @@ -22984,343 +22959,346 @@ Index Tag Table: 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 +Node: Foreword26888 +Node: Preface31212 +Ref: Preface-Footnote-134094 +Node: History34326 +Node: Names36541 +Ref: Names-Footnote-138016 +Node: This Manual38088 +Ref: This Manual-Footnote-142846 +Node: Conventions42946 +Node: Manual History44823 +Ref: Manual History-Footnote-148271 +Ref: Manual History-Footnote-248312 +Node: How To Contribute48386 +Node: Acknowledgments48984 +Node: Getting Started52789 +Node: Running gawk55160 +Node: One-shot56341 +Node: Read Terminal57557 +Ref: Read Terminal-Footnote-159206 +Node: Long59377 +Node: Executable Scripts60744 +Ref: Executable Scripts-Footnote-162640 +Ref: Executable Scripts-Footnote-262791 +Node: Comments63242 +Node: Quoting65601 +Node: Sample Data Files69515 +Node: Very Simple72548 +Node: Two Rules77148 +Node: More Complex79290 +Ref: More Complex-Footnote-182204 +Ref: More Complex-Footnote-282652 +Node: Statements/Lines82735 +Ref: Statements/Lines-Footnote-187094 +Node: Other Features87359 +Node: When88206 +Node: Regexp90173 +Node: Regexp Usage91626 +Node: Escape Sequences93673 +Node: Regexp Operators99413 +Ref: Regexp Operators-Footnote-1106515 +Ref: Regexp Operators-Footnote-2106662 +Node: Character Lists106760 +Node: GNU Regexp Operators111229 +Node: Case-sensitivity114795 +Ref: Case-sensitivity-Footnote-1117813 +Node: Leftmost Longest118048 +Node: Computed Regexps119234 +Node: Locales122641 +Node: Reading Files124668 +Node: Records126424 +Ref: Records-Footnote-1134517 +Node: Fields134554 +Ref: Fields-Footnote-1137578 +Node: Nonconstant Fields137664 +Node: Changing Fields139860 +Node: Field Separators145136 +Node: Regexp Field Splitting148619 +Node: Single Character Fields151075 +Node: Command Line Field Separator152117 +Node: Field Splitting Summary155547 +Ref: Field Splitting Summary-Footnote-1158730 +Node: Constant Size158831 +Node: Multiple Line163306 +Ref: Multiple Line-Footnote-1169011 +Node: Getline169190 +Node: Plain Getline171253 +Node: Getline/Variable173267 +Node: Getline/File174399 +Node: Getline/Variable/File175714 +Node: Getline/Pipe177264 +Node: Getline/Variable/Pipe179317 +Node: Getline/Coprocess180415 +Node: Getline/Variable/Coprocess181646 +Node: Getline Notes182351 +Node: Getline Summary183985 +Node: Printing184692 +Node: Print186320 +Node: Print Examples187641 +Node: Output Separators190421 +Node: OFMT192177 +Node: Printf193527 +Node: Basic Printf194441 +Node: Control Letters195967 +Node: Format Modifiers198654 +Node: Printf Examples203656 +Node: Redirection206364 +Node: Special Files212947 +Node: Special FD213576 +Node: Special Process216593 +Node: Special Network218799 +Node: Special Caveats219632 +Ref: Special Caveats-Footnote-1220821 +Node: Close Files And Pipes221204 +Ref: Close Files And Pipes-Footnote-1228105 +Ref: Close Files And Pipes-Footnote-2228253 +Node: Expressions228401 +Node: Constants230589 +Node: Scalar Constants231265 +Ref: Scalar Constants-Footnote-1232111 +Node: Nondecimal-numbers232293 +Node: Regexp Constants235345 +Node: Using Constant Regexps235809 +Node: Variables238891 +Node: Using Variables239542 +Node: Assignment Options241043 +Node: Conversion242911 +Ref: Conversion-Footnote-1247679 +Node: Arithmetic Ops247788 +Node: Concatenation250285 +Node: Assignment Ops252980 +Node: Increment Ops259186 +Node: Truth Values262674 +Node: Typing and Comparison263719 +Ref: Typing and Comparison-Footnote-1270152 +Node: Boolean Ops270297 +Node: Conditional Exp274291 +Node: Function Calls276021 +Node: Precedence278914 +Node: Patterns and Actions282332 +Node: Pattern Overview283385 +Node: Regexp Patterns284814 +Node: Expression Patterns285348 +Node: Ranges288889 +Node: BEGIN/END291969 +Node: Using BEGIN/END292709 +Ref: Using BEGIN/END-Footnote-1295428 +Node: I/O And BEGIN/END295542 +Node: Empty297796 +Node: Using Shell Variables298095 +Node: Action Overview300371 +Node: Statements302723 +Node: If Statement304574 +Node: While Statement306064 +Node: Do Statement308087 +Node: For Statement309227 +Node: Switch Statement312358 +Node: Break Statement314216 +Node: Continue Statement316264 +Node: Next Statement318159 +Node: Nextfile Statement320430 +Node: Exit Statement323018 +Node: Built-in Variables325078 +Node: User-modified326168 +Ref: User-modified-Footnote-1333402 +Node: Auto-set333464 +Ref: Auto-set-Footnote-1341317 +Node: ARGC and ARGV341522 +Node: Arrays345226 +Node: Array Intro347133 +Node: Reference to Elements351326 +Node: Assigning Elements353188 +Node: Array Example353650 +Node: Scanning an Array355373 +Node: Delete357640 +Ref: Delete-Footnote-1360017 +Node: Numeric Array Subscripts360074 +Node: Uninitialized Subscripts362256 +Node: Multi-dimensional363857 +Node: Multi-scanning366870 +Node: Array Sorting368478 +Node: Functions371826 +Node: Built-in372560 +Node: Calling Built-in373525 +Node: Numeric Functions375483 +Ref: Numeric Functions-Footnote-1379226 +Ref: Numeric Functions-Footnote-2379552 +Node: String Functions379821 +Ref: String Functions-Footnote-1399010 +Ref: String Functions-Footnote-2399139 +Ref: String Functions-Footnote-3399386 +Node: Gory Details399473 +Ref: Gory Details-Footnote-1406035 +Ref: Gory Details-Footnote-2406086 +Node: I/O Functions406293 +Ref: I/O Functions-Footnote-1412864 +Node: Time Functions412955 +Ref: Time Functions-Footnote-1423681 +Ref: Time Functions-Footnote-2423749 +Ref: Time Functions-Footnote-3423907 +Ref: Time Functions-Footnote-4424018 +Ref: Time Functions-Footnote-5424143 +Ref: Time Functions-Footnote-6424370 +Node: Bitwise Functions424632 +Ref: Bitwise Functions-Footnote-1429291 +Node: I18N Functions429475 +Node: User-defined431187 +Node: Definition Syntax431963 +Node: Function Example436313 +Node: Function Caveats438894 +Node: Return Statement442751 +Node: Dynamic Typing445409 +Node: Internationalization446147 +Node: I18N and L10N447565 +Node: Explaining gettext448245 +Ref: Explaining gettext-Footnote-1453152 +Ref: Explaining gettext-Footnote-2453391 +Node: Programmer i18n453560 +Node: Translator i18n457778 +Node: String Extraction458563 +Ref: String Extraction-Footnote-1459504 +Node: Printf Ordering459630 +Ref: Printf Ordering-Footnote-1462373 +Node: I18N Portability462437 +Ref: I18N Portability-Footnote-1464875 +Node: I18N Example464938 +Ref: I18N Example-Footnote-1467550 +Node: Gawk I18N467622 +Node: Advanced Features468444 +Node: Nondecimal Data469837 +Node: Two-way I/O471389 +Ref: Two-way I/O-Footnote-1476885 +Node: TCP/IP Networking476962 +Node: Portal Files479381 +Node: Profiling480018 +Node: Invoking Gawk487644 +Node: Command Line488821 +Node: Options489599 +Ref: Options-Footnote-1500961 +Node: Other Arguments500986 +Node: AWKPATH Variable503660 +Ref: AWKPATH Variable-Footnote-1506394 +Node: Obsolete506654 +Node: Undocumented507647 +Node: Known Bugs507899 +Node: Library Functions508491 +Ref: Library Functions-Footnote-1511470 +Node: Library Names511641 +Ref: Library Names-Footnote-1515107 +Ref: Library Names-Footnote-2515326 +Node: General Functions515412 +Node: Nextfile Function516348 +Node: Assert Function520713 +Node: Round Function524016 +Node: Cliff Random Function525528 +Ref: Cliff Random Function-Footnote-1526511 +Node: Ordinal Functions526582 +Ref: Ordinal Functions-Footnote-1529656 +Node: Join Function529872 +Ref: Join Function-Footnote-1531621 +Node: Gettimeofday Function531821 +Node: Data File Management535543 +Node: Filetrans Function536168 +Node: Rewind Function539598 +Node: File Checking541048 +Node: Empty Files542089 +Node: Ignoring Assigns544318 +Node: Getopt Function545860 +Ref: Getopt Function-Footnote-1556912 +Node: Passwd Functions557113 +Ref: Passwd Functions-Footnote-1565797 +Node: Group Functions565885 +Node: Sample Programs573907 +Node: Running Examples574581 +Node: Clones575302 +Node: Cut Program576427 +Node: Egrep Program586158 +Ref: Egrep Program-Footnote-1593942 +Node: Id Program594052 +Node: Split Program597683 +Node: Tee Program601150 +Node: Uniq Program603821 +Node: Wc Program611238 +Ref: Wc Program-Footnote-1615491 +Node: Miscellaneous Programs615686 +Node: Dupword Program616675 +Node: Alarm Program618695 +Node: Translate Program623271 +Ref: Translate Program-Footnote-1627526 +Ref: Translate Program-Footnote-2627763 +Node: Labels Program627897 +Ref: Labels Program-Footnote-1631222 +Node: Word Sorting631306 +Node: History Sorting635593 +Node: Extract Program637425 +Node: Simple Sed644799 +Node: Igawk Program647863 +Ref: Igawk Program-Footnote-1662668 +Ref: Igawk Program-Footnote-2662869 +Node: Language History663007 +Node: V7/SVR3.1664374 +Node: SVR4666449 +Node: POSIX667883 +Node: BTL669388 +Node: POSIX/GNU670907 +Node: Contributors677998 +Node: Installation681436 +Node: Gawk Distribution682388 +Node: Getting682867 +Node: Extracting684087 +Node: Distribution contents685466 +Node: Unix Installation690677 +Node: Quick Installation691263 +Node: Additional Configuration Options692956 +Node: Configuration Philosophy694905 +Node: Non-Unix Installation697260 +Node: Amiga Installation697842 +Node: BeOS Installation698929 +Node: PC Installation700073 +Node: PC Binary Installation701294 +Node: PC Compiling703124 +Node: PC Dynamic707660 +Node: PC Using710008 +Node: Cygwin714608 +Ref: Cygwin-Footnote-1715583 +Node: VMS Installation715615 +Node: VMS Compilation716134 +Node: VMS Installation Details717698 +Node: VMS Running719315 +Node: VMS POSIX720899 +Node: Unsupported722163 +Node: Atari Installation722561 +Node: Atari Compiling723841 +Node: Atari Using725713 +Node: Tandem Installation728545 +Node: Bugs730216 +Node: Other Versions733501 +Ref: Other Versions-Footnote-1737100 +Node: Notes737142 +Node: Compatibility Mode737815 +Node: Additions738604 +Node: Adding Code739349 +Node: New Ports745372 +Node: Dynamic Extensions749424 +Node: Internals750440 +Node: Sample Library757218 +Node: Internal File Description757868 +Node: Internal File Ops761548 +Ref: Internal File Ops-Footnote-1766964 +Node: Using Internal File Ops767112 +Node: Future Extensions769133 +Node: Basic Concepts773214 +Node: Basic High Level773952 +Ref: Basic High Level-Footnote-1777979 +Node: Basic Data Typing778173 +Node: Floating Point Issues782605 +Ref: Floating Point Issues-Footnote-1786485 +Ref: Floating Point Issues-Footnote-2786538 +Node: Glossary786647 +Node: Copying810256 +Node: GNU Free Documentation License829453 +Node: Index851856 End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 108b3320..c8fed041 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -13,16 +13,16 @@ * awk: (gawk)Invoking gawk. Text scanning and processing. @end direntry -@c @set xref-automatic-section-title +@set xref-automatic-section-title @c The following information should be updated here only! @c This sets the edition of the document, the version of gawk it @c applies to and all the info about who's publishing this edition @c These apply across the board. -@set UPDATE-MONTH February, 2003 +@set UPDATE-MONTH June, 2003 @set VERSION 3.1 -@set PATCHLEVEL 2 +@set PATCHLEVEL 3 @set FSF @@ -232,7 +232,7 @@ Cover art by Etienne Suvasa. @ifnottex @ifnotxml -@node Top, Foreword, (dir), (dir) +@node Top @top General Introduction @c Preface node should come right after the Top @c node, in `unnumbered' sections, then the chapter, `What is gawk'. @@ -436,6 +436,8 @@ particular records in a file and perform operations upon them. some condition is satisfied. * For Statement:: Another looping statement, that provides initialization and increment clauses. +* Switch Statement:: Switch/case evaluation for conditional + execution of statements based on a value. * Break Statement:: Immediately exit the innermost enclosing loop. * Continue Statement:: Skip to the end of the innermost enclosing @@ -532,6 +534,7 @@ particular records in a file and perform operations upon them. transitions. * Rewind Function:: A function for rereading the current file. * File Checking:: Checking that data files are readable. +* Empty Files:: Checking for zero-length files. * Ignoring Assigns:: Treating assignments as file names. * Getopt Function:: A function for processing command-line arguments. @@ -585,10 +588,12 @@ particular records in a file and perform operations upon them. * PC Installation:: Installing and Compiling @command{gawk} on MS-DOS and OS/2. * PC Binary Installation:: Installing a prepared distribution. -* PC Compiling:: Compiling @command{gawk} for MS-DOS, Win32, +* PC Compiling:: Compiling @command{gawk} for MS-DOS, Windows32, and OS/2. -* PC Using:: Running @command{gawk} on MS-DOS, Win32 and +* PC Using:: Running @command{gawk} on MS-DOS, Windows32 and OS/2. +* PC Dynamic:: Compiling @command{gawk} for dynamic + libraries. * Cygwin:: Building and running @command{gawk} for Cygwin. * VMS Installation:: Installing @command{gawk} on VMS. @@ -644,17 +649,17 @@ particular records in a file and perform operations upon them. @summarycontents @contents -@node Foreword, Preface, Top, Top +@node Foreword @unnumbered Foreword Arnold Robbins and I are good friends. We were introduced 11 years ago -by circumstances---and our favorite programming language, AWK. +by circumstances---and our favorite programming language, AWK. The circumstances started a couple of years -earlier. I was working at a new job and noticed an unplugged +earlier. I was working at a new job and noticed an unplugged Unix computer sitting in the corner. No one knew how to use it, and neither did I. However, a couple of days later it was running, and -I was @code{root} and the one-and-only user. +I was @code{root} and the one-and-only user. That day, I began the transition from statistician to Unix programmer. On one of many trips to the library or bookstore in search of @@ -684,12 +689,12 @@ any system; my wife uses @command{gawk} on her VMS box.) My Unix system started out unplugged from the wall; it certainly was not plugged into a network. So, oblivious to the existence of @command{gawk} and the Unix community in general, and desiring a new @command{awk}, I wrote -my own, called @command{mawk}. +my own, called @command{mawk}. Before I was finished I knew about @command{gawk}, but it was too late to stop, so I eventually posted -to a @code{comp.sources} newsgroup. +to a @code{comp.sources} newsgroup. -A few days after my posting, I got a friendly email +A few days after my posting, I got a friendly email from Arnold introducing himself. He suggested we share design and algorithms and attached a draft of the POSIX standard so @@ -698,7 +703,7 @@ after publication of the AWK book. Frankly, if our roles had been reversed, I would not have been so open and we probably would -have never met. I'm glad we did meet. +have never met. I'm glad we did meet. He is an AWK expert's AWK expert and a genuinely nice person. Arnold contributes significant amounts of his expertise and time to the Free Software Foundation. @@ -715,11 +720,11 @@ a wealth of practical programs that emphasize the power of AWK's basic idioms: data driven control-flow, pattern matching with regular expressions, and associative arrays. -Those looking for something new can try out @command{gawk}'s +Those looking for something new can try out @command{gawk}'s interface to network protocols via special @file{/inet} files. The programs in this book make clear that an AWK program is -typically much smaller and faster to develop than +typically much smaller and faster to develop than a counterpart written in C. Consequently, there is often a payoff to prototype an algorithm or design in AWK to get it running quickly and expose @@ -758,7 +763,7 @@ Michael Brennan Author of @command{mawk} @end display -@node Preface, Getting Started, Foreword, Top +@node Preface @unnumbered Preface @c I saw a comment somewhere that the preface should describe the book itself, @c and the introduction should describe what the book covers. @@ -860,7 +865,7 @@ microcomputers, BeOS, Tandem D20, and VMS. * Acknowledgments:: Acknowledgments. @end menu -@node History, Names, Preface, Preface +@node History @unnumberedsec History of @command{awk} and @command{gawk} @cindex recipe for a programming language @cindex programming language, recipe for @@ -875,7 +880,7 @@ microcomputers, BeOS, Tandem D20, and VMS. Blend all parts well using @code{lex} and @code{yacc}. Document minimally and release. -After eight years, add another part @code{egrep} and two +After eight years, add another part @code{egrep} and two more parts C. Document very well and release. @end quotation @@ -919,15 +924,15 @@ wrote the bulk of His code finally became part of the main @command{gawk} distribution with @command{gawk} @value{PVERSION} 3.1. -@xref{Contributors, ,Major Contributors to @command{gawk}}, +@xref{Contributors}, for a complete list of those who made important contributions to @command{gawk}. -@node Names, This Manual, History, Preface +@node Names @section A Rose by Any Other Name @cindex @command{awk}, new vs. old The @command{awk} language has evolved over the years. Full details are -provided in @ref{Language History, ,The Evolution of the @command{awk} Language}. +provided in @ref{Language History}. The language described in this @value{DOCUMENT} is often referred to as ``new @command{awk}'' (@command{nawk}). @@ -959,7 +964,7 @@ that should be available in any complete implementation of POSIX @command{awk}, we simply use the term @command{awk}. When referring to a feature that is specific to the GNU implementation, we use the term @command{gawk}. -@node This Manual, Conventions, Names, Preface +@node This Manual @section Using This Book @cindex @command{awk}, terms describing @@ -1009,24 +1014,24 @@ exposed to @command{awk}, there is a lot of information here that even the @command{awk} expert should find useful. In particular, the description of POSIX @command{awk} and the example programs in -@ref{Library Functions, ,A Library of @command{awk} Functions}, and in -@ref{Sample Programs, ,Practical @command{awk} Programs}, +@ref{Library Functions}, and in +@ref{Sample Programs}, should be of interest. -@ref{Getting Started, ,Getting Started with @command{awk}}, +@ref{Getting Started}, provides the essentials you need to know to begin using @command{awk}. -@ref{Regexp, ,Regular Expressions}, +@ref{Regexp}, introduces regular expressions in general, and in particular the flavors supported by POSIX @command{awk} and @command{gawk}. -@ref{Reading Files, , Reading Input Files}, +@ref{Reading Files}, describes how @command{awk} reads your data. It introduces the concepts of records and fields, as well as the @code{getline} command. I/O redirection is first described here. -@ref{Printing, , Printing Output}, +@ref{Printing}, describes how @command{awk} programs can produce output with @code{print} and @code{printf}. @@ -1034,12 +1039,12 @@ describes how @command{awk} programs can produce output with describes expressions, which are the basic building blocks for getting most things done in a program. -@ref{Patterns and Actions, ,Patterns Actions and Variables}, +@ref{Patterns and Actions}, describes how to write patterns for matching records, actions for doing something when a record is matched, and the built-in variables @command{awk} and @command{gawk} use. -@ref{Arrays, ,Arrays in @command{awk}}, +@ref{Arrays}, covers @command{awk}'s one-and-only data structure: associative arrays. Deleting array elements and whole arrays is also described, as well as sorting arrays in @command{gawk}. @@ -1049,47 +1054,47 @@ describes the built-in functions @command{awk} and @command{gawk} provide, as well as how to define your own functions. -@ref{Internationalization, ,Internationalization with @command{gawk}}, +@ref{Internationalization}, describes special features in @command{gawk} for translating program messages into different languages at runtime. -@ref{Advanced Features, ,Advanced Features of @command{gawk}}, +@ref{Advanced Features}, describes a number of @command{gawk}-specific advanced features. Of particular note are the abilities to have two-way communications with another process, perform TCP/IP networking, and profile your @command{awk} programs. -@ref{Invoking Gawk, ,Running @command{awk} and @command{gawk}}, +@ref{Invoking Gawk}, describes how to run @command{gawk}, the meaning of its command-line options, and how it finds @command{awk} program source files. -@ref{Library Functions, ,A Library of @command{awk} Functions}, and -@ref{Sample Programs, ,Practical @command{awk} Programs}, +@ref{Library Functions}, and +@ref{Sample Programs}, provide many sample @command{awk} programs. Reading them allows you to see @command{awk} solving real problems. -@ref{Language History, ,The Evolution of the @command{awk} Language}, +@ref{Language History}, describes how the @command{awk} language has evolved since first release to present. It also describes how @command{gawk} has acquired features over time. -@ref{Installation, ,Installing @command{gawk}}, +@ref{Installation}, describes how to get @command{gawk}, how to compile it under Unix, and how to compile and use it on different non-Unix systems. It also describes how to report bugs in @command{gawk} and where to get three other freely available implementations of @command{awk}. -@ref{Notes, ,Implementation Notes}, +@ref{Notes}, describes how to disable @command{gawk}'s extensions, as well as how to contribute new code to @command{gawk}, how to write extension libraries, and some possible future directions for @command{gawk} development. -@ref{Basic Concepts, ,Basic Programming Concepts}, +@ref{Basic Concepts}, provides some very cursory background material for those who are completely unfamiliar with computer programming. Also centralized there is a discussion of some of the issues @@ -1101,12 +1106,12 @@ defines most, if not all, the significant terms used throughout the book. If you find terms that you aren't familiar with, try looking them up here. -@ref{Copying, ,GNU General Public License}, and +@ref{Copying}, and @ref{GNU Free Documentation License}, present the licenses that cover the @command{gawk} source code and this @value{DOCUMENT}, respectively. -@node Conventions, Manual History, This Manual, Preface +@node Conventions @section Typographical Conventions @cindex Texinfo @@ -1181,7 +1186,7 @@ As noted by the opening quote, though, any coverage of dark corners is, by definition, something that is incomplete. -@node Manual History, How To Contribute, Conventions, Preface +@node Manual History @unnumberedsec The GNU Project and This Book @cindex FSF (Free Software Foundation) @@ -1208,7 +1213,7 @@ copy of the GPL is included in this @value{DOCUMENT} @end ifnotinfo for your reference -(@pxref{Copying, ,GNU General Public License}). +(@pxref{Copying}). The GPL applies to the C language source code for @command{gawk}. To find out more about the FSF and the GNU Project online, see @uref{http://www.gnu.org, the GNU Project's home page}. @@ -1290,12 +1295,12 @@ Edition @value{EDITION} maintains the basic structure of Edition 1.0, but with significant additional material, reflecting the host of new features in @command{gawk} @value{PVERSION} @value{VERSION}. Of particular note is -@ref{Array Sorting, ,Sorting Array Values and Indices with @command{gawk}}, -@ref{Bitwise Functions, ,Using @command{gawk}'s Bit Manipulation Functions}, -@ref{Internationalization, ,Internationalization with @command{gawk}}, -@ref{Advanced Features, ,Advanced Features of @command{gawk}}, +@ref{Array Sorting}, +@ref{Bitwise Functions}, +@ref{Internationalization}, +@ref{Advanced Features}, and -@ref{Dynamic Extensions, ,Adding New Built-in Functions to @command{gawk}}. +@ref{Dynamic Extensions}. @end ignore @cindex Close, Diane @@ -1318,23 +1323,23 @@ This edition maintains the basic structure of Edition 1.0, but with significant additional material, reflecting the host of new features in @command{gawk} @value{PVERSION} @value{VERSION}. Of particular note is -@ref{Array Sorting, ,Sorting Array Values and Indices with @command{gawk}}, +@ref{Array Sorting}, as well as -@ref{Bitwise Functions, ,Using @command{gawk}'s Bit Manipulation Functions}, -@ref{Internationalization, ,Internationalization with @command{gawk}}, +@ref{Bitwise Functions}, +@ref{Internationalization}, and also -@ref{Advanced Features, ,Advanced Features of @command{gawk}}, +@ref{Advanced Features}, and -@ref{Dynamic Extensions, ,Adding New Built-in Functions to @command{gawk}}. +@ref{Dynamic Extensions}. @cite{@value{TITLE}} will undoubtedly continue to evolve. An electronic version comes with the @command{gawk} distribution from the FSF. If you find an error in this @value{DOCUMENT}, please report it! -@xref{Bugs, ,Reporting Problems and Bugs}, for information on submitting +@xref{Bugs}, for information on submitting problem reports electronically, or write to me in care of the publisher. -@node How To Contribute, Acknowledgments, Manual History, Preface +@node How To Contribute @unnumberedsec How to Contribute As the maintainer of GNU @command{awk}, @@ -1348,7 +1353,7 @@ share with the rest of the world, please contact me (@email{arnold@@gnu.org}). Making things available on the Internet helps keep the @command{gawk} distribution down to manageable size. -@node Acknowledgments, , How To Contribute, Preface +@node Acknowledgments @unnumberedsec Acknowledgments The initial draft of @cite{The GAWK Manual} had the following acknowledgments: @@ -1500,37 +1505,37 @@ and @command{gawk}. It contains the following chapters: @itemize @bullet @item -@ref{Getting Started, ,Getting Started with @command{awk}}. +@ref{Getting Started}. @item -@ref{Regexp, ,Regular Expressions}. +@ref{Regexp}. @item -@ref{Reading Files, , Reading Input Files}. +@ref{Reading Files}. @item -@ref{Printing, , Printing Output}. +@ref{Printing}. @item @ref{Expressions}. @item -@ref{Patterns and Actions, ,Patterns Actions and Variables}. +@ref{Patterns and Actions}. @item -@ref{Arrays, ,Arrays in @command{awk}}. +@ref{Arrays}. @item @ref{Functions}. @item -@ref{Internationalization, ,Internationalization with @command{gawk}}. +@ref{Internationalization}. @item -@ref{Advanced Features, ,Advanced Features of @command{gawk}}. +@ref{Advanced Features}. @item -@ref{Invoking Gawk, ,Running @command{awk} and @command{gawk}}. +@ref{Invoking Gawk}. @end itemize @page @@ -1539,7 +1544,7 @@ and @command{gawk}. It contains the following chapters: @end iftex @end ignore -@node Getting Started, Regexp, Preface, Top +@node Getting Started @chapter Getting Started with @command{awk} @c @cindex script, definition of @c @cindex rule, definition of @@ -1573,7 +1578,7 @@ When you run @command{awk}, you specify an @command{awk} @dfn{program} that tells @command{awk} what to do. The program consists of a series of @dfn{rules}. (It may also contain @dfn{function definitions}, an advanced feature that we will ignore for now. -@xref{User-defined, ,User-Defined Functions}.) Each rule specifies one +@xref{User-defined}.) Each rule specifies one pattern to search for and one action to perform upon finding the pattern. @@ -1604,7 +1609,7 @@ program looks like this: other things. @end menu -@node Running gawk, Sample Data Files, Getting Started, Getting Started +@node Running gawk @section How to Run @command{awk} Programs @cindex @command{awk} programs, running @@ -1640,7 +1645,7 @@ variations of each. * Quoting:: More discussion of shell quoting issues. @end menu -@node One-shot, Read Terminal, Running gawk, Running gawk +@node One-shot @subsection One-Shot Throwaway @command{awk} Programs Once you are familiar with @command{awk}, you will often type in simple @@ -1672,7 +1677,7 @@ programs from shell scripts, because it avoids the need for a separate file for the @command{awk} program. A self-contained shell script is more reliable because there are no other files to misplace. -@ref{Very Simple, ,Some Simple Examples}, +@ref{Very Simple}, @ifnotinfo later in this @value{CHAPTER}, @end ifnotinfo @@ -1696,7 +1701,7 @@ egrep foo @var{files} @dots{} @end example @end ignore -@node Read Terminal, Long, One-shot, Running gawk +@node Read Terminal @subsection Running @command{awk} Without Input Files @cindex standard input @@ -1758,7 +1763,7 @@ What, me worry? @kbd{@value{CTL}-d} @end example -@node Long, Executable Scripts, Read Terminal, Running gawk +@node Long @subsection Running Long Programs @cindex @command{awk} programs, running @@ -1800,7 +1805,7 @@ awk "BEGIN @{ print \"Don't Panic!\" @}" @cindex quoting @noindent This was explained earlier -(@pxref{Read Terminal, ,Running @command{awk} Without Input Files}). +(@pxref{Read Terminal}). Note that you don't usually need single quotes around the @value{FN} that you specify with @option{-f}, because most @value{FN}s don't contain any of the shell's special characters. Notice that in @file{advice}, the @command{awk} @@ -1816,7 +1821,7 @@ you can add the extension @file{.awk} to the @value{FN}. This doesn't affect the execution of the @command{awk} program but it does make ``housekeeping'' easier. -@node Executable Scripts, Comments, Long, Running gawk +@node Executable Scripts @subsection Executable @command{awk} Programs @cindex @command{awk} programs @cindex @code{#} (number sign), @code{#!} (executable scripts) @@ -1891,7 +1896,7 @@ of @command{awk} (such as @file{/bin/awk}), and some put the name of your script (@samp{advice}). Don't rely on the value of @code{ARGV[0]} to provide your script name. -@node Comments, Quoting, Executable Scripts, Running gawk +@node Comments @subsection Comments in @command{awk} Programs @cindex @code{#} (number sign), commenting @cindex number sign (@code{#}), commenting @@ -1925,7 +1930,7 @@ when reading it at a later time. @cindex single quote (@code{'}), vs. apostrophe @cindex @code{'} (single quote), vs. apostrophe @strong{Caution:} As mentioned in -@ref{One-shot, ,One-Shot Throwaway @command{awk} Programs}, +@ref{One-shot}, you can enclose small to medium programs in single quotes, in order to keep your shell scripts self-contained. When doing so, @emph{don't} put an apostrophe (i.e., a single quote) into a comment (or anywhere else @@ -1958,7 +1963,7 @@ Putting a backslash before the single quote in @samp{let's} wouldn't help, since backslashes are not special inside single quotes. The next @value{SUBSECTION} describes the shell's quoting rules. -@node Quoting, , Comments, Running gawk +@node Quoting @subsection Shell-Quoting Issues @cindex quoting, rules for @@ -2000,7 +2005,7 @@ The shell does no interpretation of the quoted text, passing it on verbatim to the command. It is @emph{impossible} to embed a single quote inside single-quoted text. Refer back to -@ref{Comments, ,Comments in @command{awk} Programs}, +@ref{Comments}, for an example of what happens if you try. @item @@ -2019,7 +2024,7 @@ Thus, the example seen @ifnotinfo previously @end ifnotinfo -in @ref{Read Terminal, ,Running @command{awk} Without Input Files}, +in @ref{Read Terminal}, is applicable: @example @@ -2050,7 +2055,7 @@ awk -F"" '@var{program}' @var{files} # wrong! @end example @noindent -In the second case, @command{awk} will attempt to use the text of the program +In the second case, @command{awk} will attempt to use the text of the program as the value of @code{FS}, and the first @value{FN} as the text of the program! This results in syntax errors at best, and confusing behavior at worst. @end itemize @@ -2096,7 +2101,7 @@ If you really need both single and double quotes in your @command{awk} program, it is probably best to move it into a separate file, where the shell won't be part of the picture, and you can say what you mean. -@node Sample Data Files, Very Simple, Running gawk, Getting Started +@node Sample Data Files @section @value{DDF}s for the Examples @c For gawk >= 3.2, update these data files. No-one has such slow modems! @@ -2182,12 +2187,12 @@ learn in this @value{DOCUMENT}. @cindex Texinfo If you are using the stand-alone version of Info, -see @ref{Extract Program, ,Extracting Programs from Texinfo Source Files}, +see @ref{Extract Program}, for an @command{awk} program that extracts these @value{DF}s from @file{gawk.texi}, the Texinfo source file for this Info file. @end ifinfo -@node Very Simple, Two Rules, Sample Data Files, Getting Started +@node Very Simple @section Some Simple Examples The following command runs a simple @command{awk} program that searches the @@ -2210,7 +2215,7 @@ You will notice that slashes (@samp{/}) surround the string @samp{foo} in the @command{awk} program. The slashes indicate that @samp{foo} is the pattern to search for. This type of pattern is called a @dfn{regular expression}, which is covered in more detail later -(@pxref{Regexp, ,Regular Expressions}). +(@pxref{Regexp}). The pattern is allowed to match parts of words. There are single quotes around the @command{awk} program so that the shell won't @@ -2346,7 +2351,7 @@ If you use the expression @samp{NR % 2 == 1} instead, the program would print the odd-numbered lines. @end itemize -@node Two Rules, More Complex, Very Simple, Getting Started +@node Two Rules @section An Example with Two Rules @cindex @command{awk} programs @@ -2358,8 +2363,8 @@ no actions are run. After processing all the rules that match the line (and perhaps there are none), @command{awk} reads the next line. (However, -@pxref{Next Statement, ,The @code{next} Statement}, -and also @pxref{Nextfile Statement, ,Using @command{gawk}'s @code{nextfile} Statement}). +@pxref{Next Statement}, +and also @pxref{Nextfile Statement}). This continues until the program reaches the end of the file. For example, the following @command{awk} program contains two rules: @@ -2403,7 +2408,7 @@ $ awk '/12/ @{ print $0 @} Note how the line beginning with @samp{sabafoo} in @file{BBS-list} was printed twice, once for each rule. -@node More Complex, Statements/Lines, Two Rules, Getting Started +@node More Complex @section A More Complex Example Now that we've mastered some simple tasks, let's look at @@ -2426,7 +2431,7 @@ This command prints the total number of bytes in all the files in the current directory that were last modified in November (of any year). @footnote{In the C shell (@command{csh}), you need to type a semicolon and then a backslash at the end of the first line; see -@ref{Statements/Lines, ,@command{awk} Statements Versus Lines}, for an +@ref{Statements/Lines}, for an explanation. In a POSIX-compliant shell, such as the Bourne shell or @command{bash}, you can type the example as shown. If the command @samp{echo $path} produces an empty output line, you are most likely @@ -2475,13 +2480,13 @@ After the last line of output from @command{ls} has been processed, the 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 +(@pxref{Action Overview}). Before you can move on to more advanced @command{awk} programming, you have to know how @command{awk} interprets your input and displays your output. By manipulating fields and using @code{print} statements, you can produce some very useful and impressive-looking reports. -@node Statements/Lines, Other Features, More Complex, Getting Started +@node Statements/Lines @section @command{awk} Statements Versus Lines @cindex line breaks @cindex newlines @@ -2506,10 +2511,10 @@ symbols and keywords: A newline at any other point is considered the end of the statement.@footnote{The @samp{?} and @samp{:} referred to here is the three-operand conditional expression described in -@ref{Conditional Exp, ,Conditional Expressions}. +@ref{Conditional Exp}. Splitting lines after @samp{?} and @samp{:} is a minor @command{gawk} extension; if @option{--posix} is specified -(@pxref{Options, , Command-Line Options}), then this extension is disabled.} +(@pxref{Options}), then this extension is disabled.} @cindex @code{\} (backslash), continuing lines and @cindex backslash (@code{\}), continuing lines and @@ -2623,7 +2628,7 @@ separated with a semicolon was not in the original @command{awk} language; it was added for consistency with the treatment of statements within an action. -@node Other Features, When, Statements/Lines, Getting Started +@node Other Features @section Other Features of @command{awk} @cindex variables @@ -2640,9 +2645,9 @@ performing bit manipulation, and for runtime string translation. As we develop our presentation of the @command{awk} language, we introduce most of the variables and many of the functions. They are defined systematically in @ref{Built-in Variables}, and -@ref{Built-in, ,Built-in Functions}. +@ref{Built-in}. -@node When, , Other Features, Getting Started +@node When @section When to Use @command{awk} @cindex @command{awk}, uses for @@ -2653,7 +2658,7 @@ statements, and other selection criteria, you can produce much more complex output. The @command{awk} language is very useful for producing reports from large amounts of raw data, such as summarizing information from the output of other utility programs like @command{ls}. -(@xref{More Complex, ,A More Complex Example}.) +(@xref{More Complex}.) Programs written with @command{awk} are usually much smaller than they would be in other languages. This makes @command{awk} programs easy to compose and @@ -2680,7 +2685,7 @@ of large programs. Programs in these languages may require more lines of source code than the equivalent @command{awk} programs, but they are easier to maintain and usually run more efficiently. -@node Regexp, Reading Files, Getting Started, Top +@node Regexp @chapter Regular Expressions @cindex regexp, See regular expressions @c STARTOFRANGE regexp @@ -2721,7 +2726,7 @@ regular expressions work, we will present more complicated instances. * Locales:: How the locale affects things. @end menu -@node Regexp Usage, Escape Sequences, Regexp, Regexp +@node Regexp Usage @section How to Use Regular Expressions @cindex regular expressions, as patterns @@ -2761,7 +2766,7 @@ not be the entire current input record. The two operators @samp{~} and @samp{!~} perform regular expression comparisons. Expressions using these operators can be used as patterns, or in @code{if}, @code{while}, @code{for}, and @code{do} statements. -(@xref{Statements, ,Control Statements in Actions}.) +(@xref{Statements}.) For example: @example @@ -2815,7 +2820,7 @@ When a regexp is enclosed in slashes, such as @code{/foo/}, we call it a @dfn{regexp constant}, much like @code{5.27} is a numeric constant and @code{"foo"} is a string constant. -@node Escape Sequences, Regexp Operators, Regexp Usage, Regexp +@node Escape Sequences @section Escape Sequences @cindex escape sequences @@ -2933,11 +2938,11 @@ in order to tell @command{awk} to keep processing the rest of the string. In @command{gawk}, a number of additional two-character sequences that begin with a backslash have special meaning in regexps. -@xref{GNU Regexp Operators, ,@command{gawk}-Specific Regexp Operators}. +@xref{GNU Regexp Operators}. In a regexp, a backslash before any character that is not in the previous list and not listed in -@ref{GNU Regexp Operators, ,@command{gawk}-Specific Regexp Operators}, +@ref{GNU Regexp Operators}, means that the next character should be taken literally, even if it would normally be a regexp operator. For example, @code{/a\+b/} matches the three characters @samp{a+b}. @@ -2958,9 +2963,9 @@ as soon as @command{awk} reads your program. @item @command{gawk} processes both regexp constants and dynamic regexps -(@pxref{Computed Regexps, ,Using Dynamic Regexps}), +(@pxref{Computed Regexps}), for the special operators listed in -@ref{GNU Regexp Operators, ,@command{gawk}-Specific Regexp Operators}. +@ref{GNU Regexp Operators}. @item A backslash before any other character means to treat that character @@ -3006,7 +3011,7 @@ In such implementations, typing @code{"a\qc"} is the same as typing Suppose you use an octal or hexadecimal escape to represent a regexp metacharacter. -(See @ref{Regexp Operators, , Regular Expression Operators}.) +(See @ref{Regexp Operators}.) Does @command{awk} treat the character as a literal character or as a regexp operator? @@ -3015,12 +3020,12 @@ Historically, such characters were taken literally. @value{DARKCORNER} However, the POSIX standard indicates that they should be treated as real metacharacters, which is what @command{gawk} does. -In compatibility mode (@pxref{Options, ,Command-Line Options}), +In compatibility mode (@pxref{Options}), @command{gawk} treats the characters represented by octal and hexadecimal escape sequences literally when used in regexp constants. Thus, @code{/a\52b/} is equivalent to @code{/a\*b/}. -@node Regexp Operators, Character Lists, Escape Sequences, Regexp +@node Regexp Operators @section Regular Expression Operators @c STARTOFRANGE regexpo @cindex regular expressions, operators @@ -3093,7 +3098,7 @@ with @samp{A}. @c comma before using does NOT do tertiary @cindex POSIX @command{awk}, period (@code{.}), using -In strict POSIX mode (@pxref{Options, ,Command-Line Options}), +In strict POSIX mode (@pxref{Options}), @samp{.} does not match the @sc{nul} character, which is a character with all bits equal to zero. Otherwise, @sc{nul} is just another character. Other versions of @command{awk} @@ -3113,7 +3118,7 @@ the square brackets. For example, @samp{[MVX]} matches any one of the characters @samp{M}, @samp{V}, or @samp{X} in a string. A full discussion of what can be inside the square brackets of a character list is given in -@ref{Character Lists, ,Using Character Lists}. +@ref{Character Lists}. @cindex character lists, complemented @item [^ @dots{}] @@ -3137,7 +3142,7 @@ means it matches any string that starts with @samp{P} or contains a digit. The alternation applies to the largest possible regexps on either side. @cindex @code{()} (parentheses) -@cindex parentheses @code{()} +@cindex parentheses @code{()} @item (@dots{}) Parentheses are used for grouping in regular expressions, as in arithmetic. They can be used to concatenate regular expressions @@ -3218,7 +3223,7 @@ and @command{egrep} consistent with each other. However, because old programs may use @samp{@{} and @samp{@}} in regexp constants, by default @command{gawk} does @emph{not} match interval expressions in regexps. If either @option{--posix} or @option{--re-interval} are specified -(@pxref{Options, , Command-Line Options}), then interval expressions +(@pxref{Options}), then interval expressions are allowed in regexps. For new programs that use @samp{@{} and @samp{@}} in regexp constants, @@ -3244,12 +3249,12 @@ For example, @samp{/+/} matches a literal plus sign. However, many other versio @command{awk} treat such a usage as a syntax error. If @command{gawk} is in compatibility mode -(@pxref{Options, ,Command-Line Options}), +(@pxref{Options}), POSIX character classes and interval expressions are not available in regular expressions. @c ENDOFRANGE regexpo -@node Character Lists, GNU Regexp Operators, Regexp Operators, Regexp +@node Character Lists @section Using Character Lists @c STARTOFRANGE charlist @cindex character lists @@ -3423,7 +3428,7 @@ they do not recognize collating symbols or equivalence classes. @c maybe one day ... @c ENDOFRANGE charlist -@node GNU Regexp Operators, Case-sensitivity, Character Lists, Regexp +@node GNU Regexp Operators @section @command{gawk}-Specific Regexp Operators @c This section adapted (long ago) from the regex-0.12 manual @@ -3546,7 +3551,7 @@ lesser of two evils. @cindex regular expressions, @command{gawk}, command-line options @cindex @command{gawk}, command-line options The various command-line options -(@pxref{Options, ,Command-Line Options}) +(@pxref{Options}) control how @command{gawk} interprets characters in regexps: @table @asis @@ -3559,7 +3564,7 @@ GNU regexp operators. @end ifnotinfo @ifnottex GNU regexp operators described -in @ref{Regexp Operators, ,Regular Expression Operators}. +in @ref{Regexp Operators}. @end ifnottex However, interval expressions are not supported. @@ -3584,7 +3589,7 @@ when @option{--posix} is is used.) @c ENDOFRANGE gregexp @c ENDOFRANGE regexpg -@node Case-sensitivity, Leftmost Longest, GNU Regexp Operators, Regexp +@node Case-sensitivity @section Case Sensitivity in Matching @c STARTOFRANGE regexpcs @@ -3605,7 +3610,7 @@ One way to perform a case-insensitive match at a particular point in the program is to convert the data to a single case, using the @code{tolower} or @code{toupper} built-in string functions (which we haven't discussed yet; -@pxref{String Functions, ,String Manipulation Functions}). +@pxref{String Functions}). For example: @example @@ -3656,8 +3661,8 @@ thing you can do with @code{IGNORECASE} only is dynamically turn case-sensitivity on or off for all the rules at once. @code{IGNORECASE} can be set on the command line or in a @code{BEGIN} rule -(@pxref{Other Arguments, ,Other Command-Line Arguments}; also -@pxref{Using BEGIN/END, ,Startup and Cleanup Actions}). +(@pxref{Other Arguments}; also +@pxref{Using BEGIN/END}). Setting @code{IGNORECASE} from the command line is a way to make a program case-insensitive without having to edit it. @@ -3677,12 +3682,12 @@ ASCII characters, which also provides a number of characters suitable for use with European languages. The value of @code{IGNORECASE} has no effect if @command{gawk} is in -compatibility mode (@pxref{Options, ,Command-Line Options}). +compatibility mode (@pxref{Options}). Case is always significant in compatibility mode. @c ENDOFRANGE csregexp @c ENDOFRANGE regexpcs -@node Leftmost Longest, Computed Regexps, Case-sensitivity, Regexp +@node Leftmost Longest @section How Much Text Matches? @cindex regular expressions, leftmost longest match @@ -3694,7 +3699,7 @@ echo aaaabcd | awk '@{ sub(/a+/, "<A>"); print @}' @end example This example uses the @code{sub} function (which we haven't discussed yet; -@pxref{String Functions, ,String Manipulation Functions}) +@pxref{String Functions}) to make a change to the input record. Here, the regexp @code{/a+/} indicates ``one or more @samp{a} characters,'' and the replacement text is @samp{<A>}. @@ -3714,14 +3719,14 @@ For simple match/no-match tests, this is not so important. But when doing text matching and substitutions with the @code{match}, @code{sub}, @code{gsub}, and @code{gensub} functions, it is very important. @ifinfo -@xref{String Functions, ,String Manipulation Functions}, +@xref{String Functions}, for more information on these functions. @end ifinfo 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}). +and field splitting (@pxref{Records}, +and also @pxref{Field Separators}). -@node Computed Regexps, Locales, Leftmost Longest, Regexp +@node Computed Regexps @section Using Dynamic Regexps @c STARTOFRANGE dregexp @@ -3837,7 +3842,7 @@ occur often in practice, but it's worth noting for future reference. @c ENDOFRANGE regexpd @c ENDOFRANGE regexp -@node Locales, , Computed Regexps, Regexp +@node Locales @section Where You Are Makes A Difference Modern systems support the notion of @dfn{locales}: a way to tell @@ -3849,7 +3854,7 @@ one particular case. The following example uses the @code{sub} function, which does text replacement -(@pxref{String Functions, , String-Manipulation Functions}). +(@pxref{String Functions}). Here, the intent is to remove trailing uppercase characters: @example @@ -3868,7 +3873,7 @@ before running @command{gawk}, by using the shell statements: @example -LANG=C LC_ALL=C +LANG=C LC_ALL=C export LANG LC_ALL @end example @@ -3877,7 +3882,19 @@ 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 +Similar considerations apply to other ranges. For example, +@samp{["-/]} is perfectly valid in ASCII, but is not valid in many +Unicode locales, such as @samp{en_US.UTF-8}. (In general, such +ranges should be avoided; either list the characters individually, +or use a POSIX character class such as @samp{[[:punct:]]}.) + +For the normal case of @samp{RS = "\n"}, the locale is largely irrelevant. +For other single byte record separators, using @samp{LC_ALL=C} will give you +much better performance when reading records. Otherwise, @command{gawk} has +to make several function calls, @emph{per input character} to find the record +terminator. + +@node Reading Files @chapter Reading Input Files @c STARTOFRANGE infir @@ -3906,7 +3923,7 @@ On rare occasions, you may need to use the @code{getline} command. The @code{getline} command is valuable, both because it can do explicit input from any number of files, and because the files used with it do not have to be named on the @command{awk} command line -(@pxref{Getline, ,Explicit Input with @code{getline}}). +(@pxref{Getline}). @menu * Records:: Controlling how data is split into records. @@ -3920,7 +3937,7 @@ used with it do not have to be named on the @command{awk} command line using the @code{getline} function. @end menu -@node Records, Fields, Reading Files, Reading Files +@node Records @section How Input Is Split into Records @c STARTOFRANGE inspl @@ -3953,13 +3970,13 @@ assigning the character to the built-in variable @code{RS}. Like any other variable, the value of @code{RS} can be changed in the @command{awk} program with the assignment operator, @samp{=} -(@pxref{Assignment Ops, ,Assignment Expressions}). +(@pxref{Assignment Ops}). The new record-separator character should be enclosed in quotation marks, which indicate a string constant. Often the right time to do this is at the beginning of execution, before any input is processed, so that the very first record is read with the proper separator. To do this, use the special @code{BEGIN} pattern -(@pxref{BEGIN/END, ,The @code{BEGIN} and @code{END} Special Patterns}). +(@pxref{BEGIN/END}). For example: @cindex @code{BEGIN} pattern @@ -4012,7 +4029,7 @@ $ awk 'BEGIN @{ RS = "/" @} @noindent Note that the entry for the @samp{camelot} BBS is not split. In the original @value{DF} -(@pxref{Sample Data Files, ,@value{DDF}s for the Examples}), +(@pxref{Sample Data Files}), the line looks like this: @example @@ -4031,7 +4048,7 @@ is the original newline in the @value{DF}, not the one added by @cindex separators, for records Another way to change the record separator is on the command line, using the variable-assignment feature -(@pxref{Other Arguments, ,Other Command-Line Arguments}): +(@pxref{Other Arguments}): @example awk '@{ print $0 @}' RS="/" BBS-list @@ -4063,7 +4080,7 @@ The empty string @code{""} (a string without any characters) has a special meaning as the value of @code{RS}. It means that records are separated by one or more blank lines and nothing else. -@xref{Multiple Line, ,Multiple-Line Records}, for more details. +@xref{Multiple Line}, for more details. If you change the value of @code{RS} in the middle of an @command{awk} run, the new value is used to delimit subsequent records, but the record @@ -4083,7 +4100,7 @@ sets the variable @code{RT} to the text in the input that matched When using @command{gawk}, the value of @code{RS} is not limited to a one-character string. It can be any regular expression -(@pxref{Regexp, ,Regular Expressions}). +(@pxref{Regexp}). In general, each record ends at the next string that matches the regular expression; the next record starts at the end of the matching string. This general rule is @@ -4107,9 +4124,9 @@ with optional leading and/or trailing whitespace: $ echo record 1 AAAA record 2 BBBB record 3 | > gawk 'BEGIN @{ RS = "\n|( *[[:upper:]]+ *)" @} > @{ print "Record =", $0, "and RT =", RT @}' -@print{} Record = record 1 and RT = AAAA -@print{} Record = record 2 and RT = BBBB -@print{} Record = record 3 and RT = +@print{} Record = record 1 and RT = AAAA +@print{} Record = record 2 and RT = BBBB +@print{} Record = record 3 and RT = @print{} @end example @@ -4117,7 +4134,7 @@ $ echo record 1 AAAA record 2 BBBB record 3 | The final line of output has an extra blank line. This is because the value of @code{RT} is a newline, and the @code{print} statement supplies its own terminating newline. -@xref{Simple Sed, ,A Simple Stream Editor}, for a more useful example +@xref{Simple Sed}, 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 @@ -4132,7 +4149,7 @@ no guarantee that this will never happen. The use of @code{RS} as a regular expression and the @code{RT} variable are @command{gawk} extensions; they are not available in compatibility mode -(@pxref{Options, ,Command-Line Options}). +(@pxref{Options}). In compatibility mode, only the first character of the value of @code{RS} is used to determine the end of the record. @@ -4177,7 +4194,7 @@ record onto the end of the previous ones. @c ENDOFRANGE inspl @c ENDOFRANGE recspl -@node Fields, Nonconstant Fields, Records, Reading Files +@node Fields @section Examining Fields @cindex examining fields @@ -4257,7 +4274,7 @@ $ awk '$1 ~ /foo/ @{ print $0 @}' BBS-list This example prints each record in the file @file{BBS-list} whose first field contains the string @samp{foo}. The operator @samp{~} is called a @dfn{matching operator} -(@pxref{Regexp Usage, , How to Use Regular Expressions}); +(@pxref{Regexp Usage}); it tests whether a string (here, the field @code{$1}) matches a given regular expression. @@ -4274,7 +4291,7 @@ $ awk '/foo/ @{ print $1, $NF @}' BBS-list @end example @c ENDOFRANGE fiex -@node Nonconstant Fields, Changing Fields, Fields, Reading Files +@node Nonconstant Fields @section Nonconstant Field Numbers @cindex fields, numbers @cindex field numbers @@ -4310,7 +4327,7 @@ operator in the field-number expression. This example, then, prints the hours of operation (the fourth field) for every line of the file @file{BBS-list}. (All of the @command{awk} operators are listed, in order of decreasing precedence, in -@ref{Precedence, , Operator Precedence (How Operators Nest)}.) +@ref{Precedence}.) If the field number you compute is zero, you get the entire record. Thus, @samp{$(2-2)} has the same value as @code{$0}. Negative field @@ -4320,13 +4337,13 @@ what happens when you reference a negative field number. @command{gawk} notices this and terminates your program. Other @command{awk} implementations may behave differently.) -As mentioned in @ref{Fields, ,Examining Fields}, +As mentioned in @ref{Fields}, @command{awk} stores the current record's number of fields in the built-in variable @code{NF} (also @pxref{Built-in Variables}). The expression @code{$NF} is not a special feature---it is the direct consequence of evaluating @code{NF} and using its value as a field number. -@node Changing Fields, Field Separators, Nonconstant Fields, Reading Files +@node Changing Fields @section Changing the Contents of a Field @c STARTOFRANGE ficon @@ -4351,7 +4368,7 @@ The program first saves the original value of field three in the variable @code{nboxes}. The @samp{-} sign represents subtraction, so this program reassigns field three, @code{$3}, as the original value of field three minus ten: -@samp{$3 - 10}. (@xref{Arithmetic Ops, ,Arithmetic Operators}.) +@samp{$3 - 10}. (@xref{Arithmetic 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.) @@ -4361,7 +4378,7 @@ 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 becomes field three. -@xref{Conversion, ,Conversion of Strings and Numbers}. +@xref{Conversion}. When the value of a field is changed (as perceived by @command{awk}), the text of the input record is recalculated to contain the new field where @@ -4408,7 +4425,7 @@ existing fields. @cindex output field separator, See @code{OFS} variable @cindex field separators, See Also @code{OFS} This recomputation affects and is affected by -@code{NF} (the number of fields; @pxref{Fields, ,Examining Fields}). +@code{NF} (the number of fields; @pxref{Fields}). 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: @@ -4429,9 +4446,9 @@ else @noindent should print @samp{everything is normal}, because @code{NF+1} is certain -to be out of range. (@xref{If Statement, ,The @code{if}-@code{else} Statement}, +to be out of range. (@xref{If Statement}, for more information about @command{awk}'s @code{if-else} statements. -@xref{Typing and Comparison, ,Variable Typing and Comparison Expressions}, +@xref{Typing and Comparison}, for more information about the @samp{!=} operator.) It is important to note that making an assignment to an existing field @@ -4502,10 +4519,10 @@ 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}). +(@pxref{String Functions}). @c ENDOFRANGE ficon -@node Field Separators, Constant Size, Changing Fields, Reading Files +@node Field Separators @section Specifying How Fields Are Separated @menu @@ -4547,12 +4564,12 @@ the Unix Bourne shell, @command{sh}, or @command{bash}). @cindex @code{FS} variable, changing value of The value of @code{FS} can be changed in the @command{awk} program with the -assignment operator, @samp{=} (@pxref{Assignment Ops, ,Assignment Expressions}). +assignment operator, @samp{=} (@pxref{Assignment Ops}). Often the right time to do this is at the beginning of execution before any input has been processed, so that the very first record is read with the proper separator. To do this, use the special @code{BEGIN} pattern -(@pxref{BEGIN/END, ,The @code{BEGIN} and @code{END} Special Patterns}). +(@pxref{BEGIN/END}). For example, here we set the value of @code{FS} to the string @code{","}: @@ -4612,7 +4629,7 @@ beginning or the end of the line, that too delimits an empty field. The space character is the only single character that does not follow these rules. -@node Regexp Field Splitting, Single Character Fields, Field Separators, Field Separators +@node Regexp Field Splitting @subsection Using Regular Expressions to Separate Fields @c STARTOFRANGE regexpfs @@ -4644,7 +4661,7 @@ For a less trivial example of a regular expression, try using single spaces to separate fields the way single commas are used. @code{FS} can be set to @w{@code{"[@ ]"}} (left bracket, space, right bracket). This regular expression matches a single space and nothing else -(@pxref{Regexp, ,Regular Expressions}). +(@pxref{Regexp}). There is an important difference between the two cases of @samp{FS = @w{" "}} (a single space) and @samp{FS = @w{"[ \t\n]+"}} @@ -4696,7 +4713,7 @@ Finally, the last @code{print} statement prints the new @code{$0}. @c ENDOFRANGE regexpfs @c ENDOFRANGE fsregexp -@node Single Character Fields, Command Line Field Separator, Regexp Field Splitting, Field Separators +@node Single Character Fields @subsection Making Each Character a Separate Field @cindex differences in @command{awk} and @command{gawk}, single-character fields @@ -4726,11 +4743,11 @@ In this case, most versions of Unix @command{awk} simply treat the entire record as only having one field. @value{DARKCORNER} In compatibility mode -(@pxref{Options, ,Command-Line Options}), +(@pxref{Options}), if @code{FS} is the null string, then @command{gawk} also behaves this way. -@node Command Line Field Separator, Field Splitting Summary, Single Character Fields, Field Separators +@node Command Line Field Separator @subsection Setting @code{FS} from the Command Line @cindex @code{-F} option @cindex options, command-line @@ -4778,7 +4795,7 @@ a single @samp{\} to use for the field separator. @c @cindex historical features As a special case, in compatibility mode -(@pxref{Options, ,Command-Line Options}), +(@pxref{Options}), if the argument to @option{-F} is @samp{t}, then @code{FS} is set to the TAB character. If you type @samp{-F\t} at the shell, without any quotes, the @samp{\} gets deleted, so @command{awk} @@ -4849,7 +4866,7 @@ the entries for users who have no password: awk -F: '$2 == ""' /etc/passwd @end example -@node Field Splitting Summary, , Command Line Field Separator, Field Separators +@node Field Splitting Summary @subsection Field-Splitting Summary It is important to remember that when you assign a string constant @@ -4935,7 +4952,7 @@ root:nSijPlPhZZwgE:0:0:Root:/: @subheading Advanced Notes: @code{FS} and @code{IGNORECASE} The @code{IGNORECASE} variable -(@pxref{User-modified, ,Built-in Variables That Control @command{awk}}) +(@pxref{User-modified}) 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: @@ -4956,7 +4973,7 @@ will take effect. @c ENDOFRANGE fisepr @c ENDOFRANGE fisepg -@node Constant Size, Multiple Line, Field Separators, Reading Files +@node Constant Size @section Reading Fixed-Width Data @ifnotinfo @@ -4985,7 +5002,7 @@ the use of a variable number of spaces and @emph{empty fields are just spaces}. Clearly, @command{awk}'s normal field splitting based on @code{FS} does not work well in this case. Although a portable @command{awk} program can use a series of @code{substr} calls on @code{$0} -(@pxref{String Functions, ,String Manipulation Functions}), +(@pxref{String Functions}), this is awkward and inefficient for a large number of fields. @c comma before specifying is part of tertiary @@ -5076,7 +5093,7 @@ Assigning a value to @code{FS} causes @command{gawk} to use without having to know the current value of @code{FS}. In order to tell which kind of field splitting is in effect, use @code{PROCINFO["FS"]} -(@pxref{Auto-set, ,Built-in Variables That Convey Information}). +(@pxref{Auto-set}). The value is @code{"FS"} if regular field splitting is being used, or it is @code{"FIELDWIDTHS"} if fixed-width field splitting is being used: @@ -5090,10 +5107,10 @@ else This information is useful when writing a function that needs to temporarily change @code{FS} or @code{FIELDWIDTHS}, read some records, and then restore the original settings -(@pxref{Passwd Functions, ,Reading the User Database}, +(@pxref{Passwd Functions}, for an example of such a function). -@node Multiple Line, Getline, Constant Size, Reading Files +@node Multiple Line @section Multiple-Line Records @c STARTOFRANGE recm @@ -5134,7 +5151,7 @@ string @code{"\n\n+"} to @code{RS}. This regexp matches the newline at the end of the record and one or more blank lines after the record. In addition, a regular expression always matches the longest possible sequence when there is a choice -(@pxref{Leftmost Longest, ,How Much Text Matches?}). +(@pxref{Leftmost Longest}). So the next record doesn't start until the first nonblank line that follows---no matter how many blank lines appear in a row, they are considered one record separator. @@ -5166,7 +5183,7 @@ to @w{@code{" "}}). This feature can be a problem if you really don't 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}). +(@pxref{String 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 @@ -5217,15 +5234,15 @@ $ awk -f addrs.awk addresses @print{} Name is: Jane Doe @print{} Address is: 123 Main Street @print{} City and State are: Anywhere, SE 12345-6789 -@print{} +@print{} @print{} Name is: John Smith @print{} Address is: 456 Tree-lined Avenue @print{} City and State are: Smallville, MW 98765-4321 -@print{} +@print{} @dots{} @end example -@xref{Labels Program, ,Printing Mailing Labels}, for a more realistic +@xref{Labels Program}, for a more realistic program that deals with address lists. The following table @@ -5268,7 +5285,7 @@ value specified by @code{RS}. @c ENDOFRANGE imr @c ENDOFRANGE frm -@node Getline, , Multiple Line, Reading Files +@node Getline @section Explicit Input with @code{getline} @c STARTOFRANGE getl @@ -5316,7 +5333,7 @@ represents a shell command. * Getline Summary:: Summary of @code{getline} Variants. @end menu -@node Plain Getline, Getline/Variable, Getline, Getline +@node Plain Getline @subsection Using @code{getline} with No Arguments The @code{getline} command can be used without arguments to read input @@ -5370,9 +5387,9 @@ of @code{$0} that triggered the rule that executed @code{getline} is lost. By contrast, the @code{next} statement reads a new record but immediately begins processing it normally, starting with the first -rule in the program. @xref{Next Statement, ,The @code{next} Statement}. +rule in the program. @xref{Next Statement}. -@node Getline/Variable, Getline/File, Plain Getline, Getline +@node Getline/Variable @subsection Using @code{getline} into a Variable @c comma before using is NOT for tertiary @cindex variables, @code{getline} command into, using @@ -5422,7 +5439,7 @@ The @code{getline} command used in this way sets only the variables split into fields, so the values of the fields (including @code{$0}) and the value of @code{NF} do not change. -@node Getline/File, Getline/Variable/File, Getline/Variable, Getline +@node Getline/File @subsection Using @code{getline} from a File @cindex input redirection @@ -5462,10 +5479,8 @@ According to POSIX, @samp{getline < @var{expression}} is ambiguous if because the concatenation operator is not parenthesized. You should write it as @samp{getline < (dir "/" file)} if you want your program to be portable to other @command{awk} implementations. -(It happens that @command{gawk} gets it right, but you should not -rely on this. Parentheses make it easier to read.) -@node Getline/Variable/File, Getline/Pipe, Getline/File, Getline +@node Getline/Variable/File @subsection Using @code{getline} into a Variable from a File @c comma before using is NOT for tertiary @cindex variables, @code{getline} command into, using @@ -5502,16 +5517,16 @@ the @samp{@@include} line. The @code{close} function is called to ensure that if two identical @samp{@@include} lines appear in the input, the entire specified file is included twice. -@xref{Close Files And Pipes, ,Closing Input and Output Redirections}. +@xref{Close Files And Pipes}. One deficiency of this program is that it does not process nested @samp{@@include} statements (i.e., @samp{@@include} statements in included files) the way a true macro preprocessor would. -@xref{Igawk Program, ,An Easy Way to Use Library Functions}, for a program +@xref{Igawk Program}, for a program that does handle nested @samp{@@include} statements. -@node Getline/Pipe, Getline/Variable/Pipe, Getline/Variable/File, Getline +@node Getline/Pipe @subsection Using @code{getline} from a Pipe @cindex @code{|} (vertical bar), @code{|} operator (I/O) @@ -5546,7 +5561,7 @@ The @code{close} function is called to ensure that if two identical @samp{@@execute} lines appear in the input, the command is run for each one. @ifnottex -@xref{Close Files And Pipes, ,Closing Input and Output Redirections}. +@xref{Close Files And Pipes}. @end ifnottex @c Exercise!! @c This example is unrealistic, since you could just use system @@ -5593,12 +5608,8 @@ According to POSIX, @samp{@var{expression} | getline} is ambiguous if because the concatenation operator is not parenthesized. You should write it as @samp{(@w{"echo "} "date") | getline} if you want your program to be portable to other @command{awk} implementations. -@ifinfo -(It happens that @command{gawk} gets it right, but you should not -rely on this. Parentheses make it easier to read, anyway.) -@end ifinfo -@node Getline/Variable/Pipe, Getline/Coprocess, Getline/Pipe, Getline +@node Getline/Variable/Pipe @subsection Using @code{getline} into a Variable from a Pipe @c comma before using is NOT for tertiary @cindex variables, @code{getline} command into, using @@ -5629,11 +5640,9 @@ According to POSIX, @samp{@var{expression} | getline @var{var}} is ambiguous if because the concatenation operator is not parenthesized. You should write it as @samp{(@w{"echo "} "date") | getline @var{var}} if you want your program to be portable to other @command{awk} implementations. -(It happens that @command{gawk} gets it right, but you should not -rely on this. Parentheses make it easier to read, anyway.) @end ifinfo -@node Getline/Coprocess, Getline/Variable/Coprocess, Getline/Variable/Pipe, Getline +@node Getline/Coprocess @subsection Using @code{getline} from a Coprocess @cindex coprocesses, @code{getline} from @c comma before using is NOT for tertiary @@ -5672,10 +5681,10 @@ and of @code{NF}. Coprocesses are an advanced feature. They are discussed here only because this is the @value{SECTION} on @code{getline}. -@xref{Two-way I/O, ,Two-Way Communications with Another Process}, +@xref{Two-way I/O}, where coprocesses are discussed in more detail. -@node Getline/Variable/Coprocess, Getline Notes, Getline/Coprocess, Getline +@node Getline/Variable/Coprocess @subsection Using @code{getline} into a Variable from a Coprocess @c comma before using is NOT for tertiary @cindex variables, @code{getline} command into, using @@ -5691,11 +5700,11 @@ changed is @var{var}. @ifinfo Coprocesses are an advanced feature. They are discussed here only because this is the @value{SECTION} on @code{getline}. -@xref{Two-way I/O, ,Two-Way Communications with Another Process}, +@xref{Two-way I/O}, where coprocesses are discussed in more detail. @end ifinfo -@node Getline Notes, Getline Summary, Getline/Variable/Coprocess, Getline +@node Getline Notes @subsection Points to Remember About @code{getline} Here are some miscellaneous points about @code{getline} that you should bear in mind: @@ -5731,8 +5740,8 @@ causes @command{awk} to set the value of @code{FILENAME}. Normally, @code{FILENAME} does not have a value inside @code{BEGIN} rules, because you 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}.) +(@xref{BEGIN/END}, +also @pxref{Auto-set}.) @item Using @code{FILENAME} with @code{getline} @@ -5745,7 +5754,7 @@ probably by accident, and you should reconsider what it is you're trying to accomplish. @end itemize -@node Getline Summary, , Getline Notes, Getline +@node Getline Summary @subsection Summary of @code{getline} Variants @cindex @code{getline} command, variants @@ -5775,7 +5784,7 @@ This is a @command{gawk} extension @c ENDOFRANGE inex @c ENDOFRANGE infir -@node Printing, Expressions, Reading Files, Top +@node Printing @chapter Printing Output @c STARTOFRANGE prnt @@ -5790,9 +5799,9 @@ computing @emph{which} values to print. However, with two exceptions, you cannot specify @emph{how} to print them---how many columns, whether to use exponential notation or not, and so on. (For the exceptions, @pxref{Output Separators}, and -@ref{OFMT, ,Controlling Numeric Output with @code{print}}.) +@ref{OFMT}.) For printing with specifications, you need the @code{printf} statement -(@pxref{Printf, ,Using @code{printf} Statements for Fancier Printing}). +(@pxref{Printf}). @c STARTOFRANGE prnts @cindex @code{print} statement @@ -5816,7 +5825,7 @@ and discusses the @code{close} built-in function. * Close Files And Pipes:: Closing Input and Output Files and Pipes. @end menu -@node Print, Print Examples, Printing, Printing +@node Print @section The @code{print} Statement The @code{print} statement is used to produce output with simple, standardized @@ -5832,7 +5841,7 @@ print @var{item1}, @var{item2}, @dots{} The entire list of items may be optionally enclosed in parentheses. The parentheses are necessary if any of the item expressions uses the @samp{>} relational operator; otherwise it could be confused with a redirection -(@pxref{Redirection, ,Redirecting Output of @code{print} and @code{printf}}). +(@pxref{Redirection}). The items to print can be constant strings or numbers, fields of the current record (such as @code{$1}), variables, or any @command{awk} @@ -5850,7 +5859,7 @@ double-quote characters, your text is taken as an @command{awk} expression, and you will probably get an error. Keep in mind that a space is printed between any two items. -@node Print Examples, Output Separators, Print, Printing +@node Print Examples @section Examples of @code{print} Statements Each @code{print} statement makes at least one line of output. However, it @@ -5907,7 +5916,7 @@ example's output makes much sense. A heading line at the beginning would make it clearer. Let's add some headings to our table of months (@code{$1}) and green crates shipped (@code{$2}). We do this using the @code{BEGIN} pattern -(@pxref{BEGIN/END, ,The @code{BEGIN} and @code{END} Special Patterns}) +(@pxref{BEGIN/END}) so that the headings are only printed once: @example @@ -5948,17 +5957,17 @@ Lining up columns this way can get pretty complicated when there are many columns to fix. Counting spaces for two or three columns is simple, but any more than this can take up a lot of time. This is why the @code{printf} statement was -created (@pxref{Printf, ,Using @code{printf} Statements for Fancier Printing}); +created (@pxref{Printf}); one of its specialties is lining up columns of data. @cindex line continuations, in @code{print} statement @cindex @code{print} statement, line continuations and @strong{Note:} You can continue either a @code{print} or @code{printf} statement simply by putting a newline after any comma -(@pxref{Statements/Lines, ,@command{awk} Statements Versus Lines}). +(@pxref{Statements/Lines}). @c ENDOFRANGE prnts -@node Output Separators, OFMT, Print Examples, Printing +@node Output Separators @section Output Separators @cindex @code{OFS} variable @@ -5984,11 +5993,11 @@ character. Thus, each @code{print} statement normally makes a separate line. In order to change how output fields and records are separated, assign new values to the variables @code{OFS} and @code{ORS}. The usual place to do this is in the @code{BEGIN} rule -(@pxref{BEGIN/END, ,The @code{BEGIN} and @code{END} Special Patterns}), so +(@pxref{BEGIN/END}), so that it happens before any input is processed. It can also be done with assignments on the command line, before the names of the input files, or using the @option{-v} command-line option -(@pxref{Options, ,Command-Line Options}). +(@pxref{Options}). The following example prints the first and second fields of each input record, separated by a semicolon, with a blank line added after each newline: @@ -6008,9 +6017,9 @@ program by using a new value of @code{OFS}. $ awk 'BEGIN @{ OFS = ";"; ORS = "\n\n" @} > @{ print $1, $2 @}' BBS-list @print{} aardvark;555-5553 -@print{} +@print{} @print{} alpo-net;555-3412 -@print{} +@print{} @print{} barfly;555-7685 @dots{} @end example @@ -6018,7 +6027,7 @@ $ awk 'BEGIN @{ OFS = ";"; ORS = "\n\n" @} If the value of @code{ORS} does not contain a newline, the program's output is run together on a single line. -@node OFMT, Printf, Output Separators, Printing +@node OFMT @section Controlling Numeric Output with @code{print} @cindex numeric, output format @c the comma does NOT start a secondary @@ -6027,13 +6036,13 @@ When the @code{print} statement is used to print numeric values, @command{awk} internally converts the number to a string of characters and prints that string. @command{awk} uses the @code{sprintf} function to do this conversion -(@pxref{String Functions, ,String Manipulation Functions}). +(@pxref{String Functions}). For now, it suffices to say that the @code{sprintf} function accepts a @dfn{format specification} that tells it how to format numbers (or strings), and that there are a number of different ways in which numbers can be formatted. The different format specifications are discussed more fully in -@ref{Control Letters, , Format-Control Letters}. +@ref{Control Letters}. @cindex @code{sprintf} function @cindex @code{OFMT} variable @@ -6062,7 +6071,7 @@ According to the POSIX standard, @command{awk}'s behavior is undefined if @code{OFMT} contains anything but a floating-point conversion specification. @value{DARKCORNER} -@node Printf, Redirection, OFMT, Printing +@node Printf @section Using @code{printf} Statements for Fancier Printing @c STARTOFRANGE printfs @@ -6086,7 +6095,7 @@ arguments. * Printf Examples:: Several examples. @end menu -@node Basic Printf, Control Letters, Printf, Printf +@node Basic Printf @subsection Introduction to the @code{printf} Statement @cindex @code{printf} statement, syntax of @@ -6100,7 +6109,7 @@ printf @var{format}, @var{item1}, @var{item2}, @dots{} The entire list of arguments may optionally be enclosed in parentheses. The parentheses are necessary if any of the item expressions use the @samp{>} relational operator; otherwise, it can be confused with a redirection -(@pxref{Redirection, ,Redirecting Output of @code{print} and @code{printf}}). +(@pxref{Redirection}). @cindex format strings The difference between @code{printf} and @code{print} is the @var{format} @@ -6133,7 +6142,7 @@ $ awk 'BEGIN @{ Here, neither the @samp{+} nor the @samp{OUCH} appear when the message is printed. -@node Control Letters, Format Modifiers, Basic Printf, Printf +@node Control Letters @subsection Format-Control Letters @cindex @code{printf} statement, format-control characters @cindex format specifiers, @code{printf} statement @@ -6214,13 +6223,15 @@ argument and it ignores any modifiers. @cindex dark corner, format-control characters @cindex @command{gawk}, format-control characters @strong{Note:} -When using the integer format-control letters for values that are outside -the range of a C @code{long} integer, @command{gawk} switches to the -@samp{%g} format specifier. Other versions of @command{awk} may print -invalid values or do something else entirely. +When using the integer format-control letters for values that are +outside the range of the widest C integer type, @command{gawk} switches to the +the @samp{%g} format specifier. If @option{--lint} is provided on the +command line (@pxref{Options}), @command{gawk} +warns about this. Other versions of @command{awk} may print invalid +values or do something else entirely. @value{DARKCORNER} -@node Format Modifiers, Printf Examples, Control Letters, Printf +@node Format Modifiers @subsection Modifiers for @code{printf} Formats @c STARTOFRANGE pfm @@ -6259,7 +6270,7 @@ prints the famous friendly message twice. At first glance, this feature doesn't seem to be of much use. It is in fact a @command{gawk} extension, intended for use in translating messages at runtime. -@xref{Printf Ordering, , Rearranging @code{printf} Arguments}, +@xref{Printf Ordering}, which describes how and why to use positional specifiers. For now, we will not use them. @@ -6405,12 +6416,12 @@ C programmers may be used to supplying additional modifiers in @code{printf} format strings. These are not valid in @command{awk}. Most @command{awk} implementations silently ignore these modifiers. If @option{--lint} is provided on the command line -(@pxref{Options, ,Command-Line Options}), +(@pxref{Options}), @command{gawk} warns about their use. If @option{--posix} is supplied, their use is a fatal error. @c ENDOFRANGE pfm -@node Printf Examples, , Format Modifiers, Printf +@node Printf Examples @subsection Examples Using @code{printf} The following is a simple example of @@ -6454,7 +6465,7 @@ after them. The table could be made to look even nicer by adding headings to the tops of the columns. This is done using the @code{BEGIN} pattern -(@pxref{BEGIN/END, ,The @code{BEGIN} and @code{END} Special Patterns}) +(@pxref{BEGIN/END}) so that the headers are only printed once, at the beginning of the @command{awk} program: @@ -6494,10 +6505,10 @@ At this point, it would be a worthwhile exercise to use the @code{printf} statement to line up the headings and table data for the @file{inventory-shipped} example that was covered earlier in the @value{SECTION} on the @code{print} statement -(@pxref{Print, ,The @code{print} Statement}). +(@pxref{Print}). @c ENDOFRANGE printfs -@node Redirection, Special Files, Printf, Printing +@node Redirection @section Redirecting Output of @code{print} and @code{printf} @cindex output redirection @@ -6611,11 +6622,11 @@ close(report) The message is built using string concatenation and saved in the variable @code{m}. It's then sent down the pipeline to the @command{mail} program. (The parentheses group the items to concatenate---see -@ref{Concatenation, ,String Concatenation}.) +@ref{Concatenation}.) The @code{close} function is called here because it's a good idea to close the pipe as soon as all the intended output has been sent to it. -@xref{Close Files And Pipes, ,Closing Input and Output Redirections}, +@xref{Close Files And Pipes}, for more information. This example also illustrates the use of a variable to represent @@ -6638,7 +6649,7 @@ but subsidiary to, the @command{awk} program. This feature is a @command{gawk} extension, and is not available in POSIX @command{awk}. -@xref{Two-way I/O, ,Two-Way Communications with Another Process}, +@xref{Two-way I/O}, for a more complete discussion. @end table @@ -6672,7 +6683,7 @@ is only opened once. @cindex @command{gawk}, implementation issues, pipes @ifnotinfo As mentioned earlier -(@pxref{Getline Notes, ,Points About @code{getline} to Remember}), +(@pxref{Getline Notes}), many @end ifnotinfo @ifnottex @@ -6703,14 +6714,14 @@ END @{ close("sh") @} The @code{tolower} function returns its argument string with all uppercase characters converted to lowercase -(@pxref{String Functions, ,String Manipulation Functions}). +(@pxref{String Functions}). The program builds up a list of command lines, using the @command{mv} utility to rename the files. It then sends the list to the shell for execution. @c ENDOFRANGE outre @c ENDOFRANGE reout -@node Special Files, Close Files And Pipes, Redirection, Printing +@node Special Files @section Special @value{FFN}s in @command{gawk} @c STARTOFRANGE gfn @cindex @command{gawk}, @value{FN}s in @@ -6726,7 +6737,7 @@ process-related information, and TCP/IP networking. * Special Caveats:: Things to watch out for. @end menu -@node Special FD, Special Process, Special Files, Special Files +@node Special FD @subsection Special Files for Standard Descriptors @cindex standard input @cindex input, standard @@ -6822,7 +6833,7 @@ It is a common error to omit the quotes, which leads to confusing results. @c Exercise: What does it do? :-) -@node Special Process, Special Network, Special FD, Special Files +@node Special Process @subsection Special Files for Process-Related Information @cindex files, for process information @@ -6831,7 +6842,7 @@ to confusing results. about the running @command{gawk} process. Each of these ``files'' provides a single record of information. To read them more than once, they must first be closed with the @code{close} function -(@pxref{Close Files And Pipes, ,Closing Input and Output Redirections}). +(@pxref{Close Files And Pipes}). The @value{FN}s are: @c @cindex @code{/dev/pid} special file @@ -6892,9 +6903,9 @@ in the next release of @command{gawk}. @command{gawk} prints a warning message every time you use one of these files. To obtain process-related information, use the @code{PROCINFO} array. -@xref{Auto-set, ,Built-in Variables That Convey Information}. +@xref{Auto-set}. -@node Special Network, Special Caveats, Special Process, Special Files +@node Special Network @subsection Special Files for Network Communications @cindex networks, support for @cindex TCP/IP, support for @@ -6913,12 +6924,12 @@ and the other fields represent the other essential pieces of information for making a networking connection. These @value{FN}s are used with the @samp{|&} operator for communicating with a coprocess -(@pxref{Two-way I/O, ,Two-Way Communications with Another Process}). +(@pxref{Two-way I/O}). This is an advanced feature, mentioned here only for completeness. Full discussion is delayed until -@ref{TCP/IP Networking, ,Using @command{gawk} for Network Programming}. +@ref{TCP/IP Networking}. -@node Special Caveats, , Special Network, Special Files +@node Special Caveats @subsection Special @value{FFN} Caveats Here is a list of things to bear in mind when using the @@ -6929,7 +6940,7 @@ special @value{FN}s that @command{gawk} provides: @cindex @value{FN}s, in compatibility mode @item Recognition of these special @value{FN}s is disabled if @command{gawk} is in -compatibility mode (@pxref{Options, ,Command-Line Options}). +compatibility mode (@pxref{Options}). @c @cindex automatic warnings @c @cindex warnings, automatic @@ -6969,7 +6980,7 @@ Doing so results in unpredictable behavior. @end itemize @c ENDOFRANGE gfn -@node Close Files And Pipes, , Special Files, Printing +@node Close Files And Pipes @section Closing Input and Output Redirections @cindex files, output, See output files @c STARTOFRANGE ifc @@ -6986,7 +6997,7 @@ Doing so results in unpredictable behavior. If the same @value{FN} or the same shell command is used with @code{getline} more than once during the execution of an @command{awk} program -(@pxref{Getline, ,Explicit Input with @code{getline}}), +(@pxref{Getline}), the file is opened (or the command is executed) the first time only. At that time, the first record of input is read from that file or command. The next time the same file or command is used with @code{getline}, @@ -7140,7 +7151,7 @@ The second argument should be a string, with either of the values @code{"to"} or @code{"from"}. Case does not matter. As this is an advanced feature, a more complete discussion is delayed until -@ref{Two-way I/O, ,Two-Way Communications with Another Process}, +@ref{Two-way I/O}, which discusses it in more detail and gives an example. @c fakenode --- for prepinfo @@ -7183,6 +7194,15 @@ files, respectively. This value is zero if the close succeeds, or @minus{}1 if it fails. +The POSIX standard is very vague; it says that @code{close} +returns zero on success and non-zero otherwise. In general, +different implementations vary in what they report when closing +pipes; thus the return value cannot be used portably. +@value{DARKCORNER} + +@ignore +@c 4/27/2003: Commenting this out for now, given the above +@c return of 16-bit value 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. @@ -7209,13 +7229,14 @@ piping into @code{getline}. For commands piped into from @code{print} or @code{printf}, the return value from @code{close} is that of the library's @code{pclose} function. +@end ignore @c ENDOFRANGE ifc @c ENDOFRANGE ofc @c ENDOFRANGE pc @c ENDOFRANGE cc @c ENDOFRANGE prnt -@node Expressions, Patterns and Actions, Printing, Top +@node Expressions @chapter Expressions @c STARTOFRANGE exps @cindex expressions @@ -7257,7 +7278,7 @@ combinations of these with various operators. * Precedence:: How various operators nest. @end menu -@node Constants, Using Constant Regexps, Expressions, Expressions +@node Constants @section Constant Expressions @cindex constants, types of @@ -7275,7 +7296,7 @@ have different forms, but are stored identically internally. * Regexp Constants:: Regular Expression constants. @end menu -@node Scalar Constants, Nondecimal-numbers, Constants, Constants +@node Scalar Constants @subsection Numeric and String Constants @cindex numeric, constants @@ -7311,7 +7332,7 @@ eight-bit ASCII characters including ASCII @sc{nul} (character code zero). Other @command{awk} implementations may have difficulty with some character codes. -@node Nondecimal-numbers, Regexp Constants, Scalar Constants, Constants +@node Nondecimal-numbers @subsection Octal and Hexadecimal Numbers @cindex octal numbers @cindex hexadecimal numbers @@ -7369,14 +7390,14 @@ are not treated differently; doing so by default would break old programs. (If you really need to do this, use the @option{--non-decimal-data} command-line option; -@pxref{Nondecimal Data, ,Allowing Nondecimal Input Data}.) +@pxref{Nondecimal Data}.) If you have octal or hexadecimal data, you can use the @code{strtonum} function -(@pxref{String Functions, ,String Manipulation Functions}) +(@pxref{String Functions}) to convert the data into a number. Most of the time, you will want to use octal or hexadecimal constants when working with the built-in bit manipulation functions; -see @ref{Bitwise Functions, ,Using @command{gawk}'s Bit Manipulation Functions}, +see @ref{Bitwise Functions}, for more information. Unlike some early C implementations, @samp{8} and @samp{9} are not valid @@ -7392,7 +7413,7 @@ $ gawk 'BEGIN @{ print "021 is", 021 ; print 018 @}' @cindex compatibility mode (@command{gawk}), hexadecimal numbers Octal and hexadecimal source code constants are a @command{gawk} extension. If @command{gawk} is in compatibility mode -(@pxref{Options, ,Command-Line Options}), +(@pxref{Options}), they are not available. @c fakenode --- for prepinfo @@ -7412,7 +7433,7 @@ $ gawk 'BEGIN @{ printf "0x11 is <%s>\n", 0x11 @}' @print{} 0x11 is <17> @end example -@node Regexp Constants, , Nondecimal-numbers, Constants +@node Regexp Constants @subsection Regular Expression Constants @c STARTOFRANGE rec @@ -7428,7 +7449,7 @@ matching operators can also match computed or ``dynamic'' regexps (which are just ordinary strings or variables that contain a regexp). @c ENDOFRANGE cnst -@node Using Constant Regexps, Variables, Constants, Expressions +@node Using Constant Regexps @section Using Regular Expression Constants @cindex dark corner, regexp constants @@ -7440,7 +7461,7 @@ When a regexp constant appears by itself, it has the same meaning as if it appeared in a pattern, i.e., @samp{($0 ~ /foo/)} @value{DARKCORNER} -@xref{Expression Patterns, ,Expressions as Patterns}. +@xref{Expression Patterns}. This means that the following two code segments: @example @@ -7501,14 +7522,14 @@ POSIX specification. Constant regular expressions are also used as the first argument for the @code{gensub}, @code{sub}, and @code{gsub} functions, and as the second argument of the @code{match} function -(@pxref{String Functions, ,String Manipulation Functions}). +(@pxref{String Functions}). Modern implementations of @command{awk}, including @command{gawk}, allow the third argument of @code{split} to be a regexp constant, but some older implementations do not. @value{DARKCORNER} This can lead to confusion when attempting to use regexp constants as arguments to user-defined functions -(@pxref{User-defined, ,User-Defined Functions}). +(@pxref{User-defined}). For example: @example @@ -7541,7 +7562,7 @@ a parameter to a user-defined function, since passing a truth value in this way is probably not what was intended. @c ENDOFRANGE rec -@node Variables, Conversion, Using Constant Regexps, Expressions +@node Variables @section Variables @cindex variables, user-defined @@ -7558,7 +7579,7 @@ on the @command{awk} command line. advanced method of input. @end menu -@node Using Variables, Assignment Options, Variables, Variables +@node Using Variables @subsection Using Variables in a Program Variables let you give names to values and refer to them later. Variables @@ -7571,7 +7592,7 @@ A variable name is a valid expression by itself; it represents the variable's current value. Variables are given new values with @dfn{assignment operators}, @dfn{increment operators}, and @dfn{decrement operators}. -@xref{Assignment Ops, ,Assignment Expressions}. +@xref{Assignment Ops}. @c NEXT ED: Can also be changed by sub, gsub, split @cindex variables, built-in @@ -7590,7 +7611,7 @@ is zero if converted to a number. There is no need to ``initialize'' each variable explicitly in @command{awk}, which is what you would do in C and in most other traditional languages. -@node Assignment Options, , Using Variables, Variables +@node Assignment Options @subsection Assigning Variables on the Command Line @cindex variables, assigning on command line @c comma before assigning does NOT start tertiary @@ -7598,7 +7619,7 @@ which is what you would do in C and in most other traditional languages. Any @command{awk} variable can be set by including a @dfn{variable assignment} among the arguments on the command line when @command{awk} is invoked -(@pxref{Other Arguments, ,Other Command-Line Arguments}). +(@pxref{Other Arguments}). Such an assignment has the following form: @example @@ -7621,7 +7642,7 @@ as in the following: the variable is set at the very beginning, even before the @code{BEGIN} rules are run. The @option{-v} option and its assignment must precede all the @value{FN} arguments, as well as the program text. -(@xref{Options, ,Command-Line Options}, for more information about +(@xref{Options}, for more information about the @option{-v} option.) Otherwise, the variable assignment is performed at a time determined by its position among the input file arguments---after the processing of the @@ -7652,13 +7673,13 @@ $ awk '@{ print $n @}' n=4 inventory-shipped n=2 BBS-list @cindex dark corner, command-line arguments Command-line arguments are made available for explicit examination by the @command{awk} program in the @code{ARGV} array -(@pxref{ARGC and ARGV, ,Using @code{ARGC} and @code{ARGV}}). +(@pxref{ARGC and ARGV}). @command{awk} processes the values of command-line assignments for escape sequences (@pxref{Escape Sequences}). @value{DARKCORNER} -@node Conversion, Arithmetic Ops, Variables, Expressions +@node Conversion @section Conversion of Strings and Numbers @cindex converting, strings to numbers @@ -7700,7 +7721,7 @@ by the @command{awk} built-in variable @code{CONVFMT} (@pxref{Built-in Variables Numbers are converted using the @code{sprintf} function with @code{CONVFMT} as the format specifier -(@pxref{String Functions, ,String Manipulation Functions}). +(@pxref{String Functions}). @code{CONVFMT}'s default value is @code{"%.6g"}, which prints a value with at least six significant digits. For some applications, you might want to @@ -7745,10 +7766,46 @@ However, these semantics for @code{OFMT} are something to keep in mind if you mu port your new style program to older implementations of @command{awk}. We recommend that instead of changing your programs, just port @command{gawk} itself. -@xref{Print, ,The @code{print} Statement}, +@xref{Print}, for more information on the @code{print} statement. -@node Arithmetic Ops, Concatenation, Conversion, Expressions +Finally, once again, where you are can matter when it comes to +converting between numbers and strings. In +@ref{Locales}, we mentioned that the +local character set and language (the locale) can affect how @command{gawk} matches +characters. The locale also affects numeric formats. In particular, for @command{awk} +programs, it affects the decimal point character. The @code{"C"} locale, and most +English-language locales, use the period character (@samp{.}) as the decimal point. +However, many (if not most) European and non-English locales use the comma (@samp{,}) +as the decimal point character. + +The POSIX standard says that @command{awk} always uses the period as the decimal +point when reading the @command{awk} program source code, and for command-line +variable assignments (@pxref{Other Arguments}). +However, when interpreting input data, for @code{print} and @code{printf} output, +and for number to string conversion, the local decimal point character is used. +As of @value{PVERSION} 3.1.3, @command{gawk} fully complies with this aspect +of the standard. Here are some examples indicating the difference in behavior, +on a GNU/Linux system: + +@example +$ gawk 'BEGIN @{ printf "%g\n", 3.1415927 @}' +@print{} 3.14159 +$ LC_ALL=en_DK gawk 'BEGIN @{ printf "%g\n", 3.1415927 @}' +@print{} 3,14159 +$ echo 4,321 | gawk '@{ print $1 + 1 @}' +@print{} 5 +$ echo 4,321 | LC_ALL=en_DK gawk '@{ print $1 + 1 @}' +@print{} 5,321 +@end example + +@noindent +The @samp{en_DK} locale is for English in Denmark, where the comma acts as +the decimal point separator. In the normal @code{"C"} locale, @command{gawk} +treats @samp{4,321} as @samp{4}, while in the Danish locale, it's treated +as the full number, @samp{4.321}. + +@node Arithmetic Ops @section Arithmetic Operators @cindex arithmetic operators @cindex operators, arithmetic @@ -7862,7 +7919,7 @@ The POSIX standard only specifies the use of @samp{^} for exponentiation. For maximum portability, do not use the @samp{**} operator. -@node Concatenation, Assignment Ops, Arithmetic Ops, Expressions +@node Concatenation @section String Concatenation @cindex Kernighan, Brian @quotation @@ -7992,7 +8049,7 @@ As mentioned earlier, when doing concatenation, @emph{parenthesize}. Otherwise, you're never quite sure what you'll get. -@node Assignment Ops, Increment Ops, Concatenation, Expressions +@node Assignment Ops @section Assignment Expressions @c STARTOFRANGE asop @cindex assignment operators @@ -8042,8 +8099,8 @@ a @dfn{side effect}. @cindex operators, assignment The lefthand operand of an assignment need not be a variable (@pxref{Variables}); it can also be a field -(@pxref{Changing Fields, ,Changing the Contents of a Field}) or -an array element (@pxref{Arrays, ,Arrays in @command{awk}}). +(@pxref{Changing Fields}) or +an array element (@pxref{Arrays}). These are all called @dfn{lvalues}, which means they can appear on the lefthand side of an assignment operator. The righthand operand may be any expression; it produces the new value @@ -8149,7 +8206,7 @@ BEGIN @{ The indices of @code{bar} are practically guaranteed to be different, because @code{rand} returns different values each time it is called. (Arrays and the @code{rand} function haven't been covered yet. -@xref{Arrays, ,Arrays in @command{awk}}, +@xref{Arrays}, and see @ref{Numeric Functions}, for more information). This example illustrates an important fact about assignment operators: the lefthand expression is only evaluated @emph{once}. @@ -8269,12 +8326,12 @@ awk '/[=]=/' /dev/null @command{gawk} does not have this problem, nor do the other freely available versions described in -@ref{Other Versions, , Other Freely Available @command{awk} Implementations}. +@ref{Other Versions}. @c ENDOFRANGE exas @c ENDOFRANGE opas @c ENDOFRANGE asop -@node Increment Ops, Truth Values, Assignment Ops, Expressions +@node Increment Ops @section Increment and Decrement Operators @c STARTOFRANGE inop @@ -8397,7 +8454,7 @@ You should avoid such things in your own programs. @c ENDOFRANGE opde @c ENDOFRANGE deop -@node Truth Values, Typing and Comparison, Increment Ops, Expressions +@node Truth Values @section True and False in @command{awk} @cindex truth values @cindex logical false/true @@ -8432,7 +8489,7 @@ There is a surprising consequence of the ``nonzero or non-null'' rule: the string constant @code{"0"} is actually true, because it is non-null. @value{DARKCORNER} -@node Typing and Comparison, Boolean Ops, Truth Values, Expressions +@node Typing and Comparison @section Variable Typing and Comparison Expressions @quotation @i{The Guide is definitive. Reality is frequently inaccurate.}@* @@ -8525,15 +8582,15 @@ following symmetric matrix: % \hfil -- infinite glue; has the effect of right-justifying in this case. % # -- replaced by the text (for instance, `STRNUM', in the last row). % \quad -- about the width of an `M'. Just separates the columns. -% +% % The second column (\vrule#) is what generates the vertical rule that % spans table rows. -% +% % The doubled && before the next entry means `repeat the following % template as many times as necessary on each line' -- in our case, twice. -% +% % The template itself, \quad#\hfil, left-justifies with a little space before. -% +% \halign{\strut\hfil#\quad&\vrule#&&\quad#\hfil\cr &&STRING &NUMERIC &STRNUM\cr % The \omit tells TeX to skip inserting the template for this column on @@ -8635,7 +8692,7 @@ True if the array @var{array} has an element with the subscript @var{subscript}. Comparison expressions have the value one if true and zero if false. When comparing operands of mixed types, numeric operands are converted to strings using the value of @code{CONVFMT} -(@pxref{Conversion, ,Conversion of Strings and Numbers}). +(@pxref{Conversion}). Strings are compared by comparing the first character of each, then the second character of each, @@ -8730,8 +8787,8 @@ has the value one if @code{x} contains @samp{foo}, such as The righthand operand of the @samp{~} and @samp{!~} operators may be either a regexp constant (@code{/@dots{}/}) or an ordinary expression. In the latter case, the value of the expression as a string is used as a -dynamic regexp (@pxref{Regexp Usage, ,How to Use Regular Expressions}; also -@pxref{Computed Regexps, ,Using Dynamic Regexps}). +dynamic regexp (@pxref{Regexp Usage}; also +@pxref{Computed Regexps}). @cindex @command{awk}, regexp constants and @cindex regexp constants @@ -8746,14 +8803,14 @@ $0 ~ /@var{regexp}/ One special place where @code{/foo/} is @emph{not} an abbreviation for @samp{$0 ~ /foo/} is when it is the righthand operand of @samp{~} or @samp{!~}. -@xref{Using Constant Regexps, ,Using Regular Expression Constants}, +@xref{Using Constant Regexps}, where this is discussed in more detail. @c ENDOFRANGE comex @c ENDOFRANGE excom @c ENDOFRANGE vartypc @c ENDOFRANGE varting -@node Boolean Ops, Conditional Exp, Typing and Comparison, Expressions +@node Boolean Ops @section Boolean Expressions @cindex and Boolean-logic operator @cindex or Boolean-logic operator @@ -8778,7 +8835,7 @@ The terms are equivalent. Boolean expressions can be used wherever comparison and matching expressions can be used. They can be used in @code{if}, @code{while}, @code{do}, and @code{for} statements -(@pxref{Statements, ,Control Statements in Actions}). +(@pxref{Statements}). They have numeric values (one if true, zero if false) that come into play if the result of the Boolean expression is stored in a variable or used in arithmetic. @@ -8830,7 +8887,7 @@ BEGIN @{ if (! ("HOME" in ENVIRON)) @end example (The @code{in} operator is described in -@ref{Reference to Elements, ,Referring to an Array Element}.) +@ref{Reference to Elements}.) @end table @cindex short-circuit operators @@ -8848,7 +8905,7 @@ its evaluation. Statements that use @samp{&&} or @samp{||} can be continued simply by putting a newline after them. But you cannot put a newline in front of either of these operators without using backslash continuation -(@pxref{Statements/Lines, ,@command{awk} Statements Versus Lines}). +(@pxref{Statements/Lines}). @cindex @code{!} (exclamation point), @code{!} operator @cindex exclamation point (@code{!}), @code{!} operator @@ -8884,7 +8941,7 @@ so we'll leave well enough alone. @cindex @code{next} statement @strong{Note:} The @code{next} statement is discussed in -@ref{Next Statement, ,The @code{next} Statement}. +@ref{Next Statement}. @code{next} tells @command{awk} to skip the rest of the rules, get the next record, and start processing the rules over again at the top. The reason it's there is to avoid printing the bracketing @@ -8892,7 +8949,7 @@ The reason it's there is to avoid printing the bracketing @c ENDOFRANGE exbo @c ENDOFRANGE boex -@node Conditional Exp, Function Calls, Boolean Ops, Expressions +@node Conditional Exp @section Conditional Expressions @cindex conditional expressions @cindex expressions, conditional @@ -8935,7 +8992,7 @@ x == y ? a[i++] : b[i++] This is guaranteed to increment @code{i} exactly once, because each time only one of the two increment expressions is executed and the other is not. -@xref{Arrays, ,Arrays in @command{awk}}, +@xref{Arrays}, for more information about arrays. @cindex differences in @command{awk} and @command{gawk}, line continuations @@ -8946,11 +9003,11 @@ a statement that uses @samp{?:} can be continued simply by putting a newline after either character. However, putting a newline in front of either character does not work without using backslash continuation -(@pxref{Statements/Lines, ,@command{awk} Statements Versus Lines}). +(@pxref{Statements/Lines}). If @option{--posix} is specified -(@pxref{Options, , Command-Line Options}), then this extension is disabled. +(@pxref{Options}), then this extension is disabled. -@node Function Calls, Precedence, Conditional Exp, Expressions +@node Function Calls @section Function Calls @cindex function calls @@ -8962,10 +9019,10 @@ example, the function @code{sqrt} computes the square root of a number. @cindex functions, built-in A fixed set of functions are @dfn{built-in}, which means they are available in every @command{awk} program. The @code{sqrt} function is one -of these. @xref{Built-in, ,Built-in Functions}, for a list of built-in +of these. @xref{Built-in}, for a list of built-in functions and their descriptions. In addition, you can define functions for use in your program. -@xref{User-defined, ,User-Defined Functions}, +@xref{User-defined}, for instructions on how to do this. @cindex arguments, in function calls @@ -9004,10 +9061,10 @@ Some of the built-in functions have one or more optional arguments. If those arguments are not supplied, the functions use a reasonable default value. -@xref{Built-in, ,Built-in Functions}, for full details. If arguments +@xref{Built-in}, for full details. If arguments are omitted in calls to user-defined functions, then those arguments are treated as local variables and initialized to the empty string -(@pxref{User-defined, ,User-Defined Functions}). +(@pxref{User-defined}). @cindex side effects, function calls Like every other expression, the function call has a value, which is @@ -9029,7 +9086,7 @@ $ awk '@{ print "The square root of", $1, "is", sqrt($1) @}' @kbd{@value{CTL}-d} @end example -@node Precedence, , Function Calls, Expressions +@node Precedence @section Operator Precedence (How Operators Nest) @c STARTOFRANGE prec @cindex precedence @@ -9122,7 +9179,7 @@ Addition, subtraction. @item @r{String Concatenation} No special symbol is used to indicate concatenation. The operands are simply written side by side -(@pxref{Concatenation, ,String Concatenation}). +(@pxref{Concatenation}). @cindex @code{<} (left angle bracket), @code{<} operator @cindex left angle bracket (@code{<}), @code{<} operator @@ -9216,7 +9273,7 @@ For maximum portability, do not use them. @c ENDOFRANGE oppr @c ENDOFRANGE exps -@node Patterns and Actions, Arrays, Expressions, Top +@node Patterns and Actions @chapter Patterns, Actions, and Variables @c STARTOFRANGE pat @cindex patterns @@ -9242,7 +9299,7 @@ building something useful. * Built-in Variables:: Summarizes the built-in variables. @end menu -@node Pattern Overview, Using Shell Variables, Patterns and Actions, Patterns and Actions +@node Pattern Overview @section Pattern Elements @menu @@ -9262,31 +9319,31 @@ The following is a summary of the types of @command{awk} patterns: @item /@var{regular expression}/ A regular expression. It matches when the text of the input record fits the regular expression. -(@xref{Regexp, ,Regular Expressions}.) +(@xref{Regexp}.) @item @var{expression} A single expression. It matches when its value is nonzero (if a number) or non-null (if a string). -(@xref{Expression Patterns, ,Expressions as Patterns}.) +(@xref{Expression Patterns}.) @item @var{pat1}, @var{pat2} A pair of patterns separated by a comma, specifying a range of records. The range includes both the initial record that matches @var{pat1} and the final record that matches @var{pat2}. -(@xref{Ranges, ,Specifying Record Ranges with Patterns}.) +(@xref{Ranges}.) @item BEGIN @itemx END Special patterns for you to supply startup or cleanup actions for your @command{awk} program. -(@xref{BEGIN/END, ,The @code{BEGIN} and @code{END} Special Patterns}.) +(@xref{BEGIN/END}.) @item @var{empty} The empty pattern matches every input record. -(@xref{Empty, ,The Empty Pattern}.) +(@xref{Empty}.) @end table -@node Regexp Patterns, Expression Patterns, Pattern Overview, Pattern Overview +@node Regexp Patterns @subsection Regular Expressions as Patterns @cindex patterns, expressions as @cindex regular expressions, as patterns @@ -9303,7 +9360,7 @@ For example: END @{ print buzzwords, "buzzwords seen" @} @end example -@node Expression Patterns, Ranges, Regexp Patterns, Pattern Overview +@node Expression Patterns @subsection Expressions as Patterns @cindex expressions, as patterns @@ -9319,14 +9376,14 @@ depends on only what has happened so far in the execution of the @cindex comparison expressions, as patterns @cindex patterns, comparison expressions as Comparison expressions, using the comparison operators described in -@ref{Typing and Comparison, ,Variable Typing and Comparison Expressions}, +@ref{Typing and Comparison}, are a very common kind of pattern. Regexp matching and nonmatching are also very common expressions. The left operand of the @samp{~} and @samp{!~} operators is a string. The right operand is either a constant regular expression enclosed in slashes (@code{/@var{regexp}/}), or any expression whose string value is used as a dynamic regular expression -(@pxref{Computed Regexps, , Using Dynamic Regexps}). +(@pxref{Computed Regexps}). The following example prints the second field of each input record whose first field is precisely @samp{foo}: @@ -9410,7 +9467,7 @@ patterns. Likewise, the special patterns @code{BEGIN} and @code{END}, which never match any input record, are not expressions and cannot appear inside Boolean patterns. -@node Ranges, BEGIN/END, Expression Patterns, Pattern Overview +@node Ranges @subsection Specifying Record Ranges with Patterns @cindex range patterns @@ -9455,7 +9512,7 @@ the @samp{%} symbol), each on its own line, that should be ignored. A first attempt would be to combine a range pattern that describes the delimited text with the @code{next} statement -(not discussed yet, @pxref{Next Statement, , The @code{next} Statement}). +(not discussed yet, @pxref{Next Statement}). This causes @command{awk} to skip any further processing of the current record and start over again with the next input record. Such a program looks like this: @@ -9499,7 +9556,7 @@ $ echo Yes | gawk '(/1/,/2/) || /Yes/' @error{} gawk: cmd. line:2: ^ unexpected newline @end example -@node BEGIN/END, Empty, Ranges, Pattern Overview +@node BEGIN/END @subsection The @code{BEGIN} and @code{END} Special Patterns @c STARTOFRANGE beg @@ -9520,7 +9577,7 @@ programmers. * I/O And BEGIN/END:: I/O issues in BEGIN/END rules. @end menu -@node Using BEGIN/END, I/O And BEGIN/END, BEGIN/END, BEGIN/END +@node Using BEGIN/END @subsubsection Startup and Cleanup Actions A @code{BEGIN} rule is executed once only, before the first input record @@ -9564,14 +9621,14 @@ in terms of program organization and readability. Multiple @code{BEGIN} and @code{END} rules are useful for writing library functions, because each library file can have its own @code{BEGIN} and/or -@code{END} rule to do its own initialization and/or cleanup. +@code{END} rule to do its own initialization and/or cleanup. The order in which library functions are named on the command line controls the order in which their @code{BEGIN} and @code{END} rules are executed. Therefore, you have to be careful when writing such rules in library files so that the order in which they are executed doesn't matter. -@xref{Options, ,Command-Line Options}, for more information on +@xref{Options}, for more information on using library functions. -@xref{Library Functions, ,A Library of @command{awk} Functions}, +@xref{Library Functions}, for a number of useful library functions. If an @command{awk} program has only a @code{BEGIN} rule and no @@ -9582,7 +9639,7 @@ reading and ignoring input until the end of the file was seen.} However, if an no other rules in the program. This is necessary in case the @code{END} rule checks the @code{FNR} and @code{NR} variables. -@node I/O And BEGIN/END, , Using BEGIN/END, BEGIN/END +@node I/O And BEGIN/END @subsubsection Input/Output from @code{BEGIN} and @code{END} Rules @cindex input/output, from @code{BEGIN} and @code{END} @@ -9594,14 +9651,14 @@ there simply is no input record, and therefore no fields, when executing @code{BEGIN} rules. References to @code{$0} and the fields yield a null string or zero, depending upon the context. One way to give @code{$0} a real value is to execute a @code{getline} command -without a variable (@pxref{Getline, ,Explicit Input with @code{getline}}). +without a variable (@pxref{Getline}). Another way is simply to assign a value to @code{$0}. @cindex differences in @command{awk} and @command{gawk}, @code{BEGIN}/@code{END} patterns @cindex POSIX @command{awk}, @code{BEGIN}/@code{END} patterns @cindex @code{print} statement, @code{BEGIN}/@code{END} patterns and @cindex @code{BEGIN} pattern, @code{print} statement and -@cindex @code{END} pattern, @code{print} statement and +@cindex @code{END} pattern, @code{print} statement and The second point is similar to the first but from the other direction. Traditionally, due largely to implementation issues, @code{$0} and @code{NF} were @emph{undefined} inside an @code{END} rule. @@ -9626,17 +9683,17 @@ line is needed in the output, the program should print one explicitly. @cindex @code{next} statement, @code{BEGIN}/@code{END} patterns and @cindex @code{nextfile} statement, @code{BEGIN}/@code{END} patterns and @cindex @code{BEGIN} pattern, @code{next}/@code{nextfile} statements and -@cindex @code{END} pattern, @code{next}/@code{nextfile} statements and +@cindex @code{END} pattern, @code{next}/@code{nextfile} statements and Finally, the @code{next} and @code{nextfile} statements are not allowed in a @code{BEGIN} rule, because the implicit read-a-record-and-match-against-the-rules loop has not started yet. Similarly, those statements are not valid in an @code{END} rule, since all the input has been read. -(@xref{Next Statement, ,The @code{next} Statement}, and see -@ref{Nextfile Statement, ,Using @command{gawk}'s @code{nextfile} Statement}.) +(@xref{Next Statement}, and see +@ref{Nextfile Statement}.) @c ENDOFRANGE beg @c ENDOFRANGE end -@node Empty, , BEGIN/END, Pattern Overview +@node Empty @subsection The Empty Pattern @cindex empty pattern @@ -9652,7 +9709,7 @@ awk '@{ print $1 @}' BBS-list prints the first field of every record. @c ENDOFRANGE pat -@node Using Shell Variables, Action Overview, Pattern Overview, Patterns and Actions +@node Using Shell Variables @section Using Shell Variables in Programs @cindex shells, variables @cindex @command{awk} programs, shell variables in @@ -9686,15 +9743,15 @@ The second part is single-quoted. Variable substitution via quoting works, but can be potentially messy. It requires a good understanding of the shell's quoting rules -(@pxref{Quoting, ,Shell Quoting Issues}), +(@pxref{Quoting}), and it's often difficult to correctly match up the quotes when reading the program. A better method is to use @command{awk}'s variable assignment feature -(@pxref{Assignment Options, ,Assigning Variables on the Command Line}) +(@pxref{Assignment Options}) to assign the shell variable's value to an @command{awk} variable's value. Then use dynamic regexps to match the pattern -(@pxref{Computed Regexps, ,Using Dynamic Regexps}). +(@pxref{Computed Regexps}). The following shows how to redo the previous example using this technique: @@ -9715,7 +9772,7 @@ provides more flexibility, since the variable can be used anywhere inside the program---for printing, as an array subscript, or for any other use---without requiring the quoting tricks at every point in the program. -@node Action Overview, Statements, Using Shell Variables, Patterns and Actions +@node Action Overview @section Actions @c @cindex action, definition of @c @cindex curly braces @@ -9725,7 +9782,7 @@ use---without requiring the quoting tricks at every point in the program. An @command{awk} program or script consists of a series of rules and function definitions interspersed. (Functions are -described later. @xref{User-defined, ,User-Defined Functions}.) +described later. @xref{User-defined}.) A rule contains a pattern and an action, either of which (but not both) may be omitted. The purpose of the @dfn{action} is to tell @command{awk} what to do once a match for the pattern is found. Thus, @@ -9767,13 +9824,13 @@ Call functions or assign values to variables (@pxref{Expressions}). Executing this kind of statement simply computes the value of the expression. This is useful when the expression has side effects -(@pxref{Assignment Ops, ,Assignment Expressions}). +(@pxref{Assignment Ops}). @item Control statements Specify the control flow of @command{awk} programs. The @command{awk} language gives you C-like constructs (@code{if}, @code{for}, @code{while}, and @code{do}) as well as a few -special ones (@pxref{Statements, ,Control Statements in Actions}). +special ones (@pxref{Statements}). @item Compound statements Consist of one or more statements enclosed in @@ -9783,22 +9840,22 @@ or @code{for} statement. @item Input statements Use the @code{getline} command -(@pxref{Getline, ,Explicit Input with @code{getline}}). +(@pxref{Getline}). Also supplied in @command{awk} are the @code{next} -statement (@pxref{Next Statement, ,The @code{next} Statement}), +statement (@pxref{Next Statement}), and the @code{nextfile} statement -(@pxref{Nextfile Statement, ,Using @command{gawk}'s @code{nextfile} Statement}). +(@pxref{Nextfile Statement}). @item Output statements Such as @code{print} and @code{printf}. -@xref{Printing, ,Printing Output}. +@xref{Printing}. @item Deletion statements For deleting array elements. -@xref{Delete, ,The @code{delete} Statement}. +@xref{Delete}. @end table -@node Statements, Built-in Variables, Action Overview, Patterns and Actions +@node Statements @section Control Statements in Actions @c STARTOFRANGE csta @cindex control statements @@ -9838,6 +9895,8 @@ newlines or semicolons. condition is satisfied. * For Statement:: Another looping statement, that provides initialization and increment clauses. +* Switch Statement:: Switch/case evaluation for conditional + execution of statements based on a value. * Break Statement:: Immediately exit the innermost enclosing loop. * Continue Statement:: Skip to the end of the innermost enclosing loop. @@ -9846,7 +9905,7 @@ newlines or semicolons. * Exit Statement:: Stop execution of @command{awk}. @end menu -@node If Statement, While Statement, Statements, Statements +@node If Statement @subsection The @code{if}-@code{else} Statement @cindex @code{if} statement @@ -9894,7 +9953,7 @@ it produces a syntax error. Don't actually write programs this way, because a human reader might fail to see the @code{else} if it is not the first thing on its line. -@node While Statement, Do Statement, If Statement, Statements +@node While Statement @subsection The @code{while} Statement @cindex @code{while} statement @cindex loops @@ -9954,7 +10013,7 @@ compound statement or else is very simple. The newline after the open-brace that begins the compound statement is not required either, but the program is harder to read without it. -@node Do Statement, For Statement, While Statement, Statements +@node Do Statement @subsection The @code{do}-@code{while} Statement @cindex @code{do}-@code{while} statement @@ -9998,7 +10057,7 @@ realistic example, since in this case an ordinary @code{while} would do just as well. This situation reflects actual experience; only occasionally is there a real use for a @code{do} statement. -@node For Statement, Break Statement, Do Statement, Statements +@node For Statement @subsection The @code{for} Statement @cindex @code{for} statement @@ -10076,7 +10135,7 @@ while (@var{condition}) @{ @cindex loops, @code{continue} statements and @noindent The only exception is when the @code{continue} statement -(@pxref{Continue Statement, ,The @code{continue} Statement}) is used +(@pxref{Continue Statement}) is used inside the loop. Changing a @code{for} statement to a @code{while} statement in this way can change the effect of the @code{continue} statement inside the loop. @@ -10098,11 +10157,71 @@ for (i in array) @end example @noindent -@xref{Scanning an Array, ,Scanning All Elements of an Array}, +@xref{Scanning an Array}, for more information on this version of the @code{for} loop. @end ifinfo -@node Break Statement, Continue Statement, For Statement, Statements +@node Switch Statement +@subsection The @code{switch} Statement +@cindex @code{switch} statement +@cindex @code{case} keyword +@cindex @code{default} keyword + +@strong{NOTE:} This @value{SUBSECTION} describes an experimental feature +added in @command{gawk} 3.1.3. It is @emph{not} enabled by default. To +enable it, use the @option{--enable-switch} option to @command{configure} +when @command{gawk} is being configured and built. +@xref{Additional Configuration Options}, +for more information. + +The @code{switch} statement allows the evaluation of an expression and +the execution of statements based on a @code{case} match. Case statements +are checked for a match in the order they are defined. If no suitable +@code{case} is found, the @code{default} section is executed, if supplied. The +general form of the @code{switch} statement looks like this: + +@example +switch (@var{expression}) @{ +case @var{value or regular expression}: + @var{case-body} +default: + @var{default-body} +@} +@end example + +The @code{switch} statement works as it does in C. Once a match to a given +case is made, case statement bodies are executed until a @code{break}, +@code{continue}, @code{next}, @code{nextfile} or @code{exit} is encountered, +or the end of the @code{switch} statement itself. For example: + +@example +switch (NR * 2 + 1) @{ +case 3: +case "11": + print NR - 1 + break + +case /2[[:digit:]]+/: + print NR + +default: + print NR + 1 + +case -1: + print NR * -1 +@} +@end example + +Note that if none of the statements specified above halt execution +of a matched @code{case} statement, execution falls through to the +next @code{case} until execution halts. In the above example, for +any case value starting with @samp{2} followed by one or more digits, +the @code{print} statement is executed and then falls through into the +@code{default} section, executing its @code{print} statement. In turn, +the @minus{}1 case will also be executed since the @code{default} does +not halt execution. + +@node Break Statement @subsection The @code{break} Statement @cindex @code{break} statement @cindex loops, exiting @@ -10131,7 +10250,7 @@ immediately @dfn{breaks out} of the containing @code{for} loop. This means that @command{awk} proceeds immediately to the statement following the loop and continues processing. (This is very different from the @code{exit} statement, which stops the entire @command{awk} program. -@xref{Exit Statement, ,The @code{exit} Statement}.) +@xref{Exit Statement}.) Th following program illustrates how the @var{condition} of a @code{for} or @code{while} statement could be replaced with a @code{break} inside @@ -10164,18 +10283,18 @@ The @code{break} statement has no meaning when used outside the body of a loop. However, although it was never documented, historical implementations of @command{awk} treated the @code{break} statement outside of a loop as if it were a @code{next} statement -(@pxref{Next Statement, ,The @code{next} Statement}). +(@pxref{Next Statement}). Recent versions of Unix @command{awk} no longer allow this usage. @command{gawk} supports this use of @code{break} only if @option{--traditional} has been specified on the command line -(@pxref{Options, ,Command-Line Options}). +(@pxref{Options}). Otherwise, it is treated as an error, since the POSIX standard specifies that @code{break} should only be used inside the body of a loop. @value{DARKCORNER} -@node Continue Statement, Next Statement, Break Statement, Statements +@node Continue Statement @subsection The @code{continue} Statement @cindex @code{continue} statement @@ -10234,15 +10353,15 @@ a loop. Historical versions of @command{awk} treated a @code{continue} statement outside a loop the same way they treated a @code{break} statement outside a loop: as if it were a @code{next} statement -(@pxref{Next Statement, ,The @code{next} Statement}). +(@pxref{Next Statement}). Recent versions of Unix @command{awk} no longer work this way, and @command{gawk} allows it only if @option{--traditional} is specified on -the command line (@pxref{Options, ,Command-Line Options}). Just like the +the command line (@pxref{Options}). Just like the @code{break} statement, the POSIX standard specifies that @code{continue} should only be used inside the body of a loop. @value{DARKCORNER} -@node Next Statement, Nextfile Statement, Continue Statement, Statements +@node Next Statement @subsection The @code{next} Statement @cindex @code{next} statement @@ -10252,7 +10371,7 @@ further rules are executed for the current record, and the rest of the current rule's action isn't executed. Contrast this with the effect of the @code{getline} function -(@pxref{Getline, ,Explicit Input with @code{getline}}). That also causes +(@pxref{Getline}). That also causes @command{awk} to read the next record immediately, but it does not alter the flow of control in any way (i.e., the rest of the current action executes with a new input record). @@ -10284,12 +10403,12 @@ the program's subsequent rules won't see the bad record. The error message is redirected to the standard error output stream, as error messages should be. For more detail see -@ref{Special Files, ,Special @value{FFN}s in @command{gawk}}. +@ref{Special Files}. @c @cindex @command{awk} language, POSIX version @c @cindex @code{next}, inside a user-defined function @cindex @code{BEGIN} pattern, @code{next}/@code{nextfile} statements and -@cindex @code{END} pattern, @code{next}/@code{nextfile} statements and +@cindex @code{END} pattern, @code{next}/@code{nextfile} statements and @cindex POSIX @command{awk}, @code{next}/@code{nextfile} statements and @cindex @code{next} statement, user-defined functions and @cindex functions, user-defined, @code{next}/@code{nextfile} statements and @@ -10299,15 +10418,15 @@ the @code{next} statement is used in a @code{BEGIN} or @code{END} rule. Although POSIX permits it, some other @command{awk} implementations don't allow the @code{next} statement inside function bodies -(@pxref{User-defined, ,User-Defined Functions}). +(@pxref{User-defined}). Just as with any other @code{next} statement, a @code{next} statement inside a function body reads the next record and starts processing it with the first rule in the program. If the @code{next} statement causes the end of the input to be reached, then the code in any @code{END} rules is executed. -@xref{BEGIN/END, ,The @code{BEGIN} and @code{END} Special Patterns}. +@xref{BEGIN/END}. -@node Nextfile Statement, Exit Statement, Next Statement, Statements +@node Nextfile Statement @subsection Using @command{gawk}'s @code{nextfile} Statement @cindex @code{nextfile} statement @cindex differences in @command{awk} and @command{gawk}, @code{next}/@code{nextfile} statements @@ -10321,7 +10440,7 @@ current @value{DF}. The @code{nextfile} statement is a @command{gawk} extension. In most other @command{awk} implementations, or if @command{gawk} is in compatibility mode -(@pxref{Options, ,Command-Line Options}), +(@pxref{Options}), @code{nextfile} is not special. Upon execution of the @code{nextfile} statement, @code{FILENAME} is @@ -10331,7 +10450,7 @@ starts over with the first rule in the program. (@code{ARGIND} hasn't been introduced yet. @xref{Built-in Variables}.) If the @code{nextfile} statement causes the end of the input to be reached, then the code in any @code{END} rules is executed. -@xref{BEGIN/END, ,The @code{BEGIN} and @code{END} Special Patterns}. +@xref{BEGIN/END}. The @code{nextfile} statement is useful when there are many @value{DF}s to process but it isn't necessary to process every record in every file. @@ -10347,17 +10466,17 @@ opened with redirections. It is not related to the main processing that If it's necessary to use an @command{awk} version that doesn't support @code{nextfile}, see -@ref{Nextfile Function, ,Implementing @code{nextfile} as a Function}, +@ref{Nextfile Function}, for a user-defined function that simulates the @code{nextfile} statement. @cindex functions, user-defined, @code{next}/@code{nextfile} statements and @cindex @code{nextfile} statement, user-defined functions and The current version of the Bell Laboratories @command{awk} -(@pxref{Other Versions, ,Other Freely Available @command{awk} Implementations}) +(@pxref{Other Versions}) also supports @code{nextfile}. However, it doesn't allow the @code{nextfile} statement inside function bodies -(@pxref{User-defined, ,User-Defined Functions}). +(@pxref{User-defined}). @command{gawk} does; a @code{nextfile} inside a function body reads the next record and starts processing it with the first rule in the program, just as any other @code{nextfile} statement. @@ -10374,7 +10493,7 @@ inconsistent. When it appeared after @code{next}, @samp{file} was a keyword; otherwise, it was a regular identifier. The old usage is no longer accepted; @samp{next file} generates a syntax error. -@node Exit Statement, , Nextfile Statement, Statements +@node Exit Statement @subsection The @code{exit} Statement @cindex @code{exit} statement @@ -10393,7 +10512,7 @@ program stops processing everything immediately. No input records are read. However, if an @code{END} rule is present, as part of executing the @code{exit} statement, the @code{END} rule is executed -(@pxref{BEGIN/END, ,The @code{BEGIN} and @code{END} Special Patterns}). +(@pxref{BEGIN/END}). If @code{exit} is used as part of an @code{END} rule, it causes the program to stop immediately. @@ -10406,7 +10525,7 @@ In such a case, if you don't want the @code{END} rule to do its job, set a variable to nonzero before the @code{exit} statement and check that variable in the @code{END} rule. -@xref{Assert Function, ,Assertions}, +@xref{Assert Function}, for an example that does this. @cindex dark corner, @code{exit} statement @@ -10439,7 +10558,7 @@ BEGIN @{ @c ENDOFRANGE acs @c ENDOFRANGE accs -@node Built-in Variables, , Statements, Patterns and Actions +@node Built-in Variables @section Built-in Variables @c STARTOFRANGE bvar @cindex built-in variables @@ -10468,7 +10587,7 @@ describing their areas of activity. * ARGC and ARGV:: Ways to use @code{ARGC} and @code{ARGV}. @end menu -@node User-modified, Auto-set, Built-in Variables, Built-in Variables +@node User-modified @subsection Built-in Variables That Control @command{awk} @c STARTOFRANGE bvaru @cindex built-in variables, user-modifiable @@ -10495,15 +10614,15 @@ files should use binary I/O. Any other string value is equivalent to @code{"rw"}, but @command{gawk} generates a warning message. @code{BINMODE} is described in more detail in -@ref{PC Using, ,Using @command{gawk} on PC Operating Systems}. +@ref{PC Using}. @cindex differences in @command{awk} and @command{gawk}, @code{BINMODE} variable This variable is a @command{gawk} extension. In other @command{awk} implementations (except @command{mawk}, -@pxref{Other Versions, , Other Freely Available @command{awk} Implementations}), +@pxref{Other Versions}), or if @command{gawk} is in compatibility mode -(@pxref{Options, ,Command-Line Options}), +(@pxref{Options}), it is not special. @cindex @code{CONVFMT} variable @@ -10512,10 +10631,10 @@ it is not special. @cindex strings, converting, numbers to @item CONVFMT This string controls conversion of numbers to -strings (@pxref{Conversion, ,Conversion of Strings and Numbers}). +strings (@pxref{Conversion}). It works by being passed, in effect, as the first argument to the @code{sprintf} function -(@pxref{String Functions, ,String Manipulation Functions}). +(@pxref{String Functions}). Its default value is @code{"%.6g"}. @code{CONVFMT} was introduced by the POSIX standard. @@ -10528,11 +10647,11 @@ This is a space-separated list of columns that tells @command{gawk} how to split input with fixed columnar boundaries. Assigning a value to @code{FIELDWIDTHS} overrides the use of @code{FS} for field splitting. -@xref{Constant Size, ,Reading Fixed-Width Data}, for more information. +@xref{Constant Size}, for more information. @cindex @command{gawk}, @code{FIELDWIDTHS} variable in If @command{gawk} is in compatibility mode -(@pxref{Options, ,Command-Line Options}), then @code{FIELDWIDTHS} +(@pxref{Options}), then @code{FIELDWIDTHS} has no special meaning, and field-splitting operations occur based exclusively on the value of @code{FS}. @@ -10541,7 +10660,7 @@ exclusively on the value of @code{FS}. @cindex field separators @item FS This is the input field separator -(@pxref{Field Separators, ,Specifying How Fields Are Separated}). +(@pxref{Field Separators}). The value is a single-character string or a multi-character regular expression that matches the separations between fields in an input record. If the value is the null string (@code{""}), then each @@ -10585,11 +10704,11 @@ functions, record termination with @code{RS}, and field splitting with 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}. +@xref{Case-sensitivity}. @cindex @command{gawk}, @code{IGNORECASE} variable in If @command{gawk} is in compatibility mode -(@pxref{Options, ,Command-Line Options}), +(@pxref{Options}), then @code{IGNORECASE} has no special meaning. Thus, string and regexp operations are always case-sensitive. @@ -10599,7 +10718,7 @@ and regexp operations are always case-sensitive. @item LINT # When this variable is true (nonzero or non-null), @command{gawk} behaves as if the @option{--lint} command-line option is in effect. -(@pxref{Options, ,Command-Line Options}). +(@pxref{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.) @@ -10621,10 +10740,10 @@ of @command{awk} being executed. @cindex strings, converting, numbers to @item OFMT This string controls conversion of numbers to -strings (@pxref{Conversion, ,Conversion of Strings and Numbers}) for +strings (@pxref{Conversion}) for printing with the @code{print} statement. It works by being passed as the first argument to the @code{sprintf} function -(@pxref{String Functions, ,String Manipulation Functions}). +(@pxref{String Functions}). Its default value is @code{"%.6g"}. Earlier versions of @command{awk} also used @code{OFMT} to specify the format for converting numbers to strings in general expressions; this is now done by @code{CONVFMT}. @@ -10656,13 +10775,13 @@ It can also be the null string, in which case records are separated by runs of blank lines. If it is a regexp, records are separated by matches of the regexp in the input text. -(@xref{Records, ,How Input Is Split into Records}.) +(@xref{Records}.) The ability for @code{RS} to be a regular expression is a @command{gawk} extension. In most other @command{awk} implementations, or if @command{gawk} is in compatibility mode -(@pxref{Options, ,Command-Line Options}), +(@pxref{Options}), just the first character of @code{RS}'s value is used. @cindex @code{SUBSEP} variable @@ -10673,7 +10792,7 @@ This is the subscript separator. It has the default value of @code{"\034"} and is used to separate the parts of the indices of a multidimensional array. Thus, the expression @code{@w{foo["A", "B"]}} really accesses @code{foo["A\034B"]} -(@pxref{Multi-dimensional, ,Multidimensional Arrays}). +(@pxref{Multi-dimensional}). @cindex @code{TEXTDOMAIN} variable @cindex differences in @command{awk} and @command{gawk}, @code{TEXTDOMAIN} variable @@ -10683,13 +10802,13 @@ This variable is used for internationalization of programs at the @command{awk} level. It sets the default text domain for specially marked string constants in the source text, as well as for the @code{dcgettext}, @code{dcngettext} and @code{bindtextdomain} functions -(@pxref{Internationalization, ,Internationalization with @command{gawk}}). +(@pxref{Internationalization}). The default value of @code{TEXTDOMAIN} is @code{"messages"}. This variable is a @command{gawk} extension. In other @command{awk} implementations, or if @command{gawk} is in compatibility mode -(@pxref{Options, ,Command-Line Options}), +(@pxref{Options}), it is not special. @end table @c ENDOFRANGE bvar @@ -10697,7 +10816,7 @@ it is not special. @c ENDOFRANGE bvaru @c ENDOFRANGE nmbv -@node Auto-set, ARGC and ARGV, User-modified, Built-in Variables +@node Auto-set @subsection Built-in Variables That Convey Information @c STARTOFRANGE bvconi @@ -10716,7 +10835,7 @@ information to your program. The variables that are specific to @item ARGC@r{,} ARGV The command-line arguments available to @command{awk} programs are stored in an array called @code{ARGV}. @code{ARGC} is the number of command-line -arguments present. @xref{Other Arguments, ,Other Command-Line Arguments}. +arguments present. @xref{Other Arguments}. Unlike most @command{awk} arrays, @code{ARGV} is indexed from 0 to @code{ARGC} @minus{} 1. In the following example: @@ -10746,7 +10865,7 @@ method of accessing command-line arguments. The value of @code{ARGV[0]} can vary from system to system. Also, you should note that the program text is @emph{not} included in @code{ARGV}, nor are any of @command{awk}'s command-line options. -@xref{ARGC and ARGV, , Using @code{ARGC} and @code{ARGV}}, for information +@xref{ARGC and ARGV}, for information about how @command{awk} uses these variables. @cindex @code{ARGIND} variable @@ -10772,7 +10891,7 @@ next file is opened. This variable is a @command{gawk} extension. In other @command{awk} implementations, or if @command{gawk} is in compatibility mode -(@pxref{Options, ,Command-Line Options}), +(@pxref{Options}), it is not special. @cindex @code{ENVIRON} variable @@ -10789,7 +10908,7 @@ does not affect the environment passed on to any programs that Some operating systems may not have environment variables. On such systems, the @code{ENVIRON} array is empty (except for @w{@code{ENVIRON["AWKPATH"]}}, -@pxref{AWKPATH Variable, ,The @env{AWKPATH} Environment Variable}). +@pxref{AWKPATH Variable}). @cindex @code{ERRNO} variable @cindex differences in @command{awk} and @command{gawk}, @code{ERRNO} variable @@ -10802,7 +10921,7 @@ then @code{ERRNO} contains a string describing the error. This variable is a @command{gawk} extension. In other @command{awk} implementations, or if @command{gawk} is in compatibility mode -(@pxref{Options, ,Command-Line Options}), +(@pxref{Options}), it is not special. @cindex @code{FILENAME} variable @@ -10812,7 +10931,7 @@ The name of the file that @command{awk} is currently reading. When no @value{DF}s are listed on the command line, @command{awk} reads from the standard input and @code{FILENAME} is set to @code{"-"}. @code{FILENAME} is changed each time a new file is read -(@pxref{Reading Files, ,Reading Input Files}). +(@pxref{Reading Files}). Inside a @code{BEGIN} rule, the value of @code{FILENAME} is @code{""}, since there are no input files being processed yet.@footnote{Some early implementations of Unix @command{awk} initialized @@ -10821,7 +10940,7 @@ processed. This behavior was incorrect and should not be relied upon in your programs.} @value{DARKCORNER} Note, though, that using @code{getline} -(@pxref{Getline, ,Explicit Input with @code{getline}}) +(@pxref{Getline}) inside a @code{BEGIN} rule can give @code{FILENAME} a value. @@ -10829,14 +10948,14 @@ inside a @code{BEGIN} rule can give @item FNR The current record number in the current file. @code{FNR} is incremented each time a new record is read -(@pxref{Getline, ,Explicit Input with @code{getline}}). It is reinitialized +(@pxref{Getline}). It is reinitialized to zero each time a new input file is started. @cindex @code{NF} variable @item NF The number of fields in the current input record. @code{NF} is set each time a new record is read, when a new field is -created or when @code{$0} changes (@pxref{Fields, ,Examining Fields}). +created or when @code{$0} changes (@pxref{Fields}). Unlike most of the variables described in this @ifnotinfo @@ -10848,13 +10967,13 @@ node, 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}. +current record: @xref{Changing Fields}. @cindex @code{NR} variable @item NR The number of input records @command{awk} has processed since the beginning of the program's execution -(@pxref{Records, ,How Input Is Split into Records}). +(@pxref{Records}). @code{NR} is incremented each time a new record is read. @cindex @code{PROCINFO} array @@ -10897,19 +11016,19 @@ On some systems, there may be elements in the array, @code{"group1"} through @code{"group@var{N}"} for some @var{N}. @var{N} is the number of supplementary groups that the process has. Use the @code{in} operator to test for these elements -(@pxref{Reference to Elements, , Referring to an Array Element}). +(@pxref{Reference to Elements}). This array is a @command{gawk} extension. In other @command{awk} implementations, or if @command{gawk} is in compatibility mode -(@pxref{Options, ,Command-Line Options}), +(@pxref{Options}), it is not special. @cindex @code{RLENGTH} variable @item RLENGTH The length of the substring matched by the @code{match} function -(@pxref{String Functions, ,String Manipulation Functions}). +(@pxref{String Functions}). @code{RLENGTH} is set by invoking the @code{match} function. Its value is the length of the matched string, or @minus{}1 if no match is found. @@ -10917,7 +11036,7 @@ is the length of the matched string, or @minus{}1 if no match is found. @item RSTART The start-index in characters of the substring that is matched by the @code{match} function -(@pxref{String Functions, ,String Manipulation Functions}). +(@pxref{String Functions}). @code{RSTART} is set by invoking the @code{match} function. Its value is the position of the string where the matched substring starts, or zero if no match was found. @@ -10931,7 +11050,7 @@ that matched the text denoted by @code{RS}, the record separator. This variable is a @command{gawk} extension. In other @command{awk} implementations, or if @command{gawk} is in compatibility mode -(@pxref{Options, ,Command-Line Options}), +(@pxref{Options}), it is not special. @end table @c ENDOFRANGE bvconi @@ -10965,18 +11084,18 @@ $ echo '1 @noindent Before @code{FNR} was added to the @command{awk} language -(@pxref{V7/SVR3.1, ,Major Changes Between V7 and SVR3.1}), +(@pxref{V7/SVR3.1}), many @command{awk} programs used this feature to track the number of records in a file by resetting @code{NR} to zero when @code{FILENAME} changed. -@node ARGC and ARGV, , Auto-set, Built-in Variables +@node ARGC and ARGV @subsection Using @code{ARGC} and @code{ARGV} @cindex @code{ARGC}/@code{ARGV} variables @cindex arguments, command-line @cindex command line, arguments -@ref{Auto-set, ,Built-in Variables That Convey Information}, +@ref{Auto-set}, presented the following program describing the information contained in @code{ARGC} and @code{ARGV}: @@ -10997,7 +11116,7 @@ contains @samp{inventory-shipped}, and @code{ARGV[2]} contains Notice that the @command{awk} program is not entered in @code{ARGV}. The other special command-line options, with their arguments, are also not entered. This includes variable assignments done with the @option{-v} -option (@pxref{Options, ,Command-Line Options}). +option (@pxref{Options}). Normal variable assignments on the command line @emph{are} treated as arguments and do show up in the @code{ARGV} array: @@ -11036,12 +11155,12 @@ special feature, @command{awk} ignores @value{FN}s that have been replaced with the null string. Another option is to use the @code{delete} statement to remove elements from -@code{ARGV} (@pxref{Delete, ,The @code{delete} Statement}). +@code{ARGV} (@pxref{Delete}). All of these actions are typically done in the @code{BEGIN} rule, before actual processing of the input begins. -@xref{Split Program, ,Splitting a Large File into Pieces}, and see -@ref{Tee Program, ,Duplicating Output into Multiple Files}, for examples +@xref{Split Program}, and see +@ref{Tee Program}, for examples of each way of removing elements from @code{ARGV}. The following fragment processes @code{ARGV} in order to examine, and then remove, command-line options: @@ -11090,7 +11209,7 @@ Because @option{-d} is not a valid @command{gawk} option, it and the following @option{-v} are passed on to the @command{awk} program. -@node Arrays, Functions, Patterns and Actions, Top +@node Arrays @chapter Arrays in @command{awk} @c STARTOFRANGE arrs @cindex arrays @@ -11114,7 +11233,7 @@ for sorting an array based on its indices. @cindex namespace issues @command{awk} maintains a single set of names that may be used for naming variables, arrays, and functions -(@pxref{User-defined, ,User-Defined Functions}). +(@pxref{User-defined}). Thus, you cannot have a variable and an array with the same name in the same @command{awk} program. @@ -11137,7 +11256,7 @@ same @command{awk} program. * Array Sorting:: Sorting array values and indices. @end menu -@node Array Intro, Reference to Elements, Arrays, Arrays +@node Array Intro @section Introduction to Arrays The @command{awk} language provides one-dimensional arrays @@ -11269,7 +11388,7 @@ numeric form---thus illustrating that a single array can have both numbers and strings as indices. In fact, array subscripts are always strings; this is discussed in more detail in -@ref{Numeric Array Subscripts, ,Using Numbers to Subscript Arrays}. +@ref{Numeric Array Subscripts}. Here, the number @code{1} isn't double-quoted, since @command{awk} automatically converts it to a string. @@ -11282,14 +11401,14 @@ to retrieve it. When @command{awk} creates an array (e.g., with the @code{split} built-in function), that array's indices are consecutive integers starting at one. -(@xref{String Functions, ,String Manipulation Functions}.) +(@xref{String Functions}.) @command{awk}'s arrays are efficient---the time to access an element is independent of the number of elements in the array. @c ENDOFRANGE arrin @c ENDOFRANGE inarr -@node Reference to Elements, Assigning Elements, Array Intro, Arrays +@node Reference to Elements @section Referring to an Array Element @cindex arrays, elements, referencing @cindex elements in arrays @@ -11312,7 +11431,7 @@ of array @code{foo} at index @samp{4.3}. A reference to an array element that has no recorded value yields a value of @code{""}, the null string. This includes elements that have not been assigned any value as well as elements that have been -deleted (@pxref{Delete, ,The @code{delete} Statement}). Such a reference +deleted (@pxref{Delete}). Such a reference automatically creates that array element, with the null string as its value. (In some cases, this is unfortunate, because it might waste memory inside @command{awk}.) @@ -11351,7 +11470,7 @@ if (frequencies[2] != "") print "Subscript 2 is present." @end example -@node Assigning Elements, Array Example, Reference to Elements, Arrays +@node Assigning Elements @section Assigning Array Elements @cindex arrays, elements, assigning @cindex elements in arrays, assigning @@ -11369,7 +11488,7 @@ Array elements can be assigned values just like assigned a value. The expression @var{value} is the value to assign to that element of the array. -@node Array Example, Scanning an Array, Assigning Elements, Arrays +@node Array Example @section Basic Array Example The following program takes a list of lines, each beginning with a line @@ -11437,7 +11556,7 @@ END @{ @} @end example -@node Scanning an Array, Delete, Array Example, Arrays +@node Scanning an Array @section Scanning All Elements of an Array @cindex elements in arrays, scanning @cindex arrays, scanning @@ -11470,7 +11589,7 @@ the word as index. The second rule scans the elements of @code{used} to find all the distinct words that appear in the input. It prints each word that is more than 10 characters long and also prints the number of such words. -@xref{String Functions, ,String Manipulation Functions}, +@xref{String Functions}, for more information on the built-in function @code{length}. @example @@ -11492,7 +11611,7 @@ END @{ @end example @noindent -@xref{Word Sorting, ,Generating Word Usage Counts}, +@xref{Word Sorting}, for a more detailed example of this type. @cindex arrays, elements, order of @@ -11505,7 +11624,7 @@ the loop body; it is not predictable whether the @code{for} loop will reach them. Similarly, changing @var{var} inside the loop may produce strange results. It is best to avoid such things. -@node Delete, Numeric Array Subscripts, Scanning an Array, Arrays +@node Delete @section The @code{delete} Statement @cindex @code{delete} statement @cindex deleting elements in arrays @@ -11520,7 +11639,7 @@ delete @var{array}[@var{index}] @end example Once an array element has been deleted, any value the element once -had is no longer available. It is as if the element had never +had is no longer available. It is as if the element had never been referred to or had been given a value. The following is an example of deleting elements in an array: @@ -11555,7 +11674,7 @@ if (4 in foo) @cindex lint checking, array elements It is not an error to delete an element that does not exist. If @option{--lint} is provided on the command line -(@pxref{Options, ,Command-Line Options}), +(@pxref{Options}), @command{gawk} issues a warning message when an element that is not in the array is deleted. @@ -11571,7 +11690,7 @@ delete @var{array} @end example This ability is a @command{gawk} extension; it is not available in -compatibility mode (@pxref{Options, ,Command-Line Options}). +compatibility mode (@pxref{Options}). Using this version of the @code{delete} statement is about three times more efficient than the equivalent loop that deletes each element one @@ -11589,7 +11708,7 @@ split("", array) @c comma before deleting does NOT start a tertiary @cindex @code{split} function, array elements, deleting The @code{split} function -(@pxref{String Functions, ,String Manipulation Functions}) +(@pxref{String Functions}) clears out the target array first. This call asks it to split apart the null string. Because there is no data to split out, the function simply clears the array and then returns. @@ -11602,7 +11721,7 @@ delete an array and then use the array's name as a scalar a[1] = 3; delete a; a = 3 @end example -@node Numeric Array Subscripts, Uninitialized Subscripts, Delete, Arrays +@node Numeric Array Subscripts @section Using Numbers to Subscript Arrays @cindex numbers, as array subscripts @@ -11612,7 +11731,7 @@ a[1] = 3; delete a; a = 3 An important aspect about arrays to remember is that @emph{array subscripts are always strings}. When a numeric value is used as a subscript, it is converted to a string value before being used for subscripting -(@pxref{Conversion, ,Conversion of Strings and Numbers}). +(@pxref{Conversion}). This means that the value of the built-in variable @code{CONVFMT} can affect how your program accesses elements of an array. For example: @@ -11640,7 +11759,7 @@ since @code{"12.15"} is a different string from @code{"12.153"}. @cindex converting, during subscripting According to the rules for conversions -(@pxref{Conversion, ,Conversion of Strings and Numbers}), integer +(@pxref{Conversion}), integer values are always converted to strings as integers, no matter what the value of @code{CONVFMT} may happen to be. So the usual case of the following works: @@ -11653,7 +11772,7 @@ for (i = 1; i <= maxsub; i++) The ``integer values always convert to strings as integers'' rule has an additional consequence for array indexing. Octal and hexadecimal constants -(@pxref{Nondecimal-numbers, ,Octal and Hexadecimal Numbers}) +(@pxref{Nondecimal-numbers}) are converted internally into numbers, and their original form is forgotten. This means, for example, that @@ -11668,7 +11787,7 @@ things work as one would expect them to. But it is useful to have a precise knowledge of the actual rules which sometimes can have a subtle effect on your programs. -@node Uninitialized Subscripts, Multi-dimensional, Numeric Array Subscripts, Arrays +@node Uninitialized Subscripts @section Using Uninitialized Variables as Subscripts @c last comma does NOT start a tertiary @@ -11726,9 +11845,9 @@ Even though it is somewhat unusual, the null string @value{DARKCORNER} @command{gawk} warns about the use of the null string as a subscript if @option{--lint} is provided -on the command line (@pxref{Options, ,Command-Line Options}). +on the command line (@pxref{Options}). -@node Multi-dimensional, Multi-scanning, Uninitialized Subscripts, Arrays +@node Multi-dimensional @section Multidimensional Arrays @cindex subscripts in arrays, multidimensional @@ -11744,7 +11863,7 @@ two-dimensional array named @code{grid} is with Multidimensional arrays are supported in @command{awk} through concatenation of indices into one string. @command{awk} converts the indices into strings -(@pxref{Conversion, ,Conversion of Strings and Numbers}) and +(@pxref{Conversion}) and concatenates them together, with a separator between them. This creates a single string that describes the values of the separate indices. The combined string is used as a single index into an ordinary, @@ -11826,7 +11945,7 @@ the program produces the following output: 3 2 1 6 @end example -@node Multi-scanning, Array Sorting, Multi-dimensional, Arrays +@node Multi-scanning @section Scanning Multidimensional Arrays There is no special @code{for} statement for scanning a @@ -11839,9 +11958,9 @@ multidimensional @emph{way of accessing} an array. However, if your program has an array that is always accessed as multidimensional, you can get the effect of scanning it by combining the scanning @code{for} statement -(@pxref{Scanning an Array, ,Scanning All Elements of an Array}) with the +(@pxref{Scanning an Array}) with the built-in @code{split} function -(@pxref{String Functions, ,String Manipulation Functions}). +(@pxref{String Functions}). It works in the following manner: @example @@ -11874,7 +11993,7 @@ The result is to set @code{separate[1]} to @code{"1"} and @code{separate[2]} to @code{"foo"}. Presto! The original sequence of separate indices is recovered. -@node Array Sorting, , Multi-scanning, Arrays +@node Array Sorting @section Sorting Array Values and Indices with @command{gawk} @cindex arrays, sorting @@ -11890,7 +12009,7 @@ 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} and @code{asorti} functions -(@pxref{String Functions, ,String Manipulation Functions}) +(@pxref{String Functions}) for sorting arrays. For example: @example @@ -11906,7 +12025,7 @@ to some number @var{n}, the total number of elements in @code{data}. @code{data[1]} @value{LEQ} @code{data[2]} @value{LEQ} @code{data[3]}, and so on. The comparison of array elements is done using @command{gawk}'s usual comparison rules -(@pxref{Typing and Comparison, ,Variable Typing and Comparison Expressions}). +(@pxref{Typing and Comparison}). @cindex side effects, @code{asort} function An important side effect of calling @code{asort} is that @@ -11983,7 +12102,7 @@ affects sorting for both @code{asort} and @code{asorti}. Caveat Emptor. @c ENDOFRANGE arrs -@node Functions, Internationalization, Arrays, Top +@node Functions @chapter Functions @c STARTOFRANGE funcbi @@ -12006,7 +12125,7 @@ The second half of this @value{CHAPTER} describes these * User-defined:: Describes User-defined functions in detail. @end menu -@node Built-in, User-defined, Functions, Functions +@node Built-in @section Built-in Functions @c 2e: USE TEXINFO-2 FUNCTION DEFINITION STUFF!!!!!!!!!!!!! @@ -12028,7 +12147,7 @@ but are summarized here for your convenience. * I18N Functions:: Functions for string translation. @end menu -@node Calling Built-in, Numeric Functions, Built-in, Built-in +@node Calling Built-in @subsection Calling Built-in Functions To call one of @command{awk}'s built-in functions, write the name of @@ -12087,7 +12206,7 @@ and 12. But if the order of evaluation is right to left, @code{i} first becomes 10, then 11, and @code{atan2} is called with the two arguments 11 and 10. -@node Numeric Functions, String Functions, Calling Built-in, Built-in +@node Numeric Functions @subsection Numeric Functions The following list describes all of @@ -12137,7 +12256,7 @@ This returns the arctangent of @code{@var{y} / @var{x}} in radians. @cindex random numbers, @code{rand}/@code{srand} functions This returns a random number. The values of @code{rand} are uniformly distributed between zero and one. -The value is never zero and never one.@footnote{The C version of @code{rand} +The value could be zero but is never one.@footnote{The C version of @code{rand} is known to produce fairly poor sequences of random numbers. However, nothing requires that an @command{awk} implementation use the C @code{rand} to implement the @command{awk} version of @code{rand}. @@ -12214,7 +12333,7 @@ easy to keep track of the seeds in case you need to consistently reproduce sequences of random numbers. @end table -@node String Functions, I/O Functions, Numeric Functions, Built-in +@node String Functions @subsection String-Manipulation Functions The functions in this @value{SECTION} look at or change the text of one or more @@ -12267,9 +12386,9 @@ a[3] = "sac" @end example The @code{asort} function is described in more detail in -@ref{Array Sorting, ,Sorting Array Values and Indices with @command{gawk}}. +@ref{Array Sorting}. @code{asort} is a @command{gawk} extension; it is not available -in compatibility mode (@pxref{Options, ,Command-Line Options}). +in compatibility mode (@pxref{Options}). @item asorti(@var{source} @r{[}, @var{dest}@r{]}) # @cindex @code{asorti} function (@command{gawk}) @@ -12281,10 +12400,10 @@ 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}}. +@ref{Array Sorting}. 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}). +in compatibility mode (@pxref{Options}). @item index(@var{in}, @var{find}) @cindex @code{index} function @@ -12336,7 +12455,7 @@ at which that substring begins (one, if it starts at the beginning of 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 +@ref{Computed Regexps}, for a discussion of the difference between the two forms, and the implications for writing your program correctly. @@ -12430,10 +12549,15 @@ $ echo foooobazbarrrrr | @print{} 9 7 @end example +There may not be subscripts for the start and index for every parenthesized +subexpressions, since they may not all have matched text; thus they +should be tested for with the @code{in} operator +(@pxref{Reference to Elements}). + @cindex troubleshooting, @code{match} function The @var{array} argument to @code{match} is a @command{gawk} extension. In compatibility mode -(@pxref{Options, ,Command-Line Options}), +(@pxref{Options}), using a third argument is a fatal error. @item split(@var{string}, @var{array} @r{[}, @var{fieldsep}@r{]}) @@ -12486,7 +12610,7 @@ 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 +@ref{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. @@ -12495,7 +12619,7 @@ elements in the array @var{array}. 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}.) +@xref{Delete}.) 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 @@ -12505,7 +12629,7 @@ If @var{string} does not match @var{fieldsep} at all (but is not null), @cindex @code{sprintf} function This returns (without printing) the string that @code{printf} would have printed out with the same arguments -(@pxref{Printf, ,Using @code{printf} Statements for Fancier Printing}). +(@pxref{Printf}). For example: @example @@ -12534,11 +12658,11 @@ Using the @code{strtonum} function is @emph{not} the same as adding zero to a string value; the automatic coercion of strings to numbers works only for decimal data, not for octal or hexadecimal.@footnote{Unless you use the @option{--non-decimal-data} option, which isn't recommended. -@xref{Nondecimal Data, ,Allowing Nondecimal Input Data}, for more information.} +@xref{Nondecimal Data}, for more information.} @cindex differences in @command{awk} and @command{gawk}, @code{strtonum} function (@command{gawk}) @code{strtonum} is a @command{gawk} extension; it is not available -in compatibility mode (@pxref{Options, ,Command-Line Options}). +in compatibility mode (@pxref{Options}). @item sub(@var{regexp}, @var{replacement} @r{[}, @var{target}@r{]}) @cindex @code{sub} function @@ -12552,7 +12676,7 @@ 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 +@ref{Computed Regexps}, for a discussion of the difference between the two forms, and the implications for writing your program correctly. @@ -12605,7 +12729,7 @@ $ awk 'BEGIN @{ @noindent This shows how @samp{&} can represent a nonconstant string and also illustrates the ``leftmost, longest'' rule in regexp matching -(@pxref{Leftmost Longest, ,How Much Text Matches?}). +(@pxref{Leftmost Longest}). The effect of this special character (@samp{&}) can be turned off by putting a backslash before it in the string. As usual, to insert one backslash in @@ -12723,7 +12847,7 @@ If @var{regexp} does not match @var{target}, @code{gensub}'s return value is the original unchanged value of @var{target}. @code{gensub} is a @command{gawk} extension; it is not available -in compatibility mode (@pxref{Options, ,Command-Line Options}). +in compatibility mode (@pxref{Options}). @item substr(@var{string}, @var{start} @r{[}, @var{length}@r{]}) @cindex @code{substr} function @@ -12798,7 +12922,7 @@ Nonalphabetic characters are left unchanged. For example, @code{toupper("MiXeD cAsE 123")} returns @code{"MIXED CASE 123"}. @end table -@node Gory Details, , String Functions, String Functions +@node Gory Details @subsubsection More About @samp{\} and @samp{&} with @code{sub}, @code{gsub}, and @code{gensub} @cindex escape processing, @code{gsub}/@code{gensub}/@code{sub} functions @@ -13051,7 +13175,7 @@ $ echo abc | awk '@{ gsub(/m*/, "X"); print @}' @noindent Although this makes a certain amount of sense, it can be surprising. -@node I/O Functions, Time Functions, String Functions, Built-in +@node I/O Functions @subsection Input/Output Functions The following functions relate to input/output (I/O). @@ -13064,7 +13188,7 @@ Optional parameters are enclosed in square brackets ([ ]): Close the file @var{filename} for input or output. Alternatively, the argument may be a shell command that was used for creating a coprocess, or for redirecting to or from a pipe; then the coprocess or pipe is closed. -@xref{Close Files And Pipes, ,Closing Input and Output Redirections}, +@xref{Close Files And Pipes}, for more information. When closing a coprocess, it is occasionally useful to first close @@ -13073,7 +13197,7 @@ by providing a second argument to @code{close}. This second argument should be one of the two string values @code{"to"} or @code{"from"}, indicating which end of the pipe to close. Case in the string does not matter. -@xref{Two-way I/O, ,Two-Way Communications with Another Process}, +@xref{Two-way I/O}, which discusses this feature in more detail and gives an example. @item fflush(@r{[}@var{filename}@r{]}) @@ -13099,7 +13223,7 @@ buffers its output and the @code{fflush} function forces @code{fflush} was added to the Bell Laboratories research version of @command{awk} in 1994; it is not part of the POSIX standard and is not available if @option{--posix} has been specified on the -command line (@pxref{Options, ,Command-Line Options}). +command line (@pxref{Options}). @cindex @command{gawk}, @code{fflush} function in @command{gawk} extends the @code{fflush} function in two ways. The first @@ -13265,7 +13389,7 @@ second print If @command{awk} did not flush its buffers before calling @code{system}, you would see the latter (undesirable) output. -@node Time Functions, Bitwise Functions, I/O Functions, Built-in +@node Time Functions @subsection Using @command{gawk}'s Timestamp Functions @c STARTOFRANGE tst @@ -13371,7 +13495,7 @@ time data coming from an external source, such as a log file. The @code{strftime} function allows you to easily turn a timestamp into human-readable information. It is similar in nature to the @code{sprintf} function -(@pxref{String Functions, ,String Manipulation Functions}), +(@pxref{String Functions}), in that it copies nonformat specification characters verbatim to the returned string, while substituting date and time values for format specifications in the @var{format} string. @@ -13522,7 +13646,7 @@ and so on).@footnote{If you don't understand any of this, don't worry about it; these facilities are meant to make it easier to ``internationalize'' programs. Other internationalization features are described in -@ref{Internationalization, ,Internationalization with @command{gawk}}.} +@ref{Internationalization}.} (These facilitate compliance with the POSIX @command{date} utility.) @item %% @@ -13551,7 +13675,7 @@ A public-domain C version of @code{strftime} is supplied with @command{gawk} for systems that are not yet fully standards-compliant. It supports all of the just listed format specifications. If that version is -used to compile @command{gawk} (@pxref{Installation, ,Installing @command{gawk}}), +used to compile @command{gawk} (@pxref{Installation}), then the following additional format specifications are available: @table @code @@ -13634,7 +13758,7 @@ gawk 'BEGIN @{ @c ENDOFRANGE filogtst @c ENDOFRANGE gawtst -@node Bitwise Functions, I18N Functions, Time Functions, Built-in +@node Bitwise Functions @subsection Bit-Manipulation Functions of @command{gawk} @c STARTOFRANGE bit @cindex bitwise, operations @@ -13781,12 +13905,12 @@ Return the value of @var{val}, shifted right by @var{count} bits. @end multitable For all of these functions, first the double-precision floating-point value is -converted to a C @code{unsigned long}, then the bitwise operation is +converted to the widest C unsigned integer type, then the bitwise operation is performed and then the result is converted back into a C @code{double}. (If you don't understand this paragraph, don't worry about it.) Here is a user-defined function -(@pxref{User-defined, ,User-Defined Functions}) +(@pxref{User-defined}) that illustrates the use of these functions: @cindex @code{bits2str} user-defined function @@ -13882,7 +14006,7 @@ of 8-bit quantities. This is typical in modern computers. The main code in the @code{BEGIN} rule shows the difference between the decimal and octal values for the same numbers -(@pxref{Nondecimal-numbers, ,Octal and Hexadecimal Numbers}), +(@pxref{Nondecimal-numbers}), and then demonstrates the results of the @code{compl}, @code{lshift}, and @code{rshift} functions. @c ENDOFRANGE bit @@ -13891,7 +14015,7 @@ results of the @code{compl}, @code{lshift}, and @code{rshift} functions. @c ENDOFRANGE xor @c ENDOFRANGE opbit -@node I18N Functions, , Bitwise Functions, Built-in +@node I18N Functions @subsection Using @command{gawk}'s String-Translation Functions @cindex @command{gawk}, string-translation functions @cindex functions, string-translation @@ -13901,7 +14025,7 @@ results of the @code{compl}, @code{lshift}, and @code{rshift} functions. @command{gawk} provides facilities for internationalizing @command{awk} programs. These include the functions described in the following list. The descriptions here are purposely brief. -@xref{Internationalization, ,Internationalization with @command{gawk}}, +@xref{Internationalization}, for the full story. Optional parameters are enclosed in square brackets ([ ]): @@ -13939,7 +14063,7 @@ given @var{domain}. @c ENDOFRANGE funcbi @c ENDOFRANGE bifunc -@node User-defined, , Built-in, Functions +@node User-defined @section User-Defined Functions @c STARTOFRANGE udfunc @@ -13960,7 +14084,7 @@ them, i.e., to tell @command{awk} what they should do. * Dynamic Typing:: How variable types can change at runtime. @end menu -@node Definition Syntax, Function Example, User-defined, User-defined +@node Definition Syntax @subsection Function Definition Syntax @c STARTOFRANGE fdef @@ -14053,7 +14177,7 @@ the keyword @code{function} may be abbreviated @code{func}. However, POSIX only specifies the use of the keyword @code{function}. This actually has some practical implications. If @command{gawk} is in POSIX-compatibility mode -(@pxref{Options, ,Command-Line Options}), then the following +(@pxref{Options}), then the following statement does @emph{not} define a function: @example @@ -14074,7 +14198,7 @@ in @command{awk} programs.) To ensure that your @command{awk} programs are portable, always use the keyword @code{function} when defining a function. -@node Function Example, Function Caveats, Definition Syntax, User-defined +@node Function Example @subsection Function Definition Examples Here is an example of a user-defined function, called @code{myprint}, that @@ -14125,7 +14249,7 @@ function delarray(a, i) When working with arrays, it is often necessary to delete all the elements in an array and start over with a new list of elements -(@pxref{Delete, ,The @code{delete} Statement}). +(@pxref{Delete}). Instead of having to repeat this loop everywhere that you need to clear out an array, your program can just call @code{delarray}. @@ -14161,7 +14285,7 @@ $ echo "Don't Panic!" | The C @code{ctime} function takes a timestamp and returns it in a string, formatted in a well-known fashion. The following example uses the built-in @code{strftime} function -(@pxref{Time Functions, ,Using @command{gawk}'s Timestamp Functions}) +(@pxref{Time Functions}) to create an @command{awk} version of @code{ctime}: @cindex @code{ctime} user-defined function @@ -14183,7 +14307,7 @@ function ctime(ts, format) @end example @c ENDOFRANGE fdef -@node Function Caveats, Return Statement, Function Example, User-defined +@node Function Caveats @subsection Calling User-Defined Functions @c STARTOFRANGE fudc @@ -14302,18 +14426,18 @@ problem if a program calls an undefined function. @cindex lint checking, undefined functions If @option{--lint} is specified -(@pxref{Options, ,Command-Line Options}), +(@pxref{Options}), @command{gawk} reports calls to undefined functions. @cindex portability, @code{next} statement in user-defined functions Some @command{awk} implementations generate a runtime error if you use the @code{next} statement -(@pxref{Next Statement, , The @code{next} Statement}) +(@pxref{Next Statement}) inside a user-defined function. @command{gawk} does not have this limitation. @c ENDOFRANGE fudc -@node Return Statement, Dynamic Typing, Function Caveats, User-defined +@node Return Statement @subsection The @code{return} Statement @c comma does NOT start a secondary @cindex @code{return} statement, user-defined functions @@ -14404,7 +14528,7 @@ Given the following input: the program reports (predictably) that @code{99385} is the largest number in the array. -@node Dynamic Typing, , Return Statement, User-defined +@node Dynamic Typing @subsection Functions and Their Effects on Variable Typing @command{awk} is a very fluid language. @@ -14432,7 +14556,7 @@ being aware of them. @c ENDOFRANGE udfunc @c ENDOFRANGE funcud -@node Internationalization, Advanced Features, Functions, Top +@node Internationalization @chapter Internationalization with @command{gawk} Once upon a time, computer makers @@ -14467,7 +14591,7 @@ a requirement. * Gawk I18N:: @command{gawk} is also internationalized. @end menu -@node I18N and L10N, Explaining gettext, Internationalization, Internationalization +@node I18N and L10N @section Internationalization and Localization @cindex internationalization @@ -14484,7 +14608,7 @@ used for printing error messages, the language used to read responses, and information related to how numerical and monetary values are printed and read. -@node Explaining gettext, Programmer i18n, I18N and L10N, Internationalization +@node Explaining gettext @section GNU @code{gettext} @cindex internationalizing a program @@ -14633,7 +14757,7 @@ so on). This information is accessed via the POSIX character classes in regular expressions, such as @code{/[[:alnum:]]/} -(@pxref{Regexp Operators, ,Regular Expression Operators}). +(@pxref{Regexp Operators}). @cindex monetary information, localization @cindex currency symbols, localization @@ -14669,7 +14793,7 @@ All of the above. (Not too useful in the context of @code{gettext}.) @end table @c ENDOFRANGE gettex -@node Programmer i18n, Translator i18n, Explaining gettext, Internationalization +@node Programmer i18n @section Internationalizing @command{awk} Programs @c STARTOFRANGE inap @cindex @command{awk} programs, internationalizing @@ -14704,7 +14828,7 @@ one of the known locale categories described in the previous @value{SECTION}. @end ifnotinfo @ifinfo -@ref{Explaining gettext, ,GNU @code{gettext}}. +@ref{Explaining gettext}. @end ifinfo You must also supply a text domain. Use @code{TEXTDOMAIN} if you want to use the current domain. @@ -14751,7 +14875,7 @@ outlined in the previous @value{SECTION}, @end ifnotinfo @ifinfo -@ref{Explaining gettext, ,GNU @code{gettext}}, +@ref{Explaining gettext}, @end ifinfo like so: @@ -14761,9 +14885,9 @@ like so: @item Set the variable @code{TEXTDOMAIN} to the text domain of your program. This is best done in a @code{BEGIN} rule -(@pxref{BEGIN/END, ,The @code{BEGIN} and @code{END} Special Patterns}), +(@pxref{BEGIN/END}), or it can also be done via the @option{-v} command-line -option (@pxref{Options, ,Command-Line Options}): +option (@pxref{Options}): @example BEGIN @{ @@ -14821,11 +14945,11 @@ BEGIN @{ @end enumerate -@xref{I18N Example, ,A Simple Internationalization Example}, +@xref{I18N Example}, for an example program showing the steps to create and use translations from @command{awk}. -@node Translator i18n, I18N Example, Programmer i18n, Internationalization +@node Translator i18n @section Translating @command{awk} Programs @cindex @code{.po} files @@ -14835,7 +14959,7 @@ and use translations from @command{awk}. Once a program's translatable strings have been marked, they must be extracted to create the initial @file{.po} file. As part of translation, it is often helpful to rearrange the order -in which arguments to @code{printf} are output. +in which arguments to @code{printf} are output. @command{gawk}'s @option{--gen-po} command-line option extracts the messages and is discussed next. @@ -14849,7 +14973,7 @@ is covered. * I18N Portability:: @command{awk}-level portability issues. @end menu -@node String Extraction, Printf Ordering, Translator i18n, Translator i18n +@node String Extraction @subsection Extracting Marked Strings @cindex strings, extracting @c comma does NOT start secondary @@ -14880,18 +15004,18 @@ 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.5, the @command{xgettext} utility that comes with GNU @code{gettext} can handle @file{.awk} files.} -@xref{I18N Example, ,A Simple Internationalization Example}, +@xref{I18N Example}, for the full list of steps to go through to create and test translations for @command{guide}. -@node Printf Ordering, I18N Portability, String Extraction, Translator i18n +@node Printf Ordering @subsection Rearranging @code{printf} Arguments @cindex @code{printf} statement, positional specifiers @c comma does NOT start secondary @cindex positional specifiers, @code{printf} statement Format strings for @code{printf} and @code{sprintf} -(@pxref{Printf, ,Using @code{printf} Statements for Fancier Printing}) +(@pxref{Printf}) present a special problem for translation. Consider the following:@footnote{This example is borrowed from the GNU @code{gettext} manual.} @@ -14978,7 +15102,7 @@ their primary purpose is to help in producing correct translations of format strings into languages different from the one in which the program is first written. -@node I18N Portability, , Printf Ordering, Translator i18n +@node I18N Portability @subsection @command{awk} Portability Issues @cindex portability, internationalization and @@ -15060,7 +15184,7 @@ retrieve the translated string, this should not be a problem in practice. @end itemize @c ENDOFRANGE inap -@node I18N Example, Gawk I18N, Translator i18n, Internationalization +@node I18N Example @section A Simple Internationalization Example Now let's look at a step-by-step example of how to internationalize and @@ -15180,7 +15304,7 @@ $ gawk -f guide.awk If the three replacement functions for @code{dcgettext}, @code{dcngettext} and @code{bindtextdomain} -(@pxref{I18N Portability, ,@command{awk} Portability Issues}) +(@pxref{I18N Portability}) are in a file named @file{libintl.awk}, then we can run @file{guide.awk} unchanged as follows: @@ -15191,7 +15315,7 @@ $ gawk --posix -f guide.awk -f libintl.awk @print{} Pardon me, Zaphod who? @end example -@node Gawk I18N, , I18N Example, Internationalization +@node Gawk I18N @section @command{gawk} Can Speak Your Language As of @value{PVERSION} 3.1, @command{gawk} itself has been internationalized @@ -15222,7 +15346,7 @@ before compiling and installing it. for more information. @c ENDOFRANGE inloc -@node Advanced Features, Invoking Gawk, Internationalization, Top +@node Advanced Features @chapter Advanced Features of @command{gawk} @cindex advanced features, network connections, See Also networks, connections @c STARTOFRANGE gawadv @@ -15254,7 +15378,7 @@ of TCP/IP networking and BSD portal files. Finally, @command{gawk} can @dfn{profile} an @command{awk} program, making it possible to tune it for performance. -@ref{Dynamic Extensions, ,Adding New Built-in Functions to @command{gawk}}, +@ref{Dynamic Extensions}, discusses the ability to dynamically add new built-in functions to @command{gawk}. As this feature is still immature and likely to change, its description is relegated to an appendix. @@ -15267,7 +15391,7 @@ its description is relegated to an appendix. * Profiling:: Profiling your @command{awk} programs. @end menu -@node Nondecimal Data, Two-way I/O, Advanced Features, Advanced Features +@node Nondecimal Data @section Allowing Nondecimal Input Data @cindex @code{--non-decimal-data} option @cindex advanced features, @command{gawk}, nondecimal input data @@ -15320,11 +15444,11 @@ facility disabled. If you want it, you must explicitly request it. @emph{Use of this option is not recommended.} It can break old programs very badly. Instead, use the @code{strtonum} function to convert your data -(@pxref{Nondecimal-numbers, ,Octal and Hexadecimal Numbers}). +(@pxref{Nondecimal-numbers}). This makes your programs easier to write and easier to read, and leads to less surprising results. -@node Two-way I/O, TCP/IP Networking, Nondecimal Data, Advanced Features +@node Two-way I/O @section Two-Way Communications with Another Process @cindex Brennan, Michael @cindex programmers, attractiveness of @@ -15440,7 +15564,7 @@ other one to do something. It is possible to close just one end of the two-way pipe to a coprocess, by supplying a second argument to the @code{close} function of either @code{"to"} or @code{"from"} -(@pxref{Close Files And Pipes, ,Closing Input and Output Redirections}). +(@pxref{Close Files And Pipes}). These strings tell @command{gawk} to close the end of the pipe that sends data to the process or the end that reads from it, respectively. @@ -15487,7 +15611,7 @@ 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}), +(@pxref{Auto-set}), like so: @example @@ -15503,7 +15627,7 @@ 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 +@node TCP/IP Networking @section Using @command{gawk} for Network Programming @cindex advanced features, @command{gawk}, network programming @cindex networks, programming @@ -15521,7 +15645,7 @@ is busy hung or dead.} In addition to being able to open a two-way pipeline to a coprocess on the same system -(@pxref{Two-way I/O, ,Two-Way Communications with Another Process}), +(@pxref{Two-way I/O}), it is possible to make a two-way connection to another process on another system across an IP networking connection. @@ -15591,7 +15715,7 @@ which comes as part of the @command{gawk} distribution, for a much more complete introduction and discussion, as well as extensive examples. -@node Portal Files, Profiling, TCP/IP Networking, Advanced Features +@node Portal Files @section Using @command{gawk} with BSD Portals @cindex advanced features, @command{gawk}, BSD portals @cindex portal files @@ -15604,7 +15728,7 @@ extensive examples. Similar to the @file{/inet} special files, if @command{gawk} is configured with the @option{--enable-portals} option -(@pxref{Quick Installation, , Compiling @command{gawk} for Unix}), +(@pxref{Quick Installation}), then @command{gawk} treats files whose pathnames begin with @code{/p} as 4.4 BSD-style portals. @@ -15616,7 +15740,7 @@ then manages creating the process associated with the portal and the corresponding communications with the portal's process. @c ENDOFRANGE tcpip -@node Profiling, , Portal Files, Advanced Features +@node Profiling @section Profiling Your @command{awk} Programs @c STARTOFRANGE awkp @cindex @command{awk} programs, profiling @@ -15793,7 +15917,7 @@ The counts next to the statements in the body show how many times those statements were executed. @cindex @code{@{@}} (braces), @command{pgawk} program -@cindex braces (@code{@{@}}), @command{pgawk} program +@cindex braces (@code{@{@}}), @command{pgawk} program @item The layout uses ``K&R'' style with tabs. Braces are used everywhere, even when @@ -15921,7 +16045,7 @@ keyboard. The @code{INT} signal is generated by the @c ENDOFRANGE awkp @c ENDOFRANGE proawk -@node Invoking Gawk, Library Functions, Advanced Features, Top +@node Invoking Gawk @chapter Running @command{awk} and @command{gawk} This @value{CHAPTER} covers how to run awk, both POSIX-standard @@ -15948,7 +16072,7 @@ full details. * Known Bugs:: Known Bugs in @command{gawk}. @end menu -@node Command Line, Options, Invoking Gawk, Invoking Gawk +@node Command Line @section Invoking @command{awk} @cindex command line, invoking @command{awk} from @cindex @command{awk}, invoking @@ -15987,7 +16111,7 @@ If @option{--lint} has been specified on the command line, @command{gawk} issues a warning that the program is empty. -@node Options, Other Arguments, Command Line, Invoking Gawk +@node Options @section Command-Line Options @c STARTOFRANGE ocl @cindex options, command-line @@ -16022,7 +16146,7 @@ The options and their meanings are as follows: @cindex @code{--field-separator} option @cindex @code{FS} variable, @code{--field-separator} option and Sets the @code{FS} variable to @var{fs} -(@pxref{Field Separators, ,Specifying How Fields Are Separated}). +(@pxref{Field Separators}). @item -f @var{source-file} @itemx --file @var{source-file} @@ -16040,7 +16164,7 @@ instead of in the first non-option argument. Sets the variable @var{var} to the value @var{val} @emph{before} execution of the program begins. Such variable values are available inside the @code{BEGIN} rule -(@pxref{Other Arguments, ,Other Command-Line Arguments}). +(@pxref{Other Arguments}). The @option{-v} option can only set one variable, but it can be used more than once, setting another variable each time, like this: @@ -16110,9 +16234,9 @@ Specifies @dfn{compatibility mode}, in which the GNU extensions to the @command{awk} language are disabled, so that @command{gawk} behaves just like the Bell Laboratories research version of Unix @command{awk}. @option{--traditional} is the preferred form of this option. -@xref{POSIX/GNU, ,Extensions in @command{gawk} Not in POSIX @command{awk}}, +@xref{POSIX/GNU}, which summarizes the extensions. Also see -@ref{Compatibility Mode, ,Downward Compatibility and Debugging}. +@ref{Compatibility Mode}. @item -W copyright @itemx --copyright @@ -16154,7 +16278,7 @@ names like @code{i}, @code{j}, etc.) Analyzes the source program and generates a GNU @code{gettext} Portable Object file on standard output for all string constants that have been marked for translation. -@xref{Internationalization, ,Internationalization with @command{gawk}}, +@xref{Internationalization}, for information about this option. @item -W help @@ -16190,7 +16314,7 @@ actually invalid are issued. (This is not fully implemented yet.) @cindex @code{--lint-old} option Warns about constructs that are not available in the original version of @command{awk} from Version 7 Unix -(@pxref{V7/SVR3.1, ,Major Changes Between V7 and SVR3.1}). +(@pxref{V7/SVR3.1}). @item -W non-decimal-data @itemx --non-decimal-data @@ -16200,7 +16324,7 @@ Warns about constructs that are not available in the original version of @cindex octal values, enabling interpretation of Enable automatic interpretation of octal and hexadecimal values in input data -(@pxref{Nondecimal Data, ,Allowing Nondecimal Input Data}). +(@pxref{Nondecimal Data}). @cindex troubleshooting, @code{--non-decimal-data} option @strong{Caution:} This option can severely break old programs. @@ -16229,15 +16353,15 @@ restrictions: @item Newlines do not act as whitespace to separate fields when @code{FS} is equal to a single space -(@pxref{Fields, , Examining Fields}). +(@pxref{Fields}). @item Newlines are not allowed after @samp{?} or @samp{:} -(@pxref{Conditional Exp, ,Conditional Expressions}). +(@pxref{Conditional Exp}). @item The synonym @code{func} for the keyword @code{function} is not -recognized (@pxref{Definition Syntax, ,Function Definition Syntax}). +recognized (@pxref{Definition Syntax}). @cindex @code{*} (asterisk), @code{**} operator @cindex asterisk (@code{*}), @code{**} operator @@ -16249,20 +16373,20 @@ recognized (@pxref{Definition Syntax, ,Function Definition Syntax}). @cindex caret (@code{^}), @code{^=} operator @item The @samp{**} and @samp{**=} operators cannot be used in -place of @samp{^} and @samp{^=} (@pxref{Arithmetic Ops, ,Arithmetic Operators}, -and also @pxref{Assignment Ops, ,Assignment Expressions}). +place of @samp{^} and @samp{^=} (@pxref{Arithmetic Ops}, +and also @pxref{Assignment Ops}). @cindex @code{FS} variable, as TAB character @item Specifying @samp{-Ft} on the command-line does not set the value of @code{FS} to be a single TAB character -(@pxref{Field Separators, ,Specifying How Fields Are Separated}). +(@pxref{Field Separators}). @c comma does not start secondary @cindex @code{fflush} function, unsupported @item The @code{fflush} built-in function is not supported -(@pxref{I/O Functions, ,Input/Output Functions}). +(@pxref{I/O Functions}). @end itemize @c @cindex automatic warnings @@ -16278,7 +16402,7 @@ also issues a warning if both options are supplied. @cindex @code{--profile} option @cindex @command{awk} programs, profiling, enabling Enable profiling of @command{awk} programs -(@pxref{Profiling, ,Profiling Your @command{awk} Programs}). +(@pxref{Profiling}). By default, profiles are created in a file named @file{awkprof.out}. The optional @var{file} argument allows you to specify a different @value{FN} for the profile file. @@ -16293,7 +16417,7 @@ call counts for each function. @cindex @code{--re-interval} option @cindex regular expressions, interval expressions and Allows interval expressions -(@pxref{Regexp Operators, , Regular Expression Operators}) +(@pxref{Regexp Operators}) in regexps. Because interval expressions were traditionally not available in @command{awk}, @command{gawk} does not provide them by default. This prevents old @command{awk} @@ -16308,7 +16432,7 @@ code that you enter on the command line. Program source code is taken from the @var{program-text}. This is particularly useful when you have library functions that you want to use from your command-line -programs (@pxref{AWKPATH Variable, ,The @env{AWKPATH} Environment Variable}). +programs (@pxref{AWKPATH Variable}). @item -W version @itemx --version @@ -16320,7 +16444,7 @@ This allows you to determine if your copy of @command{gawk} is up to date with respect to whatever the Free Software Foundation is currently distributing. It is also useful for bug reports -(@pxref{Bugs, , Reporting Problems and Bugs}). +(@pxref{Bugs}). @end table As long as program text has been supplied, @@ -16332,7 +16456,7 @@ In compatibility mode, as a special case, if the value of @var{fs} supplied to the @option{-F} option is @samp{t}, then @code{FS} is set to the TAB character (@code{"\t"}). This is true only for @option{--traditional} and not for @option{--posix} -(@pxref{Field Separators, ,Specifying How Fields Are Separated}). +(@pxref{Field Separators}). @cindex @code{-f} option, on command line The @option{-f} option may be used more than once on the command line. @@ -16342,7 +16466,7 @@ useful for creating libraries of @command{awk} functions. These functions can be written once and then retrieved from a standard place, instead of having to be included into each individual program. (As mentioned in -@ref{Definition Syntax, ,Function Definition Syntax}, +@ref{Definition Syntax}, function names must be unique.) Library functions can still be used, even if the program is entered at the terminal, @@ -16357,7 +16481,7 @@ file and command-line @command{awk} programs, @command{gawk} provides the @option{--source} option. This does not require you to pre-empt the standard input for your source code; it allows you to easily mix command-line and library source code -(@pxref{AWKPATH Variable, ,The @env{AWKPATH} Environment Variable}). +(@pxref{AWKPATH Variable}). @cindex @code{--source} option If no @option{-f} or @option{--source} option is specified, then @command{gawk} @@ -16400,7 +16524,7 @@ environments. @c ENDOFRANGE ocl @c ENDOFRANGE clo -@node Other Arguments, AWKPATH Variable, Options, Invoking Gawk +@node Other Arguments @section Other Command-Line Arguments @cindex command line, arguments @cindex arguments, command-line @@ -16411,7 +16535,7 @@ argument that has the form @code{@var{var}=@var{value}}, assigns the value @var{value} to the variable @var{var}---it does not specify a file at all. (This was discussed earlier in -@ref{Assignment Options, ,Assigning Variables on the Command Line}.) +@ref{Assignment Options}.) @cindex @code{ARGIND} variable, command-line arguments @cindex @code{ARGC}/@code{ARGV} variables, command-line arguments @@ -16434,7 +16558,7 @@ Therefore, the variables actually receive the given values after all previously specified files have been read. In particular, the values of variables assigned in this fashion are @emph{not} available inside a @code{BEGIN} rule -(@pxref{BEGIN/END, ,The @code{BEGIN} and @code{END} Special Patterns}), +(@pxref{BEGIN/END}), because such rules are run before @command{awk} begins scanning the argument list. @cindex dark corner, escape sequences @@ -16468,7 +16592,7 @@ Given the variable assignment feature, the @option{-F} option for setting the value of @code{FS} is not strictly necessary. It remains for historical compatibility. -@node AWKPATH Variable, Obsolete, Other Arguments, Invoking Gawk +@node AWKPATH Variable @section The @env{AWKPATH} Environment Variable @cindex @env{AWKPATH} environment variable @cindex directories, searching @@ -16507,10 +16631,10 @@ would have to be typed for each file. By using both the @option{--source} and @option{-f} options, your command-line @command{awk} programs can use facilities in @command{awk} library files -(@pxref{Library Functions, , A Library of @command{awk} Functions}). +(@pxref{Library Functions}). Path searching is not done if @command{gawk} is in compatibility mode. This is true for both @option{--traditional} and @option{--posix}. -@xref{Options, ,Command-Line Options}. +@xref{Options}. @strong{Note:} If you want files in the current directory to be found, you must include the current directory in the path, either by including @@ -16534,7 +16658,7 @@ sense: the @env{AWKPATH} environment variable is used to find the program source files. Once your program is running, all the files have been found, and @command{gawk} no longer needs to use @env{AWKPATH}. -@node Obsolete, Undocumented, AWKPATH Variable, Invoking Gawk +@node Obsolete @section Obsolete Options and/or Features @cindex features, advanced, See advanced features @@ -16559,12 +16683,12 @@ in @command{gawk} 3.0 but still worked. Starting with @value{PVERSION} 3.1, the two-word usage is no longer accepted. The process-related special files described in -@ref{Special Process, ,Special Files for Process-Related Information}, +@ref{Special Process}, work as described, but are now considered deprecated. @command{gawk} prints a warning message every time they are used. (Use @code{PROCINFO} instead; see -@ref{Auto-set, ,Built-in Variables That Convey Information}.) +@ref{Auto-set}.) They will be removed from the next release of @command{gawk}. @ignore @@ -16573,10 +16697,10 @@ is thus essentially a place holder, in case some option becomes obsolete in a future version of @command{gawk}. @end ignore -@node Undocumented, Known Bugs, Obsolete, Invoking Gawk +@node Undocumented @section Undocumented Options and Features @cindex undocumented features -@cindex features, undocumented +@cindex features, undocumented @cindex Skywalker, Luke @cindex Kenobi, Obi-Wan @cindex Jedi knights @@ -16630,7 +16754,7 @@ awk '@{ sum += $1 @} @end example @noindent -@xref{Statements/Lines, ,@command{awk} Statements Versus Lines}, for a fuller +@xref{Statements/Lines}, for a fuller explanation. You can insert newlines after the @samp{;} in @code{for} loops. @@ -16654,7 +16778,7 @@ verbatim, instead of using the octal equivalent. @end ignore -@node Known Bugs, , Undocumented, Invoking Gawk +@node Known Bugs @section Known Bugs in @command{gawk} @cindex @command{gawk}, debugging @cindex debugging @command{gawk} @@ -16666,7 +16790,7 @@ verbatim, instead of using the octal equivalent. @cindex @code{FS} variable, changing value of @item The @option{-F} option for changing the value of @code{FS} -(@pxref{Options, ,Command-Line Options}) +(@pxref{Options}) is not necessary given the command-line variable assignment feature; it remains only for backward compatibility. @@ -16689,10 +16813,10 @@ It contains the following chapters: @itemize @bullet @item -@ref{Library Functions, ,A Library of @command{awk} Functions}. +@ref{Library Functions}. @item -@ref{Sample Programs, ,Practical @command{awk} Programs}. +@ref{Sample Programs}. @end itemize @@ -16702,7 +16826,7 @@ It contains the following chapters: @end iftex @end ignore -@node Library Functions, Sample Programs, Invoking Gawk, Top +@node Library Functions @chapter A Library of @command{awk} Functions @c STARTOFRANGE libf @cindex libraries of @command{awk} functions @@ -16711,7 +16835,7 @@ It contains the following chapters: @c STARTOFRANGE fudlib @cindex functions, user-defined, library of -@ref{User-defined, ,User-Defined Functions}, describes how to write +@ref{User-defined}, describes how to write your own @command{awk} functions. Writing functions is important, because it allows you to encapsulate algorithms and program tasks in a single place. It simplifies programming, making program development more @@ -16719,7 +16843,7 @@ manageable, and making programs more readable. One valuable way to learn a new programming language is to @emph{read} programs in that language. To that end, this @value{CHAPTER} -and @ref{Sample Programs, ,Practical @command{awk} Programs}, +and @ref{Sample Programs}, provide a good-sized body of code for you to read, and hopefully, to learn from. @@ -16730,7 +16854,7 @@ use these functions. The functions are presented here in a progression from simple to complex. @cindex Texinfo -@ref{Extract Program, ,Extracting Programs from Texinfo Source Files}, +@ref{Extract Program}, presents a program that you can use to extract the source code for these example library functions and programs from the Texinfo source for this @value{DOCUMENT}. @@ -16739,11 +16863,11 @@ for this @value{DOCUMENT}. If you have written one or more useful, general-purpose @command{awk} functions and would like to contribute them to the author's collection of @command{awk} programs, see -@ref{How To Contribute, ,How to Contribute}, for more information. +@ref{How To Contribute}, for more information. @cindex portability, example programs The programs in this @value{CHAPTER} and in -@ref{Sample Programs, ,Practical @command{awk} Programs}, +@ref{Sample Programs}, freely use features that are @command{gawk}-specific. Rewriting these programs for different implementations of awk is pretty straightforward. @@ -16752,9 +16876,9 @@ Use @samp{| "cat 1>&2"} instead of @samp{> "/dev/stderr"} if your system does not have a @file{/dev/stderr}, or if you cannot use @command{gawk}. A number of programs use @code{nextfile} -(@pxref{Nextfile Statement, ,Using @command{gawk}'s @code{nextfile} Statement}) +(@pxref{Nextfile Statement}) to skip any remaining input in the input file. -@ref{Nextfile Function, ,Implementing @code{nextfile} as a Function}, +@ref{Nextfile Function}, shows you how to write a function that does the same thing. @c 12/2000: Thanks to Nelson Beebe for pointing out the output issue. @@ -16789,7 +16913,7 @@ comparisons use only lowercase letters. * Group Functions:: Functions for getting group information. @end menu -@node Library Names, General Functions, Library Functions, Library Functions +@node Library Names @section Naming Library Function Global Variables @cindex names, arrays/variables @@ -16808,7 +16932,7 @@ a specific function). There is no intermediate state analogous to Library functions often need to have global variables that they can use to preserve state information between calls to the function---for example, @code{getopt}'s variable @code{_opti} -(@pxref{Getopt Function, ,Processing Command-Line Options}). +(@pxref{Getopt Function}). Such variables are called @dfn{private}, since the only functions that need to use them are the ones in the library. @@ -16830,7 +16954,7 @@ with the user's program. In addition, several of the library functions use a prefix that helps indicate what function or set of functions use the variables---for example, @code{_pw_byname} in the user database routines -(@pxref{Passwd Functions, ,Reading the User Database}). +(@pxref{Passwd Functions}). This convention is recommended, since it even further decreases the chance of inadvertent conflict among variable names. Note that this convention is used equally well for variable names and for private @@ -16843,7 +16967,7 @@ As a final note on variable naming, if a function makes global variables available for use by a main program, it is a good convention to start that variable's name with a capital letter---for example, @code{getopt}'s @code{Opterr} and @code{Optind} variables -(@pxref{Getopt Function, ,Processing Command-Line Options}). +(@pxref{Getopt Function}). The leading capital letter indicates that it is global, while the fact that the variable name is not all capital letters indicates that the variable is not one of @command{awk}'s built-in variables, such as @code{FS}. @@ -16873,7 +16997,7 @@ A different convention, common in the Tcl community, is to use a single associative array to hold the values needed by the library function(s), or ``package.'' This significantly decreases the number of actual global names in use. For example, the functions described in -@ref{Passwd Functions, , Reading the User Database}, +@ref{Passwd Functions}, might have used array elements @code{@w{PW_data["inited"]}}, @code{@w{PW_data["total"]}}, @code{@w{PW_data["count"]}}, and @code{@w{PW_data["awklib"]}}, instead of @code{@w{_pw_inited}}, @code{@w{_pw_awklib}}, @code{@w{_pw_total}}, @@ -16883,7 +17007,7 @@ The conventions presented in this @value{SECTION} are exactly that: conventions. You are not required to write your programs this way---we merely recommend that you do so. -@node General Functions, Data File Management, Library Names, Library Functions +@node General Functions @section General Programming This @value{SECTION} presents a number of functions that are of general @@ -16903,7 +17027,7 @@ programming use. * Gettimeofday Function:: A function to get formatted times. @end menu -@node Nextfile Function, Assert Function, General Functions, General Functions +@node Nextfile Function @subsection Implementing @code{nextfile} as a Function @cindex input files, skipping @@ -16915,7 +17039,7 @@ programming use. @cindex @code{nextfile} statement, implementing @cindex @command{gawk}, @code{nextfile} statement in The @code{nextfile} statement, presented in -@ref{Nextfile Statement, ,Using @command{gawk}'s @code{nextfile} Statement}, +@ref{Nextfile Statement}, is a @command{gawk}-specific extension---it is not available in most other implementations of @command{awk}. This @value{SECTION} shows two versions of a @code{nextfile} function that you can use to simulate @command{gawk}'s @@ -16939,7 +17063,7 @@ a private variable named @code{_abandon_}. If the @value{FN} matches, then the action part of the rule executes a @code{next} statement to go on to the next record. (The use of @samp{_} in the variable name is a convention. It is discussed more fully in -@ref{Library Names, , Naming Library Function Global Variables}.) +@ref{Library Names}.) The use of the @code{next} statement effectively creates a loop that reads all the records from the current @value{DF}. @@ -17035,7 +17159,7 @@ computations). @c ENDOFRANGE flibnex @c ENDOFRANGE nexim -@node Assert Function, Round Function, Nextfile Function, General Functions +@node Assert Function @subsection Assertions @c STARTOFRANGE asse @@ -17153,7 +17277,7 @@ to the program calling @code{assert}. Normally, if a program consists of just a @code{BEGIN} rule, the input files and/or standard input are not read. However, now that the program has an @code{END} rule, @command{awk} attempts to read the input @value{DF}s or standard input -(@pxref{Using BEGIN/END, , Startup and Cleanup Actions}), +(@pxref{Using BEGIN/END}), most likely causing the program to hang as it waits for input. @cindex @code{BEGIN} pattern, @code{assert} user-defined function and @@ -17165,7 +17289,7 @@ with an @code{exit} statement. @c ENDOFRANGE flibass @c ENDOFRANGE libfass -@node Round Function, Cliff Random Function, Assert Function, General Functions +@node Round Function @subsection Rounding Numbers @cindex rounding @@ -17177,7 +17301,7 @@ with an @code{exit} statement. @cindex @code{printf} statement, @code{sprintf} function and @cindex @code{sprintf} function, @code{print}/@code{printf} statements and The way @code{printf} and @code{sprintf} -(@pxref{Printf, , Using @code{printf} Statements for Fancier Printing}) +(@pxref{Printf}) perform rounding often depends upon the system's C @code{sprintf} subroutine. On many machines, @code{sprintf} rounding is ``unbiased,'' which means it doesn't always round a trailing @samp{.5} up, contrary @@ -17232,7 +17356,7 @@ function round(x, ival, aval, fraction) @c endfile @end example -@node Cliff Random Function, Ordinal Functions, Round Function, General Functions +@node Cliff Random Function @subsection The Cliff Random Number Generator @cindex random numbers, Cliff @cindex Cliff random numbers @@ -17277,7 +17401,7 @@ If the built-in @code{rand} function (@pxref{Numeric Functions}) isn't random enough, you might try using this function instead. -@node Ordinal Functions, Join Function, Cliff Random Function, General Functions +@node Ordinal Functions @subsection Translating Between Characters and Numbers @cindex libraries of @command{awk} functions, character values as numbers @@ -17397,7 +17521,7 @@ written this way initially for ease of development. There is a ``test program'' in a @code{BEGIN} rule, to test the function. It is commented out for production use. -@node Join Function, Gettimeofday Function, Ordinal Functions, General Functions +@node Join Function @subsection Merging an Array into a String @cindex libraries of @command{awk} functions, merging arrays into strings @@ -17408,14 +17532,14 @@ When doing string processing, it is often useful to be able to join all the strings in an array into one long string. The following function, @code{join}, accomplishes this task. It is used later in several of the application programs -(@pxref{Sample Programs, ,Practical @command{awk} Programs}). +(@pxref{Sample Programs}). Good function design is important; this function needs to be general but it should also have a reasonable default behavior. It is called with an array as well as the beginning and ending indices of the elements in the array to be merged. This assumes that the array indices are numeric---a reasonable assumption since the array was likely created with @code{split} -(@pxref{String Functions, ,String Manipulation Functions}): +(@pxref{String Functions}): @cindex @code{join} user-defined function @example @@ -17457,7 +17581,7 @@ be nice if @command{awk} had an assignment operator for concatenation. The lack of an explicit operator for concatenation makes string operations more difficult than they really need to be.} -@node Gettimeofday Function, , Join Function, General Functions +@node Gettimeofday Function @subsection Managing the Time of Day @cindex libraries of @command{awk} functions, managing, time @@ -17465,7 +17589,7 @@ more difficult than they really need to be.} @cindex timestamps, formatted @cindex time, managing The @code{systime} and @code{strftime} functions described in -@ref{Time Functions, ,Using @command{gawk}'s Timestamp Functions}, +@ref{Time Functions}, provide the minimum functionality necessary for dealing with the time of day in human readable form. While @code{strftime} is extensive, the control formats are not necessarily easy to remember or intuitively obvious when @@ -17551,13 +17675,13 @@ function gettimeofday(time, ret, now, i) The string indices are easier to use and read than the various formats required by @code{strftime}. The @code{alarm} program presented in -@ref{Alarm Program, ,An Alarm Clock Program}, +@ref{Alarm Program}, uses this function. A more general design for the @code{gettimeofday} function would have allowed the user to supply an optional timestamp value to use instead of the current time. -@node Data File Management, Getopt Function, General Functions, Library Functions +@node Data File Management @section @value{DDF} Management @c STARTOFRANGE dataf @@ -17573,17 +17697,18 @@ command-line @value{DF}s. * Filetrans Function:: A function for handling data file transitions. * Rewind Function:: A function for rereading the current file. * File Checking:: Checking that data files are readable. +* Empty Files:: Checking for zero-length files. * Ignoring Assigns:: Treating assignments as file names. @end menu -@node Filetrans Function, Rewind Function, Data File Management, Data File Management +@node Filetrans Function @subsection Noting @value{DDF} Boundaries @cindex files, managing, @value{DF} boundaries @cindex files, initialization and cleanup The @code{BEGIN} and @code{END} rules are each executed exactly once at -the beginning and end of your @command{awk} program, respectively -(@pxref{BEGIN/END, ,The @code{BEGIN} and @code{END} Special Patterns}). +the beginning and end of your @command{awk} program, respectively +(@pxref{BEGIN/END}). We (the @command{gawk} authors) once had a user who mistakenly thought that the @code{BEGIN} rule is executed at the beginning of each @value{DF} and the @code{END} rule is executed at the end of each @value{DF}. When informed @@ -17646,7 +17771,7 @@ again the value of multiple @code{BEGIN} and @code{END} rules should be clear. @cindex @code{beginfile} user-defined function @cindex @code{endfile} user-defined function This version has same problem as the first version of @code{nextfile} -(@pxref{Nextfile Function, ,Implementing @code{nextfile} as a Function}). +(@pxref{Nextfile Function}). If the same @value{DF} occurs twice in a row on the command line, then @code{endfile} and @code{beginfile} are not executed at the end of the first pass and at the beginning of the second pass. @@ -17678,18 +17803,18 @@ END @{ endfile(_filename_) @} @c endfile @end example -@ref{Wc Program, ,Counting Things}, +@ref{Wc Program}, shows how this library function can be used and how it simplifies writing the main program. -@node Rewind Function, File Checking, Filetrans Function, Data File Management +@node Rewind Function @subsection Rereading the Current File @cindex files, reading Another request for a new built-in function was for a @code{rewind} function that would make it possible to reread the current file. The requesting user didn't want to have to use @code{getline} -(@pxref{Getline, , Explicit Input with @code{getline}}) +(@pxref{Getline}) inside a loop. However, as long as you are not in the @code{END} rule, it is @@ -17730,7 +17855,7 @@ function rewind( i) @end example This code relies on the @code{ARGIND} variable -(@pxref{Auto-set, ,Built-in Variables That Convey Information}), +(@pxref{Auto-set}), which is specific to @command{gawk}. If you are not using @command{gawk}, you can use ideas presented in @@ -17738,17 +17863,17 @@ If you are not using the previous @value{SECTION} @end ifnotinfo @ifinfo -@ref{Filetrans Function, ,Noting @value{DDF} Boundaries}, +@ref{Filetrans Function}, @end ifinfo to either update @code{ARGIND} on your own or modify this code as appropriate. The @code{rewind} function also relies on the @code{nextfile} keyword -(@pxref{Nextfile Statement, ,Using @command{gawk}'s @code{nextfile} Statement}). -@xref{Nextfile Function, ,Implementing @code{nextfile} as a Function}, +(@pxref{Nextfile Statement}). +@xref{Nextfile Function}, for a function version of @code{nextfile}. -@node File Checking, Ignoring Assigns, Rewind Function, Data File Management +@node File Checking @subsection Checking for Readable @value{DDF}s @cindex troubleshooting, readable @value{DF}s @@ -17797,14 +17922,116 @@ skips the file (since it's no longer in the list). @c This doesn't handle /dev/stdin etc. Not worth the hassle to mention or fix. -@node Ignoring Assigns, , File Checking, Data File Management +@node Empty Files +@subsection Checking For Zero-length Files + +All known @command{awk} implementations silently skip over zero-length files. +This is a by-product of @command{awk}'s implicit +read-a-record-and-match-against-the-rules loop: when @command{awk} +tries to read a record from an empty file, it immediately receives an +end of file indication, closes the file, and proceeds on to the next +command-line @value{DF}, @emph{without} executing any user-level +@command{awk} program code. + +Using @command{gawk}'s @code{ARGIND} variable +(@pxref{Built-in Variables}), it is possible to detect when an empty +@value{DF} has been skipped. Similar to the library file presented +in @ref{Filetrans Function}, the following library file calls a function named +@code{zerofile} that the user must provide. The arguments passed are +the @value{FN} and the position in @code{ARGV} where it was found: + +@cindex @code{zerofile.awk} program +@example +@c file eg/lib/zerofile.awk +# zerofile.awk --- library file to process empty input files +@c endfile +@ignore +@c file eg/lib/zerofile.awk +# +# Arnold Robbins, arnold@@gnu.org, Public Domain +# June 2003 + +@c endfile +@end ignore +@c file eg/lib/zerofile.awk +BEGIN @{ Argind = 0 @} + +ARGIND > Argind + 1 @{ + for (Argind++; Argind < ARGIND; Argind++) + zerofile(ARGV[Argind], Argind) +@} + +ARGIND != Argind @{ Argind = ARGIND @} + +END @{ + if (ARGIND > Argind) + for (Argind++; Argind <= ARGIND; Argind++) + zerofile(ARGV[Argind], Argind) +@} +@c endfile +@end example + +The user-level variable @code{Argind} allows the @command{awk} program +to track its progress through @code{ARGV}. Whenever the program detects +that @code{ARGIND} is greater than @samp{Argind + 1}, it means that one or +more empty files were skipped. The action then calls @code{zerofile} for +each such file, incrementing @code{Argind} along the way. + +The @samp{Argind != ARGIND} rule simply keeps @code{Argind} up to date +in the normal case. + +Finally, the @code{END} rule catches the case of any empty files at +the end of the command-line arguments. Note that the test in the +condition of the @code{for} loop uses the @samp{<=} operator, +not @code{<}. + +As an exercise, you might consider whether this same problem can +be solved without relying on @command{gawk}'s @code{ARGIND} variable. + +As a second exercise, revise this code to handle the case where +an intervening value in @code{ARGV} is a variable assignment. + +@ignore +# zerofile2.awk --- same thing, portably +BEGIN @{ + ARGIND = Argind = 0 + for (i = 1; i < ARGC; i++) + Fnames[ARGV[i]]++ + +@} +FNR == 1 @{ + while (ARGV[ARGIND] != FILENAME) + ARGIND++ + Seen[FILENAME]++ + if (Seen[FILENAME] == Fnames[FILENAME]) + do + ARGIND++ + while (ARGV[ARGIND] != FILENAME) +@} +ARGIND > Argind + 1 @{ + for (Argind++; Argind < ARGIND; Argind++) + zerofile(ARGV[Argind], Argind) +@} +ARGIND != Argind @{ + Argind = ARGIND +@} +END @{ + if (ARGIND < ARGC - 1) + ARGIND = ARGC - 1 + if (ARGIND > Argind) + for (Argind++; Argind <= ARGIND; Argind++) + zerofile(ARGV[Argind], Argind) +@} +@end ignore + +@node Ignoring Assigns @subsection Treating Assignments as @value{FFN}s @cindex assignments as filenames @cindex filenames, assignments as Occasionally, you might not want @command{awk} to process command-line variable assignments -(@pxref{Assignment Options, ,Assigning Variables on the Command Line}). +(@pxref{Assignment Options}). In particular, if you have @value{FN}s that contain an @samp{=} character, @command{awk} treats the @value{FN} as an assignment, and does not process it. @@ -17848,7 +18075,7 @@ awk -v No_command_assign=1 -f noassign.awk -f yourprog.awk * @end example The function works by looping through the arguments. -It prepends @samp{./} to +It prepends @samp{./} to any argument that matches the form of a variable assignment, turning that argument into a @value{FN}. @@ -17860,7 +18087,7 @@ are left alone. @c ENDOFRANGE flibdataf @c ENDOFRANGE libfdataf -@node Getopt Function, Passwd Functions, Data File Management, Library Functions +@node Getopt Function @section Processing Command-Line Options @c STARTOFRANGE libfclo @@ -17877,7 +18104,7 @@ are left alone. Most utilities on POSIX compatible systems take options, or ``switches,'' on the command line that can be used to change the way a program behaves. @command{awk} is an example of such a program -(@pxref{Options, ,Command-Line Options}). +(@pxref{Options}). Often, options take @dfn{arguments}; i.e., data that the program needs to correctly obey the command-line option. For example, @command{awk}'s @option{-F} option requires a string to use as the field separator. @@ -17973,7 +18200,7 @@ main(int argc, char *argv[]) As a side point, @command{gawk} actually uses the GNU @code{getopt_long} function to process both normal and GNU-style long options -(@pxref{Options, ,Command-Line Options}). +(@pxref{Options}). The abstraction provided by @code{getopt} is very useful and is quite handy in @command{awk} programs as well. Following is an @command{awk} @@ -17981,7 +18208,7 @@ version of @code{getopt}. This function highlights one of the greatest weaknesses in @command{awk}, which is that it is very poor at manipulating single characters. Repeated calls to @code{substr} are necessary for accessing individual characters -(@pxref{String Functions, ,String Manipulation Functions}).@footnote{This +(@pxref{String Functions}).@footnote{This function was written before @command{gawk} acquired the ability to split strings into single characters using @code{""} as the separator. We have left it alone, since using @code{substr} is more portable.} @@ -18203,14 +18430,14 @@ In both runs, the first @option{--} terminates the arguments to @command{awk}, so that it does not try to interpret the @option{-a}, etc., as its own options. Several of the sample programs presented in -@ref{Sample Programs, ,Practical @command{awk} Programs}, +@ref{Sample Programs}, use @code{getopt} to process their arguments. @c ENDOFRANGE libfclo @c ENDOFRANGE flibclo @c ENDOFRANGE clop @c ENDOFRANGE oclp -@node Passwd Functions, Group Functions, Getopt Function, Library Functions +@node Passwd Functions @section Reading the User Database @c STARTOFRANGE libfudata @@ -18232,7 +18459,7 @@ However, because these are numbers, they do not provide very useful information to the average user. There needs to be some way to find the user information associated with the user and group ID numbers. This @value{SECTION} presents a suite of functions for retrieving information from the -user database. @xref{Group Functions, ,Reading the Group Database}, +user database. @xref{Group Functions}, for a similar suite that retrieves information from the group database. @cindex @code{getpwent} function (C library) @@ -18575,14 +18802,14 @@ once. If you are worried about squeezing every last cycle out of your this is not necessary, since most @command{awk} programs are I/O-bound, and it clutters up the code. -The @command{id} program in @ref{Id Program, ,Printing out User Information}, +The @command{id} program in @ref{Id Program}, uses these functions. @c ENDOFRANGE libfudata @c ENDOFRANGE flibudata @c ENDOFRANGE udatar @c ENDOFRANGE dataur -@node Group Functions, , Passwd Functions, Library Functions +@node Group Functions @section Reading the Group Database @c STARTOFRANGE libfgdata @@ -18602,7 +18829,7 @@ uses these functions. @cindex group file @cindex files, group Much of the discussion presented in -@ref{Passwd Functions, ,Reading the User Database}, +@ref{Passwd Functions}, applies to the group database as well. Although there has traditionally been a well-known file (@file{/etc/group}) in a well-known format, the POSIX standard only provides a set of C library routines @@ -18635,7 +18862,7 @@ is as follows: #if HAVE_CONFIG_H #include <config.h> #endif - + #if defined (STDC_HEADERS) #include <stdlib.h> #endif @@ -18818,7 +19045,7 @@ routine, we have chosen to put it in @file{/usr/local/libexec/awk}. You might want it to be in a different directory on your system. These routines follow the same general outline as the user database routines -(@pxref{Passwd Functions, ,Reading the User Database}). +(@pxref{Passwd Functions}). The @code{@w{_gr_inited}} variable is used to ensure that the database is scanned no more than once. The @code{@w{_gr_init}} function first saves @code{FS}, @code{FIELDWIDTHS}, @code{RS}, and @@ -18945,7 +19172,7 @@ Most of the work is in scanning the database and building the various associative arrays. The functions that the user calls are themselves very simple, relying on @command{awk}'s associative arrays to do work. -The @command{id} program in @ref{Id Program, ,Printing out User Information}, +The @command{id} program in @ref{Id Program}, uses these functions. @c ENDOFRANGE libfgdata @c ENDOFRANGE flibgdata @@ -18955,12 +19182,12 @@ uses these functions. @c ENDOFRANGE fudlib @c ENDOFRANGE datagr -@node Sample Programs, Language History, Library Functions, Top +@node Sample Programs @chapter Practical @command{awk} Programs @c STARTOFRANGE awkpex @cindex @command{awk} programs, examples of -@ref{Library Functions, ,A Library of @command{awk} Functions}, +@ref{Library Functions}, presents the idea that reading programs in a language contributes to learning that language. This @value{CHAPTER} continues that theme, presenting a potpourri of @command{awk} programs for your reading @@ -18985,7 +19212,7 @@ ability to do a lot in just a few lines of code. @end ifnotinfo Many of these programs use the library functions presented in -@ref{Library Functions, ,A Library of @command{awk} Functions}. +@ref{Library Functions}. @menu * Running Examples:: How to run these examples. @@ -18993,7 +19220,7 @@ Many of these programs use the library functions presented in * Miscellaneous Programs:: Some interesting @command{awk} programs. @end menu -@node Running Examples, Clones, Sample Programs, Sample Programs +@node Running Examples @section Running the Example Programs To run a given program, you would typically do something like this: @@ -19008,7 +19235,7 @@ Here, @var{program} is the name of the @command{awk} program (such as program that start with a @samp{-}, and @var{files} are the actual @value{DF}s. If your system supports the @samp{#!} executable interpreter mechanism -(@pxref{Executable Scripts, , Executable @command{awk} Programs}), +(@pxref{Executable Scripts}), you can instead run your program directly: @example @@ -19021,7 +19248,7 @@ If your @command{awk} is not @command{gawk}, you may instead need to use this: cut.awk -- -c1-8 myfiles > results @end example -@node Clones, Miscellaneous Programs, Running Examples, Sample Programs +@node Clones @section Reinventing Wheels for Fun and Profit @c last comma is part of secondary @c STARTOFRANGE posimawk @@ -19049,7 +19276,7 @@ The programs are presented in alphabetical order. * Wc Program:: The @command{wc} utility. @end menu -@node Cut Program, Egrep Program, Clones, Clones +@node Cut Program @subsection Cutting out Fields and Columns @cindex @command{cut} utility @@ -19095,9 +19322,9 @@ Suppress printing of lines that do not contain the field delimiter. @end table The @command{awk} implementation of @command{cut} uses the @code{getopt} library -function (@pxref{Getopt Function, ,Processing Command-Line Options}) +function (@pxref{Getopt Function}) and the @code{join} library function -(@pxref{Join Function, ,Merging an Array into a String}). +(@pxref{Join Function}). The program begins with a comment describing the options, the library functions needed, and a @code{usage} function that prints out a usage @@ -19271,7 +19498,7 @@ function set_fieldlist( n, m, i, j, k, f, g) The @code{set_charlist} function is more complicated than @code{set_fieldlist}. The idea here is to use @command{gawk}'s @code{FIELDWIDTHS} variable -(@pxref{Constant Size, ,Reading Fixed-Width Data}), +(@pxref{Constant Size}), which describes constant-width input. When using a character list, that is exactly what we have. @@ -19368,7 +19595,7 @@ written out between the fields: This version of @command{cut} relies on @command{gawk}'s @code{FIELDWIDTHS} variable to do the character-based cutting. While it is possible in other @command{awk} implementations to use @code{substr} -(@pxref{String Functions, ,String Manipulation Functions}), +(@pxref{String Functions}), it is also extremely painful. The @code{FIELDWIDTHS} variable supplies an elegant solution to the problem of picking the input line apart by characters. @@ -19378,7 +19605,7 @@ of picking the input line apart by characters. @c Exercise: Rewrite using split with "". -@node Egrep Program, Id Program, Cut Program, Clones +@node Egrep Program @subsection Searching for Regular Expressions in Files @c STARTOFRANGE regexps @@ -19390,7 +19617,7 @@ of picking the input line apart by characters. @cindex @command{egrep} utility The @command{egrep} utility searches files for patterns. It uses regular expressions that are almost identical to those available in @command{awk} -(@pxref{Regexp, ,Regular Expressions}). +(@pxref{Regexp}). It is used in the following manner: @example @@ -19432,9 +19659,9 @@ option is to allow patterns that start with a @samp{-}. @end table This version uses the @code{getopt} library function -(@pxref{Getopt Function, ,Processing Command-Line Options}) +(@pxref{Getopt Function}) and the file transition library program -(@pxref{Filetrans Function, ,Noting @value{DDF} Boundaries}). +(@pxref{Filetrans Function}). The program begins with a descriptive comment and then a @code{BEGIN} rule that processes the command-line arguments with @code{getopt}. The @option{-i} @@ -19673,7 +19900,7 @@ or not. @c ENDOFRANGE sfregexp @c ENDOFRANGE fsregexp -@node Id Program, Split Program, Egrep Program, Clones +@node Id Program @subsection Printing out User Information @cindex printing, user information @@ -19697,9 +19924,9 @@ individual numbers. Here is a simple version of @command{id} written in @command{awk}. It uses the user database library functions -(@pxref{Passwd Functions, ,Reading the User Database}) +(@pxref{Passwd Functions}) and the group database library functions -(@pxref{Group Functions, ,Reading the Group Database}): +(@pxref{Group Functions}): The program is fairly straightforward. All the work is done in the @code{BEGIN} rule. The user and group ID numbers are obtained from @@ -19814,7 +20041,7 @@ information is printed. Modify this version to accept the same arguments and perform in the same way. @end ignore -@node Split Program, Tee Program, Id Program, Clones +@node Split Program @subsection Splitting a Large File into Pieces @c STARTOFRANGE filspl @@ -19838,7 +20065,7 @@ argument that specifies the @value{FN} prefix. Here is a version of @code{split} in @command{awk}. It uses the @code{ord} and @code{chr} functions presented in -@ref{Ordinal Functions, ,Translating Between Characters and Numbers}. +@ref{Ordinal Functions}. The program first sets its defaults, and then tests to make sure there are not too many arguments. It then looks at each argument in turn. The @@ -19959,7 +20186,7 @@ which isn't true for EBCDIC systems. @c BFD... @c ENDOFRANGE filspl -@node Tee Program, Uniq Program, Split Program, Clones +@node Tee Program @subsection Duplicating Output into Multiple Files @c last comma is part of secondary @@ -19989,7 +20216,7 @@ If the first argument is @option{-a}, then the flag variable @code{copy[1]} are deleted. If @code{ARGC} is less than two, then no @value{FN}s were supplied and @code{tee} prints a usage message and exits. Finally, @command{awk} is forced to read the standard input by setting -@code{ARGV[1]} to @code{"-"} and @code{ARGC} to two: +@code{ARGV[1]} to @code{"-"} and @code{ARGC} to two: @c NEXT ED: Add more leading commentary in this program @cindex @code{tee.awk} program @@ -20078,7 +20305,7 @@ END \ @c endfile @end example -@node Uniq Program, Wc Program, Tee Program, Clones +@node Uniq Program @subsection Printing Nonduplicated Lines of Text @c STARTOFRANGE prunt @@ -20132,9 +20359,9 @@ Normally @command{uniq} behaves as if both the @option{-d} and @command{uniq} uses the @code{getopt} library function -(@pxref{Getopt Function, ,Processing Command-Line Options}) +(@pxref{Getopt Function}) and the @code{join} library function -(@pxref{Join Function, ,Merging an Array into a String}). +(@pxref{Join Function}). The program begins with a @code{usage} function and then a brief outline of the options and their meanings in a comment. @@ -20238,7 +20465,7 @@ comparison of @code{last} and @code{$0}. Otherwise, things get more complicated. If fields have to be skipped, each line is broken into an array using @code{split} -(@pxref{String Functions, ,String Manipulation Functions}); +(@pxref{String Functions}); the desired fields are then joined back into a line using @code{join}. The joined lines are stored in @code{clast} and @code{cline}. If no fields are skipped, @code{clast} and @code{cline} are set to @@ -20337,7 +20564,7 @@ END @{ @c ENDOFRANGE prunt @c ENDOFRANGE tpul -@node Wc Program, , Uniq Program, Clones +@node Wc Program @subsection Counting Things @c STARTOFRANGE count @@ -20382,9 +20609,9 @@ words (i.e., fields) and counts them, it counts lines (i.e., records), and it can easily tell us how long a line is. This uses the @code{getopt} library function -(@pxref{Getopt Function, ,Processing Command-Line Options}) +(@pxref{Getopt Function}) and the file-transition functions -(@pxref{Filetrans Function, ,Noting @value{DDF} Boundaries}). +(@pxref{Filetrans Function}). This version has one notable difference from traditional versions of @command{wc}: it always prints the counts in the order lines, words, @@ -20461,7 +20688,7 @@ The @code{endfile} function adds the current file's numbers to the running totals of lines, words, and characters.@footnote{@command{wc} can't just use the value of @code{FNR} in @code{endfile}. If you examine the code in -@ref{Filetrans Function, , Noting @value{DDF} Boundaries} +@ref{Filetrans Function} you will see that @code{FNR} has already been reset by the time @code{endfile} is called.} It then prints out those numbers @@ -20533,7 +20760,7 @@ END @{ @c ENDOFRANGE chco @c ENDOFRANGE posimawk -@node Miscellaneous Programs, , Clones, Sample Programs +@node Miscellaneous Programs @section A Grab Bag of @command{awk} Programs This @value{SECTION} is a large ``grab bag'' of miscellaneous programs. @@ -20554,7 +20781,7 @@ We hope you find them both interesting and enjoyable. files. @end menu -@node Dupword Program, Alarm Program, Miscellaneous Programs, Miscellaneous Programs +@node Dupword Program @subsection Finding Duplicated Words in a Document @c last comma is part of secondary @@ -20622,7 +20849,7 @@ word, comparing it to the previous one: @c endfile @end example -@node Alarm Program, Translate Program, Dupword Program, Miscellaneous Programs +@node Alarm Program @subsection An Alarm Clock Program @cindex insomnia, cure for @cindex Robbins, Arnold @@ -20642,7 +20869,7 @@ the number of times to repeat the message as well as a delay between repetitions. This program uses the @code{gettimeofday} function from -@ref{Gettimeofday Function, ,Managing the Time of Day}. +@ref{Gettimeofday Function}. All the work is done in the @code{BEGIN} rule. The first part is argument checking and setting of defaults: the delay, the count, and the message to @@ -20750,7 +20977,7 @@ is how long to wait before setting off the alarm: @cindex @command{sleep} utility Finally, the program uses the @code{system} function -(@pxref{I/O Functions, ,Input/Output Functions}) +(@pxref{I/O Functions}) to call the @command{sleep} utility. The @command{sleep} utility simply pauses for the given number of seconds. If the exit status is not zero, the program assumes that @command{sleep} was interrupted and exits. If @@ -20780,7 +21007,7 @@ seconds are necessary: @c ENDOFRANGE tialarm @c ENDOFRANGE alaex -@node Translate Program, Labels Program, Alarm Program, Miscellaneous Programs +@node Translate Program @subsection Transliterating Characters @c STARTOFRANGE chtra @@ -20823,7 +21050,7 @@ The @command{translate} program demonstrates one of the few weaknesses of standard @command{awk}: dealing with individual characters is very painful, requiring repeated use of the @code{substr}, @code{index}, and @code{gsub} built-in functions -(@pxref{String Functions, ,String Manipulation Functions}).@footnote{This +(@pxref{String Functions}).@footnote{This program was written before @command{gawk} acquired the ability to split each character in a string into separate array elements.} @c Exercise: How might you use this new feature to simplify the program? @@ -20920,7 +21147,7 @@ function, it is not necessarily efficient, and we (the @command{gawk} authors) started to consider adding a built-in function. However, shortly after writing this program, we learned that the System V Release 4 @command{awk} had added the @code{toupper} and @code{tolower} functions -(@pxref{String Functions, ,String Manipulation Functions}). +(@pxref{String Functions}). These functions handle the vast majority of the cases where character transliteration is necessary, and so we chose to simply add those functions to @command{gawk} as well and then leave well @@ -20932,7 +21159,7 @@ assumes that the ``from'' and ``to'' lists will never change throughout the lifetime of the program. @c ENDOFRANGE chtra -@node Labels Program, Word Sorting, Translate Program, Miscellaneous Programs +@node Labels Program @subsection Printing Mailing Labels @c STARTOFRANGE prml @@ -20955,7 +21182,7 @@ the @code{line} array and printing the page when 20 labels have been read. The @code{BEGIN} rule simply sets @code{RS} to the empty string, so that @command{awk} splits records at blank lines -(@pxref{Records, ,How Input Is Split into Records}). +(@pxref{Records}). It sets @code{MAXLINES} to 100, since 100 is the maximum number of lines on the page (20 * 5 = 100). @@ -21055,7 +21282,7 @@ END \ @c ENDOFRANGE prml @c ENDOFRANGE mlprint -@node Word Sorting, History Sorting, Labels Program, Miscellaneous Programs +@node Word Sorting @subsection Generating Word-Usage Counts @c last comma is part of secondary @@ -21088,7 +21315,7 @@ END @{ This program has two rules. The first rule, because it has an empty pattern, is executed for every input line. It uses @command{awk}'s field-accessing mechanism -(@pxref{Fields, ,Examining Fields}) to pick out the individual words from +(@pxref{Fields}) to pick out the individual words from the line, and the built-in variable @code{NF} (@pxref{Built-in Variables}) to know how many fields are available. For each input word, it increments an element of the array @code{freq} to @@ -21187,14 +21414,14 @@ See the general operating system documentation for more information on how to use the @command{sort} program. @c ENDOFRANGE worus -@node History Sorting, Extract Program, Word Sorting, Miscellaneous Programs +@node History Sorting @subsection Removing Duplicates from Unsorted Text @c last comma is part of secondary @c STARTOFRANGE lidu @cindex lines, duplicate, removing The @command{uniq} program -(@pxref{Uniq Program, ,Printing Nonduplicated Lines of Text}), +(@pxref{Uniq Program}), removes duplicate lines from @emph{sorted} data. Suppose, however, you need to remove duplicate lines from a @value{DF} but @@ -21257,7 +21484,7 @@ This works because @code{data[$0]} is incremented each time a line is seen. @c ENDOFRANGE lidu -@node Extract Program, Simple Sed, History Sorting, Miscellaneous Programs +@node Extract Program @subsection Extracting Programs from Texinfo Source Files @c STARTOFRANGE texse @@ -21267,13 +21494,13 @@ seen. @cindex files, Texinfo, extracting programs from @ifnotinfo Both this chapter and the previous chapter -(@ref{Library Functions, ,A Library of @command{awk} Functions}) +(@ref{Library Functions}) present a large number of @command{awk} programs. @end ifnotinfo @ifinfo The nodes -@ref{Library Functions, ,A Library of @command{awk} Functions}, -and @ref{Sample Programs, ,Practical @command{awk} Programs}, +@ref{Library Functions}, +and @ref{Sample Programs}, are the top level nodes for a large number of @command{awk} programs. @end ifinfo If you want to experiment with these programs, it is tedious to have to type @@ -21323,14 +21550,14 @@ file and does two things, based on the special comments. Upon seeing @samp{@w{@@c system @dots{}}}, it runs a command, by extracting the command text from the control line and passing it on to the @code{system} function -(@pxref{I/O Functions, ,Input/Output Functions}). +(@pxref{I/O Functions}). Upon seeing @samp{@@c file @var{filename}}, each subsequent line is sent to the file @var{filename}, until @samp{@@c endfile} is encountered. The rules in @file{extract.awk} match either @samp{@@c} or @samp{@@comment} by letting the @samp{omment} part be optional. Lines containing @samp{@@group} and @samp{@@end group} are simply removed. @file{extract.awk} uses the @code{join} library function -(@pxref{Join Function, ,Merging an Array into a String}). +(@pxref{Join Function}). The example programs in the online Texinfo source for @cite{@value{TITLE}} (@file{gawk.texi}) have all been bracketed inside @samp{file} and @@ -21423,7 +21650,7 @@ redirection for printing the contents, keeping open file management simple. The @samp{for} loop does the work. It reads lines using @code{getline} -(@pxref{Getline, ,Explicit Input with @code{getline}}). +(@pxref{Getline}). For an unexpected end of file, it calls the @code{@w{unexpected_eof}} function. If the line is an ``endfile'' line, then it breaks out of the loop. @@ -21436,7 +21663,7 @@ symbols, the program can print it directly. Otherwise, each leading @samp{@@} must be stripped off. To remove the @samp{@@} symbols, the line is split into separate elements of the array @code{a}, using the @code{split} function -(@pxref{String Functions, ,String Manipulation Functions}). +(@pxref{String Functions}). The @samp{@@} symbol is used as the separator character. Each element of @code{a} that is empty indicates two successive @samp{@@} symbols in the original line. For each two empty elements (@samp{@@@@} in @@ -21493,7 +21720,7 @@ line. That line is then printed to the output file: An important thing to note is the use of the @samp{>} redirection. Output done with @samp{>} only opens the file once; it stays open and subsequent output is appended to the file -(@pxref{Redirection, , Redirecting Output of @code{print} and @code{printf}}). +(@pxref{Redirection}). This makes it easy to mix program text and explanatory prose for the same sample source file (as has been done here!) without any hassle. The file is only closed when a new data @value{FN} is encountered or at the end of the @@ -21523,7 +21750,7 @@ END @{ @c ENDOFRANGE texse @c ENDOFRANGE fitex -@node Simple Sed, Igawk Program, Extract Program, Miscellaneous Programs +@node Simple Sed @subsection A Simple Stream Editor @cindex @command{sed} utility @@ -21543,7 +21770,7 @@ Here, @samp{s/old/new/g} tells @command{sed} to look for the regexp @samp{old} on each input line and globally replace it with the text @samp{new}, i.e., all the occurrences on a line. This is similar to @command{awk}'s @code{gsub} function -(@pxref{String Functions, ,String Manipulation Functions}). +(@pxref{String Functions}). The following program, @file{awksed.awk}, accepts at least two command-line arguments: the pattern to look for and the text to replace it with. Any @@ -21600,7 +21827,7 @@ BEGIN @{ The program relies on @command{gawk}'s ability to have @code{RS} be a regexp, as well as on the setting of @code{RT} to the actual text that terminates the -record (@pxref{Records, ,How Input Is Split into Records}). +record (@pxref{Records}). The idea is to have @code{RS} be the pattern to look for. @command{gawk} automatically sets @code{$0} to the text between matches of the pattern. @@ -21614,14 +21841,14 @@ statement unconditionally prints the replacement text, which is not correct. However, if the file did not end in text that matches @code{RS}, @code{RT} is set to the null string. In this case, we can print @code{$0} using @code{printf} -(@pxref{Printf, ,Using @code{printf} Statements for Fancier Printing}). +(@pxref{Printf}). The @code{BEGIN} rule handles the setup, checking for the right number of arguments and calling @code{usage} if there is a problem. Then it sets @code{RS} and @code{ORS} from the command-line arguments and sets @code{ARGV[1]} and @code{ARGV[2]} to the null string, so that they are not treated as @value{FN}s -(@pxref{ARGC and ARGV, , Using @code{ARGC} and @code{ARGV}}). +(@pxref{ARGC and ARGV}). The @code{usage} function prints an error message and exits. Finally, the single rule handles the printing scheme outlined above, @@ -21648,7 +21875,7 @@ Exercise: what are the advantages and disadvantages of this version versus sed? Others? @end ignore -@node Igawk Program, , Simple Sed, Miscellaneous Programs +@node Igawk Program @subsection An Easy Way to Use Library Functions @c STARTOFRANGE libfex @@ -21662,7 +21889,7 @@ However, using library functions is only easy when writing @command{awk} programs; it is painful when running them, requiring multiple @option{-f} options. If @command{gawk} is unavailable, then so too is the @env{AWKPATH} environment variable and the ability to put @command{awk} functions into a -library directory (@pxref{Options, ,Command-Line Options}). +library directory (@pxref{Options}). It would be nice to be able to write programs in the following manner: @example @@ -21877,7 +22104,7 @@ The @command{awk} program to process @samp{@@include} directives 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 +(@pxref{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 ``pushed'' onto the stack and the file named in the @samp{@@include} @@ -21889,7 +22116,7 @@ the first one on the stack. The @code{pathto} function does the work of finding the full path to a file. It simulates @command{gawk}'s behavior when searching the @env{AWKPATH} environment variable -(@pxref{AWKPATH Variable, ,The @env{AWKPATH} Environment Variable}). +(@pxref{AWKPATH Variable}). If a @value{FN} has a @samp{/} in it, no path search is done. Otherwise, the @value{FN} is concatenated with the name of each directory in the path, and an attempt is made to open the generated @value{FN}. @@ -22146,22 +22373,22 @@ It contains the following appendixes: @itemize @bullet @item -@ref{Language History, ,The Evolution of the @command{awk} Language}. +@ref{Language History}. @item -@ref{Installation, ,Installing @command{gawk}}. +@ref{Installation}. @item -@ref{Notes, ,Implementation Notes}. +@ref{Notes}. @item -@ref{Basic Concepts, ,Basic Programming Concepts}. +@ref{Basic Concepts}. @item @ref{Glossary}. @item -@ref{Copying, ,GNU General Public License}. +@ref{Copying}. @item @ref{GNU Free Documentation License}. @@ -22173,7 +22400,7 @@ It contains the following appendixes: @end iftex @end ignore -@node Language History, Installation, Sample Programs, Top +@node Language History @appendix The Evolution of the @command{awk} Language This @value{DOCUMENT} describes the GNU implementation of @command{awk}, which follows @@ -22201,7 +22428,7 @@ of the @value{DOCUMENT} where you can find more information. * Contributors:: The major contributors to @command{gawk}. @end menu -@node V7/SVR3.1, SVR4, Language History, Language History +@node V7/SVR3.1 @appendixsec Major Changes Between V7 and SVR3.1 @c STARTOFRANGE gawkv @cindex @command{awk}, versions of @@ -22216,18 +22443,18 @@ cross-references to further details: @itemize @bullet @item The requirement for @samp{;} to separate rules on a line -(@pxref{Statements/Lines, ,@command{awk} Statements Versus Lines}). +(@pxref{Statements/Lines}). @item User-defined functions and the @code{return} statement -(@pxref{User-defined, ,User-Defined Functions}). +(@pxref{User-defined}). @item -The @code{delete} statement (@pxref{Delete, ,The @code{delete} Statement}). +The @code{delete} statement (@pxref{Delete}). @item The @code{do}-@code{while} statement -(@pxref{Do Statement, ,The @code{do}-@code{while} Statement}). +(@pxref{Do Statement}). @item The built-in functions @code{atan2}, @code{cos}, @code{sin}, @code{rand}, and @@ -22235,11 +22462,11 @@ The built-in functions @code{atan2}, @code{cos}, @code{sin}, @code{rand}, and @item The built-in functions @code{gsub}, @code{sub}, and @code{match} -(@pxref{String Functions, ,String Manipulation Functions}). +(@pxref{String Functions}). @item The built-in functions @code{close} and @code{system} -(@pxref{I/O Functions, ,Input/Output Functions}). +(@pxref{I/O Functions}). @item The @code{ARGC}, @code{ARGV}, @code{FNR}, @code{RLENGTH}, @code{RSTART}, @@ -22247,26 +22474,26 @@ and @code{SUBSEP} built-in variables (@pxref{Built-in Variables}). @item The conditional expression using the ternary operator @samp{?:} -(@pxref{Conditional Exp, ,Conditional Expressions}). +(@pxref{Conditional Exp}). @item The exponentiation operator @samp{^} -(@pxref{Arithmetic Ops, ,Arithmetic Operators}) and its assignment operator -form @samp{^=} (@pxref{Assignment Ops, ,Assignment Expressions}). +(@pxref{Arithmetic Ops}) and its assignment operator +form @samp{^=} (@pxref{Assignment Ops}). @item C-compatible operator precedence, which breaks some old @command{awk} -programs (@pxref{Precedence, ,Operator Precedence (How Operators Nest)}). +programs (@pxref{Precedence}). @item Regexps as the value of @code{FS} -(@pxref{Field Separators, ,Specifying How Fields Are Separated}) and as the +(@pxref{Field Separators}) and as the third argument to the @code{split} function -(@pxref{String Functions, ,String Manipulation Functions}). +(@pxref{String Functions}). @item Dynamic regexps as operands of the @samp{~} and @samp{!~} operators -(@pxref{Regexp Usage, ,How to Use Regular Expressions}). +(@pxref{Regexp Usage}). @item The escape sequences @samp{\b}, @samp{\f}, and @samp{\r} @@ -22277,19 +22504,19 @@ something you can rely on.) @item Redirection of input for the @code{getline} function -(@pxref{Getline, ,Explicit Input with @code{getline}}). +(@pxref{Getline}). @item Multiple @code{BEGIN} and @code{END} rules -(@pxref{BEGIN/END, ,The @code{BEGIN} and @code{END} Special Patterns}). +(@pxref{BEGIN/END}). @item Multidimensional arrays -(@pxref{Multi-dimensional, ,Multidimensional Arrays}). +(@pxref{Multi-dimensional}). @end itemize @c ENDOFRANGE gawkv1 -@node SVR4, POSIX, V7/SVR3.1, Language History +@node SVR4 @appendixsec Changes Between SVR3.1 and SVR4 @cindex @command{awk}, versions of, changes between SVR3.1 and SVR4 @@ -22303,12 +22530,12 @@ The @code{ENVIRON} variable (@pxref{Built-in Variables}). @item Multiple @option{-f} options on the command line -(@pxref{Options, ,Command-Line Options}). +(@pxref{Options}). @c MKS awk @item The @option{-v} option for assigning variables before program execution begins -(@pxref{Options, ,Command-Line Options}). +(@pxref{Options}). @c GNU, Bell Laboratories & MKS together @item @@ -22326,29 +22553,29 @@ A defined return value for the @code{srand} built-in function @item The @code{toupper} and @code{tolower} built-in string functions for case translation -(@pxref{String Functions, ,String Manipulation Functions}). +(@pxref{String Functions}). @item A cleaner specification for the @samp{%c} format-control letter in the @code{printf} function -(@pxref{Control Letters, ,Format-Control Letters}). +(@pxref{Control Letters}). @item The ability to dynamically pass the field width and precision (@code{"%*.*d"}) in the argument list of the @code{printf} function -(@pxref{Control Letters, ,Format-Control Letters}). +(@pxref{Control Letters}). @item The use of regexp constants, such as @code{/foo/}, as expressions, where they are equivalent to using the matching operator, as in @samp{$0 ~ /foo/} -(@pxref{Using Constant Regexps, ,Using Regular Expression Constants}). +(@pxref{Using Constant Regexps}). @item Processing of escape sequences inside command-line variable assignments -(@pxref{Assignment Options, ,Assigning Variables on the Command Line}). +(@pxref{Assignment Options}). @end itemize -@node POSIX, BTL, SVR4, Language History +@node POSIX @appendixsec Changes Between SVR4 and POSIX @command{awk} @cindex @command{awk}, versions of, changes between SVR4 and POSIX @command{awk} @cindex POSIX @command{awk}, changes in @command{awk} versions @@ -22359,15 +22586,15 @@ introduced the following changes into the language: @itemize @bullet @item The use of @option{-W} for implementation-specific options -(@pxref{Options, ,Command-Line Options}). +(@pxref{Options}). @item The use of @code{CONVFMT} for controlling the conversion of numbers -to strings (@pxref{Conversion, ,Conversion of Strings and Numbers}). +to strings (@pxref{Conversion}). @item The concept of a numeric string and tighter comparison rules to go -with it (@pxref{Typing and Comparison, ,Variable Typing and Comparison Expressions}). +with it (@pxref{Typing and Comparison}). @item More complete documentation of many of the previously undocumented @@ -22387,33 +22614,33 @@ standard: @item Newlines do not act as whitespace to separate fields when @code{FS} is equal to a single space -(@pxref{Fields, ,Examining Fields}). +(@pxref{Fields}). @item Newlines are not allowed after @samp{?} or @samp{:} -(@pxref{Conditional Exp, ,Conditional Expressions}). +(@pxref{Conditional Exp}). @item The synonym @code{func} for the keyword @code{function} is not -recognized (@pxref{Definition Syntax, ,Function Definition Syntax}). +recognized (@pxref{Definition Syntax}). @item The operators @samp{**} and @samp{**=} cannot be used in -place of @samp{^} and @samp{^=} (@pxref{Arithmetic Ops, ,Arithmetic Operators}, -and @ref{Assignment Ops, ,Assignment Expressions}). +place of @samp{^} and @samp{^=} (@pxref{Arithmetic Ops}, +and @ref{Assignment Ops}). @item Specifying @samp{-Ft} on the command line does not set the value of @code{FS} to be a single TAB character -(@pxref{Field Separators, ,Specifying How Fields Are Separated}). +(@pxref{Field Separators}). @item The @code{fflush} built-in function is not supported -(@pxref{I/O Functions, ,Input/Output Functions}). +(@pxref{I/O Functions}). @end itemize @c ENDOFRANGE gawkv -@node BTL, POSIX/GNU, POSIX, Language History +@node BTL @appendixsec Extensions in the Bell Laboratories @command{awk} @cindex @command{awk}, versions of, See Also Bell Laboratories @command{awk} @@ -22422,7 +22649,7 @@ The @code{fflush} built-in function is not supported @cindex Kernighan, Brian Brian Kernighan, one of the original designers of Unix @command{awk}, has made his version available via his home page -(@pxref{Other Versions, ,Other Freely Available @command{awk} Implementations}). +(@pxref{Other Versions}). This @value{SECTION} describes extensions in his version of @command{awk} that are not in POSIX @command{awk}: @@ -22431,23 +22658,23 @@ not in POSIX @command{awk}: The @samp{-mf @var{N}} and @samp{-mr @var{N}} command-line options to set the maximum number of fields and the maximum record size, respectively -(@pxref{Options, ,Command-Line Options}). +(@pxref{Options}). As a side note, his @command{awk} no longer needs these options; it continues to accept them to avoid breaking old programs. @item The @code{fflush} built-in function for flushing buffered output -(@pxref{I/O Functions, ,Input/Output Functions}). +(@pxref{I/O Functions}). @item The @samp{**} and @samp{**=} operators -(@pxref{Arithmetic Ops, ,Arithmetic Operators} +(@pxref{Arithmetic Ops} and -@ref{Assignment Ops, ,Assignment Expressions}). +@ref{Assignment Ops}). @item The use of @code{func} as an abbreviation for @code{function} -(@pxref{Definition Syntax, ,Function Definition Syntax}). +(@pxref{Definition Syntax}). @ignore @item @@ -22469,23 +22696,23 @@ The @samp{\x} escape sequence @item The @file{/dev/stdin}, @file{/dev/stdout}, and @file{/dev/stderr} special files -(@pxref{Special Files, ,Special @value{FFN}s in @command{gawk}}). +(@pxref{Special Files}). @item The ability for @code{FS} and for the third argument to @code{split} to be null strings -(@pxref{Single Character Fields, , Making Each Character a Separate Field}). +(@pxref{Single Character Fields}). @item The @code{nextfile} statement -(@pxref{Nextfile Statement, ,Using @command{gawk}'s @code{nextfile} Statement}). +(@pxref{Nextfile Statement}). @item The ability to delete all of an array at once with @samp{delete @var{array}} -(@pxref{Delete, ,The @code{delete} Statement}). +(@pxref{Delete}). @end itemize -@node POSIX/GNU, Contributors, BTL, Language History +@node POSIX/GNU @appendixsec Extensions in @command{gawk} Not in POSIX @command{awk} @ignore @@ -22506,12 +22733,12 @@ Within each category, be alphabetical. @c STARTOFRANGE exgnot @cindex extensions, in @command{gawk}, not in POSIX @command{awk} @c STARTOFRANGE posnot -@cindex POSIX, @command{gawk} extensions not included in +@cindex POSIX, @command{gawk} extensions not included in The GNU implementation, @command{gawk}, adds a large number of features. This @value{SECTION} lists them in the order they were added to @command{gawk}. They can all be disabled with either the @option{--traditional} or @option{--posix} options -(@pxref{Options, ,Command-Line Options}). +(@pxref{Options}). Version 2.10 of @command{gawk} introduced the following features: @@ -22519,16 +22746,16 @@ Version 2.10 of @command{gawk} introduced the following features: @item The @env{AWKPATH} environment variable for specifying a path search for the @option{-f} command-line option -(@pxref{Options, ,Command-Line Options}). +(@pxref{Options}). @item The @code{IGNORECASE} variable and its effects -(@pxref{Case-sensitivity, ,Case Sensitivity in Matching}). +(@pxref{Case-sensitivity}). @item The @file{/dev/stdin}, @file{/dev/stdout}, @file{/dev/stderr} and @file{/dev/fd/@var{N}} special @value{FN}s -(@pxref{Special Files, ,Special @value{FFN}s in @command{gawk}}). +(@pxref{Special Files}). @end itemize Version 2.13 of @command{gawk} introduced the following features: @@ -22536,25 +22763,25 @@ Version 2.13 of @command{gawk} introduced the following features: @itemize @bullet @item The @code{FIELDWIDTHS} variable and its effects -(@pxref{Constant Size, ,Reading Fixed-Width Data}). +(@pxref{Constant Size}). @item The @code{systime} and @code{strftime} built-in functions for obtaining and printing timestamps -(@pxref{Time Functions, ,Using @command{gawk}'s Timestamp Functions}). +(@pxref{Time Functions}). @item The @option{-W lint} option to provide error and portability checking for both the source code and at runtime -(@pxref{Options, ,Command-Line Options}). +(@pxref{Options}). @item The @option{-W compat} option to turn off the GNU extensions -(@pxref{Options, ,Command-Line Options}). +(@pxref{Options}). @item The @option{-W posix} option for full POSIX compliance -(@pxref{Options, ,Command-Line Options}). +(@pxref{Options}). @end itemize Version 2.14 of @command{gawk} introduced the following feature: @@ -22562,7 +22789,7 @@ Version 2.14 of @command{gawk} introduced the following feature: @itemize @bullet @item The @code{next file} statement for skipping to the next @value{DF} -(@pxref{Nextfile Statement, ,Using @command{gawk}'s @code{nextfile} Statement}). +(@pxref{Nextfile Statement}). @end itemize Version 2.15 of @command{gawk} introduced the following features: @@ -22580,20 +22807,20 @@ The @code{ERRNO} variable, which contains the system error message when @item The @file{/dev/pid}, @file{/dev/ppid}, @file{/dev/pgrpid}, and @file{/dev/user} @value{FN} interpretation -(@pxref{Special Files, ,Special @value{FFN}s in @command{gawk}}). +(@pxref{Special Files}). @item The ability to delete all of an array at once with @samp{delete @var{array}} -(@pxref{Delete, ,The @code{delete} Statement}). +(@pxref{Delete}). @item The ability to use GNU-style long-named options that start with @option{--} -(@pxref{Options, ,Command-Line Options}). +(@pxref{Options}). @item The @option{--source} option for mixing command-line and library-file source code -(@pxref{Options, ,Command-Line Options}). +(@pxref{Options}). @end itemize Version 3.0 of @command{gawk} introduced the following features: @@ -22602,66 +22829,66 @@ Version 3.0 of @command{gawk} introduced the following features: @item @code{IGNORECASE} changed, now applying to string comparison as well as regexp operations -(@pxref{Case-sensitivity, ,Case Sensitivity in Matching}). +(@pxref{Case-sensitivity}). @item The @code{RT} variable that contains the input text that matched @code{RS} -(@pxref{Records, ,How Input Is Split into Records}). +(@pxref{Records}). @item Full support for both POSIX and GNU regexps -(@pxref{Regexp, , Regular Expressions}). +(@pxref{Regexp}). @item The @code{gensub} function for more powerful text manipulation -(@pxref{String Functions, ,String Manipulation Functions}). +(@pxref{String Functions}). @item The @code{strftime} function acquired a default time format, allowing it to be called with no arguments -(@pxref{Time Functions, ,Using @command{gawk}'s Timestamp Functions}). +(@pxref{Time Functions}). @item The ability for @code{FS} and for the third argument to @code{split} to be null strings -(@pxref{Single Character Fields, , Making Each Character a Separate Field}). +(@pxref{Single Character Fields}). @item The ability for @code{RS} to be a regexp -(@pxref{Records, ,How Input Is Split into Records}). +(@pxref{Records}). @item The @code{next file} statement became @code{nextfile} -(@pxref{Nextfile Statement, ,Using @command{gawk}'s @code{nextfile} Statement}). +(@pxref{Nextfile Statement}). @item The @option{--lint-old} option to warn about constructs that are not available in the original Version 7 Unix version of @command{awk} -(@pxref{V7/SVR3.1, ,Major Changes Between V7 and SVR3.1}). +(@pxref{V7/SVR3.1}). @item The @option{-m} option and the @code{fflush} function from the Bell Laboratories research version of @command{awk} -(@pxref{Options, ,Command-Line Options}; also -@pxref{I/O Functions, ,Input/Output Functions}). +(@pxref{Options}; also +@pxref{I/O Functions}). @item The @option{--re-interval} option to provide interval expressions in regexps -(@pxref{Regexp Operators, , Regular Expression Operators}). +(@pxref{Regexp Operators}). @item The @option{--traditional} option was added as a better name for -@option{--compat} (@pxref{Options, ,Command-Line Options}). +@option{--compat} (@pxref{Options}). @item The use of GNU Autoconf to control the configuration process -(@pxref{Quick Installation, , Compiling @command{gawk} for Unix}). +(@pxref{Quick Installation}). @item Amiga support -(@pxref{Amiga Installation, ,Installing @command{gawk} on an Amiga}). +(@pxref{Amiga Installation}). @end itemize @@ -22671,7 +22898,7 @@ Version 3.1 of @command{gawk} introduced the following features: @item The @code{BINMODE} special variable for non-POSIX systems, which allows binary I/O for input and/or output files -(@pxref{PC Using, ,Using @command{gawk} on PC Operating Systems}). +(@pxref{PC Using}). @item The @code{LINT} special variable, which dynamically controls lint warnings @@ -22686,53 +22913,53 @@ The @code{TEXTDOMAIN} special variable for setting an application's internationalization text domain (@pxref{Built-in Variables}, and -@ref{Internationalization, ,Internationalization with @command{gawk}}). +@ref{Internationalization}). @item The ability to use octal and hexadecimal constants in @command{awk} program source code -(@pxref{Nondecimal-numbers, ,Octal and Hexadecimal Numbers}). +(@pxref{Nondecimal-numbers}). @item The @samp{|&} operator for two-way I/O to a coprocess -(@pxref{Two-way I/O, ,Two-Way Communications with Another Process}). +(@pxref{Two-way I/O}). @item The @file{/inet} special files for TCP/IP networking using @samp{|&} -(@pxref{TCP/IP Networking, , Using @command{gawk} for Network Programming}). +(@pxref{TCP/IP Networking}). @item The optional second argument to @code{close} that allows closing one end of a two-way pipe to a coprocess -(@pxref{Two-way I/O, ,Two-Way Communications with Another Process}). +(@pxref{Two-way I/O}). @item The optional third argument to the @code{match} function for capturing text-matching subexpressions within a regexp -(@pxref{String Functions, , String Manipulation Functions}). +(@pxref{String Functions}). @item Positional specifiers in @code{printf} formats for making translations easier -(@pxref{Printf Ordering, , Rearranging @code{printf} Arguments}). +(@pxref{Printf Ordering}). @item The @code{asort} and @code{asorti} functions for sorting arrays -(@pxref{Array Sorting, ,Sorting Array Values and Indices with @command{gawk}}). +(@pxref{Array Sorting}). @item The @code{bindtextdomain}, @code{dcgettext} and @code{dcngettext} functions for internationalization -(@pxref{Programmer i18n, ,Internationalizing @command{awk} Programs}). +(@pxref{Programmer i18n}). @item The @code{extension} built-in function and the ability to add new built-in functions dynamically -(@pxref{Dynamic Extensions, , Adding New Built-in Functions to @command{gawk}}). +(@pxref{Dynamic Extensions}). @item The @code{mktime} built-in function for creating timestamps -(@pxref{Time Functions, ,Using @command{gawk}'s Timestamp Functions}). +(@pxref{Time Functions}). @item The @@ -22745,57 +22972,57 @@ The and @code{strtonum} built-in functions -(@pxref{Bitwise Functions, ,Using @command{gawk}'s Bit Manipulation Functions}). +(@pxref{Bitwise Functions}). @item @cindex @code{next file} statement The support for @samp{next file} as two words was removed completely -(@pxref{Nextfile Statement, ,Using @command{gawk}'s @code{nextfile} Statement}). +(@pxref{Nextfile Statement}). @item The @option{--dump-variables} option to print a list of all global variables -(@pxref{Options, ,Command-Line Options}). +(@pxref{Options}). @item The @option{--gen-po} command-line option and the use of a leading underscore to mark strings that should be translated -(@pxref{String Extraction, ,Extracting Marked Strings}). +(@pxref{String Extraction}). @item The @option{--non-decimal-data} option to allow non-decimal input data -(@pxref{Nondecimal Data, ,Allowing Nondecimal Input Data}). +(@pxref{Nondecimal Data}). @item The @option{--profile} option and @command{pgawk}, the profiling version of @command{gawk}, for producing execution profiles of @command{awk} programs -(@pxref{Profiling, ,Profiling Your @command{awk} Programs}). +(@pxref{Profiling}). @item The @option{--enable-portals} configuration option to enable special treatment of pathnames that begin with @file{/p} as BSD portals -(@pxref{Portal Files, , Using @command{gawk} with BSD Portals}). +(@pxref{Portal Files}). @item The use of GNU Automake to help in standardizing the configuration process -(@pxref{Quick Installation, , Compiling @command{gawk} for Unix}). +(@pxref{Quick Installation}). @item The use of GNU @code{gettext} for @command{gawk}'s own message output -(@pxref{Gawk I18N, ,@command{gawk} Can Speak Your Language}). +(@pxref{Gawk I18N}). @item BeOS support -(@pxref{BeOS Installation, , Installing @command{gawk} on BeOS}). +(@pxref{BeOS Installation}). @item Tandem support -(@pxref{Tandem Installation, ,Installing @command{gawk} on a Tandem}). +(@pxref{Tandem Installation}). @item The Atari port became officially unsupported -(@pxref{Atari Installation, ,Installing @command{gawk} on the Atari ST}). +(@pxref{Atari Installation}). @item The source code now uses new-style function definitions, with @@ -22804,7 +23031,7 @@ The source code now uses new-style function definitions, with @item The @option{--disable-lint} configuration option to disable lint checking at compile time -(@pxref{Additional Configuration Options, , Additional Configuration Options}). +(@pxref{Additional Configuration Options}). @end itemize @@ -22814,7 +23041,7 @@ at compile time @c ENDOFRANGE exgnot @c ENDOFRANGE posnot -@node Contributors, , POSIX/GNU, Language History +@node Contributors @appendixsec Major Contributors to @command{gawk} @cindex @command{gawk}, list of contributors to @quotation @@ -22920,7 +23147,7 @@ currently maintains the MS-DOS port. @item @cindex Grigera, Juan Juan Grigera -maintains the port to Win32 systems. +maintains the port to Windows32 systems. @item @cindex Hankerson, Darrel @@ -22973,6 +23200,13 @@ updated the @command{gawk} port for OS/2. Isamu Hasegawa, of IBM in Japan, contributed support for multibyte characters. +@cindex Benzinger, Michael +Michael Benzinger contributed the initial code for @code{switch} statements. + +@cindex McPhee, Patrick +Patrick T.J.@: McPhee contributed the code for dynamic loading in Windows32 +environments. + @item @cindex Robbins, Arnold Arnold Robbins @@ -22980,7 +23214,7 @@ has been working on @command{gawk} since 1988, at first helping David Trueman, and as the primary maintainer since around 1994. @end itemize -@node Installation, Notes, Language History, Top +@node Installation @appendix Installing @command{gawk} @c last two commas are part of see also @@ -22993,7 +23227,7 @@ This appendix provides instructions for installing @command{gawk} on the various platforms that are supported by the developers. The primary developer supports GNU/Linux (and Unix), whereas the other ports are contributed. -@xref{Bugs, , Reporting Problems and Bugs}, +@xref{Bugs}, for the electronic mail addresses of the people who did the respective ports. @@ -23008,7 +23242,7 @@ the respective ports. implementations. @end menu -@node Gawk Distribution, Unix Installation, Installation, Installation +@node Gawk Distribution @appendixsec The @command{gawk} Distribution @cindex source code, @command{gawk} @@ -23022,7 +23256,7 @@ subdirectories. * Distribution contents:: What is in the distribution. @end menu -@node Getting, Extracting, Gawk Distribution, Gawk Distribution +@node Getting @appendixsubsec Getting the @command{gawk} Distribution @c last comma is part of secondary @cindex @command{gawk}, source code, obtaining @@ -23065,7 +23299,7 @@ The up-to-date list of mirror sites is available from Try to use one of the mirrors; they will be less busy, and you can usually find one closer to your site. -@node Extracting, Distribution contents, Getting, Gawk Distribution +@node Extracting @appendixsubsec Extracting the Distribution @command{gawk} is distributed as a @code{tar} file compressed with the GNU Zip program, @code{gzip}. @@ -23099,7 +23333,7 @@ If you are not on a Unix system, you need to make other arrangements for getting and extracting the @command{gawk} distribution. You should consult a local expert. -@node Distribution contents, , Extracting, Gawk Distribution +@node Distribution contents @appendixsubsec Contents of the @command{gawk} Distribution @c STARTOFRANGE gawdis @cindex @command{gawk}, distribution @@ -23107,7 +23341,7 @@ a local expert. The @command{gawk} distribution has a number of C source files, documentation files, subdirectories, and files related to the configuration process -(@pxref{Unix Installation, ,Compiling and Installing @command{gawk} on Unix}), +(@pxref{Unix Installation}), as well as several subdirectories related to different non-Unix operating systems: @@ -23198,7 +23432,7 @@ The generated Info file for @item doc/igawk.1 The @command{troff} source for a manual page describing the @command{igawk} program presented in -@ref{Igawk Program, ,An Easy Way to Use Library Functions}. +@ref{Igawk Program}. @item doc/Makefile.in The input file used during the configuration process to generate the @@ -23222,7 +23456,7 @@ the @file{Makefile.in} files used by @command{autoconf} and @itemx m4/* These files and subdirectories are used when configuring @command{gawk} for various Unix systems. They are explained in -@ref{Unix Installation, ,Compiling and Installing @command{gawk} on Unix}. +@ref{Unix Installation}. @item intl/* @itemx po/* @@ -23235,15 +23469,15 @@ contains message translations. @itemx awklib/Makefile.in @itemx awklib/eg/* The @file{awklib} directory contains a copy of @file{extract.awk} -(@pxref{Extract Program, ,Extracting Programs from Texinfo Source Files}), +(@pxref{Extract Program}), which can be used to extract the sample programs from the Texinfo source file for this @value{DOCUMENT}. It also contains a @file{Makefile.in} file, which @command{configure} uses to generate a @file{Makefile}. @file{Makefile.am} is used by GNU Automake to create @file{Makefile.in}. The library functions from -@ref{Library Functions, , A Library of @command{awk} Functions}, +@ref{Library Functions}, and the @command{igawk} program from -@ref{Igawk Program, , An Easy Way to Use Library Functions}, +@ref{Igawk Program}, are included as ready-to-use files in the @command{gawk} distribution. They are installed as part of the installation process. The rest of the programs in this @value{DOCUMENT} are available in appropriate @@ -23251,22 +23485,22 @@ subdirectories of @file{awklib/eg}. @item unsupported/atari/* Files needed for building @command{gawk} on an Atari ST -(@pxref{Atari Installation, ,Installing @command{gawk} on the Atari ST}, for details). +(@pxref{Atari Installation}, for details). @item unsupported/tandem/* Files needed for building @command{gawk} on a Tandem -(@pxref{Tandem Installation, ,Installing @command{gawk} on a Tandem}, for details). +(@pxref{Tandem Installation}, for details). @item posix/* Files needed for building @command{gawk} on POSIX-compliant systems. @item pc/* Files needed for building @command{gawk} under MS-DOS, MS Windows and OS/2 -(@pxref{PC Installation, ,Installation on PC Operating Systems}, for details). +(@pxref{PC Installation}, for details). @item vms/* Files needed for building @command{gawk} under VMS -(@pxref{VMS Installation, ,How to Compile and Install @command{gawk} on VMS}, for details). +(@pxref{VMS Installation}, for details). @item test/* A test suite for @@ -23277,7 +23511,7 @@ be confident of a successful port. @end table @c ENDOFRANGE gawdis -@node Unix Installation, Non-Unix Installation, Gawk Distribution, Installation +@node Unix Installation @appendixsec Compiling and Installing @command{gawk} on Unix Usually, you can compile and install @command{gawk} by typing only two @@ -23290,7 +23524,7 @@ to configure @command{gawk} for your system yourself. * Configuration Philosophy:: How it's all supposed to work. @end menu -@node Quick Installation, Additional Configuration Options, Unix Installation, Unix Installation +@node Quick Installation @appendixsubsec Compiling @command{gawk} for Unix @c @cindex installation, unix @@ -23352,9 +23586,9 @@ If these steps do not work, or if any of the tests fail, check the files in the @file{README_d} directory to see if you've found a known problem. If the failure is not described there, please send in a bug report -(@pxref{Bugs, ,Reporting Problems and Bugs}.) +(@pxref{Bugs}.) -@node Additional Configuration Options, Configuration Philosophy, Quick Installation, Unix Installation +@node Additional Configuration Options @appendixsubsec Additional Configuration Options @cindex @command{gawk}, configuring, options @c comma is part of primary @@ -23370,7 +23604,14 @@ command line when compiling @command{gawk} from scratch, including: Treat pathnames that begin with @file{/p} as BSD portal files when doing two-way I/O with the @samp{|&} operator -(@pxref{Portal Files, , Using @command{gawk} with BSD Portals}). +(@pxref{Portal Files}). + +@cindex @code{--enable-switch} configuration option +@cindex configuration option, @code{--enable-switch} +@item --enable-switch +Enable the recognition and execution of C-style @code{switch} statements +in @command{awk} programs +(@pxref{Switch Statement}.) @cindex Linux @cindex GNU/Linux @@ -23388,10 +23629,10 @@ All known modern GNU/Linux systems use Glibc 2. Use this option on any other sy @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}) +(@pxref{Options}) are accepted, but silently do nothing. Similarly, setting the @code{LINT} variable -(@pxref{User-modified, , Built-in Variables That Control @command{awk}}) +(@pxref{User-modified}) has no effect on the running @command{awk} program. When used with GCC's automatic dead-code-elimination, this option @@ -23413,7 +23654,7 @@ You should also use this option if @option{--with-included-gettext} doesn't work on your system. @end table -@node Configuration Philosophy, , Additional Configuration Options, Unix Installation +@node Configuration Philosophy @appendixsubsec The Configuration Process @cindex @command{gawk}, configuring @@ -23456,12 +23697,12 @@ It is also possible that the @command{configure} program generated by If you do have a problem, the file @file{configure.in} is the input for @command{autoconf}. You may be able to change this file and generate a new version of @command{configure} that works on your system -(@pxref{Bugs, ,Reporting Problems and Bugs}, +(@pxref{Bugs}, for information on how to report problems in configuring @command{gawk}). The same mechanism may be used to send in updates to @file{configure.in} and/or @file{custom.h}. -@node Non-Unix Installation, Unsupported, Unix Installation, Installation +@node Non-Unix Installation @appendixsec Installation on Other Operating Systems This @value{SECTION} describes how to install @command{gawk} on @@ -23475,7 +23716,7 @@ various non-Unix systems. * VMS Installation:: Installing @command{gawk} on VMS. @end menu -@node Amiga Installation, BeOS Installation, Non-Unix Installation, Non-Unix Installation +@node Amiga Installation @appendixsubsec Installing @command{gawk} on an Amiga @cindex amiga @@ -23511,9 +23752,9 @@ configure -v m68k-amigaos Then run @command{make} and you should be all set! If these steps do not work, please send in a bug report -(@pxref{Bugs, ,Reporting Problems and Bugs}). +(@pxref{Bugs}). -@node BeOS Installation, PC Installation, Amiga Installation, Non-Unix Installation +@node BeOS Installation @appendixsubsec Installing @command{gawk} on BeOS @cindex BeOS @cindex installation, beos @@ -23547,12 +23788,12 @@ $ make install BeOS uses @command{bash} as its shell; thus, you use @command{gawk} the same way you would under Unix. If these steps do not work, please send in a bug report -(@pxref{Bugs, ,Reporting Problems and Bugs}). +(@pxref{Bugs}). @c Rewritten by Scott Deifik <scottd@amgen.com> @c and Darrel Hankerson <hankedr@mail.auburn.edu> -@node PC Installation, VMS Installation, BeOS Installation, Non-Unix Installation +@node PC Installation @appendixsubsec Installation on PC Operating Systems @c first comma is part of primary @@ -23561,27 +23802,28 @@ If these steps do not work, please send in a bug report @cindex operating systems, PC, @command{gawk} on, installing This @value{SECTION} covers installation and usage of @command{gawk} on x86 machines running DOS, any version of Windows, or OS/2. -In this @value{SECTION}, the term ``Win32'' +In this @value{SECTION}, the term ``Windows32'' refers to any of Windows-95/98/ME/NT/2000. The limitations of DOS (and DOS shells under Windows or OS/2) has meant that various ``DOS extenders'' are often used with programs such as @command{gawk}. The varying capabilities of Microsoft Windows 3.1 -and Win32 can add to the confusion. For an overview of the +and Windows32 can add to the confusion. For an overview of the considerations, please refer to @file{README_d/README.pc} in the distribution. @menu * PC Binary Installation:: Installing a prepared distribution. -* PC Compiling:: Compiling @command{gawk} for MS-DOS, Win32, +* PC Compiling:: Compiling @command{gawk} for MS-DOS, Windows32, and OS/2. -* PC Using:: Running @command{gawk} on MS-DOS, Win32 and +* PC Dynamic:: Compiling @command{gawk} for dynamic libraries. +* PC Using:: Running @command{gawk} on MS-DOS, Windows32 and OS/2. * Cygwin:: Building and running @command{gawk} for Cygwin. @end menu -@node PC Binary Installation, PC Compiling, PC Installation, PC Installation +@node PC Binary Installation @appendixsubsubsec Installing a Prepared Distribution for PC Systems If you have received a binary distribution prepared by the DOS @@ -23601,7 +23843,7 @@ contents. In particular, it may include more than one version of the OS/2 (32 bit, EMX) binary distributions are prepared for the @file{/usr} directory of your preferred drive. Set @env{UNIXROOT} to your installation drive (e.g., @samp{e:}) if you want to install @command{gawk} onto another drive -than the hardcoded default @samp{c:}. Executables appear in @file{/usr/bin}, +than the hardcoded default @samp{c:}. Executables appear in @file{/usr/bin}, libraries under @file{/usr/share/awk}, manual pages under @file{/usr/man}, Texinfo documentation under @file{/usr/info} and NLS files under @file{/usr/share/locale}. If you already have a file @file{/usr/info/dir} from another package @@ -23619,13 +23861,13 @@ set properly. The binary distribution may contain a separate file containing additional or more detailed installation instructions. -@node PC Compiling, PC Using, PC Binary Installation, PC Installation +@node PC Compiling @appendixsubsubsec Compiling @command{gawk} for PC Operating Systems -@command{gawk} can be compiled for MS-DOS, Win32, and OS/2 using the GNU +@command{gawk} can be compiled for MS-DOS, Windows32, and OS/2 using the GNU 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 +Mattes (EMX; MS-DOS, Windows32 and OS/2). Microsoft Visual C/C++ can be used +to build a Windows32 version, and Microsoft C/C++ can be 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, @@ -23635,7 +23877,7 @@ The file 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 only; for 32 bit +To build @command{gawk} for MS-DOS, Windows32, 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} @@ -23643,7 +23885,7 @@ 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} +Windows32, and OS/2 versions. A list of targets is printed if the @command{make} command is given without a target. As an example, to build @command{gawk} using the DJGPP tools, enter @samp{make djgpp}. @@ -23732,8 +23974,56 @@ 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 +@node PC Dynamic +@appendixsubsubsec Compiling @command{gawk} For Dynamic Libraries + +@c From README_d/README.pcdynamic +@c 11 June 2003 + +To compile @command{gawk} with dynamic extension support, +uncomment the definitions of @code{DYN_FLAGS}, @code{DYN_EXP}, +@code{DYN_OBJ}, and @code{DYN_MAKEXP} in the configuration section of +the @file{Makefile}. There are two definitions for @code{DYN_MAKEXP}: +pick the one that matches your target. + +To build some of the example extension libraries, @command{cd} to the +extension directory and copy @file{Makefile.pc} to @file{Makefile}. You +can then build using the same two targets. To run the example +@command{awk} scripts, you'll need to either change the call to +the @code{extension} function to match the name of the library (for +instance, change @code{"./ordchr.so"} to @code{"ordchr.dll"} or simply +@code{"ordchr"}), or rename the library to match the call (for instance, +rename @file{ordchr.dll} to @file{ordchr.so}). + +If you build @command{gawk.exe} with one compiler but want to build +an extension library with the other, you need to copy the import +library. Visual C uses a library called @file{gawk.lib}, while MinGW uses +a library called @file{libgawk.a}. These files are equivalent and will +interoperate if you give them the correct name. The resulting shared +libraries are also interoperable. + +To create your own extension library, you can use the examples as models, +but you're essentially on your own. Post to @code{comp.lang.awk} or +send electronic mail to @email{ptjm@@interlog.com} if you have problems getting +started. If you need to access functions or variables which are not +exported by @command{gawk.exe}, add them to @file{gawkw32.def} and +rebuild. You should also add @code{ATTRIBUTE_EXPORTED} to the declaration +in @file{awk.h} of any variables you add to @file{gawkw32.def}. + +Note that extension libraries have the name of the @command{awk} +executable embedded in them at link time, so they will work only +with @command{gawk.exe}. In particular, they won't work if you +rename @command{gawk.exe} to @command{awk.exe} or if you try to use +@command{pgawk.exe}. You can perform profiling by temporarily renaming +@command{pgawk.exe} to @command{gawk.exe}. You can resolve this problem +by changing the program name in the definition of @code{DYN_MAKEXP} +for your compiler. + +On Windows32, libraries are sought first in the current directory, then in +the directory containing @command{gawk.exe}, and finally through the +@env{PATH} environment variable. + +@node PC Using @appendixsubsubsec Using @command{gawk} on PC Operating Systems @c STARTOFRANGE opgawx @cindex operating systems, PC, @command{gawk} on @@ -23742,7 +24032,7 @@ version on @uref{http://www.unixos2.org/sw/pub/binary/make/} or on With the exception of the Cygwin environment, the @samp{|&} operator and TCP/IP networking -(@pxref{TCP/IP Networking, , Using @command{gawk} for Network Programming}) +(@pxref{TCP/IP Networking}) are not supported for MS-DOS or MS-Windows. EMX (OS/2 only) does support at least the @samp{|&} operator. @@ -23753,7 +24043,7 @@ at least the @samp{|&} operator. @cindex semicolon (@code{;}), @code{AWKPATH} variable and @cindex @code{AWKPATH} environment variable The OS/2 and MS-DOS versions of @command{gawk} search for program files as -described in @ref{AWKPATH Variable, ,The @env{AWKPATH} Environment Variable}. +described in @ref{AWKPATH Variable}. However, semicolons (rather than colons) separate elements in the @env{AWKPATH} variable. If @env{AWKPATH} is not set or is empty, then the default search path for OS/2 (16 bit) and MS-DOS versions is @@ -23823,7 +24113,7 @@ appropriate @samp{-v BINMODE=@var{N}} option on the command line. changed mid-stream. The name @code{BINMODE} was chosen to match @command{mawk} -(@pxref{Other Versions, , Other Freely Available @command{awk} Implementations}). +(@pxref{Other Versions}). Both @command{mawk} and @command{gawk} handle @code{BINMODE} similarly; however, @command{mawk} adds a @samp{-W BINMODE=@var{N}} option and an environment variable that can set @code{BINMODE}, @code{RS}, and @code{ORS}. The @@ -23870,7 +24160,7 @@ gawk -f binmode1.awk @dots{} With proper quoting, in the first example the setting of @code{RS} can be moved into the @code{BEGIN} rule. -@node Cygwin, , PC Using, PC Installation +@node Cygwin @appendixsubsubsec Using @command{gawk} In The Cygwin Environment @command{gawk} can be used ``out of the box'' under Windows if you are @@ -23892,11 +24182,11 @@ step on Cygwin takes considerably longer. However, it does finish, and then the @samp{make} proceeds as usual. @strong{Note:} The @samp{|&} operator and TCP/IP networking -(@pxref{TCP/IP Networking, , Using @command{gawk} for Network Programming}) +(@pxref{TCP/IP Networking}) are fully supported in the Cygwin environment. This is not true for any other environment for MS-DOS or MS-Windows. -@node VMS Installation, , PC Installation, Non-Unix Installation +@node VMS Installation @appendixsubsec How to Compile and Install @command{gawk} on VMS @c based on material from Pat Rankin <rankin@eql.caltech.edu> @@ -23912,7 +24202,7 @@ This @value{SUBSECTION} describes how to compile and install @command{gawk} unde * VMS POSIX:: Alternate instructions for VMS POSIX. @end menu -@node VMS Compilation, VMS Installation Details, VMS Installation, VMS Installation +@node VMS Compilation @appendixsubsubsec Compiling @command{gawk} on VMS To compile @command{gawk} under VMS, there is a @code{DCL} command procedure that @@ -23960,7 +24250,7 @@ No changes to @file{config.h} are needed. @command{gawk} has been tested under VAX/VMS 5.5-1 using VAX C V3.2, and GNU C 1.40 and 2.3. It should work without modifications for VMS V4.6 and up. -@node VMS Installation Details, VMS Running, VMS Compilation, VMS Installation +@node VMS Installation Details @appendixsubsubsec Installing @command{gawk} on VMS To install @command{gawk}, all you need is a ``foreign'' command, which is @@ -24008,7 +24298,7 @@ If, after searching in both directories, the file still is not found, the file search. If @samp{AWK_LIBRARY} is not defined, that portion of the file search fails benignly. -@node VMS Running, VMS POSIX, VMS Installation Details, VMS Installation +@node VMS Running @appendixsubsubsec Running @command{gawk} on VMS Command-line parsing and quoting conventions are significantly different @@ -24047,7 +24337,7 @@ of @samp{AWKPATH} is a comma-separated list of directory specifications. When defining it, the value should be quoted so that it retains a single translation and not a multitranslation @code{RMS} searchlist. -@node VMS POSIX, , VMS Running, VMS Installation +@node VMS POSIX @appendixsubsubsec Building and Using @command{gawk} on VMS POSIX Ignore the instructions above, although @file{vms/gawk.hlp} should still @@ -24076,7 +24366,7 @@ Once built, @command{gawk} works like any other shell utility. Unlike the normal VMS port of @command{gawk}, no special command-line manipulation is needed in the VMS POSIX environment. -@node Unsupported, Bugs, Non-Unix Installation, Installation +@node Unsupported @appendixsec Unsupported Operating System Ports This sections describes systems for which @@ -24087,7 +24377,7 @@ the @command{gawk} port is no longer supported. * Tandem Installation:: Installing @command{gawk} on a Tandem. @end menu -@node Atari Installation, Tandem Installation, Unsupported, Unsupported +@node Atari Installation @appendixsubsec Installing @command{gawk} on the Atari ST The Atari port is no longer supported. It is @@ -24106,7 +24396,7 @@ exactly right). In order to use @command{gawk}, you need to have a shell, either text or graphics, that does not map all the characters of a command line to uppercase. Maintaining case distinction in option flags is very -important (@pxref{Options, ,Command-Line Options}). +important (@pxref{Options}). These days this is the default and it may only be a problem for some very old machines. If your system does not preserve the case of option flags, you need to upgrade your tools. Support for I/O @@ -24118,7 +24408,7 @@ from other environments. Pipes are nice to have but not vital. * Atari Using:: Running @command{gawk} on Atari. @end menu -@node Atari Compiling, Atari Using, Atari Installation, Atari Installation +@node Atari Compiling @appendixsubsubsec Compiling @command{gawk} on the Atari ST A proper compilation of @command{gawk} sources when @code{sizeof(int)} @@ -24146,7 +24436,7 @@ Some @command{gawk} source code fragments depend on a preprocessor define @samp{atarist}. This basically assumes the TOS environment with @command{gcc}. Modify these sections as appropriate if they are not right for your environment. Also see the remarks about @env{AWKPATH} and @code{envsep} in -@ref{Atari Using, ,Running @command{gawk} on the Atari ST}. +@ref{Atari Using}. As shipped, the sample @file{config.h} claims that the @code{system} function is missing from the libraries, which is not true, and an @@ -24156,7 +24446,7 @@ Depending upon your particular combination of shell and operating system, you might want to change the file to indicate that @code{system} is available. -@node Atari Using, , Atari Compiling, Atari Installation +@node Atari Using @appendixsubsubsec Running @command{gawk} on the Atari ST An executable version of @command{gawk} should be placed, as usual, @@ -24172,7 +24462,7 @@ memory, it is a good idea to put it on a RAM drive. If neither current directory for its temporary files. The ST version of @command{gawk} searches for its program files, as described in -@ref{AWKPATH Variable, ,The @env{AWKPATH} Environment Variable}. +@ref{AWKPATH Variable}. The default value for the @env{AWKPATH} variable is taken from @code{DEFPATH} defined in @file{Makefile}. The sample @command{gcc}/TOS @file{Makefile} for the ST in the distribution sets @code{DEFPATH} to @@ -24209,7 +24499,7 @@ use only backslashes. Also remember that in @command{awk}, backslashes in strings have to be doubled in order to get literal backslashes (@pxref{Escape Sequences}). -@node Tandem Installation, , Atari Installation, Unsupported +@node Tandem Installation @appendixsubsec Installing @command{gawk} on a Tandem @cindex tandem @cindex installation, tandem @@ -24221,10 +24511,10 @@ The port's contributor no longer has access to a Tandem system. The Tandem port was done on a Cyclone machine running D20. The port is pretty clean and all facilities seem to work except for the I/O piping facilities -(@pxref{Getline/Pipe, , Using @code{getline} from a Pipe}, -@ref{Getline/Variable/Pipe, ,Using @code{getline} into a Variable from a Pipe}, +(@pxref{Getline/Pipe}, +@ref{Getline/Variable/Pipe}, and -@ref{Redirection, ,Redirecting Output of @code{print} and @code{printf}}), +@ref{Redirection}), which is just too foreign a concept for Tandem. To build a Tandem executable from source, download all of the files so @@ -24246,14 +24536,14 @@ Unix @samp{<} and @samp{>} for file redirection. (Redirection options on @code{getline}, @code{print} etc., are supported.) The @samp{-mr @var{val}} option -(@pxref{Options, ,Command-Line Options}) +(@pxref{Options}) has been ``stolen'' to enable Tandem users to process fixed-length records with no ``end-of-line'' character. That is, @samp{-mr 74} tells @command{gawk} to read the input file as fixed 74-byte records. @c ENDOFRANGE opgawx @c ENDOFRANGE pcgawon -@node Bugs, Other Versions, Unsupported, Installation +@node Bugs @appendixsec Reporting Problems and Bugs @cindex archeologists @quotation @@ -24381,7 +24671,7 @@ report to the @email{bug-gawk@@gnu.org} email list as well. @c ENDOFRANGE dbugg @c ENDOFRANGE tblgawb -@node Other Versions, , Bugs, Installation +@node Other Versions @appendixsec Other Freely Available @command{awk} Implementations @c STARTOFRANGE awkim @cindex @command{awk}, implementations @@ -24428,7 +24718,7 @@ the C compiler from GCC (the GNU Compiler Collection) works quite nicely. -@xref{BTL, ,Extensions in the Bell Laboratories @command{awk}}, +@xref{BTL}, for a list of extensions in this @command{awk} that are not in POSIX @command{awk}. @cindex Brennan, Michael @@ -24437,7 +24727,7 @@ for a list of extensions in this @command{awk} that are not in POSIX @command{aw @item @command{mawk} Michael Brennan has written an independent implementation of @command{awk}, called @command{mawk}. It is available under the GPL -(@pxref{Copying, ,GNU General Public License}), +(@pxref{Copying}), just as @command{gawk} is. You can get it via anonymous @command{ftp} to the host @@ -24447,7 +24737,7 @@ Use ``binary'' or ``image'' mode, and retrieve @file{mawk1.3.3.tar.gz} @command{gunzip} may be used to decompress this file. Installation is similar to @command{gawk}'s -(@pxref{Unix Installation, , Compiling and Installing @command{gawk} on Unix}). +(@pxref{Unix Installation}). @cindex extensions, @command{mawk} @command{mawk} has the following extensions that are not in POSIX @command{awk}: @@ -24455,17 +24745,17 @@ is similar to @command{gawk}'s @itemize @bullet @item The @code{fflush} built-in function for flushing buffered output -(@pxref{I/O Functions, ,Input/Output Functions}). +(@pxref{I/O Functions}). @item The @samp{**} and @samp{**=} operators -(@pxref{Arithmetic Ops, ,Arithmetic Operators} +(@pxref{Arithmetic Ops} and also see -@ref{Assignment Ops, ,Assignment Expressions}). +@ref{Assignment Ops}). @item The use of @code{func} as an abbreviation for @code{function} -(@pxref{Definition Syntax, ,Function Definition Syntax}). +(@pxref{Definition Syntax}). @item The @samp{\x} escape sequence @@ -24474,25 +24764,25 @@ The @samp{\x} escape sequence @item The @file{/dev/stdout}, and @file{/dev/stderr} special files -(@pxref{Special Files, ,Special @value{FFN}s in @command{gawk}}). +(@pxref{Special Files}). Use @code{"-"} instead of @code{"/dev/stdin"} with @command{mawk}. @item The ability for @code{FS} and for the third argument to @code{split} to be null strings -(@pxref{Single Character Fields, , Making Each Character a Separate Field}). +(@pxref{Single Character Fields}). @item The ability to delete all of an array at once with @samp{delete @var{array}} -(@pxref{Delete, ,The @code{delete} Statement}). +(@pxref{Delete}). @item The ability for @code{RS} to be a regexp -(@pxref{Records, ,How Input Is Split into Records}). +(@pxref{Records}). @item The @code{BINMODE} special variable for non-Unix operating systems -(@pxref{PC Using, ,Using @command{gawk} on PC Operating Systems}). +(@pxref{PC Using}). @end itemize The next version of @command{mawk} will support @code{nextfile}. @@ -24519,7 +24809,7 @@ You can reach Andrew Sumner at @email{andrew@@zbcom.net}. 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}), +(@pxref{Profiling}), 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} @@ -24531,7 +24821,7 @@ or @c ENDOFRANGE ingawk @c ENDOFRANGE awkim -@node Notes, Basic Concepts, Installation, Top +@node Notes @appendix Implementation Notes @c STARTOFRANGE gawii @cindex @command{gawk}, implementation issues @@ -24551,7 +24841,7 @@ maintainers of @command{gawk}. Everything in it applies specifically to * Future Extensions:: New features that may be implemented one day. @end menu -@node Compatibility Mode, Additions, Notes, Notes +@node Compatibility Mode @appendixsec Downward Compatibility and Debugging @cindex @command{gawk}, implementation issues, downward compatibility @cindex @command{gawk}, implementation issues, debugging @@ -24559,7 +24849,7 @@ maintainers of @command{gawk}. Everything in it applies specifically to @c first comma is part of primary @cindex implementation issues, @command{gawk}, debugging -@xref{POSIX/GNU, ,Extensions in @command{gawk} Not in POSIX @command{awk}}, +@xref{POSIX/GNU}, for a summary of the GNU extensions to the @command{awk} language and program. All of these features can be turned off by invoking @command{gawk} with the @option{--traditional} option or with the @option{--posix} option. @@ -24577,13 +24867,13 @@ This option is intended only for serious @command{gawk} developers and not for the casual user. It probably has not even been compiled into your version of @command{gawk}, since it slows down execution. -@node Additions, Dynamic Extensions, Compatibility Mode, Notes +@node Additions @appendixsec Making Additions to @command{gawk} If you find that you want to enhance @command{gawk} in a significant fashion, you are perfectly free to do so. That is the point of having free software; the source code is available and you are free to change -it as you want (@pxref{Copying, ,GNU General Public License}). +it as you want (@pxref{Copying}). This @value{SECTION} discusses the ways you might want to change @command{gawk} as well as any considerations you should bear in mind. @@ -24595,7 +24885,7 @@ as well as any considerations you should bear in mind. system. @end menu -@node Adding Code, New Ports, Additions, Additions +@node Adding Code @appendixsubsec Adding New Features @c STARTOFRANGE adfgaw @@ -24613,7 +24903,7 @@ make it possible for me to include your changes: @item Before building the new feature into @command{gawk} itself, consider writing it as an extension module -(@pxref{Dynamic Extensions, ,Adding New Built-in Functions to @command{gawk}}). +(@pxref{Dynamic Extensions}). If that's not possible, continue with the rest of the steps in this list. @item @@ -24621,7 +24911,7 @@ Get the latest version. It is much easier for me to integrate changes if they are relative to the most recent distributed version of @command{gawk}. If your version of @command{gawk} is very old, I may not be able to integrate them at all. -(@xref{Getting, ,Getting the @command{gawk} Distribution}, +(@xref{Getting}, for information on getting the latest version of @command{gawk}.) @item @@ -24723,7 +25013,7 @@ those changes in the public domain and submit a signed statement to that effect, or assign the copyright in your changes to the FSF. Both of these actions are easy to do and @emph{many} people have done so already. If you have questions, please contact me -(@pxref{Bugs, , Reporting Problems and Bugs}), +(@pxref{Bugs}), or @email{gnu@@gnu.org}. @cindex Texinfo @@ -24748,7 +25038,7 @@ more compact.) I recommend using the GNU version of @command{diff}. Send the output produced by either run of @command{diff} to me when you submit your changes. -(@xref{Bugs, , Reporting Problems and Bugs}, for the electronic mail +(@xref{Bugs}, for the electronic mail information.) Using this format makes it easy for me to apply your changes to the @@ -24770,7 +25060,7 @@ probably will not. @c ENDOFRANGE gawadf @c ENDOFRANGE fadgaw -@node New Ports, , Adding Code, Additions +@node New Ports @appendixsubsec Porting @command{gawk} to a New Operating System @cindex portability, @command{gawk} @cindex operating systems, porting @command{gawk} to @@ -24783,7 +25073,7 @@ several steps: @item Follow the guidelines in @ifinfo -@ref{Adding Code, ,Adding New Features}, +@ref{Adding Code}, @end ifinfo @ifnotinfo the previous @value{SECTION} @@ -24801,7 +25091,7 @@ If the changes needed for a particular system affect too much of the code, I probably will not accept them. In such a case, you can, of course, distribute your changes on your own, as long as you comply with the GPL -(@pxref{Copying, ,GNU General Public License}). +(@pxref{Copying}). @item A number of the files that come with @command{gawk} are maintained by other @@ -24871,7 +25161,7 @@ operating systems' code that is already there. In the code that you supply and maintain, feel free to use a coding style and brace layout that suits your taste. -@node Dynamic Extensions, Future Extensions, Additions, Notes +@node Dynamic Extensions @appendixsec Adding New Built-in Functions to @command{gawk} @cindex Robinson, Will @cindex robot, the @@ -24907,7 +25197,7 @@ upon the next release. * Sample Library:: A example of new functions. @end menu -@node Internals, Sample Library, Dynamic Extensions, Dynamic Extensions +@node Internals @appendixsubsec A Minimal Introduction to @command{gawk} Internals @c STARTOFRANGE gawint @cindex @command{gawk}, internals @@ -25085,7 +25375,9 @@ It is provided as a convenience. An argument that is supposed to be an array needs to be handled with some extra code, in case the array being passed in is actually from a function parameter. -The following boilerplate code shows how to do this: + +In versions of @command{gawk} up to and including 3.1.2, the +following boilerplate code shows how to do this: @smallexample NODE *the_arg; @@ -25109,11 +25401,27 @@ the_arg->type = Node_var_array; assoc_clear(the_arg); @end smallexample +For versions 3.1.3 and later, the internals changed. In particular, +the interface was actually @emph{simplified} drastically. The +following boilerplate code now suffices: + +@smallexample +NODE *the_arg; + +the_arg = get_argument(tree, 2); /* assume need 3rd arg, 0-based */ + +/* force it to be an array: */ +the_arg = get_array(the_arg); + +/* if necessary, clear it: */ +assoc_clear(the_arg); +@end smallexample + Again, you should spend time studying the @command{gawk} internals; don't just blindly copy this code. @c ENDOFRANGE gawint -@node Sample Library, , Internals, Dynamic Extensions +@node Sample Library @appendixsubsec Directory and File Operation Built-ins @c comma is part of primary @c STARTOFRANGE chdirg @@ -25140,7 +25448,7 @@ external extension library. * Using Internal File Ops:: How to use an external extension. @end menu -@node Internal File Description, Internal File Ops, Sample Library, Sample Library +@node Internal File Description @appendixsubsubsec Using @code{chdir} and @code{stat} This @value{SECTION} shows how to use the new functions at the @command{awk} @@ -25220,7 +25528,7 @@ be a function of the file's size if the file has holes. The file's last access, modification, and inode update times, respectively. These are numeric timestamps, suitable for formatting with @code{strftime} -(@pxref{Built-in, ,Built-in Functions}). +(@pxref{Built-in}). @item "pmode" The file's ``printable mode.'' This is a string representation of @@ -25263,7 +25571,7 @@ The file is a symbolic link. Several additional elements may be present depending upon the operating system and the type of the file. You can test for them in your @command{awk} program by using the @code{in} operator -(@pxref{Reference to Elements, ,Referring to an Array Element}): +(@pxref{Reference to Elements}): @table @code @item "blksize" @@ -25282,7 +25590,7 @@ represent the numeric device number and the major and minor components of that number, respectively. @end table -@node Internal File Ops, Using Internal File Ops, Internal File Description, Sample Library +@node Internal File Ops @appendixsubsubsec C Code for @code{chdir} and @code{stat} Here is the C code for these extensions. They were written for @@ -25481,7 +25789,7 @@ void *dl; And that's it! As an exercise, consider adding functions to implement system calls such as @code{chown}, @code{chmod}, and @code{umask}. -@node Using Internal File Ops, , Internal File Ops, Sample Library +@node Using Internal File Ops @appendixsubsubsec Integrating the Extensions @c last comma is part of secondary @@ -25529,7 +25837,7 @@ BEGIN @{ Here are the results of running the program: @example -$ gawk -f testff.awk +$ gawk -f testff.awk @print{} Info for testff.awk @print{} ret = 0 @print{} data["blksize"] = 4096 @@ -25557,7 +25865,7 @@ $ gawk -f testff.awk @c ENDOFRANGE adfugaw @c ENDOFRANGE fubadgaw -@node Future Extensions, , Dynamic Extensions, Notes +@node Future Extensions @appendixsec Probable Future Extensions @ignore From emory!scalpel.netlabs.com!lwall Tue Oct 31 12:43:17 1995 @@ -25654,7 +25962,7 @@ source code easier to work with: @table @asis @item Loadable module mechanics The current extension mechanism works -(@pxref{Dynamic Extensions, ,Adding New Built-in Functions to @command{gawk}}), +(@pxref{Dynamic Extensions}), but is rather primitive. It requires a fair amount of manual work to create and integrate a loadable module. Nor is the current mechanism as portable as might be desired. @@ -25707,12 +26015,12 @@ now. Finally, the programs in the test suite could use documenting in this @value{DOCUMENT}. -@xref{Additions, ,Making Additions to @command{gawk}}, +@xref{Additions}, if you are interested in tackling any of these projects. @c ENDOFRANGE impis @c ENDOFRANGE gawii -@node Basic Concepts, Glossary, Notes, Top +@node Basic Concepts @appendix Basic Programming Concepts @cindex programming, concepts @c STARTOFRANGE procon @@ -25732,7 +26040,7 @@ other introductory texts that you should refer to instead.) * Floating Point Issues:: Stuff to know about floating-point numbers. @end menu -@node Basic High Level, Basic Data Typing, Basic Concepts, Basic Concepts +@node Basic High Level @appendixsec What a Program Does @cindex processing data @@ -25929,7 +26237,7 @@ These are the things you do before actually starting to process data, such as checking arguments, initializing any data you need to work with, and so on. This step corresponds to @command{awk}'s @code{BEGIN} rule -(@pxref{BEGIN/END, ,The @code{BEGIN} and @code{END} Special Patterns}). +(@pxref{BEGIN/END}). If you were baking a cake, this might consist of laying out all the mixing bowls and the baking pan, and making sure you have all the @@ -25942,7 +26250,7 @@ one logical chunk at a time, and processes it as appropriate. In most programming languages, you have to manually manage the reading of data, checking to see if there is more each time you read a chunk. @command{awk}'s pattern-action paradigm -(@pxref{Getting Started, ,Getting Started with @command{awk}}) +(@pxref{Getting Started}) handles the mechanics of this for you. In baking a cake, the processing corresponds to the actual labor: @@ -25953,7 +26261,7 @@ into the oven. Once you've processed all the data, you may have things you need to do before exiting. This step corresponds to @command{awk}'s @code{END} rule -(@pxref{BEGIN/END, ,The @code{BEGIN} and @code{END} Special Patterns}). +(@pxref{BEGIN/END}). After the cake comes out of the oven, you still have to wrap it in plastic wrap to keep anyone from tasting it, as well as wash @@ -25992,7 +26300,7 @@ when those patterns are seen. This @dfn{data-driven} nature of @command{awk} programs usually makes them both easier to write and easier to read. -@node Basic Data Typing, Floating Point Issues, Basic High Level, Basic Concepts +@node Basic Data Typing @appendixsec Data Values in a Computer @cindex variables @@ -26015,7 +26323,7 @@ String values are essentially anything that's not a number, such as a name. Strings are sometimes referred to as @dfn{character data}, since they store the individual characters that comprise them. Individual variables, as well as numeric and string variables, are -referred to as @dfn{scalar} values. +referred to as @dfn{scalar} values. Groups of values, such as arrays, are not scalars. @cindex integers @@ -26049,7 +26357,7 @@ exactly. can hold more digits than @dfn{single-precision} floating-point numbers. Floating-point issues are discussed more fully in -@ref{Floating Point Issues, ,Floating-Point Number Caveats}. +@ref{Floating Point Issues}. At the very lowest level, computers store values as groups of binary digits, or @dfn{bits}. Modern computers group bits into groups of eight, called @dfn{bytes}. @@ -26076,7 +26384,7 @@ its right. Each column may contain either a 0 or a 1. Thus, binary 1010 represents 1 times 8, plus 0 times 4, plus 1 times 2, plus 0 times 1, or decimal 10. Octal and hexadecimal are discussed more in -@ref{Nondecimal-numbers, ,Octal and Hexadecimal Numbers}. +@ref{Nondecimal-numbers}. Programs are written in programming languages. Hundreds, if not thousands, of programming languages exist. @@ -26100,7 +26408,7 @@ In 1999, a revised ISO C standard was approved and released. Future versions of @command{gawk} will be as compatible as possible with this standard. -@node Floating Point Issues, , Basic Data Typing, Basic Concepts +@node Floating Point Issues @appendixsec Floating-Point Number Caveats As mentioned earlier, floating-point numbers represent what are called @@ -26121,7 +26429,7 @@ Internally, @command{awk} keeps both the numeric value (double-precision floating-point) and the string value for a variable. Separately, @command{awk} keeps track of what type the variable has -(@pxref{Typing and Comparison, ,Variable Typing and Comparison Expressions}), +(@pxref{Typing and Comparison}), which plays a role in how variables are used in comparisons. It is important to note that the string value for a number may not @@ -26212,7 +26520,7 @@ when stored internally, but that they are in fact equal to each other, as well as to ``regular'' zero: @smallexample -$ gawk 'BEGIN @{ mz = -0 ; pz = 0 +$ gawk 'BEGIN @{ mz = -0 ; pz = 0 > printf "-0 = %g, +0 = %g, (-0 == +0) -> %d\n", mz, pz, mz == pz > printf "mz == 0 -> %d, pz == 0 -> %d\n", mz == 0, pz == 0 > @}' @@ -26225,7 +26533,7 @@ that contains negative zero values; the fact that the zero is negative is noted and can affect comparisons. @c ENDOFRANGE procon -@node Glossary, Copying, Basic Concepts, Top +@node Glossary @unnumbered Glossary @table @asis @@ -26233,7 +26541,7 @@ is noted and can affect comparisons. A series of @command{awk} statements attached to a rule. If the rule's pattern matches an input record, @command{awk} executes the rule's action. Actions are always enclosed in curly braces. -(@xref{Action Overview, ,Actions}.) +(@xref{Action Overview}.) @cindex Spencer, Henry @cindex @command{sed} utility @@ -26280,7 +26588,7 @@ Useful for reasoning about how a program is supposed to behave. An @command{awk} expression that changes the value of some @command{awk} variable or data object. An object that you can assign to is called an @dfn{lvalue}. The assigned values are called @dfn{rvalues}. -@xref{Assignment Ops, ,Assignment Expressions}. +@xref{Assignment Ops}. @item Associative Array Arrays in which the indices may be numbers or strings, not just @@ -26321,7 +26629,7 @@ memory objects, or other data. @command{awk} lets you work with floating-point numbers and strings. @command{gawk} lets you manipulate bit values with the built-in functions described in -@ref{Bitwise Functions, ,Using @command{gawk}'s Bit Manipulation Functions}. +@ref{Bitwise Functions}. Computers are often defined by how many bits they use to represent integer values. Typical systems are 32-bit systems, but 64-bit systems are @@ -26344,7 +26652,7 @@ numerical, I/O-related, and string computations. Examples are substring of a string). @command{gawk} provides functions for timestamp management, bit manipulation, and runtime string translation. -(@xref{Built-in, ,Built-in Functions}.) +(@xref{Built-in}.) @item Built-in Variable @code{ARGC}, @@ -26431,13 +26739,13 @@ See also ``Interpreter.'' @item Compound Statement A series of @command{awk} statements, enclosed in curly braces. Compound statements may be nested. -(@xref{Statements, ,Control Statements in Actions}.) +(@xref{Statements}.) @item Concatenation Concatenating two strings means sticking them together, one after another, producing a new string. For example, the string @samp{foo} concatenated with the string @samp{bar} gives the string @samp{foobar}. -(@xref{Concatenation, ,String Concatenation}.) +(@xref{Concatenation}.) @item Conditional Expression An expression using the @samp{?:} ternary operator, such as @@ -26445,14 +26753,14 @@ An expression using the @samp{?:} ternary operator, such as @var{expr1} is evaluated; if the result is true, the value of the whole expression is the value of @var{expr2}; otherwise the value is @var{expr3}. In either case, only one of @var{expr2} and @var{expr3} -is evaluated. (@xref{Conditional Exp, ,Conditional Expressions}.) +is evaluated. (@xref{Conditional Exp}.) @item Comparison Expression A relation that is either true or false, such as @samp{(a < b)}. Comparison expressions are used in @code{if}, @code{while}, @code{do}, and @code{for} statements, and in patterns to select which input records to process. -(@xref{Typing and Comparison, ,Variable Typing and Comparison Expressions}.) +(@xref{Typing and Comparison}.) @item Curly Braces The characters @samp{@{} and @samp{@}}. Curly braces are used in @@ -26479,7 +26787,7 @@ are interested in processing, and what to do when that data is seen. @item Data Objects These are numbers and strings of characters. Numbers are converted into strings and vice versa, as needed. -(@xref{Conversion, ,Conversion of Strings and Numbers}.) +(@xref{Conversion}.) @item Deadlock The situation in which two communicating processes are each waiting @@ -26495,7 +26803,7 @@ numbers, but operations on them are sometimes more expensive. This is the way A dynamic regular expression is a regular expression written as an ordinary expression. It could be a string constant, such as @code{"foo"}, but it may also be an expression whose value can vary. -(@xref{Computed Regexps, , Using Dynamic Regexps}.) +(@xref{Computed Regexps}.) @item Environment A collection of strings, of the form @var{name@code{=}val}, that each @@ -26530,9 +26838,9 @@ separated by whitespace (or by a separator regexp that you can change by setting the built-in variable @code{FS}). Such pieces are called fields. If the pieces are of fixed length, you can use the built-in variable @code{FIELDWIDTHS} to describe their lengths. -(@xref{Field Separators, ,Specifying How Fields Are Separated}, +(@xref{Field Separators}, and -@ref{Constant Size, ,Reading Fixed-Width Data}.) +@ref{Constant Size}.) @item Flag A variable whose truth value indicates the existence or nonexistence @@ -26548,7 +26856,7 @@ Format strings are used to control the appearance of output in the @code{strftime} and @code{sprintf} functions, and are used in the @code{printf} statement as well. Also, data conversions from numbers to strings are controlled by the format string contained in the built-in variable -@code{CONVFMT}. (@xref{Control Letters, ,Format-Control Letters}.) +@code{CONVFMT}. (@xref{Control Letters}.) @item Free Documentation License This document describes the terms under which this @value{DOCUMENT} @@ -26580,7 +26888,7 @@ The GNU implementation of @command{awk}. @cindex GNU General Public License @item General Public License This document describes the terms under which @command{gawk} and its source -code may be distributed. (@xref{Copying, ,GNU General Public License}.) +code may be distributed. (@xref{Copying}.) @item GMT ``Greenwich Mean Time.'' @@ -26623,7 +26931,7 @@ out of a running program. @item Input Record A single chunk of data that is read in by @command{awk}. Usually, an @command{awk} input record consists of one line of text. -(@xref{Records, ,How Input Is Split into Records}.) +(@xref{Records}.) @item Integer A whole number, i.e., a number that does not have a fractional part. @@ -26743,7 +27051,7 @@ rules. A pattern is an arbitrary conditional expression against which input is tested. If the condition is satisfied, the pattern is said to @dfn{match} the input record. A typical pattern might compare the input record against -a regular expression. (@xref{Pattern Overview, ,Pattern Elements}.) +a regular expression. (@xref{Pattern Overview}.) @item POSIX The name for a series of standards @@ -26763,12 +27071,12 @@ without explicit parentheses. Variables and/or functions that are meant for use exclusively by library functions and not for the main @command{awk} program. Special care must be taken when naming such variables and functions. -(@xref{Library Names, , Naming Library Function Global Variables}.) +(@xref{Library Names}.) @item Range (of input lines) A sequence of consecutive lines from the input file(s). A pattern can specify ranges of input lines for @command{awk} to process or it can -specify single lines. (@xref{Pattern Overview, ,Pattern Elements}.) +specify single lines. (@xref{Pattern Overview}.) @item Recursion When a function calls itself, either directly or indirectly. @@ -26782,8 +27090,8 @@ You can redirect the output of the @code{print} and @code{printf} statements to a file or a system command, using the @samp{>}, @samp{>>}, @samp{|}, and @samp{|&} operators. You can redirect input to the @code{getline} statement using the @samp{<}, @samp{|}, and @samp{|&} operators. -(@xref{Redirection, ,Redirecting Output of @code{print} and @code{printf}}, -and @ref{Getline, ,Explicit Input with @code{getline}}.) +(@xref{Redirection}, +and @ref{Getline}.) @item Regexp Short for @dfn{regular expression}. A regexp is a pattern that denotes a @@ -26791,7 +27099,7 @@ set of strings, possibly an infinite set. For example, the regexp @samp{R.*xp} matches any string starting with the letter @samp{R} and ending with the letters @samp{xp}. In @command{awk}, regexps are used in patterns and in conditional expressions. Regexps may contain -escape sequences. (@xref{Regexp, ,Regular Expressions}.) +escape sequences. (@xref{Regexp}.) @item Regular Expression See ``regexp.'' @@ -26800,7 +27108,7 @@ See ``regexp.'' A regular expression constant is a regular expression written within slashes, such as @code{/foo/}. This regular expression is chosen when you write the @command{awk} program and cannot be changed during -its execution. (@xref{Regexp Usage, ,How to Use Regular Expressions}.) +its execution. (@xref{Regexp Usage}.) @item Rule A segment of an @command{awk} program that specifies how to process single @@ -26838,13 +27146,13 @@ The nature of the @command{awk} logical operators @samp{&&} and @samp{||}. If the value of the entire expression is determinable from evaluating just the lefthand side of these operators, the righthand side is not evaluated. -(@xref{Boolean Ops, ,Boolean Expressions}.) +(@xref{Boolean Ops}.) @item Side Effect A side effect occurs when an expression has an effect aside from merely producing a value. Assignment expressions, increment and decrement expressions, and function calls have side effects. -(@xref{Assignment Ops, ,Assignment Expressions}.) +(@xref{Assignment Ops}.) @item Single-Precision An internal representation of numbers that can have fractional parts. @@ -26859,7 +27167,7 @@ The character generated by hitting the space bar on the keyboard. @item Special File A @value{FN} interpreted internally by @command{gawk}, instead of being handed directly to the underlying operating system---for example, @file{/dev/stderr}. -(@xref{Special Files, ,Special @value{FFN}s in @command{gawk}}.) +(@xref{Special Files}.) @item Stream Editor A program that reads records from an input stream and processes them one @@ -26915,7 +27223,7 @@ A sequence of space, TAB, or newline characters occurring inside an input record or a string. @end table -@node Copying, GNU Free Documentation License, Glossary, Top +@node Copying @unnumbered GNU General Public License @center Version 2, June 1991 @@ -27770,7 +28078,7 @@ to permit their use in free software. @c End: -@node Index, , GNU Free Documentation License, Top +@node Index @unnumbered Index @printindex cp diff --git a/doc/gawkinet.info b/doc/gawkinet.info index 5a010dbb..db8f239f 100644 --- a/doc/gawkinet.info +++ b/doc/gawkinet.info @@ -1,7 +1,7 @@ This is gawkinet.info, produced by makeinfo version 4.5 from gawkinet.texi. -INFO-DIR-SECTION Text creation and manipulation +INFO-DIR-SECTION Network applications START-INFO-DIR-ENTRY * Gawkinet: (gawkinet). TCP/IP Internetworking With `gawk'. END-INFO-DIR-ENTRY @@ -1488,7 +1488,7 @@ is the code: PARAM[i] = _CGI_decode(PARAM[i]) j = index(PARAM[i], "=") GETARG[substr(PARAM[i], 1, j-1)] = \ - substr(PARAM[i], j+1) + substr(PARAM[i], j+1) } } else { # there is no "?", no need for splitting PARAMs split(uri, MENU, "[/:]") @@ -4331,57 +4331,57 @@ Index Tag Table: -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 +Node: Top2004 +Node: Preface5697 +Node: Introduction7075 +Node: Stream Communications8099 +Node: Datagram Communications9267 +Node: The TCP/IP Protocols10893 +Ref: The TCP/IP Protocols-Footnote-111572 +Node: Basic Protocols11729 +Node: Ports13037 +Node: Making Connections14433 +Ref: Making Connections-Footnote-117009 +Ref: Making Connections-Footnote-217056 +Node: Using Networking17237 +Node: Gawk Special Files19590 +Node: Special File Fields21589 +Node: Comparing Protocols26895 +Node: File /inet/tcp27475 +Node: File /inet/udp28488 +Node: File /inet/raw29596 +Ref: File /inet/raw-Footnote-132616 +Node: TCP Connecting32696 +Node: Troubleshooting35029 +Ref: Troubleshooting-Footnote-138080 +Node: Interacting38623 +Node: Setting Up41348 +Node: Email44837 +Node: Web page47158 +Ref: Web page-Footnote-149958 +Node: Primitive Service50155 +Node: Interacting Service52884 +Ref: Interacting Service-Footnote-162008 +Node: CGI Lib62040 +Node: Simple Server69029 +Ref: Simple Server-Footnote-176762 +Node: Caveats76863 +Node: Challenges78000 +Node: Some Applications and Techniques86659 +Node: PANIC89115 +Node: GETURL90828 +Node: REMCONF93446 +Node: URLCHK98917 +Node: WEBGRAB102747 +Node: STATIST107192 +Ref: STATIST-Footnote-1118893 +Node: MAZE119338 +Node: MOBAGWHO125518 +Ref: MOBAGWHO-Footnote-1139454 +Node: STOXPRED139509 +Node: PROTBASE153784 +Node: Links166875 +Node: GNU Free Documentation License170308 +Node: Index192713 End Tag Table diff --git a/doc/gawkinet.texi b/doc/gawkinet.texi index 0573c8f5..f75d338b 100644 --- a/doc/gawkinet.texi +++ b/doc/gawkinet.texi @@ -1,11 +1,11 @@ -\input texinfo @c -*-texinfo-*- +\input texinfo @c -*-texinfo-*- @c %**start of header (This is for running Texinfo on a region.) @setfilename gawkinet.info @settitle TCP/IP Internetworking With @command{gawk} @c %**end of header (This is for running Texinfo on a region.) @c FIXME: web vs. Web -@dircategory Text creation and manipulation +@dircategory Network applications @direntry * Gawkinet: (gawkinet). TCP/IP Internetworking With `gawk'. @end direntry @@ -1151,10 +1151,10 @@ DATE-(UTC)-TIME LAT LON DEP MAG COMMENTS yy/mm/dd hh:mm:ss deg. deg. km 98/12/14 21:09:22 37.47N 116.30W 0.0 2.3Md 76.4 km S of WARM SPRINGS, NEVA -98/12/14 22:05:09 39.69N 120.41W 11.9 2.1Md 53.8 km WNW of RENO, NEVADA -98/12/15 14:14:19 38.04N 118.60W 2.0 2.3Md 51.0 km S of HAWTHORNE, NEVADA +98/12/14 22:05:09 39.69N 120.41W 11.9 2.1Md 53.8 km WNW of RENO, NEVADA +98/12/15 14:14:19 38.04N 118.60W 2.0 2.3Md 51.0 km S of HAWTHORNE, NEVADA 98/12/17 01:49:02 36.06N 117.58W 13.9 3.0Md 74.9 km SE of LONE PINE, CALIFOR -98/12/17 05:39:26 39.95N 120.87W 6.2 2.6Md 101.6 km WNW of RENO, NEVADA +98/12/17 05:39:26 39.95N 120.87W 6.2 2.6Md 101.6 km WNW of RENO, NEVADA 98/12/22 06:07:42 38.68N 119.82W 5.2 2.3Md 50.7 km S of CARSON CITY, NEVAD @end smallexample @@ -1235,7 +1235,7 @@ BEGIN @{ @end example Now open another window on the same machine. -Copy the client program given as the first example +Copy the client program given as the first example (@pxref{TCP Connecting, ,Establishing a TCP Connection}) to a new file and edit it, changing the name @samp{daytime} to @samp{8888}. Then start the modified client. You should get a reply @@ -1626,7 +1626,7 @@ BEGIN @{ # stop talking to this client close(HttpService) # wait for new client request - HttpService |& getline + HttpService |& getline # do some logging print systime(), strftime(), $0 # read request parameters @@ -1706,8 +1706,8 @@ function CGI_setup( method, uri, version, i) @{ @group if (i > 0) @{ split(substr($2, 1, i-1), MENU, "[/:]") - split(substr($2, i+1), PARAM, "&") - for (i in PARAM) @{ + split(substr($2, i+1), PARAM, "&") + for (i in PARAM) @{ j = index(PARAM[i], "=") GETARG[substr(PARAM[i], 1, j-1)] = \ substr(PARAM[i], j+1) @@ -1874,7 +1874,7 @@ BEGIN @{ print "Content-length:", len |& HttpService print ORS Prompt |& HttpService # ignore all the header lines - while ((HttpService |& getline) > 0) + while ((HttpService |& getline) > 0) continue # stop talking to this client close(HttpService) @@ -1903,7 +1903,7 @@ function CGI_setup( method, uri, version, i) PARAM[i] = _CGI_decode(PARAM[i]) j = index(PARAM[i], "=") GETARG[substr(PARAM[i], 1, j-1)] = \ - substr(PARAM[i], j+1) + substr(PARAM[i], j+1) @} @} else @{ # there is no "?", no need for splitting PARAMs split(uri, MENU, "[/:]") @@ -1983,13 +1983,13 @@ And this is the result when we run it: @c artificial line wrap in last output line @example -$ gawk -f testserv.awk +$ gawk -f testserv.awk @print{} MENU["4"] = www.gnu.org @print{} MENU["5"] = cgi-bin @print{} MENU["6"] = foo @print{} MENU["1"] = http -@print{} MENU["2"] = -@print{} MENU["3"] = +@print{} MENU["2"] = +@print{} MENU["3"] = @print{} PARAM["1"] = p1=stuff @print{} PARAM["2"] = p2=stuff&junk @print{} PARAM["3"] = percent=a % sign @@ -2139,7 +2139,7 @@ function ElizaSays(YouSay) @{ if (w == "-") @{ # no keyword, take old subject w = wold subj = subjold - @} else @{ # find subject + @} else @{ # find subject subj = substr(q, index(q, w) + length(w)+1) wold = w subjold = subj # remember keyword and subject @@ -2317,7 +2317,7 @@ function SetUpEliza() @{ @example @c file eg/network/eliza.awk # table for looking up answers that - # fit to a certain keyword + # fit to a certain keyword k["CAN YOU"] = "1 2 3" k["CAN I"] = "4 5" k["YOU ARE"] =\ @@ -2425,7 +2425,7 @@ Studies to underwrite a contest designed to implement the Turing Test. Dr.@: Loebner pledged a Grand Prize of $100,000 for the first computer whose responses were indistinguishable from a human's. Each year an annual prize of $2000 and a bronze medal is awarded to the @emph{most} human computer. -The winner of the annual contest is the best entry relative to other entries +The winner of the annual contest is the best entry relative to other entries that year, irrespective of how good it is in an absolute sense. Here is an example of a conversation with the winning program of 1997: @@ -2524,7 +2524,7 @@ Most however need the ambient abstraction to have a higher floor.@* @dots{}@* Second, inference is merely the expansion of notation. No matter whether the logic that underlies an AI program is fuzzy, probabilistic, deontic, -defeasible, or deductive, the logic merely defines how strings can be +defeasible, or deductive, the logic merely defines how strings can be transformed into other strings. A language that provides the best support for string processing in the end provides the best support for logic, for the exploration of various logics, and for most forms of @@ -2742,7 +2742,7 @@ Serial lines or some kind of keyboard Network connections via @command{telnet} or SNMP @item -HTTP connections with HTML GUIs +HTTP connections with HTML GUIs @end itemize In this @value{SECTION}, we look at a solution that uses HTTP connections @@ -2819,7 +2819,7 @@ function HandleGET() @{ config[GETARG["Param"]] = GETARG["Value"] Document = (GETARG["Param"] " = " GETARG["Value"] ".") @} else @{ - Document = "Parameter <b>" GETARG["Param"] "</b> is invalid." + Document = "Parameter <b>" GETARG["Param"] "</b> is invalid." @} @} else @{ Document = "<FORM method=GET><h4>Change one parameter</h4>\ @@ -3201,9 +3201,9 @@ function HandleGET() @{ <TD><input type=text name=v2 value=" v2 " size=8></TD>\ <TD>2. Count </TD> <TD><input type=text name=n2 value=" n2 " size=8></TD>\ - </TR> <input type=submit value=\"Compute\">\ + </TR> <input type=submit value=\"Compute\">\ </TABLE></FORM><BR>" - @} else if (MENU[2] ~ "Image") @{ + @} else if (MENU[2] ~ "Image") @{ Reason = "OK" ORS "Content-type: image/png" #Reason = "OK" ORS "Content-type: application/x-postscript" #Reason = "OK" ORS "Content-type: image/gif" @@ -4099,7 +4099,7 @@ aligned correctly. Furthermore, we renumber the time instances. The most recent day gets day number 1 and all other days get consecutive numbers. All quotes are rounded toward the nearest whole number in US Dollars. -@smallexample +@smallexample @c file eg/network/stoxpred.awk function CleanUp() @{ # clean up time series; eliminate incomplete data sets @@ -4139,15 +4139,15 @@ function Prediction() @{ for (stock = 1; stock <= StockCount; stock++) @{ if (data[1, stock] > data[2, stock]) @{ predict[stock] = "up" - @} else if (data[1, stock] < data[2, stock]) @{ - predict[stock] = "down" + @} else if (data[1, stock] < data[2, stock]) @{ + predict[stock] = "down" @} else @{ predict[stock] = "neutral" @} if ((data[1, stock] > data[2, stock]) && (data[2, stock] > data[3, stock])) hot[stock] = 1 if ((data[1, stock] < data[2, stock]) && (data[2, stock] < data[3, stock])) - avoid[stock] = 1 + avoid[stock] = 1 @} # Do a plausibility check: how many predictions proved correct? for (s = 1; s <= StockCount; s++) @{ @@ -4158,13 +4158,13 @@ function Prediction() @{ DownCount++ @} else @{ NeutralCount++ - @} + @} if (((data[d, s] > data[d+1, s]) && (data[d+1, s] > data[d+2, s])) || ((data[d, s] < data[d+1, s]) && (data[d+1, s] < data[d+2, s])) || ((data[d, s] == data[d+1, s]) && (data[d+1, s] == data[d+2, s]))) CorrectCount++ - @} - @} + @} + @} @} @c endfile @end smallexample @@ -4181,7 +4181,7 @@ function Report() @{ report = "\nThis is your daily " report = report "stock market report for "strftime("%A, %B %d, %Y")".\n" report = report "Here are the predictions for today:\n\n" - for (stock = 1; stock <= StockCount; stock++) + for (stock = 1; stock <= StockCount; stock++) report = report "\t" name[stock] "\t" predict[stock] "\n" for (stock in hot) @{ if (HotCount++ == 0) @@ -4194,7 +4194,7 @@ function Report() @{ report = report "\nThe stock shares to avoid today are these:\n\n" report = report "\t" name[stock] "\t\thttp://biz.yahoo.com/n/" \ tolower(substr(name[stock], 1, 1)) "/" tolower(name[stock]) ".html\n" - @} + @} report = report "\nThis sums up to " HotCount+0 " winners and " AvoidCount+0 report = report " losers. When using this kind\nof prediction scheme for" report = report " the 12 months which lie behind us,\nwe get " UpCount @@ -4208,7 +4208,7 @@ function Report() @{ report = report "market, this report is, of course, complete nonsense.\n" report = report "If you are stupid enough to believe these predictions\n" report = report "you should visit a doctor who can treat your ailment." -@} +@} @c endfile @end smallexample @@ -4218,7 +4218,7 @@ email message with a proper subject heading and is addressed with his full name. @smallexample @c file eg/network/stoxpred.awk -function SendMail() @{ +function SendMail() @{ # send report to customers customer["uncle.scrooge@@ducktown.gov"] = "Uncle Scrooge" customer["more@@utopia.org" ] = "Sir Thomas More" @@ -4233,7 +4233,7 @@ function SendMail() @{ print report "\n.\n" | MailPipe close(MailPipe) @} -@} +@} @c endfile @end smallexample @@ -4261,7 +4261,7 @@ Stock prices are fixed when supply and demand meet each other. What people are willing to pay reflects human expectations. Human expectations are not necessarily random. On the Internet, you can find an elucidating paper about predictability and human -expectations: +expectations: @uref{http://it.ucsd.edu/IT/Newsletter/archives/meir/05meir.html, @cite{Reflections on ``Universal Prediction of Individual Sequences''}} The authors (Feder, Merhav, Gutman) introduce the reader to the subject @@ -4287,7 +4287,7 @@ In any event, the success of both these machines against ``untrained'' human opponents was explained by the fact that the human opponents cannot draw completely random bits. -@end quotation +@end quotation @end ignore @node PROTBASE, , STOXPRED, Some Applications and Techniques @@ -4373,12 +4373,12 @@ Sequences are expected to be represented in the standard IUB/IUPAC amino acid and nucleic acid codes, with these exceptions: lower-case letters are accepted and are mapped into upper-case; a single hyphen or dash can be used to represent a gap -of indeterminate length; and in amino acid sequences, @samp{U} and @samp{*} +of indeterminate length; and in amino acid sequences, @samp{U} and @samp{*} are acceptable letters (see below). Before submitting a request, any numerical -digits in the query sequence should either be removed or replaced by +digits in the query sequence should either be removed or replaced by appropriate letter codes (e.g., @samp{N} for unknown nucleic acid residue or @samp{X} for unknown amino acid residue). -The nucleic acid codes supported are: +The nucleic acid codes supported are: @example A --> adenosine M --> A C (amino) @@ -4389,7 +4389,7 @@ U --> uridine D --> G A T R --> G A (purine) H --> A C T Y --> T C (pyrimidine) V --> G C A K --> G T (keto) N --> A G C T (any) - - gap of indeterminate length + - gap of indeterminate length @end example Now you know the alphabet of nucleotide sequences. The last two lines @@ -4397,7 +4397,7 @@ of the following example query show you such a sequence, which is obviously made up only of elements of the alphabet just described. Store this example query into a file named @file{protbase.request}. You are now ready to send it to the server with the demonstration client. - + @example @c file eg/network/protbase.request PROGRAM blastn @@ -4407,7 +4407,7 @@ BEGIN >GAWK310 the gawking gene GNU AWK tgcttggctgaggagccataggacgagagcttcctggtgaagtgtgtttcttgaaatcat caccaccatggacagcaaa -@c endfile +@c endfile @end example @cindex FASTA/Pearson format @@ -4421,7 +4421,7 @@ mandatory @samp{BEGIN} directive, followed by the query sequence in FASTA/Pearson format. Each line of information must be less than 80 characters in length. -The ``month'' database contains all new or revised sequences released in the +The ``month'' database contains all new or revised sequences released in the last 30 days and is useful for searching against new sequences. There are five different blast programs, @command{blastn} being the one that compares a nucleotide query sequence against a nucleotide sequence database. @@ -4453,7 +4453,7 @@ END @{ BLASTService = "/inet/tcp/0/www.ncbi.nlm.nih.gov/80" printf "POST /cgi-bin/BLAST/nph-blast_report HTTP/1.0\n" |& BLASTService printf "Content-Length: " length(request) "\n\n" |& BLASTService - printf request |& BLASTService + printf request |& BLASTService while ((BLASTService |& getline) > 0) print $0 close(BLASTService) @@ -4500,7 +4500,7 @@ via the NCBI server. The syntax of sequence header lines used by the NCBI BLAST server depends on the database from which each sequence was obtained. The table below lists the identifiers for the databases from which the sequences were derived. - + @ifinfo @example Database Name Identifier Syntax @@ -4513,8 +4513,8 @@ Protein Research Foundation prf||name SWISS-PROT sp|accession|entry name Brookhaven Protein Data Bank pdb|entry|chain Kabat's Sequences of Immuno@dots{} gnl|kabat|identifier -Patents pat|country|number -GenInfo Backbone Id bbs|number +Patents pat|country|number +GenInfo Backbone Id bbs|number @end example @end ifinfo @@ -4533,7 +4533,7 @@ GenInfo Backbone Id bbs|number @end multitable @end ifnotinfo - + For example, an identifier might be @samp{gb|AC021182.14|AC021182}, where the @samp{gb} tag indicates that the identifier refers to a GenBank sequence, @samp{AC021182.14} is its GenBank ACCESSION, and @samp{AC021182} is the GenBank LOCUS. @@ -4556,7 +4556,7 @@ the first of them. Query: 35 tggtgaagtgtgtttcttg 53 ||||||||||||||||||| Sbjct: 69786 tggtgaagtgtgtttcttg 69804 -@end smallexample +@end smallexample This alignment was located on the human chromosome 7. The fragment on which part of the query was found had a total length of 176383. Only 19 of the @@ -4625,25 +4625,25 @@ They are presented in the order in which they appear. @item GNUPlot @uref{http://www.cs.dartmouth.edu/gnuplot_info.html} -@item Mark Humphrys' Eliza page +@item Mark Humphrys' Eliza page @uref{http://www.compapp.dcu.ie/~humphrys/eliza.html} -@item Yahoo! Eliza Information +@item Yahoo! Eliza Information @uref{http://dir.yahoo.com/Recreation/Games/Computer_Games/Internet_Games/Web_Games/Artificial_Intelligence} -@item Java versions of Eliza +@item Java versions of Eliza @uref{http://www.tjhsst.edu/Psych/ch1/eliza.html} -@item Java versions of Eliza with source code +@item Java versions of Eliza with source code @uref{http://home.adelphia.net/~lifeisgood/eliza/eliza.htm} -@item Eliza Programs with Explanations +@item Eliza Programs with Explanations @uref{http://chayden.net/chayden/eliza/Eliza.shtml} @item Loebner Contest @uref{http://acm.org/~loebner/loebner-prize.htmlx} -@item Tck/Tk Information +@item Tck/Tk Information @uref{http://www.scriptics.com/} @item Intel 80x86 Processors @@ -4652,7 +4652,7 @@ They are presented in the order in which they appear. @item AMD Elan Processors @uref{http://www.amd.com/products/epd/processors/4.32bitcont/32bitcont/index.html} -@item XINU +@item XINU @uref{http://willow.canberra.edu.au/~chrisc/xinu.html } @item GNU/Linux @@ -4661,7 +4661,7 @@ They are presented in the order in which they appear. @item Embedded PCs @uref{http://dir.yahoo.com/Business_and_Economy/Business_to_Business/Computers/Hardware/Embedded_Control/} -@item MiniSQL +@item MiniSQL @uref{http://www.hughes.com.au/library/} @item Market Share Surveys @@ -4676,7 +4676,7 @@ They are presented in the order in which they appear. @item The VRML FAQ @uref{http://www.vrml.org/technicalinfo/specifications/specifications.htm#FAQ} -@item The UMBC Agent Web +@item The UMBC Agent Web @uref{http://www.cs.umbc.edu/agents } @item Apache Web Server diff --git a/doc/pgawk.1 b/doc/pgawk.1 deleted file mode 100644 index d2b3f4f0..00000000 --- a/doc/pgawk.1 +++ /dev/null @@ -1 +0,0 @@ -.so gawk.1 diff --git a/doc/texinfo.tex b/doc/texinfo.tex index 555a0770..e9293f3b 100644 --- a/doc/texinfo.tex +++ b/doc/texinfo.tex @@ -3,7 +3,7 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2003-02-03.16} +\def\texinfoversion{2003-05-04.08} % % Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. @@ -34,12 +34,12 @@ % ftp://tug.org/tex/texinfo.tex % (and all CTAN mirrors, see http://www.ctan.org), % and /home/gd/gnu/doc/texinfo.tex on the GNU machines. -% +% % The GNU Texinfo home page is http://www.gnu.org/software/texinfo. -% +% % The texinfo.tex in any given Texinfo distribution could well be out % of date, so if that's what you're using, please check. -% +% % Send bug reports to bug-texinfo@gnu.org. Please include including a % complete document in each bug report with which we can reproduce the % problem. Patches are, of course, greatly appreciated. @@ -55,7 +55,7 @@ % The extra TeX runs get the cross-reference information correct. % Sometimes one run after texindex suffices, and sometimes you need more % than two; texi2dvi does it as many times as necessary. -% +% % It is possible to adapt texinfo.tex for other languages, to some % extent. You can get the existing language-specific files from the % full Texinfo distribution. @@ -71,11 +71,11 @@ \message{Basics,} \chardef\other=12 -% We never want plain's outer \+ definition in Texinfo. +% We never want plain's \outer definition of \+ in Texinfo. % For @tex, we can use \tabalign. \let\+ = \relax -% Save some parts of plain tex whose names we will redefine. +% Save some plain tex macros whose names we will redefine. \let\ptexb=\b \let\ptexbullet=\bullet \let\ptexc=\c @@ -88,10 +88,12 @@ \let\ptexgtr=> \let\ptexhat=^ \let\ptexi=\i +\let\ptexindent=\indent \let\ptexlbrace=\{ \let\ptexless=< \let\ptexplus=+ \let\ptexrbrace=\} +\let\ptexslash=\/ \let\ptexstar=\* \let\ptext=\t @@ -164,8 +166,9 @@ % Hyphenation fixes. \hyphenation{ap-pen-dix} -\hyphenation{mini-buf-fer mini-buf-fers} \hyphenation{eshell} +\hyphenation{mini-buf-fer mini-buf-fers} +\hyphenation{time-stamp} \hyphenation{white-space} % Margin to add to right of even pages, to left of odd pages. @@ -202,7 +205,7 @@ % add check for \lastpenalty to plain's definitions. If the last thing % we did was a \nobreak, we don't want to insert more space. -% +% \def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount \removelastskip\penalty-50\smallskip\fi\fi} \def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount @@ -536,6 +539,9 @@ % @* forces a line break. \def\*{\hfil\break\hbox{}\ignorespaces} +% @/ allows a line break. +\let\/=\allowbreak + % @. is an end-of-sentence period. \def\.{.\spacefactor=3000 } @@ -564,7 +570,7 @@ % 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} % @@ -721,8 +727,7 @@ where each line of input produces a line of output.} \spacefactor=3000 } - -% @page forces the start of a new page +% @page forces the start of a new page. % \def\page{\par\vfill\supereject} @@ -771,10 +776,10 @@ where each line of input produces a line of output.} % @inmargin{TEXT [, RIGHT-TEXT]} % (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right; % else use TEXT for both). -% +% \def\inmargin#1{\parseinmargin #1,,\finish} \def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing. - \setbox0 = \hbox{\ignorespaces #2}% + \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0 > 0pt \def\lefttext{#1}% have both texts \def\righttext{#2}% @@ -843,8 +848,9 @@ where each line of input produces a line of output.} % @paragraphindent NCHARS % We'll use ems for NCHARS, close enough. -% We cannot implement @paragraphindent asis, though. -% +% NCHARS can also be the word `asis' or `none'. +% We cannot feasibly implement @paragraphindent asis, though. +% \def\asisword{asis} % no translation, these are keywords \def\noneword{none} % @@ -879,6 +885,53 @@ where each line of input produces a line of output.} \fi } +% @firstparagraphindent WORD +% If WORD is `none', then suppress indentation of the first paragraph +% after a section heading. If WORD is `insert', then do indentat such +% paragraphs. +% +% The paragraph indentation is suppressed or not by calling +% \suppressfirstparagraphindent, which the sectioning commands do. We +% switch the definition of this back and forth according to WORD. By +% default, we suppress indentation. +% +\def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent} +\newdimen\currentparindent +% +\def\insertword{insert} +% +\def\firstparagraphindent{\parsearg\dofirstparagraphindent} +\def\dofirstparagraphindent#1{% + \def\temp{#1}% + \ifx\temp\noneword + \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent + \else\ifx\temp\insertword + \let\suppressfirstparagraphindent = \relax + \else + \errhelp = \EMsimple + \errmessage{Unknown @firstparagraphindent option `\temp'}% + \fi\fi +} + +% Here is how we actually suppress indentation. Redefine \everypar to +% \kern backwards by \parindent, and then reset itself to empty. +% +% We also make \indent itself not actually do anything until the next +% paragraph. +% +\gdef\dosuppressfirstparagraphindent{% + \gdef\indent{% + \global\let\indent=\ptexindent + \global\everypar = {}% + }% + \global\everypar = {% + \kern-\parindent + \global\let\indent=\ptexindent + \global\everypar = {}% + }% +}% + + % @asis just yields its argument. Used with @table, for example. % \def\asis#1{#1} @@ -887,14 +940,14 @@ where each line of input produces a line of output.} % We don't use $'s directly in the definition of \math because we need % to set catcodes according to plain TeX first, to allow for subscripts, % superscripts, special math chars, etc. -% +% \let\implicitmath = $%$ font-lock fix % % One complication: _ usually means subscripts, but it could also mean % an actual _ character, as in @math{@var{some_variable} + 1}. So make % _ within @math be active (mathcode "8000), and distinguish by seeing % if the current family is \slfam, which is what @var uses. -% +% {\catcode\underChar = \active \gdef\mathunderscore{% \catcode\underChar=\active @@ -905,7 +958,7 @@ where each line of input produces a line of output.} % FYI, plain.tex uses \\ as a temporary control sequence (why?), but % this is not advertised and we don't care. Texinfo does not % otherwise define @\. -% +% % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\. \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi} % @@ -920,7 +973,7 @@ where each line of input produces a line of output.} % 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 @@ -1046,8 +1099,8 @@ where each line of input produces a line of output.} \def\pdfmakeoutlines{{% \openin 1 \jobname.toc \ifeof 1\else\begingroup - \closein 1 - % Thanh's hack / proper braces in bookmarks + \closein 1 + % Thanh's hack / proper braces in bookmarks \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace % @@ -1076,7 +1129,7 @@ where each line of input produces a line of output.} \let\unnumbsubsubsecentry = \subsubsecentry % % Make special characters normal for writing to the pdf file. - % + % \indexnofonts \let\tt=\relax \turnoffactive @@ -1091,7 +1144,7 @@ where each line of input produces a line of output.} \let\nextmakelinks=\makelinks \ifnum\lnkcount>0,\fi \picknum{#1}% - \startlink attr{/Border [0 0 0]} + \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{\the\pgn}}% \linkcolor #1% \advance\lnkcount by 1% @@ -1146,7 +1199,7 @@ where each line of input produces a line of output.} \ifx\first0\adn0 \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 - \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 + \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 \else \ifnum0=\countA\else\makelink\fi \ifx\first.\let\next=\done\else @@ -1400,12 +1453,12 @@ where each line of input produces a line of output.} % 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. @@ -1431,7 +1484,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\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else + \ptexslash\fi\fi\fi} \def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx} \def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx} @@ -1454,7 +1508,7 @@ where each line of input produces a line of output.} % 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 @@ -1563,7 +1617,7 @@ where each line of input produces a line of output.} \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% \else \errhelp = \EMsimple - \errmessage{Unknown @kbdinputstyle `\arg'}% + \errmessage{Unknown @kbdinputstyle option `\arg'}% \fi\fi\fi } \def\worddistinct{distinct} @@ -1614,7 +1668,7 @@ where each line of input produces a line of output.} % rms does not like angle brackets --karl, 17may97. % So now @email is just like @uref, unless we are pdf. -% +% %\def\email#1{\angleleft{\tt #1}\angleright} \ifpdf \def\email#1{\doemail#1,,\finish} @@ -1659,6 +1713,16 @@ where each line of input produces a line of output.} % @pounds{} is a sterling sign. \def\pounds{{\it\$}} +% @registeredsymbol - R in a circle. For now, only works in text size; +% we'd have to redo the font mechanism to change the \scriptstyle and +% \scriptscriptstyle font sizes to make it look right in headings. +% Adapted from the plain.tex definition of \copyright. +% +\def\registeredsymbol{% + $^{{\ooalign{\hfil\raise.07ex\hbox{$\scriptstyle\rm R$}\hfil\crcr\Orb}}% + }$% +} + \message{page headings,} @@ -2071,18 +2135,21 @@ where each line of input produces a line of output.} \itemizey {#1}{\Eitemize} } -\def\itemizey #1#2{% -\aboveenvbreak % -\itemmax=\itemindent % -\advance \itemmax by -\itemmargin % -\advance \leftskip by \itemindent % -\exdentamount=\itemindent -\parindent = 0pt % -\parskip = \smallskipamount % -\ifdim \parskip=0pt \parskip=2pt \fi% -\def#2{\endgraf\afterenvbreak\endgroup}% -\def\itemcontents{#1}% -\let\item=\itemizeitem} +\def\itemizey#1#2{% + \aboveenvbreak + \itemmax=\itemindent + \advance\itemmax by -\itemmargin + \advance\leftskip by \itemindent + \exdentamount=\itemindent + \parindent=0pt + \parskip=\smallskipamount + \ifdim\parskip=0pt \parskip=2pt \fi + \def#2{\endgraf\afterenvbreak\endgroup}% + \def\itemcontents{#1}% + % @itemize with no arg is equivalent to @itemize @bullet. + \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi + \let\item=\itemizeitem +} % \splitoff TOKENS\endmark defines \first to be the first token in % TOKENS, and \rest to be the remainder. @@ -2493,12 +2560,12 @@ width0pt\relax} \fi % @deffn ... % @end deffn % @end ignore -% +% % The @end deffn is going to get expanded, because we're trying to allow % nested conditionals. But we don't want to expand the actual @deffn, % since it might be syntactically correct and intended to be ignored. % Since \end checks for \relax, using \empty does not cause an error. -% +% \def\ignoremorecommands{% \let\defcodeindex = \relax \let\defcv = \empty @@ -2903,10 +2970,10 @@ width0pt\relax} \fi % @synindex foo bar makes index foo feed into index bar. % Do this instead of @defindex foo if you don't want it as a separate index. -% +% % @syncodeindex foo bar similar, but put all entries made for index foo % inside @code. -% +% \def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}} \def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}} @@ -2948,13 +3015,13 @@ width0pt\relax} \fi % 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\@{@}% 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. + % braces and backslashes are used only as delimiters. \let\{ = \mylbrace \let\} = \myrbrace % @@ -2963,14 +3030,14 @@ width0pt\relax} \fi % 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}% }% @@ -2983,9 +3050,9 @@ width0pt\relax} \fi } % For the aux file, @ is the escape character. So we want to redefine -% everything using @ instead of \realbackslash. When everything uses +% everything using @ instead of \realbackslash. When everything uses % @, this will be simpler. -% +% \def\atdummies{% \def\@{@@}% \def\ {@ }% @@ -3006,7 +3073,7 @@ width0pt\relax} \fi % Called from \indexdummies and \atdummies. \definedummyword and % \definedummyletter must be defined first. -% +% \def\commondummies{% % \normalturnoffactive @@ -3326,6 +3393,7 @@ width0pt\relax} \fi % \smallfonts \rm \tolerance = 9500 + \everypar = {}% don't want the \kern\-parindent from indentation suppression. \indexbreaks % % See if the index file exists and is nonempty. @@ -3569,7 +3637,7 @@ width0pt\relax} \fi \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}% } -% +% % All done with double columns. \def\enddoublecolumns{% \output = {% @@ -3707,6 +3775,7 @@ width0pt\relax} \fi \numberedsubsubseczzz{#2} \fi \fi +\suppressfirstparagraphindent } % like \numhead, but chooses appendix heading levels @@ -3726,6 +3795,7 @@ width0pt\relax} \fi \appendixsubsubseczzz{#2} \fi \fi +\suppressfirstparagraphindent } % like \numhead, but chooses numberless heading levels @@ -3745,6 +3815,7 @@ width0pt\relax} \fi \unnumberedsubsubseczzz{#2} \fi \fi +\suppressfirstparagraphindent } % @chapter, @appendix, @unnumbered. @@ -4357,7 +4428,7 @@ width0pt\relax} \fi % @foo ... @end foo. % @point{}, @result{}, @expansion{}, @print{}, @equiv{}. -% +% % Since these characters are used in examples, it should be an even number of % \tt widths. Each \tt character is 1en, so two makes it 1em. % @@ -4369,7 +4440,7 @@ width0pt\relax} \fi % The @error{} command. % Adapted from the TeXbook's \boxit. -% +% \newbox\errorbox % {\tentt \global\dimen0 = 3em}% Width of the box. @@ -4416,9 +4487,11 @@ width0pt\relax} \fi \let\equiv=\ptexequiv \let\!=\ptexexclam \let\i=\ptexi + \let\indent=\ptexindent \let\{=\ptexlbrace \let\+=\tabalign \let\}=\ptexrbrace + \let\/=\ptexslash \let\*=\ptexstar \let\t=\ptext % @@ -4668,7 +4741,7 @@ width0pt\relax} \fi % LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>} -% If we want to allow any <char> as delimiter, +% If we want to allow any <char> as delimiter, % we need the curly braces so that makeinfo sees the @verb command, eg: % `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org % @@ -4746,8 +4819,8 @@ width0pt\relax} \fi \everypar{\starttabbox}% } -% Do the @verb magic: verbatim text is quoted by unique -% delimiter characters. Before first delimiter expect a +% Do the @verb magic: verbatim text is quoted by unique +% delimiter characters. Before first delimiter expect a % right brace, after last delimiter expect closing brace: % % \def\doverb'{'<char>#1<char>'}'{#1} @@ -4766,7 +4839,7 @@ width0pt\relax} \fi % % \def\doverbatim#1@end verbatim{#1} % -% For Texinfo it's a lot easier than for LaTeX, +% 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 '}'. % @@ -4833,14 +4906,14 @@ width0pt\relax} \fi % @copying ... @end copying. % Save the text away for @insertcopying later. Many commands won't be % allowed in this context, but that's ok. -% +% % We save the uninterpreted tokens, rather than creating a box. % Saving the text in a box would be much easier, but then all the % typesetting commands (@smallbook, font changes, etc.) have to be done % beforehand -- and a) we want @copying to be done first in the source % file; b) letting users define the frontmatter in as flexible order as % possible is very desirable. -% +% \def\copying{\begingroup % Define a command to swallow text until we reach `@end copying'. % \ is the escape char in this texinfo.tex file, so it is the @@ -4863,15 +4936,15 @@ width0pt\relax} \fi % 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. @@ -4912,7 +4985,7 @@ width0pt\relax} \fi \newcount\parencount % We want ()&[] to print specially on the defun line. -% +% \def\activeparens{% \catcode`\(=\active \catcode`\)=\active \catcode`\&=\active @@ -5015,7 +5088,7 @@ width0pt\relax} \fi % #1 is the \E... control sequence to end the definition (which we define). % #2 is the \...x control sequence (which our caller defines). % #3 is the control sequence to process the header, such as \defunheader. -% +% \def\parsebodycommon#1#2#3{% \begingroup\inENV % If there are two @def commands in a row, we'll have a \nobreak, @@ -5038,7 +5111,7 @@ width0pt\relax} \fi } % 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. @@ -5089,7 +5162,7 @@ width0pt\relax} \fi % to account for this both in the \...x definition and in parsing the % input at hand. Thus also need a control sequence (passed as #5) for % the \E... definition to assign the category name to. -% +% \def\deftypeopparsebody#1#2#3#4#5 #6 {% \parsebodycommon{#1}{#2}{#3}% \def#2##1 ##2 ##3 {\def#4{##1}% @@ -5194,7 +5267,7 @@ width0pt\relax} \fi } % 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. @@ -5456,7 +5529,7 @@ width0pt\relax} \fi % These definitions are used if you use @defunx (etc.) % anywhere other than immediately after a @defun or @defunx. -% +% \def\defcvx#1 {\errmessage{@defcvx in invalid context}} \def\deffnx#1 {\errmessage{@deffnx in invalid context}} \def\defivarx#1 {\errmessage{@defivarx in invalid context}} @@ -5628,7 +5701,7 @@ width0pt\relax} \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 @@ -5784,8 +5857,8 @@ width0pt\relax} \fi % @node's job is to define \lastnode. \def\node{\ENVcheck\parsearg\nodezzz} -\def\nodezzz#1{\nodexxx [#1,]} -\def\nodexxx[#1,#2]{\gdef\lastnode{#1}} +\def\nodezzz#1{\nodexxx #1,\finishnodeparse} +\def\nodexxx#1,#2\finishnodeparse{\gdef\lastnode{#1}} \let\nwnode=\node \let\lastnode=\relax @@ -5823,14 +5896,14 @@ width0pt\relax} \fi % anchor), namely NAME-title (the corresponding @chapter/etc. name), % NAME-pg (the page number), and NAME-snt (section number and type). % Called from \foonoderef. -% +% % We have to set \indexdummies so commands such as @code in a section % title aren't expanded. It would be nicer not to expand the titles in % the first place, but there's so many layers that that is hard to do. % % Likewise, use \turnoffactive so that punctuation chars such as underscore % and backslash work in node names. -% +% \def\setref#1#2{{% \atdummies \pdfmkdest{#1}% @@ -5913,14 +5986,25 @@ width0pt\relax} \fi \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi }% - % [mynode], - [\printednodename],\space - % page 3 + % output the `[mynode]' via a macro. + \xrefprintnodename\printednodename + % + % But we always want a comma and a space: + ,\space + % + % output the `page 3'. \turnoffactive \otherbackslash \putwordpage\tie\refx{#1-pg}{}% \fi \endlink \endgroup} +% This macro is called from \xrefX for the `[nodename]' part of xref +% output. It's a separate macro only so it can be changed more easily, +% since not square brackets don't work in some documents. Particularly +% one that Bob is working on :). +% +\def\xrefprintnodename#1{[#1]} + % \dosetq is called from \setref to do the actual \write (\iflinks). % \def\dosetq#1#2{% @@ -5935,7 +6019,7 @@ width0pt\relax} \fi \def\internalsetq#1#2{@xrdef{#1}{\csname #2\endcsname}} % Things to be expanded by \internalsetq. -% +% \def\Ypagenumber{\folio} \def\Ytitle{\thissection} \def\Ynothing{} @@ -6120,13 +6204,14 @@ width0pt\relax} \fi % % Auto-number footnotes. Otherwise like plain. \gdef\footnote{% + \let\indent=\ptexindent \global\advance\footnoteno by \@ne \edef\thisfootno{$^{\the\footnoteno}$}% % % In case the footnote comes at the end of a sentence, preserve the % extra spacing after we do the footnote number. \let\@sf\empty - \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi + \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi % % Remove inadvertent blank space before typesetting the footnote number. \unskip @@ -6267,7 +6352,7 @@ width0pt\relax} \fi \nobreak\bigskip % Usually we'll have text after the image which will insert % \parskip glue, so insert it here too to equalize the space - % above and below. + % above and below. \nobreak\vskip\parskip \nobreak \line\bgroup\hss @@ -6355,7 +6440,7 @@ should work if nowhere else does.} % Parameters in order: 1) textheight; 2) textwidth; 3) voffset; % 4) hoffset; 5) binding offset; 6) topskip; 7) physical page height; 8) % physical page width. -% +% % We also call \setleading{\textleading}, so the caller should define % \textleading. The caller should also set \parskip. % @@ -6423,7 +6508,7 @@ should work if nowhere else does.} \parskip = 3pt plus 2pt minus 1pt \textleading = 13.2pt % - % Double-side printing via postscript on Laserjet 4050 + % 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 @@ -6464,7 +6549,7 @@ should work if nowhere else does.} \tableindent = 12mm }} -% A specific text layout, 24x15cm overall, intended for A4 paper. +% A specific text layout, 24x15cm overall, intended for A4 paper. \def\afourlatex{{\globaldefs = 1 \afourpaper \internalpagesizes{237mm}{150mm}% @@ -6640,7 +6725,7 @@ should work if nowhere else does.} % 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. @@ -6669,7 +6754,7 @@ should work if nowhere else does.} % Say @foo, not \foo, in error messages. @escapechar = `@@ -% These look ok in all fonts, so just make them not special. +% These look ok in all fonts, so just make them not special. @catcode`@& = @other @catcode`@# = @other @catcode`@% = @other @@ -33,15 +33,13 @@ static int eval_condition P((NODE *tree)); static NODE *op_assign P((NODE *tree)); 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 inline 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, const char *func_name, char **varnames)); -static void pop_fcall_stack P((void)); +static inline void pop_fcall_stack P((void)); static void pop_fcall P((void)); -static int in_function P((void)); static int comp_func P((const void *p1, const void *p2)); #if __GNUC__ < 2 @@ -190,10 +188,15 @@ static const char *const nodetypes[] = { "Node_rule_list", "Node_rule_node", "Node_statement_list", + "Node_switch_body", + "Node_case_list", "Node_if_branches", "Node_expression_list", "Node_param_list", "Node_K_if", + "Node_K_switch", + "Node_K_case", + "Node_K_default", "Node_K_while", "Node_K_for", "Node_K_arrayfor", @@ -217,6 +220,7 @@ static const char *const nodetypes[] = { "Node_redirect_pipein", "Node_redirect_input", "Node_redirect_twoway", + "Node_var_new", "Node_var", "Node_var_array", "Node_val", @@ -278,11 +282,9 @@ flags2str(int flagval) { NUMBER, "NUMBER" }, { MAYBE_NUM, "MAYBE_NUM" }, { ARRAYMAXED, "ARRAYMAXED" }, - { SCALAR, "SCALAR" }, { FUNC, "FUNC" }, { FIELD, "FIELD" }, { INTLSTR, "INTLSTR" }, - { UNINITIALIZED, "UNINITIALIZED" }, { 0, NULL }, }; @@ -372,16 +374,12 @@ interpret(register NODE *volatile tree) } break; case TAG_CONTINUE: /* NEXT statement */ - if (forloops_active()) - pop_all_forloops(); - if (in_function()) - pop_fcall_stack(); + pop_all_forloops(); + pop_fcall_stack(); return 1; case TAG_BREAK: /* EXIT statement */ - if (forloops_active()) - pop_all_forloops(); - if (in_function()) - pop_fcall_stack(); + pop_all_forloops(); + pop_fcall_stack(); return 0; default: cant_happen(); @@ -406,6 +404,106 @@ interpret(register NODE *volatile tree) } break; + case Node_K_switch: + { + NODE *switch_value; + NODE *switch_body; + NODE *case_list; + NODE *default_list; + NODE *case_stmt; + + int match_found = FALSE; + + PUSH_BINDING(loop_tag_stack, loop_tag, loop_tag_valid); + INCREMENT(tree->exec_count); + stable_tree = tree; + + switch_value = tree_eval(stable_tree->lnode); + switch_body = stable_tree->rnode; + case_list = switch_body->lnode; + default_list = switch_body->rnode; + + for (; case_list != NULL; case_list = case_list->rnode) { + case_stmt = case_list->lnode; + + /* + * Once a match is found, all cases will be processed as they fall through, + * so continue to execute statements until a break is reached. + */ + if (! match_found) { + if (case_stmt->type == Node_K_default) + ; /* do nothing */ + else if (case_stmt->lnode->type == Node_regex) { + NODE *t1; + Regexp *rp; + + t1 = force_string(switch_value); + rp = re_update(case_stmt->lnode); + + match_found = (research(rp, t1->stptr, 0, t1->stlen, FALSE) >= 0); + if (t1 != switch_value) + free_temp(t1); + } else { + match_found = (cmp_nodes(switch_value, case_stmt->lnode) == 0); + } + } + + /* If a match was found, execute the statements associated with the case. */ + if (match_found) { + INCREMENT(case_stmt->exec_count); + switch (setjmp(loop_tag)) { + case 0: /* Normal non-jump */ + (void) interpret(case_stmt->rnode); + break; + case TAG_CONTINUE: /* continue statement */ + free_temp(switch_value); + RESTORE_BINDING(loop_tag_stack, loop_tag, loop_tag_valid); + longjmp(loop_tag, TAG_CONTINUE); + break; + case TAG_BREAK: /* break statement */ + free_temp(switch_value); + RESTORE_BINDING(loop_tag_stack, loop_tag, loop_tag_valid); + return 1; + default: + cant_happen(); + } + } + + } + + free_temp(switch_value); + + /* + * If a default section was found, execute the statements associated with it + * and execute any trailing case statements if the default falls through. + */ + if (! match_found && default_list != NULL) { + for (case_list = default_list; + case_list != NULL; case_list = case_list->rnode) { + case_stmt = case_list->lnode; + + INCREMENT(case_stmt->exec_count); + switch (setjmp(loop_tag)) { + case 0: /* Normal non-jump */ + (void) interpret(case_stmt->rnode); + break; + case TAG_CONTINUE: /* continue statement */ + RESTORE_BINDING(loop_tag_stack, loop_tag, loop_tag_valid); + longjmp(loop_tag, TAG_CONTINUE); + break; + case TAG_BREAK: /* break statement */ + RESTORE_BINDING(loop_tag_stack, loop_tag, loop_tag_valid); + return 1; + default: + cant_happen(); + } + } + } + + RESTORE_BINDING(loop_tag_stack, loop_tag, loop_tag_valid); + } + break; + case Node_K_while: PUSH_BINDING(loop_tag_stack, loop_tag, loop_tag_valid); @@ -475,8 +573,9 @@ interpret(register NODE *volatile tree) case Node_K_arrayfor: { Func_ptr after_assign = NULL; - NODE **list = 0; + NODE **list = NULL; NODE *volatile array; + NODE *volatile save_array; volatile size_t i, num_elems; size_t j; volatile int retval = 0; @@ -485,19 +584,12 @@ interpret(register NODE *volatile tree) #define hakvar forloop->init #define arrvar forloop->incr /* get the array */ - array = tree->arrvar; - if (array->type == Node_param_list) - array = stack_ptr[array->param_cnt]; - if (array->type == Node_array_ref) - array = array->orig_array; - if ((array->flags & SCALAR) != 0) - fatal(_("attempt to use scalar `%s' as array"), array->vname); + save_array = tree->arrvar; + array = get_array(save_array); /* sanity: do nothing if empty */ - if (array->type == Node_var || array->var_array == NULL - || array->table_size == 0) { + if (array->var_array == NULL || array->table_size == 0) break; /* from switch */ - } /* allocate space for array */ num_elems = array->table_size; @@ -553,7 +645,7 @@ interpret(register NODE *volatile tree) if (do_lint && 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); + array_vname(save_array), (long) num_elems, (long) array->table_size); if (retval == 1) return 1; @@ -652,11 +744,8 @@ interpret(register NODE *volatile tree) * 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(); + pop_all_forloops(); + pop_fcall_stack(); do_nextfile(); break; @@ -692,7 +781,7 @@ interpret(register NODE *volatile tree) * Appears to be an expression statement. Throw away the * value. */ - if (do_lint && tree->type == Node_var) + if (do_lint && (tree->type == Node_var || tree->type == Node_var_new)) lintwarn(_("statement has no effect")); INCREMENT(tree->exec_count); t = tree_eval(tree); @@ -717,20 +806,20 @@ r_tree_eval(register NODE *tree, int iscond) long lx2; #endif -#ifdef GAWKDEBUG +#ifndef TREE_EVAL_MACRO if (tree == NULL) return Nnull_string; else if (tree->type == Node_val) { if (tree->stref <= 0) cant_happen(); - return tree; + return ((tree->flags & INTLSTR) != 0 + ? r_force_string(tree) + : tree); } else if (tree->type == Node_var) { if (tree->var_value->stref <= 0) cant_happen(); - if ((tree->flags & UNINITIALIZED) != 0) - warning(_("reference to uninitialized variable `%s'"), - tree->vname); - return tree->var_value; + if (! var_uninitialized(tree)) + return tree->var_value; } #endif @@ -748,16 +837,24 @@ r_tree_eval(register NODE *tree, int iscond) return Nnull_string; } - if (do_lint && (tree->flags & UNINITIALIZED) != 0) + if (do_lint && var_uninitialized(tree)) lintwarn(_("reference to uninitialized argument `%s'"), tree->vname); } - if (tree->type == Node_array_ref) - tree = tree->orig_array; switch (tree->type) { + case Node_array_ref: + if (tree->orig_array->type == Node_var_array) + fatal(_("attempt to use array `%s' in a scalar context"), + array_vname(tree)); + tree->orig_array->type = Node_var; + /* fall through */ + case Node_var_new: + tree->type = Node_var; + tree->var_value = Nnull_string; + /* fall through */ case Node_var: - if (do_lint && (tree->flags & UNINITIALIZED) != 0) + if (do_lint && var_uninitialized(tree)) lintwarn(_("reference to uninitialized variable `%s'"), tree->vname); return tree->var_value; @@ -808,7 +905,7 @@ r_tree_eval(register NODE *tree, int iscond) case Node_var_array: fatal(_("attempt to use array `%s' in a scalar context"), - tree->vname); + array_vname(tree)); case Node_unary_minus: t1 = tree_eval(tree->subnode); @@ -937,7 +1034,6 @@ r_tree_eval(register NODE *tree, int iscond) lhs = get_lhs(tree->lnode, &after_assign, FALSE); assign_val(lhs, r); - tree->lnode->flags |= SCALAR; if (after_assign) (*after_assign)(); return *lhs; @@ -1261,7 +1357,6 @@ op_assign(register NODE *tree) cant_happen(); } - tree->lnode->flags |= SCALAR; if (after_assign) (*after_assign)(); @@ -1298,15 +1393,6 @@ static struct loop_info { 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 @@ -1332,7 +1418,7 @@ pop_forloop() /* pop_forloops --- pop the for loops stack all the way */ -static void +static inline void pop_all_forloops() { while (nloops_active > 0) @@ -1374,20 +1460,12 @@ static struct fcall { static long fcall_list_size = 0; static long curfcall = -1; -/* in_function --- return true/false if we need to unwind awk functions */ - -static int -in_function() -{ - return (curfcall >= 0); -} - /* pop_fcall --- pop off a single function call */ static void pop_fcall() { - NODE *n, **sp, *arg, *argp; + NODE *n, **sp; int count; struct fcall *f; @@ -1395,71 +1473,25 @@ pop_fcall() f = & fcall_list[curfcall]; stack_ptr = f->prevstack; - /* - * here, we pop each parameter and check whether - * it was an array. If so, and if the arg. passed in was - * a simple variable, then the value should be copied back. - * This achieves "call-by-reference" for arrays. - */ sp = f->stack; - count = f->count; - for (argp = f->arglist; count > 0 && argp != NULL; argp = argp->rnode) { - arg = argp->lnode; - if (arg->type == Node_param_list) - arg = stack_ptr[arg->param_cnt]; + for (count = f->count; count > 0; count--) { n = *sp++; - if (n->type == Node_var_array || n->type == Node_array_ref) { - NODETYPE old_type; /* for check, below */ - - old_type = arg->type; - - /* - * We only free n->vname in the same cases in push_fcall() which - * mallocs it. These are when passing a real array in; the - * old type is array and the parameter "copy" is an array ref, - * or when passing an array reference on to another function. - * It helps to be awake when writing code. - */ - if ( (old_type == Node_var_array && n->type == Node_array_ref) - || (old_type == Node_array_ref && n->type == Node_array_ref) ) - free(n->vname); - - if (arg->type == Node_var) { - /* type changed, copy array back for call by reference */ - /* should we free arg->var_value ? */ - arg->var_array = n->var_array; - arg->type = Node_var_array; - arg->array_size = n->array_size; - arg->table_size = n->table_size; - arg->flags = n->flags; - } - } - /* n->lnode overlays the array size, don't unref it if array */ - if (n->type != Node_var_array && n->type != Node_array_ref) - unref(n->lnode); - freenode(n); - count--; - } - while (count-- > 0) { - n = *sp++; - /* if n is a local array, all the elements should be freed */ - if (n->type == Node_var_array) + if (n->type == Node_var) /* local variable */ + unref(n->var_value); + else if (n->type == Node_var_array) /* local array */ assoc_clear(n); - /* n->lnode overlays the array size, don't unref it if array */ - if (n->type != Node_var_array && n->type != Node_array_ref) - unref(n->lnode); freenode(n); } if (f->stack) free((char *) f->stack); - memset(f, '\0', sizeof(struct fcall)); + /* memset(f, '\0', sizeof(struct fcall)); */ curfcall--; } /* pop_fcall_stack --- pop off all function args, don't leak memory */ -static void +static inline void pop_fcall_stack() { while (curfcall >= 0) @@ -1470,17 +1502,14 @@ pop_fcall_stack() static void push_args(int count, - NODE *arglist, + NODE *argp, NODE **oldstack, const char *func_name, char **varnames) { struct fcall *f; - NODE *arg, *argp, *r, **sp, *n; + NODE *arg, *r, **sp; int i; - int num_args; - - num_args = count; /* save for later use */ if (fcall_list_size == 0) { /* first time */ emalloc(fcall_list, struct fcall *, 10 * sizeof(struct fcall), @@ -1494,64 +1523,52 @@ push_args(int count, fcall_list_size * sizeof(struct fcall), "push_args"); } f = & fcall_list[curfcall]; - memset(f, '\0', sizeof(struct fcall)); if (count > 0) emalloc(f->stack, NODE **, count*sizeof(NODE *), "push_args"); + else + f->stack = NULL; f->count = count; f->fname = func_name; /* not used, for debugging, just in case */ - f->arglist = arglist; + f->arglist = argp; f->prevstack = oldstack; sp = f->stack; /* for each calling arg. add NODE * on stack */ - for (argp = arglist, i = 0; count > 0 && argp != NULL; argp = argp->rnode) { - static const char from[] = N_("%s (from %s)"); - arg = argp->lnode; + for (i = 0; i < count; i++) { getnode(r); - r->type = Node_var; - r->flags = 0; + *sp++ = r; + if (argp == NULL) { + /* local variable */ + r->type = Node_var_new; + r->vname = varnames[i]; + continue; + } + arg = argp->lnode; /* call by reference for arrays; see below also */ if (arg->type == Node_param_list) { /* we must also reassign f here; see below */ f = & fcall_list[curfcall]; arg = f->prevstack[arg->param_cnt]; } - if (arg->type == Node_var_array) { - char *p; - size_t len; - + if (arg->type == Node_var_array || arg->type == Node_var_new) { r->type = Node_array_ref; - r->flags &= ~SCALAR; r->orig_array = arg; - len = strlen(varnames[i]) + strlen(arg->vname) - + strlen(gettext(from)) - 4 + 1; - emalloc(p, char *, len, "push_args"); - sprintf(p, _(from), varnames[i], arg->vname); - r->vname = p; + r->prev_array = arg; } else if (arg->type == Node_array_ref) { - char *p; - size_t len; - *r = *arg; - len = strlen(varnames[i]) + strlen(arg->vname) - + strlen(gettext(from)) - 4 + 1; - emalloc(p, char *, len, "push_args"); - sprintf(p, _(from), varnames[i], arg->vname); - r->vname = p; + r->prev_array = arg; } else { - n = tree_eval(arg); + NODE *n = tree_eval(arg); + + r->type = Node_var; r->lnode = dupnode(n); r->rnode = (NODE *) NULL; - if ((n->flags & SCALAR) != 0) - r->flags |= SCALAR; - r->vname = varnames[i]; free_temp(n); } - *sp++ = r; - i++; - count--; + r->vname = varnames[i]; + argp = argp->rnode; } /* @@ -1574,7 +1591,8 @@ push_args(int count, if (arg->type == Node_param_list) arg = f->prevstack[arg->param_cnt]; if (arg->type != Node_var_array && - arg->type != Node_array_ref) + arg->type != Node_array_ref && + arg->type != Node_var_new) free_temp(tree_eval(arg)); /* reassign f, tree_eval could have moved it */ @@ -1582,19 +1600,6 @@ push_args(int count, } while ((argp = argp->rnode) != NULL); } - /* add remaining params. on stack with null value */ - while (count-- > 0) { - getnode(r); - r->type = Node_var; - r->lnode = Nnull_string; - r->flags &= ~SCALAR; - r->rnode = (NODE *) NULL; - r->vname = varnames[i++]; - r->flags = UNINITIALIZED; - r->param_cnt = num_args - count; - *sp++ = r; - } - stack_ptr = f->stack; } @@ -1723,18 +1728,30 @@ r_get_lhs(register NODE *ptr, Func_ptr *assign, int reference) } switch (ptr->type) { - case Node_array_ref: case Node_var_array: fatal(_("attempt to use array `%s' in a scalar context"), - ptr->vname); + array_vname(ptr)); + /* + * The following goop ensures that uninitialized variables + * used as parameters eventually get their type set correctly + * to scalar (i.e., Node_var). + */ + case Node_array_ref: + if (ptr->orig_array->type == Node_var_array) + fatal(_("attempt to use array `%s' in a scalar context"), + array_vname(ptr)); + ptr->orig_array->type = Node_var; + /* fall through */ + case Node_var_new: + ptr->type = Node_var; + ptr->var_value = Nnull_string; + /* fall through */ case Node_var: - if (do_lint && reference && (ptr->flags & UNINITIALIZED) != 0) + if (do_lint && reference && var_uninitialized(ptr)) 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) @@ -1860,23 +1877,16 @@ r_get_lhs(register NODE *ptr, Func_ptr *assign, int reference) aptr = &fields_arr[0]; if (assign != NULL) *assign = reset_record; - break; - } - aptr = get_field(field_num, assign); + } else + aptr = get_field(field_num, assign); + if (do_lint && reference && (*aptr == Null_field || *aptr == Nnull_string)) + lintwarn(_("reference to uninitialized field `$%d'"), + field_num); break; } case Node_subscript: - n = ptr->lnode; - if (n->type == Node_param_list) { - n = stack_ptr[n->param_cnt]; - if ((n->flags & SCALAR) != 0) - fatal(_("attempt to use scalar parameter `%s' as an array"), n->vname); - } - if (n->type == Node_array_ref) { - n = n->orig_array; - assert(n->type == Node_var_array || n->type == Node_var); - } + n = get_array(ptr->lnode); aptr = assoc_lookup(n, concat_exp(ptr->rnode), reference); break; @@ -2217,6 +2227,7 @@ comp_func(const void *p1, const void *p2) size_t len1, len2; const char *str1, *str2; const NODE *t1, *t2; + int cmp1; t1 = *((const NODE *const *) p1); t2 = *((const NODE *const *) p2); @@ -2225,15 +2236,15 @@ comp_func(const void *p1, const void *p2) t1 = force_string(t1); t2 = force_string(t2); */ - len1 = t1->stlen; - str1 = t1->stptr; + len1 = t1->ahname_len; + str1 = t1->ahname_str; - len2 = t2->stlen; - str2 = t2->stptr; + len2 = t2->ahname_len; + str2 = t2->ahname_str; /* Array indexes are strings, compare as such, always! */ - if (len1 == len2 || len1 < len2) - return memcmp(str1, str2, len1); - else - return memcmp(str1, str2, len2); + cmp1 = memcmp(str1, str2, len1 < len2 ? len1 : len2); + /* if prefixes are equal, size matters */ + return (cmp1 != 0 ? cmp1 : + len1 < len2 ? -1 : (len1 > len2)); } @@ -150,8 +150,10 @@ get_argument(NODE *tree, int i) if (tree->lnode == Nnull_string) return NULL; - if (tree->type == Node_array_ref) + if (tree->type == Node_array_ref) { tree = tree->orig_array; + return tree; + } if (tree->type == Node_var_array) return tree; diff --git a/extension/Makefile.pc b/extension/Makefile.pc new file mode 100644 index 00000000..fe8f5b47 --- /dev/null +++ b/extension/Makefile.pc @@ -0,0 +1,55 @@ +# Makefile for gawk extensions Mar 2003
+
+# - for GNU C (mingw32) [Windows32 executable for Windows 9x/NT]
+# - for Microsoft C 7 [16bit ececutable for DOS]
+
+# see README.pc for comments
+
+#------------------------------------------------------------------------
+# Some makes do not define MAKE (and ndmake does not allow a define).
+# Define MAK to be your make command.
+#MAKE = dmake
+MAK = $(MAKE) $(MAKEFILE)
+#MAK = $(MAKE)
+#MAKEFILE = -f Makefile
+#MAK = make45 $(MAKEFILE)
+
+VCCFLAGS=-nologo -O2 -DWIN32 -DWIN32_EXTENSION -D__STDC__=0 -DGAWK -I.. -DHAVE_CONFIG_H -DDYNAMIC
+VCLDFLAGS=-LD ../gawk.lib
+VCCC=cl -nologo
+
+MWCFLAGS=-O -shared -DWIN32 -DWIN32_EXTENSION -DGAWK -I.. -DHAVE_CONFIG_H -DDYNAMIC
+MWLDFLAGS=-s -Wl,--enable-stdcall-fixup -L.. -lgawk
+MWCC=gcc
+
+# this DEFFILE will work provided the exported function is always called
+# dlload
+DEFFILE=pcext.def
+
+
+default:
+ @echo "Enter $(MAK) target "
+ @echo " where 'target' is chosen from "
+ @echo " mingw32 . Windows32 exe [Mingw32 GNU C] "
+ @echo " vcWin32 . Windows32 exe [Microsoft Visual C] "
+
+.SUFFIXES: .c .dll
+
+.c.dll:
+ $(CC) $(CFLAGS) $< -o$@ $(LDFLAGS) $(DEFFILE)
+
+
+# dl.c, fork.c, and filefuncs.c don't compile cleanly...
+all : readfile.dll ordchr.dll arrayparm.dll
+
+vcWin32:
+ $(MAK) CFLAGS="$(VCCFLAGS)" LDFLAGS="$(VCLDFLAGS)" CC="$(VCCC)" all
+
+mingw32:
+ $(MAK) CFLAGS="$(MWCFLAGS)" LDFLAGS="$(MWLDFLAGS)" CC="$(MWCC)" all
+
+clean:
+ -rm *.dll
+ -rm *.o
+ -rm *.obj
+ -rm *.lib
diff --git a/extension/arrayparm.c b/extension/arrayparm.c index 9a158676..6c627d65 100644 --- a/extension/arrayparm.c +++ b/extension/arrayparm.c @@ -4,10 +4,12 @@ * Arnold Robbins * arnold@skeeve.com * 10/2001 + * + * Revised 7/2003 */ /* - * Copyright (C) 2001 the Free Software Foundation, Inc. + * Copyright (C) 2001, 2003 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. @@ -51,6 +53,8 @@ NODE *tree; var = get_argument(tree, 0); if (var == NULL) var = stack_ptr[0]; + + var = get_array(var); sub = get_argument(tree, 1); val = get_argument(tree, 2); @@ -58,14 +62,6 @@ NODE *tree; printf("sub->type = %s\n", nodetype2str(sub->type)); printf("val->type = %s\n", nodetype2str(val->type)); - if (var->var_array == NULL) { - if (var->type != Node_var_array) { - unref(var->var_value); - var->type = Node_var_array; - } - var->array_size = var->table_size = 0; /* sanity */ - var->flags &= ~ARRAYMAXED; - } assoc_clear(var); elemval = assoc_lookup(var, sub, 0); diff --git a/extension/filefuncs.c b/extension/filefuncs.c index 12badb5b..194db28f 100644 --- a/extension/filefuncs.c +++ b/extension/filefuncs.c @@ -189,6 +189,8 @@ NODE *tree; file = get_argument(tree, 0); array = get_argument(tree, 1); + array = get_array(array); + /* empty out the array */ assoc_clear(array); diff --git a/extension/pcext.def b/extension/pcext.def new file mode 100644 index 00000000..696907f6 --- /dev/null +++ b/extension/pcext.def @@ -0,0 +1,2 @@ +EXPORTS
+dlload @1
diff --git a/extension/readfile.c b/extension/readfile.c index 8713bc8d..65f0efca 100644 --- a/extension/readfile.c +++ b/extension/readfile.c @@ -3,10 +3,12 @@ * * Arnold Robbins * Tue Apr 23 17:43:30 IDT 2002 + * Revised per Peter Tillier + * Mon Jun 9 17:05:11 IDT 2003 */ /* - * Copyright (C) 2002 the Free Software Foundation, Inc. + * Copyright (C) 2002, 2003 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. @@ -29,6 +31,10 @@ #include "awk.h" #include <fcntl.h> +#ifndef O_BINARY +#define O_BINARY 0 +#endif + /* do_readfile --- read a file into memory */ NODE * @@ -61,7 +67,7 @@ NODE *tree; goto done; } - if ((fd = open(filename->stptr, O_RDONLY)) < 0) { + if ((fd = open(filename->stptr, O_RDONLY|O_BINARY)) < 0) { ret = -1; update_ERRNO(); free_temp(filename); @@ -63,7 +63,7 @@ int default_FS; /* TRUE when FS == " " */ Regexp *FS_re_yes_case = NULL; Regexp *FS_re_no_case = NULL; Regexp *FS_regexp = NULL; -static NODE *Null_field = NULL; +NODE *Null_field = NULL; /* using_FIELDWIDTHS --- static function, macro to avoid overhead */ #define using_FIELDWIDTHS() (parse_field == fw_parse_field) @@ -73,19 +73,13 @@ static NODE *Null_field = NULL; void init_fields() { - NODE *n; - emalloc(fields_arr, NODE **, sizeof(NODE *), "init_fields"); - getnode(n); - *n = *Nnull_string; - n->flags |= (SCALAR|FIELD); - n->flags &= ~PERM; - fields_arr[0] = n; + fields_arr[0] = Nnull_string; parse_extent = fields_arr[0]->stptr; save_FS = dupnode(FS_node->var_value); getnode(Null_field); *Null_field = *Nnull_string; - Null_field->flags |= (SCALAR|FIELD); + Null_field->flags |= FIELD; Null_field->flags &= ~(NUMCUR|NUMBER|MAYBE_NUM|PERM); field0_valid = TRUE; } @@ -123,7 +117,7 @@ set_field(long num, n = fields_arr[num]; n->stptr = str; n->stlen = len; - n->flags = (STRCUR|STRING|MAYBE_NUM|SCALAR|FIELD); + n->flags = (STRCUR|STRING|MAYBE_NUM|FIELD); } /* rebuild_record --- Someone assigned a value to $(something). @@ -267,7 +261,7 @@ set_record(const char *buf, int cnt) n->stref = 1; n->type = Node_val; n->stfmt = -1; - n->flags = (STRING|STRCUR|MAYBE_NUM|SCALAR|FIELD); + n->flags = (STRING|STRCUR|MAYBE_NUM|FIELD); fields_arr[0] = n; #undef INITIAL_SIZE @@ -809,17 +803,11 @@ do_split(NODE *tree) src = force_string(tree_eval(tree->lnode)); - arr = tree->rnode->lnode; - - if (arr->type == Node_param_list) - arr = stack_ptr[arr->param_cnt]; - if (arr->type == Node_array_ref) - arr = arr->orig_array; - if (arr->type != Node_var && arr->type != Node_var_array) + arr = get_param(tree->rnode->lnode); + if (arr->type != Node_var_array) fatal(_("split: second argument is not an array")); - arr->type = Node_var_array; - sep = tree->rnode->rnode->lnode; /* 3rd arg */ + sep = tree->rnode->rnode->lnode; if (src->stlen == 0) { /* @@ -832,7 +820,7 @@ do_split(NODE *tree) if ((sep->re_flags & (FS_DFLT|CONST)) == 0) free_temp(tree_eval(sep->re_exp)); /* - * And now you can safely turn off the array. + * And now we can safely turn off the array. */ assoc_clear(arr); return tmp_number((AWKNUM) 0); @@ -1,7 +1,7 @@ #! /bin/sh # fixvers --- make sure version.c and patchlev.h reflect -# the reality in configure.in +# the reality in configure.ac # # Copyright (C) 2001, 2002 the Free Software Foundation, Inc. # @@ -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.ac` case $1 in -v) diff --git a/intl/ChangeLog b/intl/ChangeLog index 65ec50f7..eed2d21a 100644 --- a/intl/ChangeLog +++ b/intl/ChangeLog @@ -1,4 +1,4 @@ -2002-08-06 GNU <bug-gnu-gettext@gnu.org> +2003-05-22 GNU <bug-gnu-gettext@gnu.org> - * Version 0.11.5 released. + * Version 0.12.1 released. diff --git a/intl/Makefile.in b/intl/Makefile.in index 0486dc93..88239648 100644 --- a/intl/Makefile.in +++ b/intl/Makefile.in @@ -1,5 +1,5 @@ -# Makefile for directory with message catalog handling in GNU NLS Utilities. -# Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc. +# Makefile for directory with message catalog handling library of GNU gettext +# Copyright (C) 1995-1998, 2000-2003 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 @@ -24,7 +24,7 @@ SHELL = /bin/sh srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = .. -VPATH = @srcdir@ +VPATH = $(srcdir) prefix = @prefix@ exec_prefix = @exec_prefix@ @@ -40,7 +40,7 @@ subdir = intl INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ MKINSTALLDIRS = @MKINSTALLDIRS@ -mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac` +mkinstalldirs = $(SHELL) $(MKINSTALLDIRS) l = @INTL_LIBTOOL_SUFFIX_PREFIX@ @@ -52,58 +52,84 @@ YACC = @INTLBISON@ -y -d YFLAGS = --name-prefix=__gettext DEFS = -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \ --DLIBDIR=\"$(libdir)\" -DIN_LIBINTL @DEFS@ +-DLIBDIR=\"$(libdir)\" -DIN_LIBINTL \ +-DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"$(libdir)\" -DNO_XMALLOC \ +-Dset_relocation_prefix=libintl_set_relocation_prefix \ +-Drelocate=libintl_relocate \ +-DDEPENDS_ON_LIBICONV=1 @DEFS@ CPPFLAGS = @CPPFLAGS@ CFLAGS = @CFLAGS@ LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) -HEADERS = $(COMHDRS) libgnuintl.h loadinfo.h -COMHDRS = gmo.h gettextP.h hash-string.h plural-exp.h eval-plural.h os2compat.h -SOURCES = $(COMSRCS) intl-compat.c -COMSRCS = bindtextdom.c dcgettext.c dgettext.c gettext.c \ -finddomain.c loadmsgcat.c localealias.c textdomain.c l10nflist.c \ -explodename.c dcigettext.c dcngettext.c dngettext.c ngettext.c plural.y \ -plural-exp.c localcharset.c localename.c osdep.c os2compat.c -OBJECTS = @INTLOBJS@ bindtextdom.$lo dcgettext.$lo dgettext.$lo gettext.$lo \ -finddomain.$lo loadmsgcat.$lo localealias.$lo textdomain.$lo l10nflist.$lo \ -explodename.$lo dcigettext.$lo dcngettext.$lo dngettext.$lo ngettext.$lo \ -plural.$lo plural-exp.$lo localcharset.$lo localename.$lo osdep.$lo -GETTOBJS = intl-compat.$lo +HEADERS = \ + gmo.h \ + gettextP.h \ + hash-string.h \ + loadinfo.h \ + plural-exp.h \ + eval-plural.h \ + localcharset.h \ + relocatable.h \ + os2compat.h \ + libgnuintl.h.in +SOURCES = \ + bindtextdom.c \ + dcgettext.c \ + dgettext.c \ + gettext.c \ + finddomain.c \ + loadmsgcat.c \ + localealias.c \ + textdomain.c \ + l10nflist.c \ + explodename.c \ + dcigettext.c \ + dcngettext.c \ + dngettext.c \ + ngettext.c \ + plural.y \ + plural-exp.c \ + localcharset.c \ + relocatable.c \ + localename.c \ + log.c \ + osdep.c \ + os2compat.c \ + intl-compat.c +OBJECTS = \ + bindtextdom.$lo \ + dcgettext.$lo \ + dgettext.$lo \ + gettext.$lo \ + finddomain.$lo \ + loadmsgcat.$lo \ + localealias.$lo \ + textdomain.$lo \ + l10nflist.$lo \ + explodename.$lo \ + dcigettext.$lo \ + dcngettext.$lo \ + dngettext.$lo \ + ngettext.$lo \ + plural.$lo \ + plural-exp.$lo \ + localcharset.$lo \ + relocatable.$lo \ + localename.$lo \ + log.$lo \ + osdep.$lo \ + intl-compat.$lo DISTFILES.common = Makefile.in \ config.charset locale.alias ref-add.sin ref-del.sin $(HEADERS) $(SOURCES) DISTFILES.generated = plural.c DISTFILES.normal = VERSION -DISTFILES.gettext = COPYING.LIB-2.0 COPYING.LIB-2.1 libintl.glibc +DISTFILES.gettext = COPYING.LIB-2.0 COPYING.LIB-2.1 libintl.glibc \ +Makefile.vms libgnuintl.h.msvc-shared README.woe32 Makefile.msvc DISTFILES.obsolete = xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.c \ -COPYING.LIB-2 gettext.h libgettext.h plural-eval.c - -# Libtool's library version information for libintl. -# Before making a gettext release, the gettext maintainer must change this -# according to the libtool documentation, section "Library interface versions". -# Maintainers of other packages that include the intl directory must *not* -# change these values. -LTV_CURRENT=4 -LTV_REVISION=0 -LTV_AGE=2 - -.SUFFIXES: -.SUFFIXES: .c .y .o .lo .sin .sed -.c.o: - $(COMPILE) $< -.c.lo: - $(LIBTOOL) --mode=compile $(COMPILE) $< - -.y.c: - $(YACC) $(YFLAGS) --output $@ $< - rm -f $*.h - -.sin.sed: - sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $< > t-$@ - mv t-$@ $@ - -INCLUDES = -I.. -I. -I$(top_srcdir)/intl +COPYING.LIB-2 gettext.h libgettext.h plural-eval.c libgnuintl.h all: all-@USE_INCLUDED_LIBINTL@ all-yes: libintl.$la libintl.h charset.alias ref-add.sed ref-del.sed @@ -119,23 +145,96 @@ libintl.a libgnuintl.a: $(OBJECTS) libintl.la libgnuintl.la: $(OBJECTS) $(LIBTOOL) --mode=link \ $(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \ - $(OBJECTS) @LTLIBICONV@ -lc \ + $(OBJECTS) @LTLIBICONV@ $(LIBS) -lc \ -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \ -rpath $(libdir) \ -no-undefined +# Libtool's library version information for libintl. +# Before making a gettext release, the gettext maintainer must change this +# according to the libtool documentation, section "Library interface versions". +# Maintainers of other packages that include the intl directory must *not* +# change these values. +LTV_CURRENT=5 +LTV_REVISION=0 +LTV_AGE=3 + +.SUFFIXES: +.SUFFIXES: .c .y .o .lo .sin .sed + +.c.o: + $(COMPILE) $< + +.y.c: + $(YACC) $(YFLAGS) --output $@ $< + rm -f $*.h + +bindtextdom.lo: $(srcdir)/bindtextdom.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/bindtextdom.c +dcgettext.lo: $(srcdir)/dcgettext.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcgettext.c +dgettext.lo: $(srcdir)/dgettext.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dgettext.c +gettext.lo: $(srcdir)/gettext.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/gettext.c +finddomain.lo: $(srcdir)/finddomain.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/finddomain.c +loadmsgcat.lo: $(srcdir)/loadmsgcat.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/loadmsgcat.c +localealias.lo: $(srcdir)/localealias.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localealias.c +textdomain.lo: $(srcdir)/textdomain.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/textdomain.c +l10nflist.lo: $(srcdir)/l10nflist.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/l10nflist.c +explodename.lo: $(srcdir)/explodename.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/explodename.c +dcigettext.lo: $(srcdir)/dcigettext.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcigettext.c +dcngettext.lo: $(srcdir)/dcngettext.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcngettext.c +dngettext.lo: $(srcdir)/dngettext.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dngettext.c +ngettext.lo: $(srcdir)/ngettext.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/ngettext.c +plural.lo: $(srcdir)/plural.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural.c +plural-exp.lo: $(srcdir)/plural-exp.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural-exp.c +localcharset.lo: $(srcdir)/localcharset.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localcharset.c +relocatable.lo: $(srcdir)/relocatable.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/relocatable.c +localename.lo: $(srcdir)/localename.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localename.c +log.lo: $(srcdir)/log.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/log.c +osdep.lo: $(srcdir)/osdep.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/osdep.c +intl-compat.lo: $(srcdir)/intl-compat.c + $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/intl-compat.c + +ref-add.sed: $(srcdir)/ref-add.sin + sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-add.sin > t-ref-add.sed + mv t-ref-add.sed ref-add.sed +ref-del.sed: $(srcdir)/ref-del.sin + sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-del.sin > t-ref-del.sed + mv t-ref-del.sed ref-del.sed + +INCLUDES = -I. -I$(srcdir) -I.. + +libgnuintl.h: $(srcdir)/libgnuintl.h.in + cp $(srcdir)/libgnuintl.h.in libgnuintl.h + libintl.h: libgnuintl.h - cp $(srcdir)/libgnuintl.h libintl.h + cp libgnuintl.h libintl.h -charset.alias: config.charset +charset.alias: $(srcdir)/config.charset $(SHELL) $(srcdir)/config.charset '@host@' > t-$@ mv t-$@ $@ check: all -# This installation goal is only used in GNU gettext. Packages which -# only use the library should use install instead. - # We must not install the libintl.h/libintl.a files if we are on a # system which has the GNU gettext() function in its C library or in a # separate library. @@ -143,12 +242,30 @@ check: all # package, you have to use `configure --with-included-gettext'. install: install-exec install-data install-exec: all - if test "$(PACKAGE)" = "gettext" \ - && test '@INTLOBJS@' = '$(GETTOBJS)'; then \ + if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \ + && test '@USE_INCLUDED_LIBINTL@' = yes; then \ $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \ $(INSTALL_DATA) libintl.h $(DESTDIR)$(includedir)/libintl.h; \ $(LIBTOOL) --mode=install \ $(INSTALL_DATA) libintl.$la $(DESTDIR)$(libdir)/libintl.$la; \ + if test "@RELOCATABLE@" = yes; then \ + dependencies=`sed -n -e 's,^dependency_libs=\(.*\),\1,p' < $(DESTDIR)$(libdir)/libintl.la | sed -e "s,^',," -e "s,'\$$,,"`; \ + if test -n "$dependencies"; then \ + rm -f $(DESTDIR)$(libdir)/libintl.la; \ + fi; \ + fi; \ + else \ + : ; \ + fi + if test "$(PACKAGE)" = "gettext-tools" \ + && test '@USE_INCLUDED_LIBINTL@' = no; then \ + $(mkinstalldirs) $(DESTDIR)$(libdir); \ + $(LIBTOOL) --mode=install \ + $(INSTALL_DATA) libgnuintl.$la $(DESTDIR)$(libdir)/libgnuintl.$la; \ + rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \ + $(INSTALL_DATA) $(DESTDIR)$(libdir)/libgnuintl.so $(DESTDIR)$(libdir)/preloadable_libintl.so; \ + $(LIBTOOL) --mode=uninstall \ + rm -f $(DESTDIR)$(libdir)/libgnuintl.$la; \ else \ : ; \ fi @@ -182,7 +299,7 @@ install-exec: all : ; \ fi install-data: all - if test "$(PACKAGE)" = "gettext"; then \ + if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ $(INSTALL_DATA) VERSION $(DESTDIR)$(gettextsrcdir)/VERSION; \ $(INSTALL_DATA) ChangeLog.inst $(DESTDIR)$(gettextsrcdir)/ChangeLog; \ @@ -209,19 +326,25 @@ install-data: all install-strip: install installdirs: - if test "$(PACKAGE)" = "gettext" \ - && test '@INTLOBJS@' = '$(GETTOBJS)'; then \ + if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \ + && test '@USE_INCLUDED_LIBINTL@' = yes; then \ $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \ else \ : ; \ fi + if test "$(PACKAGE)" = "gettext-tools" \ + && test '@USE_INCLUDED_LIBINTL@' = no; then \ + $(mkinstalldirs) $(DESTDIR)$(libdir); \ + else \ + : ; \ + fi if test '@USE_INCLUDED_LIBINTL@' = yes; then \ test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \ $(mkinstalldirs) $(DESTDIR)$(localedir); \ else \ : ; \ fi - if test "$(PACKAGE)" = "gettext"; then \ + if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ else \ : ; \ @@ -231,14 +354,20 @@ installdirs: installcheck: uninstall: - if test "$(PACKAGE)" = "gettext" \ - && test '@INTLOBJS@' = '$(GETTOBJS)'; then \ + if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \ + && test '@USE_INCLUDED_LIBINTL@' = yes; then \ rm -f $(DESTDIR)$(includedir)/libintl.h; \ $(LIBTOOL) --mode=uninstall \ rm -f $(DESTDIR)$(libdir)/libintl.$la; \ else \ : ; \ fi + if test "$(PACKAGE)" = "gettext-tools" \ + && test '@USE_INCLUDED_LIBINTL@' = no; then \ + rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \ + else \ + : ; \ + fi if test '@USE_INCLUDED_LIBINTL@' = yes; then \ if test -f $(DESTDIR)$(libdir)/charset.alias; then \ temp=$(DESTDIR)$(libdir)/t-charset.alias; \ @@ -265,7 +394,7 @@ uninstall: else \ : ; \ fi - if test "$(PACKAGE)" = "gettext"; then \ + if test "$(PACKAGE)" = "gettext-tools"; then \ for file in VERSION ChangeLog COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common) $(DISTFILES.generated); do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ @@ -273,20 +402,27 @@ uninstall: : ; \ fi -info dvi: +info dvi ps pdf html: $(OBJECTS): ../config.h libgnuintl.h -bindtextdom.$lo dcgettext.$lo dcigettext.$lo dcngettext.$lo dgettext.$lo dngettext.$lo finddomain.$lo gettext.$lo intl-compat.$lo loadmsgcat.$lo localealias.$lo ngettext.$lo textdomain.$lo: gettextP.h gmo.h loadinfo.h -dcigettext.$lo: hash-string.h -explodename.$lo l10nflist.$lo: loadinfo.h -dcigettext.$lo loadmsgcat.$lo plural.$lo plural-exp.$lo: plural-exp.h -dcigettext.$lo: eval-plural.h +bindtextdom.$lo dcgettext.$lo dcigettext.$lo dcngettext.$lo dgettext.$lo dngettext.$lo finddomain.$lo gettext.$lo intl-compat.$lo loadmsgcat.$lo localealias.$lo ngettext.$lo textdomain.$lo: $(srcdir)/gettextP.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h +dcigettext.$lo loadmsgcat.$lo: $(srcdir)/hash-string.h +explodename.$lo l10nflist.$lo: $(srcdir)/loadinfo.h +dcigettext.$lo loadmsgcat.$lo plural.$lo plural-exp.$lo: $(srcdir)/plural-exp.h +dcigettext.$lo: $(srcdir)/eval-plural.h +localcharset.$lo: $(srcdir)/localcharset.h +localealias.$lo localcharset.$lo relocatable.$lo: $(srcdir)/relocatable.h tags: TAGS TAGS: $(HEADERS) $(SOURCES) here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES) +ctags: CTAGS + +CTAGS: $(HEADERS) $(SOURCES) + here=`pwd`; cd $(srcdir) && ctags -o $$here/CTAGS $(HEADERS) $(SOURCES) + id: ID ID: $(HEADERS) $(SOURCES) @@ -294,15 +430,15 @@ ID: $(HEADERS) $(SOURCES) mostlyclean: - rm -f *.a *.la *.o *.lo core core.* - rm -f libintl.h charset.alias ref-add.sed ref-del.sed + rm -f *.a *.la *.o *.obj *.lo core core.* + rm -f libgnuintl.h libintl.h charset.alias ref-add.sed ref-del.sed rm -f -r .libs _libs clean: mostlyclean distclean: clean rm -f Makefile ID TAGS - if test "$(PACKAGE)" = gettext; then \ + if test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; then \ rm -f ChangeLog.inst $(DISTFILES.normal); \ else \ : ; \ @@ -317,20 +453,26 @@ maintainer-clean: distclean # other files which should not be distributed in other packages. distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: Makefile - if test "$(PACKAGE)" = gettext; then \ - additional="$(DISTFILES.gettext)"; \ + if test "$(PACKAGE)" = "gettext-tools"; then \ + : ; \ else \ - additional="$(DISTFILES.normal)"; \ - fi; \ - $(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \ - for file in ChangeLog $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \ - if test -f $$file; then dir=.; else dir=$(srcdir); fi; \ - cp -p $$dir/$$file $(distdir); \ - done - -Makefile: Makefile.in ../config.status - cd .. \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + if test "$(PACKAGE)" = "gettext-runtime"; then \ + additional="$(DISTFILES.gettext)"; \ + else \ + additional="$(DISTFILES.normal)"; \ + fi; \ + $(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \ + for file in ChangeLog $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \ + if test -f $$file; then dir=.; else dir=$(srcdir); fi; \ + cp -p $$dir/$$file $(distdir); \ + done; \ + fi + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status +# This would be more efficient, but doesn't work any more with autoconf-2.57, +# when AC_CONFIG_FILES([intl/Makefile:somedir/Makefile.in]) is used. +# cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/intl/VERSION b/intl/VERSION index acc8052f..13031835 100644 --- a/intl/VERSION +++ b/intl/VERSION @@ -1 +1 @@ -GNU gettext library from gettext-0.11.5 +GNU gettext library from gettext-0.12.1 diff --git a/intl/bindtextdom.c b/intl/bindtextdom.c index d582ce11..250f5e86 100644 --- a/intl/bindtextdom.c +++ b/intl/bindtextdom.c @@ -58,6 +58,11 @@ /* Contains the default location of the message catalogs. */ extern const char _nl_default_dirname[]; +#ifdef _LIBC +extern const char _nl_default_dirname_internal[] attribute_hidden; +#else +# define INTUSE(name) name +#endif /* List with bindings of specific domains. */ extern struct binding *_nl_domain_bindings; @@ -146,8 +151,8 @@ set_binding_values (domainname, dirnamep, codesetp) char *result = binding->dirname; if (strcmp (dirname, result) != 0) { - if (strcmp (dirname, _nl_default_dirname) == 0) - result = (char *) _nl_default_dirname; + if (strcmp (dirname, INTUSE(_nl_default_dirname)) == 0) + result = (char *) INTUSE(_nl_default_dirname); else { #if defined _LIBC || defined HAVE_STRDUP @@ -162,7 +167,7 @@ set_binding_values (domainname, dirnamep, codesetp) if (__builtin_expect (result != NULL, 1)) { - if (binding->dirname != _nl_default_dirname) + if (binding->dirname != INTUSE(_nl_default_dirname)) free (binding->dirname); binding->dirname = result; @@ -216,7 +221,7 @@ set_binding_values (domainname, dirnamep, codesetp) { /* Simply return the default values. */ if (dirnamep) - *dirnamep = _nl_default_dirname; + *dirnamep = INTUSE(_nl_default_dirname); if (codesetp) *codesetp = NULL; } @@ -238,11 +243,11 @@ set_binding_values (domainname, dirnamep, codesetp) if (dirname == NULL) /* The default value. */ - dirname = _nl_default_dirname; + dirname = INTUSE(_nl_default_dirname); else { - if (strcmp (dirname, _nl_default_dirname) == 0) - dirname = _nl_default_dirname; + if (strcmp (dirname, INTUSE(_nl_default_dirname)) == 0) + dirname = INTUSE(_nl_default_dirname); else { char *result; @@ -265,7 +270,7 @@ set_binding_values (domainname, dirnamep, codesetp) } else /* The default value. */ - new_binding->dirname = (char *) _nl_default_dirname; + new_binding->dirname = (char *) INTUSE(_nl_default_dirname); new_binding->codeset_cntr = 0; @@ -321,7 +326,7 @@ set_binding_values (domainname, dirnamep, codesetp) if (0) { failed_codeset: - if (new_binding->dirname != _nl_default_dirname) + if (new_binding->dirname != INTUSE(_nl_default_dirname)) free (new_binding->dirname); failed_dirname: free (new_binding); diff --git a/intl/config.charset b/intl/config.charset index 4f98b5b0..32becece 100755 --- a/intl/config.charset +++ b/intl/config.charset @@ -1,7 +1,7 @@ #! /bin/sh # Output a system dependent table of character encoding aliases. # -# Copyright (C) 2000-2002 Free Software Foundation, Inc. +# Copyright (C) 2000-2003 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,7 +71,7 @@ # CP1125 dos # CP1129 aix # CP1250 woe32 -# CP1251 glibc woe32 +# CP1251 glibc solaris woe32 # CP1252 aix woe32 # CP1253 woe32 # CP1254 woe32 @@ -231,6 +231,7 @@ case "$os" in echo "ISO8859-9 ISO-8859-9" echo "ISO8859-15 ISO-8859-15" echo "koi8-r KOI8-R" + echo "ansi-1251 CP1251" echo "BIG5 BIG5" echo "Big5-HKSCS BIG5-HKSCS" echo "gb2312 GB2312" diff --git a/intl/dcigettext.c b/intl/dcigettext.c index f2f01524..f6edb95c 100644 --- a/intl/dcigettext.c +++ b/intl/dcigettext.c @@ -1,5 +1,5 @@ /* Implementation of the internal dcigettext function. - Copyright (C) 1995-1999, 2000-2002 Free Software Foundation, Inc. + Copyright (C) 1995-1999, 2000-2003 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 @@ -33,14 +33,19 @@ # define alloca __builtin_alloca # define HAVE_ALLOCA 1 #else -# if defined HAVE_ALLOCA_H || defined _LIBC -# include <alloca.h> +# ifdef _MSC_VER +# include <malloc.h> +# define alloca _alloca # else -# ifdef _AIX - #pragma alloca +# if defined HAVE_ALLOCA_H || defined _LIBC +# include <alloca.h> # else -# ifndef alloca +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca char *alloca (); +# endif # endif # endif # endif @@ -271,6 +276,13 @@ transcmp (p1, p2) } #endif +#ifndef INTVARDEF +# define INTVARDEF(name) +#endif +#ifndef INTUSE +# define INTUSE(name) name +#endif + /* Name of the default domain used for gettext(3) prior any call to textdomain(3). The default value for this is "messages". */ const char _nl_default_default_domain[] attribute_hidden = "messages"; @@ -284,6 +296,7 @@ const char *_nl_current_default_domain attribute_hidden extern const char _nl_default_dirname[]; #else const char _nl_default_dirname[] = LOCALEDIR; +INTVARDEF (_nl_default_dirname) #endif /* List with bindings of specific domains created by bindtextdomain() @@ -296,10 +309,15 @@ static char *plural_lookup PARAMS ((struct loaded_l10nfile *domain, const char *translation, size_t translation_len)) internal_function; -static const char *category_to_name PARAMS ((int category)) internal_function; static const char *guess_category_value PARAMS ((int category, const char *categoryname)) internal_function; +#ifdef _LIBC +# include "../locale/localeinfo.h" +# define category_to_name(category) _nl_category_names[category] +#else +static const char *category_to_name PARAMS ((int category)) internal_function; +#endif /* For those loosing systems which don't have `alloca' we have to add @@ -437,6 +455,15 @@ DCIGETTEXT (domainname, msgid1, msgid2, plural, n, category) if (msgid1 == NULL) return NULL; +#ifdef _LIBC + if (category < 0 || category >= __LC_LAST || category == LC_ALL) + /* Bogus. */ + return (plural == 0 + ? (char *) msgid1 + /* Use the Germanic plural rule. */ + : n == 1 ? (char *) msgid1 : (char *) msgid2); +#endif + __libc_rwlock_rdlock (_nl_state_lock); /* If DOMAINNAME is NULL, we are interested in the default domain. If @@ -500,7 +527,7 @@ DCIGETTEXT (domainname, msgid1, msgid2, plural, n, category) } if (binding == NULL) - dirname = (char *) _nl_default_dirname; + dirname = (char *) INTUSE(_nl_default_dirname); else if (IS_ABSOLUTE_PATH (binding->dirname)) dirname = binding->dirname; else @@ -528,17 +555,9 @@ DCIGETTEXT (domainname, msgid1, msgid2, plural, n, category) } if (ret == NULL) - { - /* We cannot get the current working directory. Don't signal an - error but simply return the default string. */ - FREE_BLOCKS (block_list); - __libc_rwlock_unlock (_nl_state_lock); - __set_errno (saved_errno); - return (plural == 0 - ? (char *) msgid1 - /* Use the Germanic plural rule. */ - : n == 1 ? (char *) msgid1 : (char *) msgid2); - } + /* We cannot get the current working directory. Don't signal an + error but simply return the default string. */ + goto return_untranslated; stpcpy (stpcpy (strchr (dirname, '\0'), "/"), binding->dirname); } @@ -595,16 +614,7 @@ DCIGETTEXT (domainname, msgid1, msgid2, plural, n, category) domain. Return the MSGID. */ if (strcmp (single_locale, "C") == 0 || strcmp (single_locale, "POSIX") == 0) - { - FREE_BLOCKS (block_list); - __libc_rwlock_unlock (_nl_state_lock); - __set_errno (saved_errno); - return (plural == 0 - ? (char *) msgid1 - /* Use the Germanic plural rule. */ - : n == 1 ? (char *) msgid1 : (char *) msgid2); - } - + break; /* Find structure describing the message catalog matching the DOMAINNAME and CATEGORY. */ @@ -636,7 +646,6 @@ DCIGETTEXT (domainname, msgid1, msgid2, plural, n, category) /* Found the translation of MSGID1 in domain DOMAIN: starting at RETVAL, RETLEN bytes. */ FREE_BLOCKS (block_list); - __set_errno (saved_errno); #if defined HAVE_TSEARCH || defined _LIBC if (foundp == NULL) { @@ -675,6 +684,8 @@ DCIGETTEXT (domainname, msgid1, msgid2, plural, n, category) (*foundp)->translation_length = retlen; } #endif + __set_errno (saved_errno); + /* Now deal with plural. */ if (plural) retval = plural_lookup (domain, n, retval, retlen); @@ -684,7 +695,30 @@ DCIGETTEXT (domainname, msgid1, msgid2, plural, n, category) } } } - /* NOTREACHED */ + + return_untranslated: + /* Return the untranslated MSGID. */ + FREE_BLOCKS (block_list); + __libc_rwlock_unlock (_nl_state_lock); +#ifndef _LIBC + if (!ENABLE_SECURE) + { + extern void _nl_log_untranslated PARAMS ((const char *logfilename, + const char *domainname, + const char *msgid1, + const char *msgid2, + int plural)); + const char *logfilename = getenv ("GETTEXT_LOG_UNTRANSLATED"); + + if (logfilename != NULL && logfilename[0] != '\0') + _nl_log_untranslated (logfilename, domainname, msgid1, msgid2, plural); + } +#endif + __set_errno (saved_errno); + return (plural == 0 + ? (char *) msgid1 + /* Use the Germanic plural rule. */ + : n == 1 ? (char *) msgid1 : (char *) msgid2); } @@ -1038,7 +1072,7 @@ plural_lookup (domain, n, translation, translation_len) return (char *) p; } - +#ifndef _LIBC /* Return string representation of locale CATEGORY. */ static const char * internal_function @@ -1098,6 +1132,7 @@ category_to_name (category) return retval; } +#endif /* Guess value of current locale from value of the environment variables. */ static const char * @@ -1120,7 +1155,7 @@ guess_category_value (category, categoryname) `LC_xxx', and `LANG'. On some systems this can be done by the `setlocale' function itself. */ #ifdef _LIBC - retval = setlocale (category, NULL); + retval = __current_locale_name (category); #else retval = _nl_locale_name (category, categoryname); #endif @@ -1170,8 +1205,7 @@ mempcpy (dest, src, n) #ifdef _LIBC /* If we want to free all resources we have to do some work at program's end. */ -static void __attribute__ ((unused)) -free_mem (void) +libc_freeres_fn (free_mem) { void *old; @@ -1179,7 +1213,7 @@ free_mem (void) { struct binding *oldp = _nl_domain_bindings; _nl_domain_bindings = _nl_domain_bindings->next; - if (oldp->dirname != _nl_default_dirname) + if (oldp->dirname != INTUSE(_nl_default_dirname)) /* Yes, this is a pointer comparison. */ free (oldp->dirname); free (oldp->codeset); @@ -1201,6 +1235,4 @@ free_mem (void) free (old); } } - -text_set_element (__libc_subfreeres, free_mem); #endif diff --git a/intl/dcngettext.c b/intl/dcngettext.c index 17d9ce3e..3a3404e2 100644 --- a/intl/dcngettext.c +++ b/intl/dcngettext.c @@ -56,6 +56,5 @@ DCNGETTEXT (domainname, msgid1, msgid2, n, category) #ifdef _LIBC /* Alias for function name in GNU C Library. */ -INTDEF(__dcngettext) weak_alias (__dcngettext, dcngettext); #endif diff --git a/intl/dngettext.c b/intl/dngettext.c index 0afbd2e1..67fd030f 100644 --- a/intl/dngettext.c +++ b/intl/dngettext.c @@ -37,7 +37,7 @@ prefix. So we have to make a difference here. */ #ifdef _LIBC # define DNGETTEXT __dngettext -# define DCNGETTEXT INTUSE(__dcngettext) +# define DCNGETTEXT __dcngettext #else # define DNGETTEXT libintl_dngettext # define DCNGETTEXT libintl_dcngettext diff --git a/intl/finddomain.c b/intl/finddomain.c index 2f103d55..d2427644 100644 --- a/intl/finddomain.c +++ b/intl/finddomain.c @@ -178,8 +178,7 @@ _nl_find_domain (dirname, locale, domainname, domainbinding) #ifdef _LIBC -static void __attribute__ ((unused)) -free_mem (void) +libc_freeres_fn (free_mem) { struct loaded_l10nfile *runp = _nl_loaded_domains; @@ -193,6 +192,4 @@ free_mem (void) free (here); } } - -text_set_element (__libc_subfreeres, free_mem); #endif diff --git a/intl/gettextP.h b/intl/gettextP.h index f085c59b..f1748a35 100644 --- a/intl/gettextP.h +++ b/intl/gettextP.h @@ -1,5 +1,5 @@ /* Header describing internals of libintl library. - Copyright (C) 1995-1999, 2000-2002 Free Software Foundation, Inc. + Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc. Written by Ulrich Drepper <drepper@cygnus.com>, 1995. This program is free software; you can redistribute it and/or modify it @@ -208,33 +208,15 @@ extern char *__bindtextdomain PARAMS ((const char *__domainname, extern char *__bind_textdomain_codeset PARAMS ((const char *__domainname, const char *__codeset)); #else -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)); +/* Declare the exported libintl_* functions, in a way that allows us to + call them under their real name. */ +# define _INTL_REDIRECT_MACROS +# include "libgnuintl.h" 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/intl-compat.c b/intl/intl-compat.c index da890159..36b7af0f 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-2002 Software Foundation, Inc. + Copyright (C) 1995, 2000-2003 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,8 +21,6 @@ # include <config.h> #endif -#define _INTL_REDIRECT_MACROS -#include "libgnuintl.h" #include "gettextP.h" /* @@ end of prolog @@ */ @@ -31,7 +29,10 @@ 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. */ + has the redirections primarily in the <libintl.h> include file. + It is also compiled into libgnuintl so that libgnuintl.so can be used + as LD_PRELOADable library on glibc systems, to provide the extra + features that the functions in the libc don't have (namely, logging). */ #undef gettext @@ -45,6 +46,17 @@ #undef bind_textdomain_codeset +/* When building a DLL, we must export some functions. Note that because + the functions are only defined for binary backward compatibility, we + don't need to use __declspec(dllimport) in any case. */ +#if defined _MSC_VER && BUILDING_DLL +# define DLL_EXPORTED __declspec(dllexport) +#else +# define DLL_EXPORTED +#endif + + +DLL_EXPORTED char * gettext (msgid) const char *msgid; @@ -53,6 +65,7 @@ gettext (msgid) } +DLL_EXPORTED char * dgettext (domainname, msgid) const char *domainname; @@ -62,6 +75,7 @@ dgettext (domainname, msgid) } +DLL_EXPORTED char * dcgettext (domainname, msgid, category) const char *domainname; @@ -72,6 +86,7 @@ dcgettext (domainname, msgid, category) } +DLL_EXPORTED char * ngettext (msgid1, msgid2, n) const char *msgid1; @@ -82,6 +97,7 @@ ngettext (msgid1, msgid2, n) } +DLL_EXPORTED char * dngettext (domainname, msgid1, msgid2, n) const char *domainname; @@ -93,6 +109,7 @@ dngettext (domainname, msgid1, msgid2, n) } +DLL_EXPORTED char * dcngettext (domainname, msgid1, msgid2, n, category) const char *domainname; @@ -105,6 +122,7 @@ dcngettext (domainname, msgid1, msgid2, n, category) } +DLL_EXPORTED char * textdomain (domainname) const char *domainname; @@ -113,6 +131,7 @@ textdomain (domainname) } +DLL_EXPORTED char * bindtextdomain (domainname, dirname) const char *domainname; @@ -122,6 +141,7 @@ bindtextdomain (domainname, dirname) } +DLL_EXPORTED char * bind_textdomain_codeset (domainname, codeset) const char *domainname; diff --git a/intl/libgnuintl.h b/intl/libgnuintl.h.in index 60bc5519..f596cfcb 100644 --- a/intl/libgnuintl.h +++ b/intl/libgnuintl.h.in @@ -1,5 +1,5 @@ /* Message catalogs for internationalization. - Copyright (C) 1995-1997, 2000-2002 Free Software Foundation, Inc. + Copyright (C) 1995-1997, 2000-2003 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 @@ -93,7 +93,7 @@ extern "C" { 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__) +# if __GNUC__ >= 2 && !defined __APPLE_CC__ && (defined __STDC__ || defined __cplusplus) # define _INTL_REDIRECT_ASM # else # ifdef __cplusplus @@ -289,6 +289,19 @@ extern char *bind_textdomain_codeset _INTL_PARAMS ((const char *__domainname, #endif +/* Support for relocatable packages. */ + +/* Sets the original and the current installation prefix of the package. + Relocation simply replaces a pathname starting with the original prefix + by the corresponding pathname with the current prefix instead. Both + prefixes should be directory names without trailing slash (i.e. use "" + instead of "/"). */ +#define libintl_set_relocation_prefix libintl_set_relocation_prefix +extern void + libintl_set_relocation_prefix _INTL_PARAMS ((const char *orig_prefix, + const char *curr_prefix)); + + #ifdef __cplusplus } #endif diff --git a/intl/loadmsgcat.c b/intl/loadmsgcat.c index 516f5211..8509bd34 100644 --- a/intl/loadmsgcat.c +++ b/intl/loadmsgcat.c @@ -1,5 +1,5 @@ /* Load needed message catalogs. - Copyright (C) 1995-1999, 2000-2002 Free Software Foundation, Inc. + Copyright (C) 1995-1999, 2000-2003 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 @@ -34,17 +34,23 @@ #include <sys/stat.h> #ifdef __GNUC__ +# undef alloca # define alloca __builtin_alloca # define HAVE_ALLOCA 1 #else -# if defined HAVE_ALLOCA_H || defined _LIBC -# include <alloca.h> +# ifdef _MSC_VER +# include <malloc.h> +# define alloca _alloca # else -# ifdef _AIX - #pragma alloca +# if defined HAVE_ALLOCA_H || defined _LIBC +# include <alloca.h> # else -# ifndef alloca +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca char *alloca (); +# endif # endif # endif # endif @@ -820,7 +826,7 @@ _nl_init_domain_conv (domain_file, domain, domainbinding) if (outcharset == NULL || outcharset[0] == '\0') { # ifdef _LIBC - outcharset = (*_nl_current[LC_CTYPE])->values[_NL_ITEM_INDEX (CODESET)].string; + outcharset = _NL_CURRENT (LC_CTYPE, CODESET); # else # if HAVE_ICONV extern const char *locale_charset PARAMS ((void)); diff --git a/intl/localcharset.c b/intl/localcharset.c index 2b1564e2..d04d0536 100644 --- a/intl/localcharset.c +++ b/intl/localcharset.c @@ -1,6 +1,6 @@ /* Determine a canonical name for the current locale's character encoding. - Copyright (C) 2000-2002 Free Software Foundation, Inc. + Copyright (C) 2000-2003 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 @@ -23,6 +23,9 @@ # include <config.h> #endif +/* Specification. */ +#include "localcharset.h" + #if HAVE_STDDEF_H # include <stddef.h> #endif @@ -64,6 +67,12 @@ # include <os2.h> #endif +#if ENABLE_RELOCATABLE +# include "relocatable.h" +#else +# define relocate(pathname) (pathname) +#endif + #if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__ /* Win32, OS/2, DOS */ # define ISSLASH(C) ((C) == '/' || (C) == '\\') @@ -82,11 +91,6 @@ # 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 @@ -110,9 +114,9 @@ get_charset_aliases () cp = charset_aliases; if (cp == NULL) { -#if !defined WIN32 +#if !(defined VMS || defined WIN32) FILE *fp; - const char *dir = LIBDIR; + const char *dir = relocate (LIBDIR); const char *base = "charset.alias"; char *file_name; @@ -200,11 +204,36 @@ get_charset_aliases () #else +# if defined VMS + /* To avoid the troubles of an extra file charset.alias_vms in the + sources of many GNU packages, simply inline the aliases here. */ + /* The list of encodings is taken from the OpenVMS 7.3-1 documentation + "Compaq C Run-Time Library Reference Manual for OpenVMS systems" + section 10.7 "Handling Different Character Sets". */ + cp = "ISO8859-1" "\0" "ISO-8859-1" "\0" + "ISO8859-2" "\0" "ISO-8859-2" "\0" + "ISO8859-5" "\0" "ISO-8859-5" "\0" + "ISO8859-7" "\0" "ISO-8859-7" "\0" + "ISO8859-8" "\0" "ISO-8859-8" "\0" + "ISO8859-9" "\0" "ISO-8859-9" "\0" + /* Japanese */ + "eucJP" "\0" "EUC-JP" "\0" + "SJIS" "\0" "SHIFT_JIS" "\0" + "DECKANJI" "\0" "DEC-KANJI" "\0" + "SDECKANJI" "\0" "EUC-JP" "\0" + /* Chinese */ + "eucTW" "\0" "EUC-TW" "\0" + "DECHANYU" "\0" "DEC-HANYU" "\0" + "DECHANZI" "\0" "GB2312" "\0" + /* Korean */ + "DECKOREAN" "\0" "EUC-KR" "\0"; +# endif + +# if defined WIN32 /* To avoid the troubles of installing a separate file in the same directory as the DLL and of retrieving the DLL's directory at runtime, simply inline the aliases here. */ -# if defined WIN32 cp = "CP936" "\0" "GBK" "\0" "CP1361" "\0" "JOHAB" "\0" "CP20127" "\0" "ASCII" "\0" diff --git a/intl/localcharset.h b/intl/localcharset.h new file mode 100644 index 00000000..3b137e73 --- /dev/null +++ b/intl/localcharset.h @@ -0,0 +1,42 @@ +/* Determine a canonical name for the current locale's character encoding. + Copyright (C) 2000-2003 Free Software Foundation, Inc. + This file is part of the GNU CHARSET Library. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +#ifndef _LOCALCHARSET_H +#define _LOCALCHARSET_H + + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Determine the current locale's character encoding, and canonicalize it + into one of the canonical names listed in config.charset. + The result must not be freed; it is statically allocated. + If the canonical name cannot be determined, the result is a non-canonical + name. */ +extern const char * locale_charset (void); + + +#ifdef __cplusplus +} +#endif + + +#endif /* _LOCALCHARSET_H */ diff --git a/intl/localealias.c b/intl/localealias.c index 456e41e3..7c4ce58f 100644 --- a/intl/localealias.c +++ b/intl/localealias.c @@ -1,5 +1,5 @@ /* Handle aliases for locale names. - Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1995-1999, 2000-2001, 2003 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 @@ -35,17 +35,23 @@ #include <sys/types.h> #ifdef __GNUC__ +# undef alloca # define alloca __builtin_alloca # define HAVE_ALLOCA 1 #else -# if defined HAVE_ALLOCA_H || defined _LIBC -# include <alloca.h> +# ifdef _MSC_VER +# include <malloc.h> +# define alloca _alloca # else -# ifdef _AIX - #pragma alloca +# if defined HAVE_ALLOCA_H || defined _LIBC +# include <alloca.h> # else -# ifndef alloca +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca char *alloca (); +# endif # endif # endif # endif @@ -56,6 +62,12 @@ char *alloca (); #include "gettextP.h" +#if ENABLE_RELOCATABLE +# include "relocatable.h" +#else +# define relocate(pathname) (pathname) +#endif + /* @@ end of prolog @@ */ #ifdef _LIBC @@ -115,10 +127,14 @@ struct alias_map }; -static char *string_space; +#ifndef _LIBC +# define libc_freeres_ptr(decl) decl +#endif + +libc_freeres_ptr (static char *string_space); static size_t string_space_act; static size_t string_space_max; -static struct alias_map *map; +libc_freeres_ptr (static struct alias_map *map); static size_t nmap; static size_t maxmap; @@ -217,7 +233,7 @@ read_alias_file (fname, fname_len) memcpy (&full_fname[fname_len], aliasfile, sizeof aliasfile); #endif - fp = fopen (full_fname, "r"); + fp = fopen (relocate (full_fname), "r"); freea (full_fname); if (fp == NULL) return 0; @@ -234,8 +250,10 @@ read_alias_file (fname, fname_len) a) we are only interested in the first two fields b) these fields must be usable as file names and so must not be that long - */ - char buf[BUFSIZ]; + We avoid a multi-kilobyte buffer here since this would use up + stack space which we might not have if the program ran out of + memory. */ + char buf[400]; char *alias; char *value; char *cp; @@ -244,19 +262,6 @@ read_alias_file (fname, fname_len) /* EOF reached. */ break; - /* Possibly not the whole line fits into the buffer. Ignore - the rest of the line. */ - if (strchr (buf, '\n') == NULL) - { - char altbuf[BUFSIZ]; - do - if (FGETS (altbuf, sizeof altbuf, fp) == NULL) - /* Make sure the inner loop will be left. The outer loop - will exit at the `feof' test. */ - break; - while (strchr (altbuf, '\n') == NULL); - } - cp = buf; /* Ignore leading white space. */ while (isspace ((unsigned char) cp[0])) @@ -340,6 +345,14 @@ read_alias_file (fname, fname_len) ++added; } } + + /* Possibly not the whole line fits into the buffer. Ignore + the rest of the line. */ + while (strchr (buf, '\n') == NULL) + if (FGETS (buf, sizeof buf, fp) == NULL) + /* Make sure the inner loop will be left. The outer loop + will exit at the `feof' test. */ + break; } /* Should we test for ferror()? I think we have to silently ignore @@ -373,19 +386,6 @@ extend_alias_table () } -#ifdef _LIBC -static void __attribute__ ((unused)) -free_mem (void) -{ - if (string_space != NULL) - free (string_space); - if (map != NULL) - free (map); -} -text_set_element (__libc_subfreeres, free_mem); -#endif - - static int alias_compare (map1, map2) const struct alias_map *map1; diff --git a/intl/log.c b/intl/log.c new file mode 100644 index 00000000..9c84791b --- /dev/null +++ b/intl/log.c @@ -0,0 +1,104 @@ +/* Log file output. + 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 Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +/* Written by Bruno Haible <bruno@clisp.org>. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +/* Print an ASCII string with quotes and escape sequences where needed. */ +static void +print_escaped (stream, str) + FILE *stream; + const char *str; +{ + putc ('"', stream); + for (; *str != '\0'; str++) + if (*str == '\n') + { + fputs ("\\n\"", stream); + if (str[1] == '\0') + return; + fputs ("\n\"", stream); + } + else + { + if (*str == '"' || *str == '\\') + putc ('\\', stream); + putc (*str, stream); + } + putc ('"', stream); +} + +/* Add to the log file an entry denoting a failed translation. */ +void +_nl_log_untranslated (logfilename, domainname, msgid1, msgid2, plural) + const char *logfilename; + const char *domainname; + const char *msgid1; + const char *msgid2; + int plural; +{ + static char *last_logfilename = NULL; + static FILE *last_logfile = NULL; + FILE *logfile; + + /* Can we reuse the last opened logfile? */ + if (last_logfilename == NULL || strcmp (logfilename, last_logfilename) != 0) + { + /* Close the last used logfile. */ + if (last_logfilename != NULL) + { + if (last_logfile != NULL) + { + fclose (last_logfile); + last_logfile = NULL; + } + free (last_logfilename); + last_logfilename = NULL; + } + /* Open the logfile. */ + last_logfilename = (char *) malloc (strlen (logfilename) + 1); + if (last_logfilename == NULL) + return; + strcpy (last_logfilename, logfilename); + last_logfile = fopen (logfilename, "a"); + if (last_logfile == NULL) + return; + } + logfile = last_logfile; + + fprintf (logfile, "domain "); + print_escaped (logfile, domainname); + fprintf (logfile, "\nmsgid "); + print_escaped (logfile, msgid1); + if (plural) + { + fprintf (logfile, "\nmsgid_plural "); + print_escaped (logfile, msgid2); + fprintf (logfile, "\nmsgstr[0] \"\"\n"); + } + else + fprintf (logfile, "\nmsgstr \"\"\n"); + putc ('\n', logfile); +} diff --git a/intl/ngettext.c b/intl/ngettext.c index 69fe1f74..17a27f4a 100644 --- a/intl/ngettext.c +++ b/intl/ngettext.c @@ -44,7 +44,7 @@ prefix. So we have to make a difference here. */ #ifdef _LIBC # define NGETTEXT __ngettext -# define DCNGETTEXT INTUSE(__dcngettext) +# define DCNGETTEXT __dcngettext #else # define NGETTEXT libintl_ngettext # define DCNGETTEXT libintl_dcngettext diff --git a/intl/plural.c b/intl/plural.c index c9ff63fb..3a4fa20c 100644 --- a/intl/plural.c +++ b/intl/plural.c @@ -1,6 +1,5 @@ - -/* A Bison parser, made from plural.y - by GNU Bison version 1.28 */ +/* A Bison parser, made from plural.y + by GNU bison 1.35. */ #define YYBISON 1 /* Identify Bison output. */ @@ -11,11 +10,11 @@ #define yychar __gettextchar #define yydebug __gettextdebug #define yynerrs __gettextnerrs -#define EQUOP2 257 -#define CMPOP2 258 -#define ADDOP2 259 -#define MULOP2 260 -#define NUMBER 261 +# define EQUOP2 257 +# define CMPOP2 258 +# define ADDOP2 259 +# define MULOP2 260 +# define NUMBER 261 #line 1 "plural.y" @@ -64,11 +63,15 @@ #define YYPARSE_PARAM arg #line 49 "plural.y" +#ifndef YYSTYPE typedef union { unsigned long int num; enum operator op; struct expression *exp; -} YYSTYPE; +} yystype; +# define YYSTYPE yystype +# define YYSTYPE_IS_TRIVIAL 1 +#endif #line 55 "plural.y" /* Prototypes for local functions. */ @@ -167,12 +170,8 @@ new_exp_3 (op, bexp, tbranch, fbranch) return new_exp (3, op, args); } -#include <stdio.h> - -#ifndef __cplusplus -#ifndef __STDC__ -#define const -#endif +#ifndef YYDEBUG +# define YYDEBUG 0 #endif @@ -181,129 +180,152 @@ new_exp_3 (op, bexp, tbranch, fbranch) #define YYFLAG -32768 #define YYNTBASE 16 +/* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */ #define YYTRANSLATE(x) ((unsigned)(x) <= 261 ? yytranslate[x] : 18) -static const char yytranslate[] = { 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 10, 2, 2, 2, 2, 5, 2, 14, - 15, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 12, 2, 2, - 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 13, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 1, 6, 7, 8, 9, - 11 +/* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */ +static const char yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 10, 2, 2, 2, 2, 5, 2, + 14, 15, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 12, 2, + 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 13, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 6, 7, 8, + 9, 11 }; -#if YYDEBUG != 0 -static const short yyprhs[] = { 0, - 0, 2, 8, 12, 16, 20, 24, 28, 32, 35, - 37, 39 +#if YYDEBUG +static const short yyprhs[] = +{ + 0, 0, 2, 8, 12, 16, 20, 24, 28, 32, + 35, 37, 39 }; - -static const short yyrhs[] = { 17, - 0, 17, 3, 17, 12, 17, 0, 17, 4, 17, - 0, 17, 5, 17, 0, 17, 6, 17, 0, 17, - 7, 17, 0, 17, 8, 17, 0, 17, 9, 17, - 0, 10, 17, 0, 13, 0, 11, 0, 14, 17, - 15, 0 +static const short yyrhs[] = +{ + 17, 0, 17, 3, 17, 12, 17, 0, 17, 4, + 17, 0, 17, 5, 17, 0, 17, 6, 17, 0, + 17, 7, 17, 0, 17, 8, 17, 0, 17, 9, + 17, 0, 10, 17, 0, 13, 0, 11, 0, 14, + 17, 15, 0 }; #endif -#if YYDEBUG != 0 -static const short yyrline[] = { 0, - 174, 182, 186, 190, 194, 198, 202, 206, 210, 214, - 218, 223 +#if YYDEBUG +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const short yyrline[] = +{ + 0, 174, 182, 186, 190, 194, 198, 202, 206, 210, + 214, 218, 223 }; #endif -#if YYDEBUG != 0 || defined (YYERROR_VERBOSE) +#if (YYDEBUG) || defined YYERROR_VERBOSE -static const char * const yytname[] = { "$","error","$undefined.","'?'","'|'", -"'&'","EQUOP2","CMPOP2","ADDOP2","MULOP2","'!'","NUMBER","':'","'n'","'('","')'", -"start","exp", NULL +/* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */ +static const char *const yytname[] = +{ + "$", "error", "$undefined.", "'?'", "'|'", "'&'", "EQUOP2", "CMPOP2", + "ADDOP2", "MULOP2", "'!'", "NUMBER", "':'", "'n'", "'('", "')'", + "start", "exp", 0 }; #endif -static const short yyr1[] = { 0, - 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17 +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const short yyr1[] = +{ + 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17 }; -static const short yyr2[] = { 0, - 1, 5, 3, 3, 3, 3, 3, 3, 2, 1, - 1, 3 +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const short yyr2[] = +{ + 0, 1, 5, 3, 3, 3, 3, 3, 3, 2, + 1, 1, 3 }; -static const short yydefact[] = { 0, - 0, 11, 10, 0, 1, 9, 0, 0, 0, 0, - 0, 0, 0, 0, 12, 0, 3, 4, 5, 6, - 7, 8, 0, 2, 0, 0, 0 +/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE + doesn't specify something else to do. Zero means the default is an + error. */ +static const short yydefact[] = +{ + 0, 0, 11, 10, 0, 1, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 12, 0, 3, 4, 5, + 6, 7, 8, 0, 2, 0, 0, 0 }; -static const short yydefgoto[] = { 25, - 5 +static const short yydefgoto[] = +{ + 25, 5 }; -static const short yypact[] = { -9, - -9,-32768,-32768, -9, 34,-32768, 11, -9, -9, -9, - -9, -9, -9, -9,-32768, 24, 39, 43, 16, 26, - -3,-32768, -9, 34, 21, 53,-32768 +static const short yypact[] = +{ + -9, -9,-32768,-32768, -9, 34,-32768, 11, -9, -9, + -9, -9, -9, -9, -9,-32768, 24, 39, 43, 16, + 26, -3,-32768, -9, 34, 21, 53,-32768 }; -static const short yypgoto[] = {-32768, - -1 +static const short yypgoto[] = +{ + -32768, -1 }; #define YYLAST 53 -static const short yytable[] = { 6, - 1, 2, 7, 3, 4, 14, 16, 17, 18, 19, - 20, 21, 22, 8, 9, 10, 11, 12, 13, 14, - 26, 24, 12, 13, 14, 15, 8, 9, 10, 11, - 12, 13, 14, 13, 14, 23, 8, 9, 10, 11, - 12, 13, 14, 10, 11, 12, 13, 14, 11, 12, - 13, 14, 27 +static const short yytable[] = +{ + 6, 1, 2, 7, 3, 4, 14, 16, 17, 18, + 19, 20, 21, 22, 8, 9, 10, 11, 12, 13, + 14, 26, 24, 12, 13, 14, 15, 8, 9, 10, + 11, 12, 13, 14, 13, 14, 23, 8, 9, 10, + 11, 12, 13, 14, 10, 11, 12, 13, 14, 11, + 12, 13, 14, 27 }; -static const short yycheck[] = { 1, - 10, 11, 4, 13, 14, 9, 8, 9, 10, 11, - 12, 13, 14, 3, 4, 5, 6, 7, 8, 9, - 0, 23, 7, 8, 9, 15, 3, 4, 5, 6, - 7, 8, 9, 8, 9, 12, 3, 4, 5, 6, - 7, 8, 9, 5, 6, 7, 8, 9, 6, 7, - 8, 9, 0 +static const short yycheck[] = +{ + 1, 10, 11, 4, 13, 14, 9, 8, 9, 10, + 11, 12, 13, 14, 3, 4, 5, 6, 7, 8, + 9, 0, 23, 7, 8, 9, 15, 3, 4, 5, + 6, 7, 8, 9, 8, 9, 12, 3, 4, 5, + 6, 7, 8, 9, 5, 6, 7, 8, 9, 6, + 7, 8, 9, 0 }; #define YYPURE 1 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ -#line 3 "/usr/local/share/bison.simple" -/* This file comes from bison-1.28. */ +#line 3 "/usr/local/share/bison/bison.simple" /* Skeleton output parser for bison, - Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. + + 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 @@ -325,62 +347,131 @@ static const short yycheck[] = { 1, This special exception was added by the Free Software Foundation in version 1.24 of Bison. */ -/* This is the parser code that is written into each bison parser - when the %semantic_parser declaration is not specified in the grammar. - It was written by Richard Stallman by simplifying the hairy parser - used when %semantic_parser is specified. */ +/* 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. */ + +/* 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. */ + +#if ! defined (yyoverflow) || defined (YYERROR_VERBOSE) + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# 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) || defined (YYERROR_VERBOSE) */ + + +#if (! defined (yyoverflow) \ + && (! defined (__cplusplus) \ + || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + short yyss; + YYSTYPE yyvs; +# if YYLSP_NEEDED + YYLTYPE yyls; +# endif +}; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# if YYLSP_NEEDED +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ + + 2 * YYSTACK_GAP_MAX) +# else +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAX) +# endif + +/* 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_MAX; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) -#ifndef YYSTACK_USE_ALLOCA -#ifdef alloca -#define YYSTACK_USE_ALLOCA -#else /* alloca not defined */ -#ifdef __GNUC__ -#define YYSTACK_USE_ALLOCA -#define alloca __builtin_alloca -#else /* not GNU C. */ -#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) -#define YYSTACK_USE_ALLOCA -#include <alloca.h> -#else /* not sparc */ -/* We think this test detects Watcom and Microsoft C. */ -/* This used to test MSDOS, but that is a bad idea - since that symbol is in the user namespace. */ -#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) -#if 0 /* No need for malloc.h, which pollutes the namespace; - instead, just don't use alloca. */ -#include <malloc.h> #endif -#else /* not MSDOS, or __TURBOC__ */ -#if defined(_AIX) -/* I don't know what this was needed for, but it pollutes the namespace. - So I turned it off. rms, 2 May 1997. */ -/* #include <malloc.h> */ - #pragma alloca -#define YYSTACK_USE_ALLOCA -#else /* not MSDOS, or __TURBOC__, or _AIX */ -#if 0 -#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up, - and on HPUX 10. Eventually we can turn this on. */ -#define YYSTACK_USE_ALLOCA -#define alloca __builtin_alloca -#endif /* __hpux */ + + +#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) +# define YYSIZE_T __SIZE_TYPE__ #endif -#endif /* not _AIX */ -#endif /* not MSDOS, or __TURBOC__ */ -#endif /* not sparc */ -#endif /* not GNU C */ -#endif /* alloca not defined */ -#endif /* YYSTACK_USE_ALLOCA not defined */ - -#ifdef YYSTACK_USE_ALLOCA -#define YYSTACK_ALLOC alloca -#else -#define YYSTACK_ALLOC malloc +#if ! defined (YYSIZE_T) && defined (size_t) +# define YYSIZE_T size_t +#endif +#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) @@ -389,131 +480,161 @@ static const short yycheck[] = { 1, #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrlab1 -/* Like YYERROR except do call yyerror. - This remains here temporarily to ease the - transition to the new meaning of YYERROR, for GCC. +/* 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); \ + { \ + yychar = (Token); \ + yylval = (Value); \ yychar1 = 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 - -#ifdef YYPURE -#ifdef YYLSP_NEEDED -#ifdef YYLEX_PARAM -#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) -#else -#define YYLEX yylex(&yylval, &yylloc) -#endif -#else /* not YYLSP_NEEDED */ -#ifdef YYLEX_PARAM -#define YYLEX yylex(&yylval, YYLEX_PARAM) -#else -#define YYLEX yylex(&yylval) -#endif -#endif /* not YYLSP_NEEDED */ -#endif -/* If nonreentrant, generate the variables here */ +/* YYLLOC_DEFAULT -- Compute the default location (before the actions + are run). -#ifndef YYPURE + When YYLLOC_DEFAULT is run, CURRENT is set the location of the + first token. By default, to implement support for ranges, extend + its range to the last symbol. */ -int yychar; /* the lookahead symbol */ -YYSTYPE yylval; /* the semantic value of the */ - /* lookahead symbol */ - -#ifdef YYLSP_NEEDED -YYLTYPE yylloc; /* location data for the lookahead */ - /* symbol */ -#endif - -int yynerrs; /* number of parse errors so far */ -#endif /* not YYPURE */ - -#if YYDEBUG != 0 -int yydebug; /* nonzero means print parse trace */ -/* Since this is uninitialized, it does not stop multiple parsers - from coexisting. */ +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + Current.last_line = Rhs[N].last_line; \ + Current.last_column = Rhs[N].last_column; #endif -/* YYINITDEPTH indicates the initial size of the parser's stacks */ +/* YYLEX -- calling `yylex' with the right arguments. */ + +#if YYPURE +# if YYLSP_NEEDED +# ifdef YYLEX_PARAM +# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) +# else +# define YYLEX yylex (&yylval, &yylloc) +# endif +# else /* !YYLSP_NEEDED */ +# ifdef YYLEX_PARAM +# define YYLEX yylex (&yylval, YYLEX_PARAM) +# else +# define YYLEX yylex (&yylval) +# endif +# endif /* !YYLSP_NEEDED */ +#else /* !YYPURE */ +# define YYLEX yylex () +#endif /* !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) +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +#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; -{ - register char *f = from; - register char *t = to; - register int i = count; +#ifdef YYERROR_VERBOSE - while (i-- > 0) - *t++ = *f++; -} +# 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 const char *yys = yystr; -#else /* __cplusplus */ + while (*yys++ != '\0') + continue; -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (char *to, char *from, unsigned int count) + 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 *t = to; - register char *f = from; - register int i = count; + register char *yyd = yydest; + register const char *yys = yysrc; - while (i-- > 0) - *t++ = *f++; -} + while ((*yyd++ = *yys++) != '\0') + continue; -#endif + return yyd - 1; +} +# endif +# endif #endif -#line 217 "/usr/local/share/bison.simple" +#line 315 "/usr/local/share/bison/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 *. @@ -522,76 +643,121 @@ __yy_memcpy (char *to, char *from, unsigned int count) to the proper pointer type. */ #ifdef YYPARSE_PARAM -#ifdef __cplusplus -#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM -#define YYPARSE_PARAM_DECL -#else /* not __cplusplus */ -#define YYPARSE_PARAM_ARG YYPARSE_PARAM -#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; -#endif /* not __cplusplus */ -#else /* not YYPARSE_PARAM */ -#define YYPARSE_PARAM_ARG -#define YYPARSE_PARAM_DECL -#endif /* not YYPARSE_PARAM */ +# if defined (__STDC__) || defined (__cplusplus) +# define YYPARSE_PARAM_ARG void *YYPARSE_PARAM +# define YYPARSE_PARAM_DECL +# else +# define YYPARSE_PARAM_ARG YYPARSE_PARAM +# define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; +# endif +#else /* !YYPARSE_PARAM */ +# define YYPARSE_PARAM_ARG +# define YYPARSE_PARAM_DECL +#endif /* !YYPARSE_PARAM */ /* Prevent warning if -Wstrict-prototypes. */ #ifdef __GNUC__ -#ifdef YYPARSE_PARAM +# ifdef YYPARSE_PARAM int yyparse (void *); -#else +# else int yyparse (void); +# endif #endif + +/* YY_DECL_VARIABLES -- depending whether we use a pure parser, + variables are global, or local to YYPARSE. */ + +#define YY_DECL_NON_LSP_VARIABLES \ +/* The lookahead symbol. */ \ +int yychar; \ + \ +/* The semantic value of the lookahead symbol. */ \ +YYSTYPE yylval; \ + \ +/* Number of parse errors so far. */ \ +int yynerrs; + +#if YYLSP_NEEDED +# define YY_DECL_VARIABLES \ +YY_DECL_NON_LSP_VARIABLES \ + \ +/* Location data for the lookahead symbol. */ \ +YYLTYPE yylloc; +#else +# define YY_DECL_VARIABLES \ +YY_DECL_NON_LSP_VARIABLES #endif + +/* If nonreentrant, generate the variables here. */ + +#if !YYPURE +YY_DECL_VARIABLES +#endif /* !YYPURE */ + int -yyparse(YYPARSE_PARAM_ARG) +yyparse (YYPARSE_PARAM_ARG) YYPARSE_PARAM_DECL { + /* If reentrant, generate the variables here. */ +#if YYPURE + YY_DECL_VARIABLES +#endif /* !YYPURE */ + 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 yychar1 = 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 */ - short *yyss = yyssa; /* refer to the stacks thru separate pointers */ - YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + register YYSTYPE *yyvsp; -#ifdef YYLSP_NEEDED - YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ +#if YYLSP_NEEDED + /* The location stack. */ + YYLTYPE yylsa[YYINITDEPTH]; YYLTYPE *yyls = yylsa; YYLTYPE *yylsp; +#endif -#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) +#if YYLSP_NEEDED +# define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) #else -#define YYPOPSTACK (yyvsp--, yyssp--) +# 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 - YYSTYPE yyval; /* the variable used to return */ - /* semantic values from the action */ - /* routines */ + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; +#if YYLSP_NEEDED + YYLTYPE yyloc; +#endif + /* 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; @@ -603,110 +769,110 @@ 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 +#if YYLSP_NEEDED yylsp = yyls; #endif + goto yysetstate; -/* 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: +/*------------------------------------------------------------. +| 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++; - *++yyssp = yystate; + yysetstate: + *yyssp = yystate; if (yyssp >= yyss + yystacksize - 1) { - /* Give user a chance to reallocate the stack */ - /* Use copies of these so that the &'s don't force the real ones into memory. */ - YYSTYPE *yyvs1 = yyvs; - short *yyss1 = yyss; -#ifdef YYLSP_NEEDED - YYLTYPE *yyls1 = yyls; -#endif - /* Get the current used size of the three stacks, in elements. */ - int size = yyssp - yyss + 1; + 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. */ +# if YYLSP_NEEDED + YYLTYPE *yyls1 = yyls; + /* 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), + &yyls1, yysize * sizeof (*yylsp), + &yystacksize); + yyls = yyls1; +# else + yyoverflow ("parser stack overflow", + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); +# endif + 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; - } + goto yyoverflowlab; yystacksize *= 2; if (yystacksize > YYMAXDEPTH) yystacksize = YYMAXDEPTH; -#ifndef YYSTACK_USE_ALLOCA - yyfree_stacks = 1; -#endif - yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); - __yy_memcpy ((char *)yyss, (char *)yyss1, - size * (unsigned int) sizeof (*yyssp)); - yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); - __yy_memcpy ((char *)yyvs, (char *)yyvs1, - size * (unsigned int) sizeof (*yyvsp)); -#ifdef YYLSP_NEEDED - yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); - __yy_memcpy ((char *)yyls, (char *)yyls1, - size * (unsigned int) sizeof (*yylsp)); -#endif + + { + short *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyoverflowlab; + YYSTACK_RELOCATE (yyss); + YYSTACK_RELOCATE (yyvs); +# if YYLSP_NEEDED + YYSTACK_RELOCATE (yyls); +# endif +# 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; + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; +#if YYLSP_NEEDED + yylsp = yyls + yysize - 1; #endif -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Stack size increased to %d\n", yystacksize); -#endif + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); if (yyssp >= yyss + yystacksize - 1) 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. */ @@ -725,10 +891,7 @@ yynewstate: if (yychar == YYEMPTY) { -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Reading a token: "); -#endif + YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } @@ -739,25 +902,25 @@ yynewstate: yychar1 = 0; yychar = YYEOF; /* Don't call YYLEX any more */ -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Now at end of input.\n"); -#endif + YYDPRINTF ((stderr, "Now at end of input.\n")); } else { - yychar1 = YYTRANSLATE(yychar); + yychar1 = YYTRANSLATE (yychar); -#if YYDEBUG != 0 +#if YYDEBUG + /* We have to keep this `#if YYDEBUG', since we use variables + which are defined only if `YYDEBUG' is set. */ 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 + YYFPRINTF (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 + YYFPRINTF (stderr, ")\n"); } #endif } @@ -789,56 +952,78 @@ yynewstate: YYACCEPT; /* Shift the lookahead token. */ - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); -#endif + YYDPRINTF ((stderr, "Shifting token %d (%s), ", + yychar, yytname[yychar1])); /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; -#ifdef YYLSP_NEEDED +#if 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 YYLEN is nonzero, implement the default value of the action: + `$$ = $1'. + + Otherwise, the following line sets YYVAL to the semantic value of + the lookahead token. 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]; + +#if YYLSP_NEEDED + /* Similarly for the default location. Let the user run additional + commands if for instance locations are ranges. */ + yyloc = yylsp[1-yylen]; + YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); +#endif + +#if YYDEBUG + /* We have to keep this `#if YYDEBUG', since we use variables which + are defined only if `YYDEBUG' is set. */ if (yydebug) { - int i; + int yyi; - fprintf (stderr, "Reducing via rule %d (line %d), ", - yyn, yyrline[yyn]); + YYFPRINTF (stderr, "Reducing via rule %d (line %d), ", + yyn, yyrline[yyn]); /* Print the symbols being reduced, and their result. */ - for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) - fprintf (stderr, "%s ", yytname[yyrhs[i]]); - fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); + for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++) + YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); + YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]); } #endif - switch (yyn) { case 1: @@ -847,119 +1032,105 @@ case 1: if (yyvsp[0].exp == NULL) YYABORT; ((struct parse_args *) arg)->res = yyvsp[0].exp; - ; - break;} + } + break; case 2: #line 183 "plural.y" { yyval.exp = new_exp_3 (qmop, yyvsp[-4].exp, yyvsp[-2].exp, yyvsp[0].exp); - ; - break;} + } + break; case 3: #line 187 "plural.y" { yyval.exp = new_exp_2 (lor, yyvsp[-2].exp, yyvsp[0].exp); - ; - break;} + } + break; case 4: #line 191 "plural.y" { yyval.exp = new_exp_2 (land, yyvsp[-2].exp, yyvsp[0].exp); - ; - break;} + } + break; case 5: #line 195 "plural.y" { yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp); - ; - break;} + } + break; case 6: #line 199 "plural.y" { yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp); - ; - break;} + } + break; case 7: #line 203 "plural.y" { yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp); - ; - break;} + } + break; case 8: #line 207 "plural.y" { yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp); - ; - break;} + } + break; case 9: #line 211 "plural.y" { yyval.exp = new_exp_1 (lnot, yyvsp[0].exp); - ; - break;} + } + break; case 10: #line 215 "plural.y" { yyval.exp = new_exp_0 (var); - ; - break;} + } + break; case 11: #line 219 "plural.y" { if ((yyval.exp = new_exp_0 (num)) != NULL) yyval.exp->val.num = yyvsp[0].num; - ; - break;} + } + break; case 12: #line 224 "plural.y" { yyval.exp = yyvsp[-1].exp; - ; - break;} + } + break; } - /* the action file gets copied in in place of this dollarsign */ -#line 543 "/usr/local/share/bison.simple" + +#line 705 "/usr/local/share/bison/bison.simple" + yyvsp -= yylen; yyssp -= yylen; -#ifdef YYLSP_NEEDED +#if YYLSP_NEEDED yylsp -= yylen; #endif -#if YYDEBUG != 0 +#if YYDEBUG if (yydebug) { - short *ssp1 = yyss - 1; - fprintf (stderr, "state stack now"); - while (ssp1 != yyssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); + short *yyssp1 = yyss - 1; + YYFPRINTF (stderr, "state stack now"); + while (yyssp1 != yyssp) + YYFPRINTF (stderr, " %d", *++yyssp1); + YYFPRINTF (stderr, "\n"); } #endif *++yyvsp = yyval; - -#ifdef YYLSP_NEEDED - yylsp++; - if (yylen == 0) - { - yylsp->first_line = yylloc.first_line; - yylsp->first_column = yylloc.first_column; - yylsp->last_line = (yylsp-1)->last_line; - yylsp->last_column = (yylsp-1)->last_column; - yylsp->text = 0; - } - else - { - yylsp->last_line = (yylsp+yylen-1)->last_line; - yylsp->last_column = (yylsp+yylen-1)->last_column; - } +#if YYLSP_NEEDED + *++yylsp = yyloc; #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]; @@ -971,10 +1142,13 @@ case 12: 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; @@ -983,102 +1157,121 @@ yyerrlab: /* here on detecting error */ if (yyn > YYFLAG && yyn < YYLAST) { - int size = 0; - char *msg; - int x, count; - - count = 0; - /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - size += strlen(yytname[x]) + 15, count++; - msg = (char *) malloc(size + 15); - if (msg != 0) + YYSIZE_T yysize = 0; + 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) + yysize += yystrlen (yytname[yyx]) + 15, yycount++; + yysize += yystrlen ("parse error, unexpected ") + 1; + yysize += yystrlen (yytname[YYTRANSLATE (yychar)]); + yymsg = (char *) YYSTACK_ALLOC (yysize); + if (yymsg != 0) { - strcpy(msg, "parse error"); + char *yyp = yystpcpy (yymsg, "parse error, unexpected "); + yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]); - 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) { - 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 ("parse error; also virtual memory exhausted"); } else -#endif /* YYERROR_VERBOSE */ - yyerror("parse error"); +#endif /* defined (YYERROR_VERBOSE) */ + yyerror ("parse error"); } - goto yyerrlab1; -yyerrlab1: /* here on error raised explicitly by an action */ + +/*--------------------------------------------------. +| yyerrlab1 -- error raised explicitly by an action | +`--------------------------------------------------*/ +yyerrlab1: 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 */ if (yychar == YYEOF) YYABORT; - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); -#endif - + YYDPRINTF ((stderr, "Discarding token %d (%s).\n", + yychar, yytname[yychar1])); yychar = YYEMPTY; } - /* Else will try to reuse lookahead token - after shifting the error token. */ + /* Else will try to reuse lookahead token after shifting the error + token. */ yyerrstatus = 3; /* Each real token shifted decrements this */ goto yyerrhandle; -yyerrdefault: /* current state does not do anything special for the error token. */ +/*-------------------------------------------------------------------. +| yyerrdefault -- current state does not do anything special for the | +| error token. | +`-------------------------------------------------------------------*/ +yyerrdefault: #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; + + /* If its default is to accept any token, ok. Otherwise pop it. */ + yyn = yydefact[yystate]; + if (yyn) + goto yydefault; #endif -yyerrpop: /* pop the current state because it cannot handle the error token */ - if (yyssp == yyss) YYABORT; +/*---------------------------------------------------------------. +| yyerrpop -- pop the current state because it cannot handle the | +| error token | +`---------------------------------------------------------------*/ +yyerrpop: + if (yyssp == yyss) + YYABORT; yyvsp--; yystate = *--yyssp; -#ifdef YYLSP_NEEDED +#if YYLSP_NEEDED yylsp--; #endif -#if YYDEBUG != 0 +#if YYDEBUG if (yydebug) { - short *ssp1 = yyss - 1; - fprintf (stderr, "Error: state stack now"); - while (ssp1 != yyssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); + short *yyssp1 = yyss - 1; + YYFPRINTF (stderr, "Error: state stack now"); + while (yyssp1 != yyssp) + YYFPRINTF (stderr, " %d", *++yyssp1); + YYFPRINTF (stderr, "\n"); } #endif +/*--------------. +| yyerrhandle. | +`--------------*/ yyerrhandle: - yyn = yypact[yystate]; if (yyn == YYFLAG) goto yyerrdefault; @@ -1101,42 +1294,45 @@ yyerrhandle: 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 +#if YYLSP_NEEDED *++yylsp = yylloc; #endif yystate = yyn; goto yynewstate; - yyacceptlab: - /* YYACCEPT comes here. */ - if (yyfree_stacks) - { - free (yyss); - free (yyvs); -#ifdef YYLSP_NEEDED - free (yyls); -#endif - } - return 0; - yyabortlab: - /* YYABORT comes here. */ - if (yyfree_stacks) - { - free (yyss); - free (yyvs); -#ifdef YYLSP_NEEDED - free (yyls); +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturn; + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturn; + +/*---------------------------------------------. +| yyoverflowab -- parser overflow comes here. | +`---------------------------------------------*/ +yyoverflowlab: + yyerror ("parser stack overflow"); + yyresult = 2; + /* Fall through. */ + +yyreturn: +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); #endif - } - return 1; + return yyresult; } #line 229 "plural.y" diff --git a/intl/relocatable.c b/intl/relocatable.c new file mode 100644 index 00000000..16f79a52 --- /dev/null +++ b/intl/relocatable.c @@ -0,0 +1,439 @@ +/* Provide relocatable packages. + Copyright (C) 2003 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2003. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + + +/* Tell glibc's <stdio.h> to provide a prototype for getline(). + This must come before <config.h> because <config.h> may include + <features.h>, and once <features.h> has been included, it's too late. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +/* Specification. */ +#include "relocatable.h" + +#if ENABLE_RELOCATABLE + +#include <stddef.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#ifdef NO_XMALLOC +# define xmalloc malloc +#else +# include "xmalloc.h" +#endif + +#if DEPENDS_ON_LIBCHARSET +# include <libcharset.h> +#endif +#if DEPENDS_ON_LIBICONV && HAVE_ICONV +# include <iconv.h> +#endif +#if DEPENDS_ON_LIBINTL && ENABLE_NLS +# include <libintl.h> +#endif + +/* Faked cheap 'bool'. */ +#undef bool +#undef false +#undef true +#define bool int +#define false 0 +#define true 1 + +/* Pathname support. + ISSLASH(C) tests whether C is a directory separator character. + IS_PATH_WITH_DIR(P) tests whether P contains a directory specification. + */ +#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__ + /* Win32, OS/2, DOS */ +# define ISSLASH(C) ((C) == '/' || (C) == '\\') +# define HAS_DEVICE(P) \ + ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \ + && (P)[1] == ':') +# define IS_PATH_WITH_DIR(P) \ + (strchr (P, '/') != NULL || strchr (P, '\\') != NULL || HAS_DEVICE (P)) +# define FILESYSTEM_PREFIX_LEN(P) (HAS_DEVICE (P) ? 2 : 0) +#else + /* Unix */ +# define ISSLASH(C) ((C) == '/') +# define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL) +# define FILESYSTEM_PREFIX_LEN(P) 0 +#endif + +/* Original installation prefix. */ +static char *orig_prefix; +static size_t orig_prefix_len; +/* Current installation prefix. */ +static char *curr_prefix; +static size_t curr_prefix_len; +/* These prefixes do not end in a slash. Anything that will be concatenated + to them must start with a slash. */ + +/* Sets the original and the current installation prefix of this module. + Relocation simply replaces a pathname starting with the original prefix + by the corresponding pathname with the current prefix instead. Both + prefixes should be directory names without trailing slash (i.e. use "" + instead of "/"). */ +static void +set_this_relocation_prefix (const char *orig_prefix_arg, + const char *curr_prefix_arg) +{ + if (orig_prefix_arg != NULL && curr_prefix_arg != NULL + /* Optimization: if orig_prefix and curr_prefix are equal, the + relocation is a nop. */ + && strcmp (orig_prefix_arg, curr_prefix_arg) != 0) + { + /* Duplicate the argument strings. */ + char *memory; + + orig_prefix_len = strlen (orig_prefix_arg); + curr_prefix_len = strlen (curr_prefix_arg); + memory = (char *) xmalloc (orig_prefix_len + 1 + curr_prefix_len + 1); +#ifdef NO_XMALLOC + if (memory != NULL) +#endif + { + memcpy (memory, orig_prefix_arg, orig_prefix_len + 1); + orig_prefix = memory; + memory += orig_prefix_len + 1; + memcpy (memory, curr_prefix_arg, curr_prefix_len + 1); + curr_prefix = memory; + return; + } + } + orig_prefix = NULL; + curr_prefix = NULL; + /* Don't worry about wasted memory here - this function is usually only + called once. */ +} + +/* Sets the original and the current installation prefix of the package. + Relocation simply replaces a pathname starting with the original prefix + by the corresponding pathname with the current prefix instead. Both + prefixes should be directory names without trailing slash (i.e. use "" + instead of "/"). */ +void +set_relocation_prefix (const char *orig_prefix_arg, const char *curr_prefix_arg) +{ + set_this_relocation_prefix (orig_prefix_arg, curr_prefix_arg); + + /* Now notify all dependent libraries. */ +#if DEPENDS_ON_LIBCHARSET + libcharset_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg); +#endif +#if DEPENDS_ON_LIBICONV && HAVE_ICONV && _LIBICONV_VERSION >= 0x0109 + libiconv_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg); +#endif +#if DEPENDS_ON_LIBINTL && ENABLE_NLS && defined libintl_set_relocation_prefix + libintl_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg); +#endif +} + +/* Convenience function: + Computes the current installation prefix, based on the original + installation prefix, the original installation directory of a particular + file, and the current pathname of this file. Returns NULL upon failure. */ +#ifdef IN_LIBRARY +#define compute_curr_prefix local_compute_curr_prefix +static +#endif +const char * +compute_curr_prefix (const char *orig_installprefix, + const char *orig_installdir, + const char *curr_pathname) +{ + const char *curr_installdir; + const char *rel_installdir; + + if (curr_pathname == NULL) + return NULL; + + /* Determine the relative installation directory, relative to the prefix. + This is simply the difference between orig_installprefix and + orig_installdir. */ + if (strncmp (orig_installprefix, orig_installdir, strlen (orig_installprefix)) + != 0) + /* Shouldn't happen - nothing should be installed outside $(prefix). */ + return NULL; + rel_installdir = orig_installdir + strlen (orig_installprefix); + + /* Determine the current installation directory. */ + { + const char *p_base = curr_pathname + FILESYSTEM_PREFIX_LEN (curr_pathname); + const char *p = curr_pathname + strlen (curr_pathname); + char *q; + + while (p > p_base) + { + p--; + if (ISSLASH (*p)) + break; + } + + q = (char *) xmalloc (p - curr_pathname + 1); +#ifdef NO_XMALLOC + if (q == NULL) + return NULL; +#endif + memcpy (q, curr_pathname, p - curr_pathname); + q[p - curr_pathname] = '\0'; + curr_installdir = q; + } + + /* Compute the current installation prefix by removing the trailing + rel_installdir from it. */ + { + const char *rp = rel_installdir + strlen (rel_installdir); + const char *cp = curr_installdir + strlen (curr_installdir); + const char *cp_base = + curr_installdir + FILESYSTEM_PREFIX_LEN (curr_installdir); + + while (rp > rel_installdir && cp > cp_base) + { + bool same = false; + const char *rpi = rp; + const char *cpi = cp; + + while (rpi > rel_installdir && cpi > cp_base) + { + rpi--; + cpi--; + if (ISSLASH (*rpi) || ISSLASH (*cpi)) + { + if (ISSLASH (*rpi) && ISSLASH (*cpi)) + same = true; + break; + } +#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__ + /* Win32, OS/2, DOS - case insignificant filesystem */ + if ((*rpi >= 'a' && *rpi <= 'z' ? *rpi - 'a' + 'A' : *rpi) + != (*cpi >= 'a' && *cpi <= 'z' ? *cpi - 'a' + 'A' : *cpi)) + break; +#else + if (*rpi != *cpi) + break; +#endif + } + if (!same) + break; + /* The last pathname component was the same. opi and cpi now point + to the slash before it. */ + rp = rpi; + cp = cpi; + } + + if (rp > rel_installdir) + /* Unexpected: The curr_installdir does not end with rel_installdir. */ + return NULL; + + { + size_t curr_prefix_len = cp - curr_installdir; + char *curr_prefix; + + curr_prefix = (char *) xmalloc (curr_prefix_len + 1); +#ifdef NO_XMALLOC + if (curr_prefix == NULL) + return NULL; +#endif + memcpy (curr_prefix, curr_installdir, curr_prefix_len); + curr_prefix[curr_prefix_len] = '\0'; + + return curr_prefix; + } + } +} + +#if defined PIC && defined INSTALLDIR + +/* Full pathname of shared library, or NULL. */ +static char *shared_library_fullname; + +#if defined _WIN32 || defined __WIN32__ + +/* Determine the full pathname of the shared library when it is loaded. */ + +BOOL WINAPI +DllMain (HINSTANCE module_handle, DWORD event, LPVOID reserved) +{ + (void) reserved; + + if (event == DLL_PROCESS_ATTACH) + { + /* The DLL is being loaded into an application's address range. */ + static char location[MAX_PATH]; + + if (!GetModuleFileName (module_handle, location, sizeof (location))) + /* Shouldn't happen. */ + return FALSE; + + if (!IS_PATH_WITH_DIR (location)) + /* Shouldn't happen. */ + return FALSE; + + shared_library_fullname = strdup (location); + } + + return TRUE; +} + +#else /* Unix */ + +static void +find_shared_library_fullname () +{ +#ifdef __linux__ + FILE *fp; + + /* Open the current process' maps file. It describes one VMA per line. */ + fp = fopen ("/proc/self/maps", "r"); + if (fp) + { + unsigned long address = (unsigned long) &find_shared_library_fullname; + for (;;) + { + unsigned long start, end; + int c; + + if (fscanf (fp, "%lx-%lx", &start, &end) != 2) + break; + if (address >= start && address <= end - 1) + { + /* Found it. Now see if this line contains a filename. */ + while (c = getc (fp), c != EOF && c != '\n' && c != '/') + continue; + if (c == '/') + { + size_t size; + int len; + + ungetc (c, fp); + shared_library_fullname = NULL; size = 0; + len = getline (&shared_library_fullname, &size, fp); + if (len >= 0) + { + /* Success: filled shared_library_fullname. */ + if (len > 0 && shared_library_fullname[len - 1] == '\n') + shared_library_fullname[len - 1] = '\0'; + } + } + break; + } + while (c = getc (fp), c != EOF && c != '\n') + continue; + } + fclose (fp); + } +#endif +} + +#endif /* WIN32 / Unix */ + +/* Return the full pathname of the current shared library. + Return NULL if unknown. + Guaranteed to work only on Linux and Woe32. */ +static char * +get_shared_library_fullname () +{ +#if !(defined _WIN32 || defined __WIN32__) + static bool tried_find_shared_library_fullname; + if (!tried_find_shared_library_fullname) + { + find_shared_library_fullname (); + tried_find_shared_library_fullname = true; + } +#endif + return shared_library_fullname; +} + +#endif /* PIC */ + +/* Returns the pathname, relocated according to the current installation + directory. */ +const char * +relocate (const char *pathname) +{ +#if defined PIC && defined INSTALLDIR + static int initialized; + + /* Initialization code for a shared library. */ + if (!initialized) + { + /* At this point, orig_prefix and curr_prefix likely have already been + set through the main program's set_program_name_and_installdir + function. This is sufficient in the case that the library has + initially been installed in the same orig_prefix. But we can do + better, to also cover the cases that 1. it has been installed + in a different prefix before being moved to orig_prefix and (later) + to curr_prefix, 2. unlike the program, it has not moved away from + orig_prefix. */ + const char *orig_installprefix = INSTALLPREFIX; + const char *orig_installdir = INSTALLDIR; + const char *curr_prefix_better; + + curr_prefix_better = + compute_curr_prefix (orig_installprefix, orig_installdir, + get_shared_library_fullname ()); + if (curr_prefix_better == NULL) + curr_prefix_better = curr_prefix; + + set_relocation_prefix (orig_installprefix, curr_prefix_better); + + initialized = 1; + } +#endif + + /* Note: It is not necessary to perform case insensitive comparison here, + even for DOS-like filesystems, because the pathname argument was + typically created from the same Makefile variable as orig_prefix came + from. */ + if (orig_prefix != NULL && curr_prefix != NULL + && strncmp (pathname, orig_prefix, orig_prefix_len) == 0) + { + if (pathname[orig_prefix_len] == '\0') + /* pathname equals orig_prefix. */ + return curr_prefix; + if (ISSLASH (pathname[orig_prefix_len])) + { + /* pathname starts with orig_prefix. */ + const char *pathname_tail = &pathname[orig_prefix_len]; + char *result = + (char *) xmalloc (curr_prefix_len + strlen (pathname_tail) + 1); + +#ifdef NO_XMALLOC + if (result != NULL) +#endif + { + memcpy (result, curr_prefix, curr_prefix_len); + strcpy (result + curr_prefix_len, pathname_tail); + return result; + } + } + } + /* Nothing to relocate. */ + return pathname; +} + +#endif diff --git a/intl/relocatable.h b/intl/relocatable.h new file mode 100644 index 00000000..d141200a --- /dev/null +++ b/intl/relocatable.h @@ -0,0 +1,67 @@ +/* Provide relocatable packages. + Copyright (C) 2003 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2003. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ + +#ifndef _RELOCATABLE_H +#define _RELOCATABLE_H + +/* This can be enabled through the configure --enable-relocatable option. */ +#if ENABLE_RELOCATABLE + +/* When building a DLL, we must export some functions. Note that because + this is a private .h file, we don't need to use __declspec(dllimport) + in any case. */ +#if defined _MSC_VER && BUILDING_DLL +# define RELOCATABLE_DLL_EXPORTED __declspec(dllexport) +#else +# define RELOCATABLE_DLL_EXPORTED +#endif + +/* Sets the original and the current installation prefix of the package. + Relocation simply replaces a pathname starting with the original prefix + by the corresponding pathname with the current prefix instead. Both + prefixes should be directory names without trailing slash (i.e. use "" + instead of "/"). */ +extern RELOCATABLE_DLL_EXPORTED void + set_relocation_prefix (const char *orig_prefix, + const char *curr_prefix); + +/* Returns the pathname, relocated according to the current installation + directory. */ +extern const char * relocate (const char *pathname); + +/* Memory management: relocate() leaks memory, because it has to construct + a fresh pathname. If this is a problem because your program calls + relocate() frequently, think about caching the result. */ + +/* Convenience function: + Computes the current installation prefix, based on the original + installation prefix, the original installation directory of a particular + file, and the current pathname of this file. Returns NULL upon failure. */ +extern const char * compute_curr_prefix (const char *orig_installprefix, + const char *orig_installdir, + const char *curr_pathname); + +#else + +/* By default, we use the hardwired pathnames. */ +#define relocate(pathname) (pathname) + +#endif + +#endif /* _RELOCATABLE_H */ @@ -103,6 +103,51 @@ enum inet_prot { INET_NONE, INET_TCP, INET_UDP, INET_RAW }; typedef enum { CLOSE_ALL, CLOSE_TO, CLOSE_FROM } two_way_close_type; +/* Several macros make the code a bit clearer: */ +/* */ +/* */ +/* <defines and enums>= */ +#define at_eof(iop) ((iop->flag & IOP_AT_EOF) != 0) +#define has_no_data(iop) (iop->dataend == NULL) +#define no_data_left(iop) (iop->off >= iop->dataend) +/* The key point to the design is to split out the code that searches through */ +/* a buffer looking for the record and the terminator into separate routines, */ +/* with a higher-level routine doing the reading of data and buffer management. */ +/* This makes the code easier to manage; the buffering code is the same independent */ +/* of how we find a record. Communication is via the return value: */ +/* */ +/* */ +/* <defines and enums>= */ +typedef enum recvalues { + REC_OK, /* record and terminator found, recmatch struct filled in */ + NOTERM, /* no terminator found, give me more input data */ + TERMATEND, /* found terminator at end of buffer */ + TERMNEAREND, /* found terminator close to end of buffer, for RE might be bigger */ +} RECVALUE; +/* Between calls to a scanning routine, the state is stored in */ +/* an [[enum scanstate]] variable. Not all states apply to all */ +/* variants, but the higher code doesn't really care. */ +/* */ +/* */ +/* <defines and enums>= */ +typedef enum scanstate { + NOSTATE, /* scanning not started yet (all) */ + INLEADER, /* skipping leading data (RS = "") */ + INDATA, /* in body of record (all) */ + INTERM, /* scanning terminator (RS = "", RS = regexp) */ +} SCANSTATE; +/* When a record is seen ([[REC_OK]] or [[TERMATEND]]), the following */ +/* structure is filled in. */ +/* */ +/* */ +/* <recmatch>= */ +struct recmatch { + char *start; /* record start */ + size_t len; /* length of record */ + char *rt_start; /* start of terminator */ + size_t rt_len; /* length of terminator */ +}; + static IOBUF *nextfile P((int skipping)); static int inrec P((IOBUF *iop)); static int iop_close P((IOBUF *iop)); @@ -125,11 +170,13 @@ static int useropen P((IOBUF *iop, const char *name, const char *mode)); 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 RECVALUE rs1scan P((IOBUF *iop, struct recmatch *recm, SCANSTATE *state)); +static RECVALUE rsnullscan P((IOBUF *iop, struct recmatch *recm, SCANSTATE *state)); +static RECVALUE rsrescan P((IOBUF *iop, struct recmatch *recm, SCANSTATE *state)); -static int (*get_a_record)P((char **out, IOBUF *iop, int rs, Regexp *RSre, int *errcode)) = rs1_get_a_record; +static RECVALUE (*matchrec) P((IOBUF *iop, struct recmatch *recm, SCANSTATE *state)) = rs1scan; + +static int get_a_record P((char **out, IOBUF *iop, int *errcode)); #if defined(HAVE_POPEN_H) #include "popen.h" @@ -152,7 +199,8 @@ extern NODE **fields_arr; static jmp_buf filebuf; /* for do_nextfile() */ -#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__EMX__) +#if defined(MSDOS) || defined(OS2) || defined(WIN32) \ + || defined(__EMX__) || defined(__CYGWIN__) static const char * binmode(const char *mode) { @@ -210,7 +258,7 @@ nextfile(int skipping) return NULL; } if (curfile != NULL) { - if ((curfile->flag & IOP_AT_EOF) != 0 && curfile->off >= curfile->dataend) { + if (at_eof(curfile)) { (void) iop_close(curfile); curfile = NULL; } else @@ -285,12 +333,12 @@ inrec(IOBUF *iop) register int cnt; int retval = 0; - if ((iop->flag & IOP_AT_EOF) != 0 && iop->off >= iop->dataend) + if (at_eof(iop) && no_data_left(iop)) cnt = EOF; else if ((iop->flag & IOP_CLOSED) != 0) cnt = EOF; else - cnt = get_a_record(&begin, iop, RS->stptr[0], RS_regexp, NULL); + cnt = get_a_record(&begin, iop, NULL); if (cnt == EOF) { cnt = 0; @@ -785,6 +833,16 @@ do_close(NODE *tree) fflush(stdout); /* synchronize regular output */ tmp = tmp_number((AWKNUM) close_redir(rp, FALSE, how)); rp = NULL; + /* + * POSIX says close() returns 0 on success, non-zero otherwise. + * For POSIX, at this point we just return 0. Otherwise we + * return the exit status of the process or of pclose(), depending. + * This whole business is a mess. + */ + if (do_posix) { + free_temp(tmp); + return tmp_number((AWKNUM) 0); + } return tmp; } @@ -1336,6 +1394,7 @@ spec_setup(IOBUF *iop, int len, int allocate) iop->count = 0; iop->size = len; iop->end = iop->buf + len; + iop->dataend = iop->end; iop->fd = -1; iop->flag = IOP_IS_INTERNAL; } @@ -2186,7 +2245,7 @@ do_getline(NODE *tree) return tmp_number((AWKNUM) 0.0); } errcode = 0; - cnt = get_a_record(&s, iop, RS->stptr[0], RS_regexp, &errcode); + cnt = get_a_record(&s, iop, &errcode); if (errcode != 0) { if (! do_traditional) update_ERRNO(); @@ -2364,7 +2423,7 @@ iop_alloc(int fd, const char *name, IOBUF *iop) lintwarn(_("data file `%s' is empty"), name); errno = 0; iop->fd = fd; - iop->count = iop->total = iop->scanoff = 0; + iop->count = iop->scanoff = 0; iop->name = name; emalloc(iop->buf, char *, iop->size += 2, "iop_alloc"); iop->off = iop->buf; @@ -2421,817 +2480,497 @@ grow_iop_buffer(IOBUF *iop) iop->end = iop->buf + iop->size; } -/* <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 */ +/* Here are the routines. */ +/* */ +/* */ +/* <rs1scan>= */ +/* rs1scan --- scan for a single character record terminator */ + +static RECVALUE +rs1scan(IOBUF *iop, struct recmatch *recm, SCANSTATE *state) { - /* We need a pointer into the buffer. */ - /* */ - /* <rs1 local vars>= */ register char *bp; - long retval; + register char rs; #ifdef MBS_SUPPORT - size_t mbclen = 0; - mbstate_t mbs; + size_t mbclen = 0; + mbstate_t mbs; #endif + memset(recm, '\0', sizeof(struct recmatch)); + rs = RS->stptr[0]; + *(iop->dataend) = rs; /* set sentinel */ + recm->start = iop->off; /* beginning of record */ - /* 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; + if (*state == INDATA) /* skip over data we've already seen */ + bp += iop->scanoff; - /* 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; +#ifdef MBS_SUPPORT + /* + * From: Bruno Haible <bruno@clisp.org> + * To: Aharon Robbins <arnold@skeeve.com>, gnits@gnits.org + * Subject: Re: multibyte locales: any way to find if a character isn't multibyte? + * Date: Mon, 23 Jun 2003 12:20:16 +0200 + * Cc: isamu@yamato.ibm.com + * + * Hi, + * + * > Is there any way to make the following query to the current locale? + * > + * > Given an 8-bit value, can this value ever appear as part of + * > a multibyte character? + * + * There is no simple answer here. The easiest solution I see is to + * get the current locale's codeset (via locale_charset() which is a + * wrapper around nl_langinfo(CODESET)), and then perform a case-by-case + * treatment of the known multibyte encodings, from GB2312 to EUC-JISX0213; + * for the unibyte encodings, a single btowc() call will tell you. + * + * > This is particularly critical for me for ASCII newline ('\n'). If I + * > can be guaranteed that it never shows up as part of a multibyte character, + * > I can speed up gawk considerably in mulitbyte locales. + * + * This is much simpler to answer! + * In all ASCII based multibyte encodings used for locales today (this + * excludes EBCDIC based doublebyte encodings from IBM, and also excludes + * ISO-2022-JP which is used for email exchange but not as a locale encoding) + * ALL bytes in the range 0x00..0x2F occur only as a single character, not + * as part of a multibyte character. + * + * So it's safe to assume, but deserves a comment in the source. + * + * Bruno + *************************************************************** + * From: Bruno Haible <bruno@clisp.org> + * To: Aharon Robbins <arnold@skeeve.com> + * Subject: Re: multibyte locales: any way to find if a character isn't multibyte? + * Date: Mon, 23 Jun 2003 14:27:49 +0200 + * + * On Monday 23 June 2003 14:11, you wrote: + * + * > if (rs != '\n' && MB_CUR_MAX > 1) { + * + * If you assume ASCII, you can even write + * + * if (rs >= 0x30 && MB_CUR_MAX > 1) { + * + * (this catches also the space character) but if portability to EBCDIC + * systems is desired, your code is fine as is. + * + * Bruno + */ + /* Thus, the check for \n here; big speedup ! */ + if (rs != '\n' && gawk_mb_cur_max > 1) { + int len = iop->dataend - bp; + int found = 0; + memset(&mbs, 0, sizeof(mbstate_t)); + do { + if (*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; } - } - - /* no data in buffer or ran out of data */ - if ((iop->flag & IOP_AT_EOF) == 0 && (iop->dataend == NULL || bp >= iop->dataend)) { + len -= mbclen; + bp += mbclen; + } while (len > 0 && ! found); + + /* Check that newline found isn't the sentinel. */ + if (found && (bp - mbclen) < iop->dataend) { + /* + * set len to what we have so far, in case this is + * all there is + */ + recm->len = bp - recm->start - mbclen; + recm->rt_start = bp - mbclen; + recm->rt_len = mbclen; + *state = NOSTATE; + return REC_OK; + } else { + /* also set len */ + recm->len = bp - recm->start; + *state = INDATA; 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; + return NOTERM; } + } +#endif + while (*bp != rs) + bp++; + + /* set len to what we have so far, in case this is all there is */ + recm->len = bp - recm->start; + + if (bp < iop->dataend) { /* found it in the buffer */ + recm->rt_start = bp; + recm->rt_len = 1; + *state = NOSTATE; + return REC_OK; + } else { + *state = INDATA; + iop->scanoff = bp - iop->off; + return NOTERM; + } +} - /* <set sentinel>= */ - *iop->dataend = grRS; - +/* <rsrescan>= */ +/* rsrescan --- search for a regex match in the buffer */ +static RECVALUE +rsrescan(IOBUF *iop, struct recmatch *recm, SCANSTATE *state) +{ + register char *bp; + size_t restart = 0, reend = 0; + Regexp *RSre = RS_regexp; - /* 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; + memset(recm, '\0', sizeof(struct recmatch)); + recm->start = iop->off; - if ((iop->flag & IOP_IS_INTERNAL) != 0) { - iop->flag |= IOP_AT_EOF; - break; - } + bp = iop->off; + if (*state == INDATA) + bp += iop->scanoff; + +again: + /* case 1, no match */ + if (research(RSre, bp, 0, iop->dataend - bp, TRUE) == -1) { + /* set len, in case this all there is. */ + recm->len = iop->dataend - iop->off - 1; + return NOTERM; + } - if ((iop->flag & IOP_AT_EOF) != 0) - break; + /* ok, we matched within the buffer, set start and end */ + restart = RESTART(RSre, iop->off); + reend = REEND(RSre, iop->off); - /* bp points one past sentinel, back it up for buffer management code */ - bp--; + /* case 2, null regex match, grow buffer, try again */ + if (restart == reend) { + *state = INDATA; + iop->scanoff = reend + 1; + /* + * If still room in buffer, skip over null match + * and restart search. Otherwise, return. + */ + if (bp + iop->scanoff < iop->dataend) { + bp += iop->scanoff; + goto again; + } + recm->len = (bp - iop->off) + restart; + return NOTERM; + } - /* hit end of data in buffer, continue around to find more */ + /* + * At this point, we have a non-empty match. + * + * First, fill in rest of data. The rest of the cases return + * a record and terminator. + */ + recm->len = restart; + recm->rt_start = bp + restart; + recm->rt_len = reend - restart; + *state = NOSTATE; + + /* + * 3. Match exactly at end: + * if re is a simple string match + * found a simple string match at end, return REC_OK + * else + * grow buffer, add more data, try again + * fi + */ + if (iop->off + reend >= iop->dataend) { + if (reisstring(RS->stptr, RS->stlen, RSre, iop->off)) + return REC_OK; + else + return TERMATEND; } - /* 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; + /* + * 4. Match within xxx bytes of end & maybe islong re: + * return TERMNEAREND + */ + + /* + * 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 (remaybelong(RS->stptr, RS->stlen)) { + char *matchend = iop->off + reend; + + if (iop->dataend - matchend < RS->stlen) + return TERMNEAREND; } - /* found rs, return the record */ - *out = iop->off; - retval = bp - iop->off - 1; - iop->off = bp; /* set up for next time */ + return REC_OK; +} - /* set RT */ - set_RT(bp - 1, 1); +/* <rsnullscan>= */ +/* rsnullscan --- handle RS = "" */ - return retval; -} -/* 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 */ +static RECVALUE +rsnullscan(IOBUF *iop, struct recmatch *recm, SCANSTATE *state) { - /* 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; - } - } + if (*state == NOSTATE || *state == INLEADER) + memset(recm, '\0', sizeof(struct recmatch)); - /* 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; - - - } - } + recm->start = iop->off; - bp = iop->off + iop->scanoff; - } + bp = iop->off; + if (*state != NOSTATE) + bp += iop->scanoff; + + /* set sentinel */ + *(iop->dataend) = '\n'; + + if (*state == INTERM) + goto find_longest_terminator; + else if (*state == INDATA) + goto scan_data; + /* else + fall into things from beginning, + either NOSTATE or INLEADER */ + +/* skip_leading: */ + /* leading newlines are ignored */ + while (*bp == '\n' && bp < iop->dataend) + bp++; + + if (bp >= iop->dataend) { /* LOTS of leading newlines, sheesh. */ + *state = INLEADER; + iop->scanoff = bp - iop->off; + return NOTERM; + } - /* <set sentinel>= */ - *iop->dataend = grRS; + iop->off = recm->start = bp; /* real start of record */ +scan_data: + while (*bp++ != '\n') + continue; + if (bp >= iop->dataend) { /* no terminator */ + iop->scanoff = recm->len = bp - iop->off - 1; + *state = INDATA; + return NOTERM; + } + /* found one newline before end of buffer, check next char */ + if (*bp != '\n') + goto scan_data; - /* 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 */ - } + /* we've now seen at least two newlines */ + *state = INTERM; + recm->len = bp - iop->off - 1; + recm->rt_start = bp - 1; - /* found one newline */ - if (*bp != '\n' && bp < iop->dataend) - goto more; /* only one */ +find_longest_terminator: + /* find as many newlines as we can, to set RT */ + while (*bp == '\n' && bp < iop->dataend) + bp++; - rt_start = bp - 1; /* prev char was first newline, *bp is second */ - while (bp < iop->dataend && *bp == '\n') - bp++; + recm->rt_len = bp - recm->rt_start; + iop->scanoff = bp - iop->off; - if (bp >= iop->dataend && (iop->flag & IOP_AT_EOF) == 0) { - firstnl = bp - iop->off; - restarting = TRUE; - continue; - } else - break; /* got the record, done */ + if (bp >= iop->dataend) + return TERMATEND; + return REC_OK; +} +/* <getarecord>= */ +/* get_a_record --- read a record from IOP into out, return length of EOF, set RT */ - /* Here's the logic when the record has been identified. */ - /* */ - /* */ - /* <rsnull end loop logic>= */ +int +get_a_record(char **out, /* pointer to pointer to data */ + IOBUF *iop, /* input IOP */ + int *errcode) /* pointer to error variable */ +{ + struct recmatch recm; + SCANSTATE state; + RECVALUE ret; + int retval; + NODE *rtval = NULL; + static RECVALUE (*lastmatchrec)P((IOBUF *iop, struct recmatch *recm, SCANSTATE *state)) = NULL; + + if (at_eof(iop) && no_data_left(iop)) + return EOF; - if ((iop->flag & IOP_IS_INTERNAL) != 0) { + /* <fill initial buffer>= */ + if (has_no_data(iop) || no_data_left(iop)) { + iop->count = read(iop->fd, iop->buf, iop->readsize); + if (iop->count == 0) { iop->flag |= IOP_AT_EOF; - break; + return EOF; + } else if (iop->count == -1) { + if (! do_traditional && errcode != NULL) { + *errcode = errno; + iop->flag |= IOP_AT_EOF; + return EOF; + } else + fatal(_("error reading input file `%s': %s"), + iop->name, strerror(errno)); + } else { + iop->dataend = iop->buf + iop->count; + iop->off = iop->buf; } + } - if ((iop->flag & IOP_AT_EOF) != 0) - break; - /* hit end of data in buffer, continue around to find more */ - } + /* <loop through file to find a record>= */ + state = NOSTATE; + for (;;) { + size_t dataend_off; - /* <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; - } + ret = (*matchrec)(iop, & recm, & state); - set_RT(rt_start, bp - rt_start); + if (ret == REC_OK) + break; - /* found rs, return the record */ - *out = iop->off; - retval = rt_start - iop->off; - iop->off = bp; /* set up for next time */ + /* need to add more data to buffer */ + /* <shift data down in buffer>= */ + dataend_off = iop->dataend - iop->off; + memmove(iop->buf, iop->off, dataend_off); + iop->off = iop->buf; + iop->dataend = iop->buf + dataend_off; - 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; + /* <adjust recm contents>= */ + recm.start = iop->off; + if (recm.rt_start != NULL) + recm.rt_start = iop->off + recm.len; + /* <read more data, break if EOF>= */ + if ((iop->flag & IOP_IS_INTERNAL) != 0) { + iop->flag |= IOP_AT_EOF; + break; + } 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); - /* 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; + if (amt_to_read < iop->readsize) { grow_iop_buffer(iop); - bp = iop->off + iop->scanoff; + /* <adjust recm contents>= */ + recm.start = iop->off; + if (recm.rt_start != NULL) + recm.rt_start = iop->off + recm.len; + + /* 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; - /* 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->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; - } - 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; + } 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; 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; - } - } + } else + iop->dataend += iop->count; } + } - /* 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; + /* <set record, RT, return right value>= */ + /* + * rtval is not a static pointer to avoid dangling pointer problems + * in case awk code assigns to RT. A remote possibility, to be sure, + * but Bitter Experience teaches us not to make ``that'll never + * happen'' kinds of assumptions. + */ + rtval = RT_node->var_value; - /* 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; + if (recm.rt_len == 0) { set_RT_to_null(); - return EOF; + lastmatchrec = NULL; + } else { + assert(recm.rt_start != NULL); + /* + * Optimization. For rs1 case, don't set RT if + * character is same as last time. This knocks a + * chunk of time off something simple like + * + * gawk '{ print }' /some/big/file + * + * Similarly, for rsnull case, if length of new RT is + * shorter than current RT, just bump length down in RT. + * + * Make sure that matchrec didn't change since the last + * check. (Ugh, details, details, details.) + */ + if (lastmatchrec == NULL || lastmatchrec != matchrec) { + lastmatchrec = matchrec; + set_RT(recm.rt_start, recm.rt_len); + } else if (matchrec == rs1scan) { + if (rtval->stlen != 1 || rtval->stptr[0] != recm.rt_start[0]) + set_RT(recm.rt_start, recm.rt_len); + /* else + leave it alone */ + } else if (matchrec == rsnullscan) { + if (rtval->stlen <= recm.rt_len) + rtval->stlen = recm.rt_len; + else + set_RT(recm.rt_start, recm.rt_len); + } else + set_RT(recm.rt_start, recm.rt_len); } - /* found rs, return the record */ + if (recm.len == 0) { + *out = NULL; + retval = 0; + } else { + assert(recm.start != NULL); + *out = recm.start; + retval = recm.len; + } - assert(set_res); - /* set RT before adjusting pointers in iop. */ - set_RT(iop->off + restart, reend - restart); + iop->off += recm.len + recm.rt_len; - *out = iop->off; - retval = (iop->off + restart) - iop->off; - iop->off += reend; + if (recm.len == 0 && recm.rt_len == 0 && at_eof(iop)) + return EOF; + else + return retval; - return retval; } /* set_RS --- update things as appropriate when RS is set */ @@ -3267,7 +3006,7 @@ set_RS() } if (RS->stlen == 0) { RS_is_null = TRUE; - get_a_record = rsnull_get_a_record; + matchrec = rsnullscan; } else if (RS->stlen > 1) { static int warned = FALSE; @@ -3275,14 +3014,14 @@ set_RS() 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; + matchrec = rsrescan; if (do_lint && ! warned) { lintwarn(_("multicharacter value of `RS' is a gawk extension")); warned = TRUE; } } else - get_a_record = rs1_get_a_record; + matchrec = rs1scan; set_FS: if (! using_fieldwidths()) set_FS(); @@ -3336,7 +3075,7 @@ pty_vs_pipe(const char *command) const char * iopflags2str(int flag) { - static struct flagtab values[] = { + static const struct flagtab values[] = { { IOP_IS_TTY, "IOP_IS_TTY" }, { IOP_IS_INTERNAL, "IOP_IS_INTERNAL" }, { IOP_NO_FREE, "IOP_NO_FREE" }, diff --git a/m4/ChangeLog b/m4/ChangeLog index c0168b59..846cf148 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,27 @@ +Mon Jul 7 11:01:43 2003 Arnold D. Robbins <arnold@skeeve.com> + + * Release 3.1.3: Release tar file made. + +2003-06-16 gettextize <bug-gnu-gettext@gnu.org> + + * gettext.m4: Upgrade to gettext-0.12.1. + * inttypes_h.m4: Upgrade to gettext-0.12.1. + * lib-ld.m4: Upgrade to gettext-0.12.1. + * lib-link.m4: Upgrade to gettext-0.12.1. + * lib-prefix.m4: Upgrade to gettext-0.12.1. + * nls.m4: New file, from gettext-0.12.1. + * po.m4: New file, from gettext-0.12.1. + * progtest.m4: Upgrade to gettext-0.12.1. + * stdint_h.m4: Upgrade to gettext-0.12.1. + * uintmax_t.m4: New file, from gettext-0.12.1. + * ulonglong.m4: New file, from gettext-0.12.1. + * Makefile.am: New file. + +2003-03-26 Paul Eggert <eggert@twinsun.com> + + * longlong.m4, intmax_t.m4: New files. + * ulonglong.m4, uintmax_t.m4: Removed. + Wed Mar 19 14:10:31 2003 Arnold D. Robbins <arnold@skeeve.com> This time for sure. diff --git a/m4/gettext.m4 b/m4/gettext.m4 index 45cad855..16070b40 100644 --- a/m4/gettext.m4 +++ b/m4/gettext.m4 @@ -1,5 +1,5 @@ -# gettext.m4 serial 17 (gettext-0.11.5) -dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. +# gettext.m4 serial 20 (gettext-0.12) +dnl Copyright (C) 1995-2003 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 @@ -17,7 +17,7 @@ dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000. -dnl Bruno Haible <haible@clisp.cons.org>, 2000-2002. +dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003. dnl Macro to add for using GNU gettext. @@ -92,13 +92,8 @@ AC_DEFUN([AM_GNU_GETTEXT], AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) ]) - AC_MSG_CHECKING([whether NLS is requested]) - dnl Default is enabled NLS - AC_ARG_ENABLE(nls, - [ --disable-nls do not use Native Language Support], - USE_NLS=$enableval, USE_NLS=yes) - AC_MSG_RESULT($USE_NLS) - AC_SUBST(USE_NLS) + dnl Set USE_NLS. + AM_NLS ifelse(gt_included_intl, yes, [ BUILD_INCLUDED_LIBINTL=no @@ -216,7 +211,8 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", dnl libintl. (Cf. the install rule in intl/Makefile.in.) if test "$gt_cv_func_gnugettext_libc" = "yes" \ || { test "$gt_cv_func_gnugettext_libintl" = "yes" \ - && test "$PACKAGE" != gettext; }; then + && test "$PACKAGE" != gettext-runtime \ + && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else dnl Reset the values set by searching for libintl. @@ -235,7 +231,6 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", if test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions used to generate GNU NLS library. - INTLOBJS="\$(GETTOBJS)" BUILD_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV" @@ -260,6 +255,22 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", fi fi + AC_MSG_CHECKING([whether to use NLS]) + AC_MSG_RESULT([$USE_NLS]) + if test "$USE_NLS" = "yes"; then + AC_MSG_CHECKING([where the gettext function comes from]) + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if test "$gt_cv_func_gnugettext_libintl" = "yes"; then + gt_source="external libintl" + else + gt_source="libc" + fi + else + gt_source="included intl directory" + fi + AC_MSG_RESULT([$gt_source]) + fi + if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then @@ -283,7 +294,7 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", ifelse(gt_included_intl, yes, [ dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL dnl to 'yes' because some of the testsuite requires it. - if test "$PACKAGE" = gettext; then + if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then BUILD_INCLUDED_LIBINTL=yes fi @@ -291,7 +302,6 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", AC_SUBST(BUILD_INCLUDED_LIBINTL) AC_SUBST(USE_INCLUDED_LIBINTL) AC_SUBST(CATOBJEXT) - AC_SUBST(INTLOBJS) dnl For backward compatibility. Some configure.ins may be using this. nls_cv_header_intl= @@ -309,6 +319,12 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", GENCAT=gencat AC_SUBST(GENCAT) + dnl For backward compatibility. Some Makefiles may be using this. + if test "$USE_INCLUDED_LIBINTL" = yes; then + INTLOBJS="\$(GETTOBJS)" + fi + AC_SUBST(INTLOBJS) + dnl Enable libtool support if the surrounding package wishes it. INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) @@ -325,179 +341,6 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", ]) -dnl Checks for all prerequisites of the po subdirectory, -dnl except for USE_NLS. -AC_DEFUN([AM_PO_SUBDIRS], -[ - AC_REQUIRE([AC_PROG_MAKE_SET])dnl - AC_REQUIRE([AC_PROG_INSTALL])dnl - AC_REQUIRE([AM_MKINSTALLDIRS])dnl - - dnl Perform the following tests also if --disable-nls has been given, - dnl because they are needed for "make dist" to work. - - dnl Search for GNU msgfmt in the PATH. - dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. - dnl The second test excludes FreeBSD msgfmt. - AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, - [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 && - (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], - :) - AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) - - dnl Search for GNU xgettext 0.11 or newer in the PATH. - dnl The first test excludes Solaris xgettext and early GNU xgettext versions. - dnl The second test excludes FreeBSD xgettext. - AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, - [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 && - (if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], - :) - dnl Remove leftover from FreeBSD xgettext call. - rm -f messages.po - - dnl Search for GNU msgmerge 0.11 or newer in the PATH. - AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, - [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :) - - dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. - dnl Test whether we really found GNU msgfmt. - if test "$GMSGFMT" != ":"; then - dnl If it is no GNU msgfmt we define it as : so that the - dnl Makefiles still can work. - if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && - (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then - : ; - else - GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` - AC_MSG_RESULT( - [found $GMSGFMT program is not GNU msgfmt; ignore it]) - GMSGFMT=":" - fi - fi - - dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. - dnl Test whether we really found GNU xgettext. - if test "$XGETTEXT" != ":"; then - dnl If it is no GNU xgettext we define it as : so that the - dnl Makefiles still can work. - if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 && - (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then - : ; - else - AC_MSG_RESULT( - [found xgettext program is not GNU xgettext; ignore it]) - XGETTEXT=":" - fi - dnl Remove leftover from FreeBSD xgettext call. - rm -f messages.po - fi - - AC_OUTPUT_COMMANDS([ - for ac_file in $CONFIG_FILES; do - # Support "outfile[:infile[:infile...]]" - case "$ac_file" in - *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - esac - # PO directories have a Makefile.in generated from Makefile.in.in. - case "$ac_file" in */Makefile.in) - # Adjust a relative srcdir. - ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` - ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" - ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` - # In autoconf-2.13 it is called $ac_given_srcdir. - # In autoconf-2.50 it is called $srcdir. - test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" - case "$ac_given_srcdir" in - .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; - /*) top_srcdir="$ac_given_srcdir" ;; - *) top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac - if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then - rm -f "$ac_dir/POTFILES" - test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" - cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" - # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend - # on $ac_dir but don't depend on user-specified configuration - # parameters. - if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then - # The LINGUAS file contains the set of available languages. - if test -n "$ALL_LINGUAS"; then - test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" - fi - ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"` - # Hide the ALL_LINGUAS assigment from automake. - eval 'ALL_LINGUAS''=$ALL_LINGUAS_' - fi - case "$ac_given_srcdir" in - .) srcdirpre= ;; - *) srcdirpre='$(srcdir)/' ;; - esac - POFILES= - GMOFILES= - UPDATEPOFILES= - DUMMYPOFILES= - for lang in $ALL_LINGUAS; do - POFILES="$POFILES $srcdirpre$lang.po" - GMOFILES="$GMOFILES $srcdirpre$lang.gmo" - UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" - DUMMYPOFILES="$DUMMYPOFILES $lang.nop" - done - # CATALOGS depends on both $ac_dir and the user's LINGUAS - # environment variable. - INST_LINGUAS= - if test -n "$ALL_LINGUAS"; then - for presentlang in $ALL_LINGUAS; do - useit=no - if test "%UNSET%" != "$LINGUAS"; then - desiredlanguages="$LINGUAS" - else - desiredlanguages="$ALL_LINGUAS" - fi - for desiredlang in $desiredlanguages; do - # Use the presentlang catalog if desiredlang is - # a. equal to presentlang, or - # b. a variant of presentlang (because in this case, - # presentlang can be used as a fallback for messages - # which are not translated in the desiredlang catalog). - case "$desiredlang" in - "$presentlang"*) useit=yes;; - esac - done - if test $useit = yes; then - INST_LINGUAS="$INST_LINGUAS $presentlang" - fi - done - fi - CATALOGS= - if test -n "$INST_LINGUAS"; then - for lang in $INST_LINGUAS; do - CATALOGS="$CATALOGS $lang.gmo" - done - fi - test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" - sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" - for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do - if test -f "$f"; then - case "$f" in - *.orig | *.bak | *~) ;; - *) cat "$f" >> "$ac_dir/Makefile" ;; - esac - fi - done - fi - ;; - esac - done], - [# Capture the value of obsolete ALL_LINGUAS because we need it to compute - # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it - # from automake. - eval 'ALL_LINGUAS''="$ALL_LINGUAS"' - # Capture the value of LINGUAS because we need it to compute CATALOGS. - LINGUAS="${LINGUAS-%UNSET%}" - ]) -]) - - dnl Checks for all prerequisites of the intl subdirectory, dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS, dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL. @@ -526,7 +369,8 @@ AC_DEFUN([AM_INTL_SUBDIR], stdlib.h string.h unistd.h sys/param.h]) AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \ geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \ -strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next]) +strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next \ +__fsetlocking]) AM_ICONV AM_LANGINFO_CODESET @@ -567,21 +411,5 @@ changequote([,])dnl ]) -AC_DEFUN([AM_MKINSTALLDIRS], -[ - dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly - dnl find the mkinstalldirs script in another subdir but $(top_srcdir). - dnl Try to locate is. - MKINSTALLDIRS= - if test -n "$ac_aux_dir"; then - MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" - fi - if test -z "$MKINSTALLDIRS"; then - MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" - fi - AC_SUBST(MKINSTALLDIRS) -]) - - dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) diff --git a/m4/intmax_t.m4 b/m4/intmax_t.m4 new file mode 100644 index 00000000..9571814f --- /dev/null +++ b/m4/intmax_t.m4 @@ -0,0 +1,32 @@ +#serial 6 + +dnl From Paul Eggert. + +AC_PREREQ(2.52) + +# Define intmax_t to long or long long if <inttypes.h> doesn't define. + +AC_DEFUN([jm_AC_TYPE_INTMAX_T], +[ + AC_REQUIRE([jm_AC_TYPE_LONG_LONG]) + AC_CHECK_TYPE(intmax_t, , + [test $ac_cv_type_long_long = yes \ + && ac_type='long long' \ + || ac_type='long' + AC_DEFINE_UNQUOTED(intmax_t, $ac_type, + [Define to widest signed type if <inttypes.h> doesn't define.])]) +]) + +# Define uintmax_t to unsigned long or unsigned long long +# if <inttypes.h> doesn't define. + +AC_DEFUN([jm_AC_TYPE_UINTMAX_T], +[ + AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG]) + AC_CHECK_TYPE(uintmax_t, , + [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 widest unsigned type if <inttypes.h> doesn't define.])]) +]) diff --git a/m4/inttypes_h.m4 b/m4/inttypes_h.m4 index 400a1118..f342eba3 100644 --- a/m4/inttypes_h.m4 +++ b/m4/inttypes_h.m4 @@ -1,5 +1,5 @@ -# inttypes_h.m4 serial 4 (gettext-0.11.4) -dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. +# inttypes_h.m4 serial 5 (gettext-0.12) +dnl Copyright (C) 1997-2003 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 @@ -22,7 +22,7 @@ AC_DEFUN([jm_AC_HEADER_INTTYPES_H], 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. ]) + [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>, + and declares uintmax_t. ]) fi ]) diff --git a/m4/lib-ld.m4 b/m4/lib-ld.m4 index ddb57323..11d0ce77 100644 --- a/m4/lib-ld.m4 +++ b/m4/lib-ld.m4 @@ -1,5 +1,5 @@ -# lib-ld.m4 serial 1 (gettext-0.11) -dnl Copyright (C) 1996-2002 Free Software Foundation, Inc. +# lib-ld.m4 serial 2 (gettext-0.12) +dnl Copyright (C) 1996-2003 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 @@ -29,6 +29,19 @@ AC_DEFUN([AC_LIB_PROG_LD], test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. diff --git a/m4/lib-link.m4 b/m4/lib-link.m4 index 6b942510..eeb200d2 100644 --- a/m4/lib-link.m4 +++ b/m4/lib-link.m4 @@ -1,5 +1,5 @@ -# lib-link.m4 serial 3 (gettext-0.11.3) -dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. +# lib-link.m4 serial 4 (gettext-0.12) +dnl Copyright (C) 2001-2003 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 @@ -92,8 +92,7 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], dnl Determine the platform dependent parameters needed to use rpath: dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, -dnl hardcode_direct, hardcode_minus_L, -dnl sys_lib_search_path_spec, sys_lib_dlsearch_path_spec. +dnl hardcode_direct, hardcode_minus_L. AC_DEFUN([AC_LIB_RPATH], [ AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS @@ -114,8 +113,6 @@ AC_DEFUN([AC_LIB_RPATH], hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" hardcode_direct="$acl_cv_hardcode_direct" hardcode_minus_L="$acl_cv_hardcode_minus_L" - sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec" - sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec" dnl Determine whether the user wants rpath handling at all. AC_ARG_ENABLE(rpath, [ --disable-rpath do not hardcode runtime library paths], @@ -135,7 +132,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) - AC_ARG_WITH([lib$1-prefix], + AC_LIB_ARG_WITH([lib$1-prefix], [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib --without-lib$1-prefix don't search for lib$1 in includedir and libdir], [ diff --git a/m4/lib-prefix.m4 b/m4/lib-prefix.m4 index b8b79ab9..c719bc80 100644 --- a/m4/lib-prefix.m4 +++ b/m4/lib-prefix.m4 @@ -1,5 +1,5 @@ -# lib-prefix.m4 serial 1 (gettext-0.11) -dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. +# lib-prefix.m4 serial 2 (gettext-0.12) +dnl Copyright (C) 2001-2003 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 @@ -8,6 +8,13 @@ dnl the same distribution terms as the rest of that program. dnl From Bruno Haible. +dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and +dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't +dnl require excessive bracketing. +ifdef([AC_HELP_STRING], +[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], +[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) + dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed dnl to access previously installed libraries. The basic assumption is that dnl a user will want packages to use other packages he previously installed @@ -26,7 +33,7 @@ AC_DEFUN([AC_LIB_PREFIX], eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) - AC_ARG_WITH([lib-prefix], + AC_LIB_ARG_WITH([lib-prefix], [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib --without-lib-prefix don't search for libraries in includedir and libdir], [ diff --git a/m4/longlong.m4 b/m4/longlong.m4 new file mode 100644 index 00000000..daa95c07 --- /dev/null +++ b/m4/longlong.m4 @@ -0,0 +1,35 @@ +#serial 2 + +dnl From Paul Eggert. + +# Define HAVE_LONG_LONG if 'long long' works. + +AC_DEFUN([jm_AC_TYPE_LONG_LONG], +[ + AC_CACHE_CHECK([for long long], ac_cv_type_long_long, + [AC_TRY_LINK([long long ll = 1; int i = 63;], + [long long llmax = (long long) -1; + return ll << i | ll >> i | llmax / ll | llmax % ll;], + ac_cv_type_long_long=yes, + ac_cv_type_long_long=no)]) + if test $ac_cv_type_long_long = yes; then + AC_DEFINE(HAVE_LONG_LONG, 1, + [Define if you have the long long type.]) + fi +]) + +# Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works. + +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/m4/nls.m4 b/m4/nls.m4 new file mode 100644 index 00000000..36bc4931 --- /dev/null +++ b/m4/nls.m4 @@ -0,0 +1,49 @@ +# nls.m4 serial 1 (gettext-0.12) +dnl Copyright (C) 1995-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. +dnl +dnl This file can can be used in projects which are not available under +dnl the GNU General Public License or the GNU Library General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Library General Public License, and the rest of the GNU +dnl gettext package package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Authors: +dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000. +dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003. + +AC_DEFUN([AM_NLS], +[ + AC_MSG_CHECKING([whether NLS is requested]) + dnl Default is enabled NLS + AC_ARG_ENABLE(nls, + [ --disable-nls do not use Native Language Support], + USE_NLS=$enableval, USE_NLS=yes) + AC_MSG_RESULT($USE_NLS) + AC_SUBST(USE_NLS) +]) + +AC_DEFUN([AM_MKINSTALLDIRS], +[ + dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly + dnl find the mkinstalldirs script in another subdir but $(top_srcdir). + dnl Try to locate it. + MKINSTALLDIRS= + if test -n "$ac_aux_dir"; then + case "$ac_aux_dir" in + /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;; + *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;; + esac + fi + if test -z "$MKINSTALLDIRS"; then + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" + fi + AC_SUBST(MKINSTALLDIRS) +]) diff --git a/m4/po.m4 b/m4/po.m4 new file mode 100644 index 00000000..861e3dec --- /dev/null +++ b/m4/po.m4 @@ -0,0 +1,197 @@ +# po.m4 serial 1 (gettext-0.12) +dnl Copyright (C) 1995-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. +dnl +dnl This file can can be used in projects which are not available under +dnl the GNU General Public License or the GNU Library General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Library General Public License, and the rest of the GNU +dnl gettext package package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Authors: +dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000. +dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003. + +dnl Checks for all prerequisites of the po subdirectory. +AC_DEFUN([AM_PO_SUBDIRS], +[ + AC_REQUIRE([AC_PROG_MAKE_SET])dnl + AC_REQUIRE([AC_PROG_INSTALL])dnl + AC_REQUIRE([AM_MKINSTALLDIRS])dnl + AC_REQUIRE([AM_NLS])dnl + + dnl Perform the following tests also if --disable-nls has been given, + dnl because they are needed for "make dist" to work. + + dnl Search for GNU msgfmt in the PATH. + dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. + dnl The second test excludes FreeBSD msgfmt. + AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, + [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 && + (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], + :) + AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + + dnl Search for GNU xgettext 0.12 or newer in the PATH. + dnl The first test excludes Solaris xgettext and early GNU xgettext versions. + dnl The second test excludes FreeBSD xgettext. + AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && + (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], + :) + dnl Remove leftover from FreeBSD xgettext call. + rm -f messages.po + + dnl Search for GNU msgmerge 0.11 or newer in the PATH. + AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, + [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :) + + dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. + dnl Test whether we really found GNU msgfmt. + if test "$GMSGFMT" != ":"; then + dnl If it is no GNU msgfmt we define it as : so that the + dnl Makefiles still can work. + if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && + (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + : ; + else + GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` + AC_MSG_RESULT( + [found $GMSGFMT program is not GNU msgfmt; ignore it]) + GMSGFMT=":" + fi + fi + + dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. + dnl Test whether we really found GNU xgettext. + if test "$XGETTEXT" != ":"; then + dnl If it is no GNU xgettext we define it as : so that the + dnl Makefiles still can work. + if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && + (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + : ; + else + AC_MSG_RESULT( + [found xgettext program is not GNU xgettext; ignore it]) + XGETTEXT=":" + fi + dnl Remove leftover from FreeBSD xgettext call. + rm -f messages.po + fi + + AC_OUTPUT_COMMANDS([ + for ac_file in $CONFIG_FILES; do + # Support "outfile[:infile[:infile...]]" + case "$ac_file" in + *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + esac + # PO directories have a Makefile.in generated from Makefile.in.in. + case "$ac_file" in */Makefile.in) + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then + rm -f "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" + POMAKEFILEDEPS="POTFILES.in" + # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend + # on $ac_dir but don't depend on user-specified configuration + # parameters. + if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then + # The LINGUAS file contains the set of available languages. + if test -n "$OBSOLETE_ALL_LINGUAS"; then + test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" + fi + ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"` + # Hide the ALL_LINGUAS assigment from automake. + eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" + else + # The set of available languages was given in configure.in. + eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' + fi + case "$ac_given_srcdir" in + .) srcdirpre= ;; + *) srcdirpre='$(srcdir)/' ;; + esac + POFILES= + GMOFILES= + UPDATEPOFILES= + DUMMYPOFILES= + for lang in $ALL_LINGUAS; do + POFILES="$POFILES $srcdirpre$lang.po" + GMOFILES="$GMOFILES $srcdirpre$lang.gmo" + UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" + DUMMYPOFILES="$DUMMYPOFILES $lang.nop" + done + # CATALOGS depends on both $ac_dir and the user's LINGUAS + # environment variable. + INST_LINGUAS= + if test -n "$ALL_LINGUAS"; then + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "$LINGUAS"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + INST_LINGUAS="$INST_LINGUAS $presentlang" + fi + done + fi + CATALOGS= + if test -n "$INST_LINGUAS"; then + for lang in $INST_LINGUAS; do + CATALOGS="$CATALOGS $lang.gmo" + done + fi + test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" + sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do + if test -f "$f"; then + case "$f" in + *.orig | *.bak | *~) ;; + *) cat "$f" >> "$ac_dir/Makefile" ;; + esac + fi + done + fi + ;; + esac + done], + [# Capture the value of obsolete ALL_LINGUAS because we need it to compute + # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it + # from automake. + eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' + # Capture the value of LINGUAS because we need it to compute CATALOGS. + LINGUAS="${LINGUAS-%UNSET%}" + ]) +]) diff --git a/m4/progtest.m4 b/m4/progtest.m4 index 443c8e30..8fe527ce 100644 --- a/m4/progtest.m4 +++ b/m4/progtest.m4 @@ -1,5 +1,5 @@ -# progtest.m4 serial 2 (gettext-0.10.40) -dnl Copyright (C) 1996-2002 Free Software Foundation, Inc. +# progtest.m4 serial 3 (gettext-0.12) +dnl Copyright (C) 1996-2003 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 @@ -23,31 +23,63 @@ dnl Ulrich Drepper <drepper@cygnus.com>, 1996. dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) AC_DEFUN([AM_PATH_PROG_WITH_TEST], -[# Extract the first word of "$2", so it can be a program name with args. +[ +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "$2", so it can be a program name with args. set dummy $2; ac_word=[$]2 AC_MSG_CHECKING([for $ac_word]) AC_CACHE_VAL(ac_cv_path_$1, [case "[$]$1" in - /*) - ac_cv_path_$1="[$]$1" # Let the user override the test with a path. - ;; + [[\\/]]* | ?:[[\\/]]*) + ac_cv_path_$1="[$]$1" # Let the user override the test with a path. + ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in ifelse([$5], , $PATH, [$5]); do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if [$3]; then - ac_cv_path_$1="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in ifelse([$5], , $PATH, [$5]); do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + if [$3]; then + ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" dnl If no 4th arg is given, leave the cache variable unset, dnl so AC_PATH_PROGS will keep looking. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" ])dnl - ;; + ;; esac])dnl $1="$ac_cv_path_$1" if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then diff --git a/m4/stdint_h.m4 b/m4/stdint_h.m4 index 4b5a4ac6..32ba7ae7 100644 --- a/m4/stdint_h.m4 +++ b/m4/stdint_h.m4 @@ -1,5 +1,5 @@ -# stdint_h.m4 serial 2 (gettext-0.11.4) -dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. +# stdint_h.m4 serial 3 (gettext-0.12) +dnl Copyright (C) 1997-2003 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 @@ -22,7 +22,7 @@ AC_DEFUN([jm_AC_HEADER_STDINT_H], 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. ]) + [Define if <stdint.h> exists, doesn't clash with <sys/types.h>, + and declares uintmax_t. ]) fi ]) diff --git a/m4/uintmax_t.m4 b/m4/uintmax_t.m4 index ec3a8b92..b5f28d44 100644 --- a/m4/uintmax_t.m4 +++ b/m4/uintmax_t.m4 @@ -1,5 +1,5 @@ -# uintmax_t.m4 serial 6 (gettext-0.11) -dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. +# uintmax_t.m4 serial 7 (gettext-0.12) +dnl Copyright (C) 1997-2003 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 @@ -10,8 +10,8 @@ dnl From Paul Eggert. AC_PREREQ(2.13) -# Define uintmax_t to `unsigned long' or `unsigned long long' -# if <inttypes.h> does not exist. +# Define uintmax_t to 'unsigned long' or 'unsigned long long' +# if it is not already defined in <stdint.h> or <inttypes.h>. AC_DEFUN([jm_AC_TYPE_UINTMAX_T], [ @@ -23,7 +23,10 @@ AC_DEFUN([jm_AC_TYPE_UINTMAX_T], && 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.]) + [Define to unsigned long or unsigned long long + if <stdint.h> and <inttypes.h> don't define.]) + else + AC_DEFINE(HAVE_UINTMAX_T, 1, + [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.]) fi ]) @@ -201,7 +201,7 @@ main(int argc, char **argv) int c; char *scan; /* the + on the front tells GNU getopt not to rearrange argv */ - const char *optlist = "+F:f:v:W;m:"; + const char *optlist = "+F:f:v:W;m:D"; int stopped_early = FALSE; int old_optind; extern int optind; @@ -232,8 +232,10 @@ main(int argc, char **argv) #endif #if defined(LC_NUMERIC) /* - * Force the issue here. On some systems, gawk ends up - * printing output with commas for the decimal point. + * Force the issue here. According to POSIX 2001, decimal + * point is used for parsing source code and for command-line + * assignments and the locale value for processing input, + * number to string conversion, and printing output. */ setlocale(LC_NUMERIC, "C"); #endif @@ -388,12 +390,6 @@ main(int argc, char **argv) version(); break; -#ifdef GAWKDEBUG - case 'D': - yydebug = 2; - break; -#endif - case 0: /* * getopt_long found an option that sets a variable @@ -402,6 +398,13 @@ main(int argc, char **argv) */ break; + case 'D': +#ifdef GAWKDEBUG + yydebug = 2; + break; +#endif + /* if not debugging, fall through */ + case '?': default: /* @@ -548,6 +551,11 @@ out: init_profiling_signals(); +#if defined(LC_NUMERIC) + /* See comment above. */ + setlocale(LC_NUMERIC, ""); +#endif + /* Whew. Finally, run the program. */ if (begin_block != NULL) { in_begin_rule = TRUE; @@ -657,6 +665,11 @@ By default it reads standard input and writes standard output.\n\n"), fp); fputs(_("Examples:\n\tgawk '{ sum += $1 }; END { print sum }' file\n\ \tgawk -F: '{ print $1 }' /etc/passwd\n"), fp); + fflush(fp); + + if (ferror(fp)) + exit(1); + exit(exitval); } @@ -689,6 +702,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n"); fputs(_(blurb_part2), stdout); fputs(_(blurb_part3), stdout); fflush(stdout); + + if (ferror(stdout)) + exit(1); + exit(0); } @@ -734,12 +751,10 @@ init_args(int argc0, int argc, char *argv0, char **argv) aptr = assoc_lookup(ARGV_node, tmp_number((AWKNUM) j), FALSE); *aptr = make_string(argv[i], strlen(argv[i])); (*aptr)->flags |= MAYBE_NUM; - (*aptr)->flags &= ~UNINITIALIZED; j++; } ARGC_node = install("ARGC", node(make_number((AWKNUM) j), Node_var, (NODE *) NULL)); - ARGC_node->flags &= ~UNINITIALIZED; } /* @@ -795,8 +810,6 @@ init_vars() : make_string((char *) vp->strval, strlen(vp->strval)), vp->type, (NODE *) NULL)); - (*(vp->spec))->flags |= SCALAR; - (*(vp->spec))->flags &= ~UNINITIALIZED; if (vp->assign) (*(vp->assign))(); } @@ -831,7 +844,7 @@ load_environ() aptr = assoc_lookup(ENVIRON_node, tmp_string(var, strlen(var)), FALSE); *aptr = make_string(val, strlen(val)); - (*aptr)->flags |= (MAYBE_NUM|SCALAR); + (*aptr)->flags |= MAYBE_NUM; /* restore '=' so that system() gets a valid environment */ if (val != nullstr) @@ -844,7 +857,6 @@ load_environ() if (getenv("AWKPATH") == NULL) { aptr = assoc_lookup(ENVIRON_node, tmp_string("AWKPATH", 7), FALSE); *aptr = make_string(defpath, strlen(defpath)); - (*aptr)->flags |= SCALAR; } #endif /* TANDEM */ return ENVIRON_node; @@ -972,7 +984,12 @@ arg_assign(char *arg, int initing) * This makes sense, so we do it too. */ it = make_str_node(cp, strlen(cp), SCAN); - it->flags |= (MAYBE_NUM|SCALAR); + it->flags |= MAYBE_NUM; +#ifdef LC_NUMERIC + setlocale(LC_NUMERIC, "C"); + (void) force_number(it); + setlocale(LC_NUMERIC, ""); +#endif /* LC_NUMERIC */ var = variable(arg, FALSE, Node_var); lhs = get_lhs(var, &after_assign, FALSE); unref(*lhs); diff --git a/missing_d/ChangeLog b/missing_d/ChangeLog index d21af3b1..da1d09a5 100644 --- a/missing_d/ChangeLog +++ b/missing_d/ChangeLog @@ -1,3 +1,7 @@ +Mon Jul 7 11:01:43 2003 Arnold D. Robbins <arnold@skeeve.com> + + * Release 3.1.3: Release tar file made. + Wed Mar 19 14:10:31 2003 Arnold D. Robbins <arnold@skeeve.com> This time for sure. @@ -52,7 +52,6 @@ r_force_number(register NODE *n) n->numbr = 0.0; n->flags |= NUMCUR; - n->flags &= ~UNINITIALIZED; if (n->stlen == 0) { if (0 && do_lint) @@ -211,7 +210,6 @@ format_val(const char *format, int index, register NODE *s) no_malloc: s->stref = 1; s->flags |= STRCUR; - s->flags &= ~UNINITIALIZED; return s; } @@ -283,7 +281,7 @@ r_dupnode(NODE *n) 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'; + r->ahname_str[r->ahname_len] = '\0'; } return r; } @@ -314,7 +312,7 @@ mk_number(AWKNUM x, unsigned int flags) getnode(r); r->type = Node_val; r->numbr = x; - r->flags = flags | SCALAR; + r->flags = flags; #ifdef GAWKDEBUG r->stref = 1; r->stptr = NULL; @@ -332,7 +330,7 @@ make_str_node(char *s, unsigned long len, int flags) getnode(r); r->type = Node_val; - r->flags = (STRING|STRCUR|MALLOC|SCALAR); + r->flags = (STRING|STRCUR|MALLOC); if (flags & ALREADY_MALLOCED) r->stptr = s; else { @@ -400,7 +398,6 @@ more_nodes() emalloc(nextfree, NODE *, NODECHUNK * sizeof(NODE), "more_nodes"); for (np = nextfree; np <= &nextfree[NODECHUNK - 1]; np++) { np->flags = 0; - np->flags |= UNINITIALIZED; #ifndef NO_PROFILING np->exec_count = 0; #endif @@ -420,8 +417,6 @@ more_nodes() void freenode(NODE *it) { - it->flags &= ~SCALAR; - it->flags |= UNINITIALIZED; #ifdef MPROF it->stref = 0; free((char *) it); @@ -1 +1 @@ -#define PATCHLEVEL "2" +#define PATCHLEVEL "3" diff --git a/pc/ChangeLog b/pc/ChangeLog index bad45635..29ed6ce5 100644 --- a/pc/ChangeLog +++ b/pc/ChangeLog @@ -1,3 +1,32 @@ +Mon Jul 7 11:01:43 2003 Arnold D. Robbins <arnold@skeeve.com> + + * Release 3.1.3: Release tar file made. + +Thu Jun 26 15:00:20 2003 Scott Deifik <scottd@amgen.com> + + * Makefile.tst: Synchronized to main dist. + +Sun Jun 15 19:27:58 2003 Patrick T.J. McPhee <ptjm@interlog.com> + + * config.h: Separate the ifdefs for os_system from ssize_t etc. + +Sun Jun 15 19:05:15 2003 Scott Deifik <scottd@amgen.com> + + * Makefile.tst: Synchronized to main dist. + +Mon Jun 9 17:12:24 2003 Patrick T.J. McPhee <ptjm@interlog.com> + + * dlfcn.c, dlfcn.h, gawke32.def: New files. + * Makefile: Changes to allow dynamic linking of libraries + under Windows32. + +Sun May 11 15:19:52 2003 Scott Deifik <scottd@amgen.com> + + * config.h: Update defs for ssize_t, intmax_t, uintmax_t. + * Makefile: Update compile options. + * gawkmisc.pc (memcpy_long, memset_long): New functions. + * Makefile.tst: Synchronized with test/Makefile. + Wed Mar 19 14:10:31 2003 Arnold D. Robbins <arnold@skeeve.com> This time for sure. @@ -175,7 +204,7 @@ Sun Jun 27 12:27:00 1999 Darrel Hankerson <hankedr@mail.auburn.edu> Fri May 21 00:00:00 1999 Darrel Hankerson <hankedr@mail.auburn.edu> - * popen.c: MSC (on DOS/Win32) and MINGW32 now honor SHELL. + * popen.c: MSC (on DOS/Windows32) and MINGW32 now honor SHELL. * io.c: MINGW32 reports errno==0 after failure in redirect(); assume close_one() in this case. * io.c: Add HAVE_POPEN_H and let pc/config.h deal with the mess. @@ -201,8 +230,8 @@ Thu Nov 12 21:01:24 1998 Darrel Hankerson <hankedr@mail.auburn.edu> omitted from 3.0.3. * README.pc updated to clarify the procedure for building - non-LFN versions on LFN systems, and to note that Win32 gawk - may require Win32 utilities. + non-LFN versions on LFN systems, and to note that Windows32 gawk + may require Windows32 utilities. * emxbnd target modified to accomodate older versions of emx. diff --git a/pc/Makefile b/pc/Makefile index 85113b33..db5febf9 100644 --- a/pc/Makefile +++ b/pc/Makefile @@ -1,9 +1,9 @@ # Makefile for gawk (GNU awk) Dec 2000 # # - for GNU C (djgpp) [32bit executable for DOS] -# - for GNU C (emx) [32bit executable for OS/2 or DOS or Win32] -# - for GNU C (mingw32) [Win32 executable for Windows 9x/NT] -# - for MS-Visual C/C++ 4.x [Win32 executable for Windows 9x/NT] +# - for GNU C (emx) [32bit executable for OS/2 or DOS or Windows32] +# - for GNU C (mingw32) [Windows32 executable for Windows 9x/NT] +# - for MS-Visual C/C++ 4.x [Windows32 executable for Windows 9x/NT] # - for Microsoft C 7 [16bit ececutable for DOS] # - for Microsoft C 6.00A [16bit executable for OS/2 or DOS] @@ -20,12 +20,12 @@ default: @echo " emx ..... OS/2 32-bit exe [emx/gcc; uses emxlibc.dll] " @echo " emxnt ... NT exe [emx/gcc with RSXNT] " @echo " emxbnd .. OS/2 and DOS 32-bit exe [emx/gcc] " - @echo " mingw32 . Win32 exe [Mingw32 GNU C] " + @echo " mingw32 . Windows32 exe [Mingw32 GNU C] " @echo " msc ..... DOS exe [Microsoft C 7 & 8 (AKA 1.52)] " @echo " msc6 .... DOS exe [Microsoft C 6.00a] " @echo " msc6os2 . OS/2 exe [Microsoft C 6.00a] " @echo " msc6bnd . OS/2 and DOS exe [Microsoft C 6.00a] " - @echo " vcWin32 . Win32 exe [Microsoft Visual C] " + @echo " vcWin32 . Windows32 exe [Microsoft Visual C] " @echo " ----------------------------------------------------- " @echo " test .... Perform tests (see README_d/README.pc) " @echo " install . Install gawk under $(prefix)/ " @@ -83,12 +83,21 @@ install = 1 # cannot handle such macros, define DO_LNK and DO_BIND for your target # as $(L<target>) and $(B<target>), resp.; e.g., #DO_LNK = $(LvcWin32) -#DO_BIND= $(BvcWin32) +#DO_PLNK = $(PLvcWin32) # and then comment the following: DO_LNK = $($(LNK)) DO_BIND= $($(BIND)) DO_PLNK = $($(PLNK)) DO_PBIND= $($(PBIND)) +#------------------------------------------------------------------------ +# For dynamic extension support, uncomment these lines +# pick the appropriate .def file entry for your compiler +#DYN_FLAGS=-DDYNAMIC +#DYN_EXP=gawk.exp +#DYN_OBJ=dlfcn$O $(DYN_EXP) +#DYN_MAKEXP=$(DMEvcWin32) +#DYN_MAKEXP=$(DMEmingw32) +# #======================================================================== # End of general configuration. Some platform-specific configuration # notes appear below. @@ -167,14 +176,17 @@ emxbnd-debug: #========================== MINGW32 ===================================== #======================================================================== +DMEmingw32 = dlltool -D gawk.exe -d gawkw32.def -e gawk.exp -l libgawk.a + LMINGW32 = $(CC) $(LF) -o $@ $(GAWKOBJS) $(LF2) +PLMINGW32 = $(CC) $(LF) -o $@ $(PGAWKOBJS) $(LF2) # The following might work around command-line length limitations: #LMINGW32 = $(CC) $(LF) -o $@ *.o $(LF2) mingw32: $(MAK) all \ CC=gcc O=.o CF=-O OBJ=popen.o \ - LNK=LMINGW32 LF=-s RSP= + LNK=LMINGW32 PLNK=PLMINGW32 LF=-s RSP= #======================================================================== #========================== MSC ========================================= @@ -189,8 +201,10 @@ STDARGV = setargv.obj # Optimization and library options: # Os == optimize for size, Ot == optimize for speed, G2 == 286 or better #MSCOPT = -Gt3600 -Os -G2 -# MSC seems to be more stable with -Od than with -Ot. -MSCOPT = -Gt3600 -Od # -G2 +# MSC seems to be more stable with -Od than with -Ot, but then regexec.c gives +# "code segment too large" error when compiling. Adding -G2y fixes this and +# lets us keep the -Od. +MSCOPT = -Gt3600 -Od -G2y # Alternate lib, does not use math coprocessor. #MSCLIB = llibca #MSCCL = -FPa @@ -262,7 +276,9 @@ Bmsc6bnd = $(BMSC) # Windows '9x / NT +DMEvcWin32 = lib /def:gawkw32.def /name:gawk.exe /out:gawk.lib LvcWin32 = link -nologo -subsystem:console -release -out:$@ $(LNKRSP) +PLvcWin32 = link -nologo -subsystem:console -release -out:$@ $(PLDRSP) vcWin32: $(MAK) all \ @@ -293,13 +309,13 @@ EMPTY= # bitwise operations (-DBITOPS) and non-decimal input data (-DNONDECDATA) are # undocumented in 3.0.3. They may be enabled in config.h, or added to CFLAGS. -CFLAGS = $(CF) -DGAWK -I. -DHAVE_CONFIG_H +CFLAGS = $(CF) -DGAWK -I. -DHAVE_CONFIG_H $(DYN_FLAGS) # object files -AWKOBJS1 = array$O builtin$O eval$O field$O gawkmisc$O io$O main$O -AWKOBJS2 = ext$O msg$O node$O profile$O re$O version$O +AWKOBJS1 = array$O builtin$O eval$O field$O gawkmisc$O io$O main$O +AWKOBJS2 = ext$O msg$O node$O profile$O re$O version$O $(DYN_OBJ) PAWKOBJS1 = array$O builtin$O eval_p$O field$O gawkmisc$O io$O main$O -PAWKOBJS2 = ext$O msg$O node$O profile_p$O re$O version$O +PAWKOBJS2 = ext$O msg$O node$O profile_p$O re$O version$O $(DYN_OBJ) AWKOBJS = $(AWKOBJS1) $(AWKOBJS2) ALLOBJS = $(AWKOBJS) awkgram$O getid$O $(OBJ) @@ -309,7 +325,7 @@ ALLOBJS = $(AWKOBJS) awkgram$O getid$O $(OBJ) LIBOBJS= getopt$O getopt1$O regex$O random$O GAWKOBJS = $(ALLOBJS) $(LIBOBJS) -PGAWKOBJS = $(PAWKOBJS1) $(PAWKOBJS2) awkgram$O getid$O $(OBJ) +PGAWKOBJS = $(PAWKOBJS1) $(PAWKOBJS2) $(LIBOBJS) awkgram$O getid$O $(OBJ) # clear out suffixes list # .SUFFIXES: @@ -347,6 +363,9 @@ getopt$O: getopt.h getopt1$O: getopt.h +gawk.exp: gawkw32.def + $(DYN_MAKEXP) + main$O: patchlev.h eval_p$O: eval.c @@ -382,7 +401,7 @@ install2: gawk -v prefix=$(prefix) -f install.awk clean: - rm -rf gawk pgawk *.exe gawk.map *.o *.obj core a.out $(RSPFILE) $(PRSPFILE) + rm -rf gawk pgawk *.exe gawk.map *.o *.obj core a.out $(RSPFILE) $(PRSPFILE) $(DYN_EXP) # cd doc && $(MAKE) clean # cd test && $(MAKE) clean # cd awklib && $(MAKE) clean diff --git a/pc/Makefile.tst b/pc/Makefile.tst index f94a67ba..4a61d28d 100644 --- a/pc/Makefile.tst +++ b/pc/Makefile.tst @@ -112,31 +112,36 @@ PATH_SEPARATOR = ; 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
+BASIC_TESTS = addcomma anchgsub argarray arrayparm arrayref arrymem1 \
+ arrayprm2 arrayprm3 arryref2 arryref3 arryref4 arryref5 arynasty \
+ arynocls aryprm1 aryprm2 aryprm3 aryprm4 aryprm5 aryprm6 aryprm7 \
+ aryprm8 arysubnm asgext awkpath back89 backgsub childin clobber \
+ clsflnam compare compare2 concat1 convfmt datanonl defref \
+ delarprm delarpm2 dynlj eofsplit fldchg fldchgnf fmttest fnamedat \
+ fnarray fnarray2 fnarydel fnaryscl fnasgnm fnmisc fnparydl \
+ forsimp fsbs fsrs fstabplus funsemnl funsmnam funstack getline \
+ getline2 getline3 getlnbuf getnr2tb getnr2tm gsubasgn gsubtest \
+ gsubtst2 gsubtst3 gsubtst4 gsubtst5 hsprint inputred intest \
+ intprec leaddig leadnl litoct longsub longwrds math membug1 \
+ messages minusstr mmap8k nasty nasty2 negexp nested 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 rsnulbig rsnulbig2 rstest1 \
+ rstest2 rstest3 rstest4 rstest5 rswhite scalar sclforin sclifin \
+ sortempty splitargv splitarr splitdef splitvar splitwht sprintfc \
+ strtod subslash substr swaplns synerr1 tradanch tweakfld uninit2 \
+ uninit3 uninit4 uninitialized zeroe0 zeroflag
+
+
+UNIX_TESTS = fflush getlnhd pid pipeio1 pipeio2 poundbang poundbang2 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
+ match1 match2 manyfiles nondec posix procinfs regx8bit rebuf reint \
+ shadow sort1 strtonum strftime whiny
EXTRA_TESTS = regtest inftest
@@ -144,12 +149,14 @@ 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
+NEED_LINT = defref noeffect nofmtch shadow uninit2 uninit3 uninit4 uninitialized
# List of the files that appear in manual tests or are for reserve testing:
-GENTESTS_UNUSED = Makefile.in gtlnbufv.awk printfloat.awk
+GENTESTS_UNUSED = Makefile.in gtlnbufv.awk printfloat.awk switch2.awk
-# 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 \
@@ -210,9 +217,13 @@ poundbang:: fi
@-$(CMP) $(srcdir)/poundbang.awk _`basename $@` && rm -f _`basename $@` _pbd.awk
+poundbang2:
+ @echo $@
+ @LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 make poundbang
+
messages::
@echo $@
- @$(AWK) -f $(srcdir)/messages.awk >out2 2>out3
+ @LC_ALL=C LANG=C $(AWK) -f $(srcdir)/messages.awk >out2 2>out3
@-$(CMP) $(srcdir)/out1.ok out1 && $(CMP) $(srcdir)/out2.ok out2 && $(CMP) $(srcdir)/out3.ok out3 && rm -f out1 out2 out3
argarray::
@@ -221,7 +232,7 @@ argarray:: .) : ;; \
*) cp $(srcdir)/argarray.in . ;; \
esac
- @TEST=test echo just a test | $(AWK) -f $(srcdir)/argarray.awk ./argarray.in - >_$@
+ @TEST=test echo just a test | LC_ALL=C LANG=C $(AWK) -f $(srcdir)/argarray.awk ./argarray.in - >_$@
@case $(srcdir) in \
.) : ;; \
*) rm -f ./argarray.in ;; \
@@ -239,48 +250,51 @@ manyfiles:: @rm -rf junk
@mkdir junk
@$(AWK) 'BEGIN { for (i = 1; i <= 300; i++) print i, i}' >_$@
- @$(AWK) -f $(srcdir)/manyfiles.awk _$@ _$@
+ @LC_ALL=C LANG=C $(AWK) -f $(srcdir)/manyfiles.awk _$@ _$@
@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 >_$@
+ @LC_ALL=C LANG=C $(AWK) -f $(srcdir)/compare.awk 0 1 $(srcdir)/compare.in >_$@
@-$(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' >_$@
+ @echo 'Both MSC 7.0 and 8.0 gawk generate a floating point exception.'
+ @echo 'EMX gawk uses #INF rather than Inf.'
+ @LC_ALL=C LANG=C $(AWK) -f $(srcdir)/inftest.awk | sed 's/inf/Inf/g' >_$@
@-$(CMP) $(srcdir)/inftest.ok _$@ && rm -f _$@
getline2::
@echo $@
- @$(AWK) -f $(srcdir)/getline2.awk $(srcdir)/getline2.awk $(srcdir)/getline2.awk >_$@
+ @LC_ALL=C LANG=C $(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 >_$@
+ @LC_ALL=C LANG=C 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 >_$@
+ @LC_ALL=C LANG=C $(AWK) -f $(srcdir)/argtest.awk -x -y abc >_$@
@-$(CMP) $(srcdir)/argtest.ok _$@ && rm -f _$@
badargs::
@echo $@
- @-$(AWK) -f 2>&1 | grep -v patchlevel >_$@
+ @-LC_ALL=C LANG=C $(AWK) -f 2>&1 | grep -v patchlevel >_$@
@-$(CMP) $(srcdir)/badargs.ok _$@ && rm -f _$@
nonl::
@echo $@
- @-AWKPATH=$(srcdir) $(AWK) --lint -f nonl.awk /dev/null >_$@ 2>&1
+# @-LC_ALL=C LANG=C AWKPATH=$(srcdir) $(AWK) --lint -f nonl.awk /dev/null >_$@ 2>&1
+ @-LC_ALL=C LANG=C AWKPATH=$(srcdir) $(AWK) --lint -f nonl.awk NUL >_$@ 2>&1
@-$(CMP) $(srcdir)/nonl.ok _$@ && rm -f _$@
strftime::
- @echo This test could fail on slow machines or on a second boundary,
+ @echo This test could fail on slow machines or on a minute boundary,
@echo so if it does, double check the actual results:
@echo $@
@LC_ALL=C; export LC_ALL; LANG=C; export LANG; \
@@ -290,41 +304,41 @@ strftime:: litoct::
@echo $@
- @echo ab | $(AWK) --traditional -f $(srcdir)/litoct.awk >_$@
+ @echo ab | LC_ALL=C LANG=C $(AWK) --traditional -f $(srcdir)/litoct.awk >_$@
@-$(CMP) $(srcdir)/litoct.ok _$@ && rm -f _$@
fflush::
@echo $@
- @$(srcdir)/fflush.sh >_$@
+ @LC_ALL=C LANG=C $(srcdir)/fflush.sh >_$@
@-$(CMP) $(srcdir)/fflush.ok _$@ && rm -f _$@
tweakfld::
@echo $@
- @$(AWK) -f $(srcdir)/tweakfld.awk $(srcdir)/tweakfld.in >_$@
+ @LC_ALL=C LANG=C $(AWK) -f $(srcdir)/tweakfld.awk $(srcdir)/tweakfld.in >_$@
@rm -f errors.cleanup
@-$(CMP) $(srcdir)/tweakfld.ok _$@ && rm -f _$@
mmap8k::
@echo $@
- @$(AWK) '{ print }' $(srcdir)/mmap8k.in >_$@
+ @LC_ALL=C LANG=C $(AWK) '{ print }' $(srcdir)/mmap8k.in >_$@
@-$(CMP) $(srcdir)/mmap8k.in _$@ && rm -f _$@
tradanch::
@echo $@
- @$(AWK) --traditional -f $(srcdir)/tradanch.awk $(srcdir)/tradanch.in >_$@
+ @LC_ALL=C LANG=C $(AWK) --traditional -f $(srcdir)/tradanch.awk $(srcdir)/tradanch.in >_$@
@-$(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 $@` ; :
+ @AWKPATH=$(srcdir) AWK=$(AWKPROG) LC_ALL=C LANG=C $(SHELL) $(srcdir)/pid.sh $$$$ > _`basename $@` ; :
@echo 'Expect pid to fail in DOS.'
@-$(CMP) $(srcdir)/pid.ok _`basename $@` && rm -f _`basename $@` _`basename $@`.in
strftlng::
@echo $@
- @TZ=UTC; export TZ; $(AWK) -f $(srcdir)/strftlng.awk >_$@
+ @TZ=UTC; export TZ; LC_ALL=C LANG=C $(AWK) -f $(srcdir)/strftlng.awk >_$@
@if $(CMP) -s $(srcdir)/strftlng.ok _$@ ; then : ; else \
TZ=UTC0; export TZ; $(AWK) -f $(srcdir)/strftlng.awk >_$@ ; \
fi
@@ -337,35 +351,35 @@ nors:: reint::
@echo $@
- @$(AWK) --re-interval -f $(srcdir)/reint.awk $(srcdir)/reint.in >_$@
+ @LC_ALL=C LANG=C $(AWK) --re-interval -f $(srcdir)/reint.awk $(srcdir)/reint.in >_$@
@-$(CMP) $(srcdir)/reint.ok _$@ && rm -f _$@
pipeio1::
@echo $@
- @$(AWK) -f $(srcdir)/pipeio1.awk >_$@
+ @LC_ALL=C LANG=C $(AWK) -f $(srcdir)/pipeio1.awk >_$@
@rm -f test1 test2
@-$(CMP) $(srcdir)/pipeio1.ok _$@ && rm -f _$@
pipeio2::
@echo $@
- @$(AWK) -v SRCDIR=$(srcdir) -f $(srcdir)/pipeio2.awk >_$@
+ @LC_ALL=C LANG=C $(AWK) -v SRCDIR=$(srcdir) -f $(srcdir)/pipeio2.awk >_$@
@-$(CMP) $(srcdir)/pipeio2.ok _$@ && rm -f _$@
clobber::
@echo $@
- @$(AWK) -f $(srcdir)/clobber.awk >_$@
+ @LC_ALL=C LANG=C $(AWK) -f $(srcdir)/clobber.awk >_$@
@-$(CMP) $(srcdir)/clobber.ok seq && $(CMP) $(srcdir)/clobber.ok _$@ && rm -f _$@
@rm -f seq
arynocls::
@echo $@
- @-AWKPATH=$(srcdir) $(AWK) -v INPUT=$(srcdir)/arynocls.in -f arynocls.awk >_$@
+ @-AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -v INPUT=$(srcdir)/arynocls.in -f arynocls.awk >_$@
@-$(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$@
+ @-AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -f getlnbuf.awk $(srcdir)/getlnbuf.in > _$@
+ @-AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -f gtlnbufv.awk $(srcdir)/getlnbuf.in > _2$@
@-$(CMP) $(srcdir)/getlnbuf.ok _$@ && $(CMP) $(srcdir)/getlnbuf.ok _2$@ && rm -f _$@ _2$@
inetmesg::
@@ -394,745 +408,914 @@ inetdayt:: redfilnm::
@echo $@
- @$(AWK) -f $(srcdir)/redfilnm.awk srcdir=$(srcdir) $(srcdir)/redfilnm.in >_$@
+ @LC_ALL=C LANG=C $(AWK) -f $(srcdir)/redfilnm.awk srcdir=$(srcdir) $(srcdir)/redfilnm.in >_$@
@-$(CMP) $(srcdir)/redfilnm.ok _$@ && rm -f _$@
leaddig::
@echo $@
- @$(AWK) -v x=2E -f $(srcdir)/leaddig.awk >_$@
+ @LC_ALL=C LANG=C $(AWK) -v x=2E -f $(srcdir)/leaddig.awk >_$@
@-$(CMP) $(srcdir)/leaddig.ok _$@ && rm -f _$@
gsubtst3::
@echo $@
- @$(AWK) --re-interval -f $(srcdir)/$@.awk $(srcdir)/$@.in >_$@
+ @LC_ALL=C LANG=C $(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: $$? >>_$@
+ @echo 'Expect space to fail with DJGPP.'
+ @LC_ALL=C LANG=C $(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: $$? >>_$@
+ @LC_ALL=C LANG=C $(AWK) --posix -f $(srcdir)/$@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+rsnulbig::
+ @echo $@
+ @ : Suppose that block size for pipe is at most 128kB:
+ @$(AWK) 'BEGIN { for (i = 1; i <= 128*64+1; i++) print "abcdefgh123456\n" }' 2>&1 | \
+ $(AWK) 'BEGIN { RS = ""; ORS = "\n\n" }; { print }' 2>&1 | \
+ $(AWK) '/^[^a]/; END{ print NR }' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+rsnulbig2::
+ @echo $@
+ @$(AWK) 'BEGIN { ORS = ""; n = "\n"; for (i = 1; i <= 10; i++) n = (n n); \
+ for (i = 1; i <= 128; i++) print n; print "abc\n" }' 2>&1 | \
+ $(AWK) 'BEGIN { RS = ""; ORS = "\n\n" };{ print }' 2>&1 | \
+ $(AWK) '/^[^a]/; END { print NR }' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+whiny::
+ @echo $@
+ @WHINY_USERS=1 $(AWK) -f $(srcdir)/$@.awk $(srcdir)/$@.in >_$@
+ @-$(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+arrayprm2:
+ @echo arrayprm2
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+arrayprm3:
+ @echo arrayprm3
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+arryref2:
+ @echo arryref2
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+arryref3:
+ @echo arryref3
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+arryref4:
+ @echo arryref4
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+arryref5:
+ @echo arryref5
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+aryprm1:
+ @echo aryprm1
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+aryprm2:
+ @echo aryprm2
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+aryprm3:
+ @echo aryprm3
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+aryprm4:
+ @echo aryprm4
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+aryprm5:
+ @echo aryprm5
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+aryprm6:
+ @echo aryprm6
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+aryprm7:
+ @echo aryprm7
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+aryprm8:
+ @echo aryprm8
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+delarpm2:
+ @echo delarpm2
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fmttest:
+ @echo fmttest
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -f $@.awk >_$@ 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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fnarray2:
+ @echo fnarray2
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @echo 'Expect funstack to fail with MSC DOS versions.'
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+gsubtst5:
+ @echo gsubtst5
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
hsprint:
@echo hsprint
- @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @echo 'hsprint may fail due to 1.27e+01 not being equal to'
+ @echo '1.27e+001 (and similarly for other numbers) for MSC gawk.'
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @echo 'Expect longsub to fail with MSC DOS versions.'
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @echo "longwrds may run out of environment space with MSC DOS versions."
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+nested:
+ @echo nested
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+rstest3:
+ @echo rstest3
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+rstest4:
+ @echo rstest4
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+rstest5:
+ @echo rstest5
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+scalar:
+ @echo scalar
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
sclforin:
@echo sclforin
- @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+sortempty:
+ @echo sortempty
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
uninit2:
@echo uninit2
- @AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+uninit3:
+ @echo uninit3
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+uninit4:
+ @echo uninit4
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+uninitialized:
+ @echo uninitialized
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
match1:
@echo match1
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+match2:
+ @echo match2
@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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @echo 'posix test may fail due to 1.500000e+000 not being equal to'
+ @echo '1.500000e+00 for MSC gawk.'
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(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: $$? >>_$@
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+strtonum:
+ @echo strtonum
+ @AWKPATH=$(srcdir) LC_ALL=C LANG=C $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
# end of file Maketests
@@ -1143,7 +1326,7 @@ $(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:
diff --git a/pc/config.h b/pc/config.h index 1048ecba..01893676 100644 --- a/pc/config.h +++ b/pc/config.h @@ -340,13 +340,14 @@ # define HAVE_POPEN_H -/* #if defined (_MSC_VER) */ -#define ssize_t long int -/* #endif */ - +#if defined(_MSC_VER) && defined(MSDOS) +#define system(s) os_system(s) +#endif -#if (defined(_MSC_VER) && defined(MSDOS)) || defined(__MINGW32__) -# define system(s) os_system(s) +#if defined(_MSC_VER) || defined(__MINGW32__) +#define ssize_t long int /* DJGPP has ssize_t */ +#define intmax_t long +#define uintmax_t unsigned long #endif #if defined (_MSC_VER) || defined(__EMX__) @@ -357,6 +358,8 @@ #if defined(DJGPP) # define HAVE_LIMITS_H 1 # undef HAVE_POPEN_H +#define intmax_t long long +#define uintmax_t unsigned long long #endif #if defined(__WIN32__) && defined(__CRTRSXNT__) @@ -372,3 +375,6 @@ #if defined(__MINGW32__) #undef HAVE_SYS_PARAM_H #endif + + +/* #define NO_LINT 1 */ diff --git a/pc/dlfcn.c b/pc/dlfcn.c new file mode 100644 index 00000000..f0cee556 --- /dev/null +++ b/pc/dlfcn.c @@ -0,0 +1,84 @@ +/*
+** dlfcn.c -- limited implementation of posix dynamic loading functions
+*/
+
+/*
+ * Copyright (C) 2003 the Free Software Foundation, Inc.
+ *
+ * This file is part of GAWK, the GNU implementation of the
+ * AWK Programming Language.
+ *
+ * GAWK is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * GAWK is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#include <dlfcn.h>
+#include <errno.h>
+#include <windows.h>
+
+/* open the library file. We currently ignore flags. */
+void *dlopen(const char * libname, int flags)
+{
+ HMODULE libH;
+
+
+ /* if libname is specified, we need to load a library of that name */
+ if (libname) {
+ libH = LoadLibrary(libname);
+ }
+
+ /* otherwise, we're supposed to return a handle to global symbol
+ * information, which includes the executable and all libraries loaded
+ * with RTLD_GLOBAL. For our purposes, it doesn't really matter, so
+ * we simply return the handle to the .exe */
+ else {
+ libH = GetModuleHandle(NULL);
+ }
+
+ return (void *)libH;
+}
+
+
+/* don't need the library any more */
+int dlclose(void * libH)
+{
+ int rc;
+
+ if (FreeLibrary((HMODULE)libH)) {
+ rc = 0;
+ }
+ else {
+ rc = -1;
+ }
+
+ return rc;
+}
+
+/* find the symbol */
+void *dlsym(void * /*restrict*/ libH, const char * /*restrict*/ fnName)
+{
+ return (void *)GetProcAddress((HMODULE)libH, fnName);
+}
+
+char *dlerror(void)
+{
+ static char errbuf[1024];
+
+ FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(),
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), errbuf, sizeof(errbuf), NULL);
+
+ return errbuf;
+}
+
+
diff --git a/pc/dlfcn.h b/pc/dlfcn.h new file mode 100644 index 00000000..b337c303 --- /dev/null +++ b/pc/dlfcn.h @@ -0,0 +1,41 @@ +/*
+** dlfcn.h -- limited implementation of posix dynamic loading functions
+*/
+
+/*
+ * Copyright (C) 2003 the Free Software Foundation, Inc.
+ *
+ * This file is part of GAWK, the GNU implementation of the
+ * AWK Programming Language.
+ *
+ * GAWK is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * GAWK is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifndef _DLFCN_H
+#define _DLFCN_H
+
+/* symbols required by susv3. These are not supported here (everything is
+ * RTLD_NOW, RTLD_GLOBAL) */
+#define RTLD_LAZY 0
+#define RTLD_NOW 1
+#define RTLD_GLOBAL 0
+#define RTLD_LOCAL 2
+
+int dlclose(void *);
+char *dlerror(void);
+void *dlopen(const char *, int);
+void *dlsym(void * /*restrict*/, const char * /*restrict*/);
+
+#endif
diff --git a/pc/gawkmisc.pc b/pc/gawkmisc.pc index e984c80e..b34dc947 100644 --- a/pc/gawkmisc.pc +++ b/pc/gawkmisc.pc @@ -61,6 +61,42 @@ const char *filespec; return strlwr(p); } + +/* + * memcpy_long() & memset_ulong() are 32-bit replacements for MSC which + * has a 16-bit size_t. + */ +char * +memcpy_ulong (dest, src, l) +register char *dest; +register const char *src; +register unsigned long l; +{ + register char *ret = dest; + + while (l--) + *dest++ = *src++; + + return ret; +} + + +void * +memset_ulong(dest, val, l) +void *dest; +register int val; +register unsigned long l; +{ + register char *ret = dest; + register char *d = dest; + + while (l--) + *d++ = val; + + return ((void *) ret); +} + + /* os_arg_fixup --- fixup the command line */ void diff --git a/pc/gawkw32.def b/pc/gawkw32.def new file mode 100644 index 00000000..5a0e3227 --- /dev/null +++ b/pc/gawkw32.def @@ -0,0 +1,37 @@ +;; export definitions for Windows32 gawk
+;; this is to support extension libraries -- this should generate a gawk.lib
+;; against which they can link
+;; don't change the ordinals (the numbers after the function names)
+
+EXPORTS
+
+;; functions related directly to adding external functions
+get_argument @1
+set_value @2
+make_builtin @3
+
+;; functions for manipulating data types
+mk_number @11
+tmp_string @12
+unref @13
+r_force_string @14
+r_force_number @15
+nodetype2str @16
+
+
+;; incidental other functions
+assoc_lookup @31
+assoc_clear @32
+r_dupnode @33
+set_loc @34
+update_ERRNO @35
+r_fatal @36
+get_actual @37
+
+;; data -- note that this must be redeclared with __declspec(dllimport) in the extension
+;; library since the exported symbol is actually a pointer to the data
+
+CONVFMTidx @101
+lintfunc @102
+do_lint @103
+stack_ptr @104
diff --git a/po/ChangeLog b/po/ChangeLog index 24bde545..5b6336f6 100644 --- a/po/ChangeLog +++ b/po/ChangeLog @@ -1,3 +1,17 @@ +Mon Jul 7 11:01:43 2003 Arnold D. Robbins <arnold@skeeve.com> + + * Release 3.1.3: Release tar file made. + +2003-06-16 gettextize <bug-gnu-gettext@gnu.org> + + * Makefile.in.in: Upgrade to gettext-0.12.1. + * Rules-quot: New file, from gettext-0.12.1. + * boldquot.sed: New file, from gettext-0.12.1. + * en@boldquot.header: New file, from gettext-0.12.1. + * en@quot.header: New file, from gettext-0.12.1. + * insert-header.sin: New file, from gettext-0.12.1. + * quot.sed: New file, from gettext-0.12.1. + Wed Mar 19 14:10:31 2003 Arnold D. Robbins <arnold@skeeve.com> This time for sure. @@ -7,3 +7,4 @@ tr de da pt_BR +ca diff --git a/po/Makefile.in.in b/po/Makefile.in.in index ada8bb4f..27b721aa 100644 --- a/po/Makefile.in.in +++ b/po/Makefile.in.in @@ -1,5 +1,5 @@ # Makefile for PO directory in any package using GNU gettext. -# Copyright (C) 1995-1997, 2000-2002 by Ulrich Drepper <drepper@gnu.ai.mit.edu> +# Copyright (C) 1995-1997, 2000-2003 by Ulrich Drepper <drepper@gnu.ai.mit.edu> # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU General Public @@ -27,7 +27,7 @@ gettextsrcdir = $(datadir)/gettext/po INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ MKINSTALLDIRS = @MKINSTALLDIRS@ -mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac` +mkinstalldirs = $(SHELL) $(MKINSTALLDIRS) GMSGFMT = @GMSGFMT@ MSGFMT = @MSGFMT@ @@ -42,9 +42,9 @@ POFILES = @POFILES@ GMOFILES = @GMOFILES@ UPDATEPOFILES = @UPDATEPOFILES@ DUMMYPOFILES = @DUMMYPOFILES@ -DISTFILES.common = Makefile.in.in Makevars remove-potcdate.sin \ +DISTFILES.common = Makefile.in.in remove-potcdate.sin \ $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) -DISTFILES = $(DISTFILES.common) POTFILES.in $(DOMAIN).pot \ +DISTFILES = $(DISTFILES.common) Makevars POTFILES.in $(DOMAIN).pot stamp-po \ $(POFILES) $(GMOFILES) \ $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) @@ -74,18 +74,35 @@ CATALOGS = @CATALOGS@ all: all-@USE_NLS@ -all-yes: $(CATALOGS) +all-yes: stamp-po all-no: +# stamp-po is a timestamp denoting the last time at which the CATALOGS have +# been loosely updated. Its purpose is that when a developer or translator +# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, +# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent +# invocations of "make" will do nothing. This timestamp would not be necessary +# if updating the $(CATALOGS) would always touch them; however, the rule for +# $(POFILES) has been designed to not touch files that don't need to be +# changed. +stamp-po: $(srcdir)/$(DOMAIN).pot + test -z "$(CATALOGS)" || $(MAKE) $(CATALOGS) + @echo "touch stamp-po" + @echo timestamp > stamp-poT + @mv stamp-poT stamp-po + # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', # otherwise packages like GCC can not be built if only parts of the source # have been downloaded. +# This target rebuilds $(DOMAIN).pot; it is an expensive operation. +# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ --files-from=$(srcdir)/POTFILES.in \ - --copyright-holder='$(COPYRIGHT_HOLDER)' + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)' test ! -f $(DOMAIN).po || { \ if test -f $(srcdir)/$(DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ @@ -101,9 +118,14 @@ $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed fi; \ } +# This rule has no dependencies: we don't need to update $(DOMAIN).pot at +# every "make" invocation, only create it when it is missing. +# Only "make $(DOMAIN).pot-update" or "make dist" will force an update. $(srcdir)/$(DOMAIN).pot: $(MAKE) $(DOMAIN).pot-update +# This target rebuilds a PO file if $(DOMAIN).pot has changed. +# Note that a PO file is not touched if it doesn't need to be changed. $(POFILES): $(srcdir)/$(DOMAIN).pot @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ @@ -114,12 +136,15 @@ $(POFILES): $(srcdir)/$(DOMAIN).pot install: install-exec install-data install-exec: install-data: install-data-@USE_NLS@ - if test "$(PACKAGE)" = "gettext"; then \ + if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ - for file in $(DISTFILES.common); do \ + for file in $(DISTFILES.common) Makevars.template; do \ $(INSTALL_DATA) $(srcdir)/$$file \ $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ + for file in Makevars; do \ + rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ else \ : ; \ fi @@ -170,7 +195,7 @@ install-strip: install installdirs: installdirs-exec installdirs-data installdirs-exec: installdirs-data: installdirs-data-@USE_NLS@ - if test "$(PACKAGE)" = "gettext"; then \ + if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ else \ : ; \ @@ -215,8 +240,8 @@ installcheck: uninstall: uninstall-exec uninstall-data uninstall-exec: uninstall-data: uninstall-data-@USE_NLS@ - if test "$(PACKAGE)" = "gettext"; then \ - for file in $(DISTFILES.common); do \ + if test "$(PACKAGE)" = "gettext-tools"; then \ + for file in $(DISTFILES.common) Makevars.template; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ @@ -235,10 +260,11 @@ uninstall-data-yes: check: all -dvi info tags TAGS ID: +info dvi ps pdf html tags TAGS ctags CTAGS ID: mostlyclean: rm -f remove-potcdate.sed + rm -f stamp-poT rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po rm -fr *.o @@ -250,7 +276,7 @@ distclean: clean maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." - rm -f $(GMOFILES) + rm -f stamp-po $(GMOFILES) distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: @@ -259,7 +285,17 @@ dist distdir: # This is a separate target because 'update-po' must be executed before. dist2: $(DISTFILES) dists="$(DISTFILES)"; \ - if test -f $(srcdir)/ChangeLog; then dists="$$dists ChangeLog"; fi; \ + if test "$(PACKAGE)" = "gettext-tools"; then \ + dists="$$dists Makevars.template"; \ + fi; \ + if test -f $(srcdir)/ChangeLog; then \ + dists="$$dists ChangeLog"; \ + fi; \ + for i in 0 1 2 3 4 5 6 7 8 9; do \ + if test -f $(srcdir)/ChangeLog.$$i; then \ + dists="$$dists ChangeLog.$$i"; \ + fi; \ + done; \ if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ for file in $$dists; do \ if test -f $$file; then \ @@ -271,14 +307,14 @@ dist2: $(DISTFILES) update-po: Makefile $(MAKE) $(DOMAIN).pot-update - $(MAKE) $(UPDATEPOFILES) + test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) $(MAKE) update-gmo # General rule for updating PO files. .nop.po-update: @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ - if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; fi; \ + if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ @@ -305,7 +341,7 @@ $(DUMMYPOFILES): update-gmo: Makefile $(GMOFILES) @: -Makefile: Makefile.in.in $(top_builddir)/config.status POTFILES.in +Makefile: Makefile.in.in $(top_builddir)/config.status @POMAKEFILEDEPS@ cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \ $(SHELL) ./config.status diff --git a/po/Makevars b/po/Makevars index 8b09f53b..c5a271db 100644 --- a/po/Makevars +++ b/po/Makevars @@ -20,6 +20,22 @@ XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ # their copyright. COPYRIGHT_HOLDER = Free Software Foundation, Inc. +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = arnold@skeeve.com + # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = diff --git a/po/Rules-quot b/po/Rules-quot new file mode 100644 index 00000000..5f46d237 --- /dev/null +++ b/po/Rules-quot @@ -0,0 +1,42 @@ +# Special Makefile rules for English message catalogs with quotation marks. + +DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot + +.SUFFIXES: .insert-header .po-update-en + +en@quot.po-update: en@quot.po-update-en +en@boldquot.po-update: en@boldquot.po-update-en + +.insert-header.po-update-en: + @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ + if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + ll=`echo $$lang | sed -e 's/@.*//'`; \ + LC_ALL=C; export LC_ALL; \ + cd $(srcdir); \ + if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$ll -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "creation of $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +en@quot.insert-header: insert-header.sin + sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header + +en@boldquot.insert-header: insert-header.sin + sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header + +mostlyclean: mostlyclean-quot +mostlyclean-quot: + rm -f *.insert-header diff --git a/po/boldquot.sed b/po/boldquot.sed new file mode 100644 index 00000000..4b937aa5 --- /dev/null +++ b/po/boldquot.sed @@ -0,0 +1,10 @@ +s/"\([^"]*\)"/“\1â€/g +s/`\([^`']*\)'/‘\1’/g +s/ '\([^`']*\)' / ‘\1’ /g +s/ '\([^`']*\)'$/ ‘\1’/g +s/^'\([^`']*\)' /‘\1’ /g +s/“â€/""/g +s/“/“[1m/g +s/â€/[0mâ€/g +s/‘/‘[1m/g +s/’/[0m’/g diff --git a/po/ca.gmo b/po/ca.gmo Binary files differnew file mode 100644 index 00000000..bed9a5af --- /dev/null +++ b/po/ca.gmo diff --git a/po/ca.po b/po/ca.po new file mode 100644 index 00000000..1d746271 --- /dev/null +++ b/po/ca.po @@ -0,0 +1,1863 @@ +# translation of gawk.po to Catalan +# Copyright (C) 2003 Free Software Foundation, Inc. +# Antoni Bella Perez <bella5@teleline.es>, 2003. +# +msgid "" +msgstr "" +"Project-Id-Version: gawk 3.1.31\n" +"Report-Msgid-Bugs-To: arnold@skeeve.com\n" +"POT-Creation-Date: 2003-07-07 11:20-0700\n" +"PO-Revision-Date: 2003-05-07 21:13+0100\n" +"Last-Translator: Antoni Bella Perez <bella5@teleline.es>\n" +"Language-Team: Catalan <ca@dodds.net>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.0.1\n" + +#: array.c:112 +#, c-format +msgid "attempt to use scalar parameter `%s' as an array" +msgstr "s'ha intentat usar un paràmetre escalar «%s» com a una matriu" + +#: array.c:113 +#, c-format +msgid "attempt to use scalar `%s' as array" +msgstr "s'ha intentat usar la dada escalar «%s» com a una matriu" + +#: array.c:151 +#, fuzzy, c-format +msgid "from %s" +msgstr "%s (de %s)" + +#: array.c:506 +#, c-format +msgid "reference to uninitialized element `%s[\"%s\"]'" +msgstr "referència a un element sense valor inicial «%s[\"%s\"]»" + +#: array.c:512 +#, c-format +msgid "subscript of array `%s' is null string" +msgstr "el subscript de la matriu «%s» és una cadena nul·la" + +#: array.c:609 +#, c-format +msgid "delete: index `%s' not in array `%s'" +msgstr "delete: l'índex «%s» no està en la matriu «%s»" + +#: array.c:769 +#, c-format +msgid "%s: empty (null)\n" +msgstr "%s: buit (nul)\n" + +#: array.c:774 +#, c-format +msgid "%s: empty (zero)\n" +msgstr "%s: buit (zero)\n" + +#: array.c:778 +#, c-format +msgid "%s: table_size = %d, array_size = %d\n" +msgstr "%s: mida_taula = %d, mida_matriu = %d\n" + +#: array.c:807 +#, fuzzy, c-format +msgid "%s: is parameter\n" +msgstr "%s: és un paràmetre\n" + +#: array.c:812 +#, c-format +msgid "%s: array_ref to %s\n" +msgstr "%s: ref_matriu a %s\n" + +#: awkgram.y:208 +#, fuzzy, c-format +msgid "%s blocks must have an action part" +msgstr "Els blocs FINAL han de tindre una part d'acció" + +#: awkgram.y:211 +#, fuzzy +msgid "each rule must have a pattern or an action part" +msgstr "Els blocs FINAL han de tindre una part d'acció" + +#: awkgram.y:267 +#, c-format +msgid "`%s' is a built-in function, it cannot be redefined" +msgstr "«%s» és una funció interna, no pot ser redefinida" + +#: awkgram.y:314 +#, c-format +msgid "regexp constant `/%s/' looks like a C comment, but is not" +msgstr "" +"la constant d'expressió regular «/%s/» sembla un comentari en C, perà no ho " +"és" + +#: awkgram.y:340 awkgram.y:615 +msgid "statement may have no effect" +msgstr "la declaració podria no tindre efecte" + +#: awkgram.y:435 awkgram.y:455 +#, fuzzy, c-format +msgid "`%s' used in %s action" +msgstr "«next» és usat dintre de l'acció BEGIN o END" + +#: awkgram.y:448 awkgram.y:451 +msgid "`nextfile' is a gawk extension" +msgstr "«nextfile» és una extensió de gawk" + +#: awkgram.y:465 +msgid "`return' used outside function context" +msgstr "«return» és usat fora del context d'una funció" + +#: awkgram.y:504 +msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" +msgstr "" +"el «print» simple en la regla BEGIN o END probablement ha de ser «print \"\"»" + +#: awkgram.y:517 awkgram.y:524 +msgid "`delete array' is a gawk extension" +msgstr "«delete array» és una extensió de gawk" + +#: awkgram.y:532 awkgram.y:539 +#, fuzzy +msgid "`delete(array)' is a non-portable tawk extension" +msgstr "«delete array» és una extensió de gawk" + +#: awkgram.y:583 +#, c-format +msgid "duplicate case values in switch body: %s" +msgstr "" + +#: awkgram.y:593 +msgid "Duplicate `default' detected in switch body" +msgstr "" + +#: awkgram.y:681 +msgid "multistage two-way pipelines don't work" +msgstr "les canonades bidireccionals multi-etapes no funcionen" + +#: awkgram.y:772 +msgid "regular expression on right of assignment" +msgstr "expressió regular a la dreta d'una assignació" + +#: awkgram.y:782 +msgid "regular expression on left of `~' or `!~' operator" +msgstr "expressió regular a l'esquerra de l'operador «~» o «!~»" + +#: awkgram.y:790 +msgid "regular expression on right of comparison" +msgstr "expressió regular a la derta de la comparació" + +#: awkgram.y:857 +msgid "non-redirected `getline' undefined inside END action" +msgstr "«getline» no redirigit sense definir dintre de l'acció FINAL" + +#: awkgram.y:884 +msgid "call of `length' without parentheses is not portable" +msgstr "la crida de «length» sense parèntesis no és portable" + +#: awkgram.y:887 +msgid "call of `length' without parentheses is deprecated by POSIX" +msgstr "la crida de «length» sense parèntesis està desaprovada per POSIX" + +#: awkgram.y:940 +msgid "use of non-array as array" +msgstr "" + +#: awkgram.y:942 +msgid "invalid subscript expression" +msgstr "expressió de subscript no vàlida" + +#: awkgram.y:1140 +#, fuzzy +msgid "unexpected newline or end of string" +msgstr "nova línia inesperada" + +#: awkgram.y:1235 +msgid "empty program text on command line" +msgstr "el text del programa en la línia de comandaments està buit" + +#: awkgram.y:1292 +#, c-format +msgid "can't open source file `%s' for reading (%s)" +msgstr "no es pot obrir el fitxer font «%s» per a lectura (%s)" + +#: awkgram.y:1327 +#, c-format +msgid "can't read sourcefile `%s' (%s)" +msgstr "no es pot llegir el fitxer font «%s» (%s)" + +#: awkgram.y:1335 +#, c-format +msgid "source file `%s' is empty" +msgstr "el fitxer font «%s» està buit" + +#: awkgram.y:1537 awkgram.y:1647 awkgram.y:1665 awkgram.y:2015 awkgram.y:2100 +msgid "source file does not end in newline" +msgstr "el fitxer font no finalitza amb un retorn de carro" + +#: awkgram.y:1601 +msgid "unterminated regexp ends with `\\' at end of file" +msgstr "expressió regular sense finalitzar acaba amb «\\» al final del fitxer" + +#: awkgram.y:1621 +msgid "unterminated regexp" +msgstr "expressió regular sense finalitzar" + +#: awkgram.y:1624 +msgid "unterminated regexp at end of file" +msgstr "expressió regular sense finalitzar al final del fitxer" + +#: awkgram.y:1691 +msgid "use of `\\ #...' line continuation is not portable" +msgstr "l'ús de «\\ #...» com a continuació de línia no és portable" + +#: awkgram.y:1703 +msgid "backslash not last character on line" +msgstr "la barra invertida no és l'últim caràcter en la línia" + +#: awkgram.y:1748 +msgid "POSIX does not allow operator `**='" +msgstr "POSIX no permet l'operador «**=»" + +#: awkgram.y:1750 +msgid "old awk does not support operator `**='" +msgstr "l'antic awk no suporta l'operador «**=»" + +#: awkgram.y:1759 +msgid "POSIX does not allow operator `**'" +msgstr "POSIX no permet l'operador «**»" + +#: awkgram.y:1761 +msgid "old awk does not support operator `**'" +msgstr "l'antic awk no suporta l'operador «**=»" + +#: awkgram.y:1792 +msgid "operator `^=' is not supported in old awk" +msgstr "l'operador «^=» no està suportat en l'antic awk" + +#: awkgram.y:1800 +msgid "operator `^' is not supported in old awk" +msgstr "l'operador «^» no està suportat en l'antic awk" + +#: awkgram.y:1884 awkgram.y:1901 +msgid "unterminated string" +msgstr "cadena sense finalitzar" + +#: awkgram.y:2061 +#, c-format +msgid "invalid char '%c' in expression" +msgstr "caràcter «%c» no vàlid en l'expressió" + +#: awkgram.y:2121 +#, c-format +msgid "`%s' is a gawk extension" +msgstr "«%s» és una extensió de gawk" + +#: awkgram.y:2124 +#, c-format +msgid "`%s' is a Bell Labs extension" +msgstr "«%s» és una extensió de Bell Labs" + +#: awkgram.y:2127 +#, c-format +msgid "POSIX does not allow `%s'" +msgstr "POSIX no permet «%s»" + +#: awkgram.y:2131 +#, c-format +msgid "`%s' is not supported in old awk" +msgstr "«%s» no està suportat en l'antic awk" + +#: awkgram.y:2158 +msgid "`goto' considered harmful!\n" +msgstr "«goto» se considera nefast!\n" + +#: awkgram.y:2220 +#, c-format +msgid "%d is invalid as number of arguments for %s" +msgstr "%d no és vàlid com a nombre d'arguments per a %s" + +#: awkgram.y:2239 awkgram.y:2242 +msgid "match: third argument is a gawk extension" +msgstr "match: el tercer argument és una extensió de gawk" + +#: awkgram.y:2255 +#, c-format +msgid "%s: string literal as last arg of substitute has no effect" +msgstr "%s: la cadena literal com a últim argument de substitució no té efecte" + +#: awkgram.y:2258 +#, fuzzy, c-format +msgid "%s third parameter is not a changeable object" +msgstr "sub: el tercer argument no és un objecte intercanviable" + +#: awkgram.y:2285 awkgram.y:2288 +msgid "close: second argument is a gawk extension" +msgstr "close: el segon argument és una extensió de gawk" + +#: awkgram.y:2298 +msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" +msgstr "" +"l'ús de dcgettext(_\"...\") no és correcte: elimineu el guió baix inicial" + +#: awkgram.y:2313 +#, fuzzy +msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" +msgstr "" +"l'ús de dcgettext(_\"...\") no és correcte: elimineu el guió baix inicial" + +#: awkgram.y:2384 +#, c-format +msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" +msgstr "funció «%s»: paràmetre #%d, «%s», duplica al paràmetre #%d" + +#: awkgram.y:2417 +#, c-format +msgid "function `%s': parameter `%s' shadows global variable" +msgstr "funció «%s»: paràmetre «%s» ofusca la variable global" + +#: awkgram.y:2529 +#, c-format +msgid "could not open `%s' for writing (%s)" +msgstr "no es pot obrir «%s» per a escriptura (%s)" + +#: awkgram.y:2530 profile.c:93 +msgid "sending profile to standard error" +msgstr "enviant el perfil a l'eixida d'error estàndard" + +#: awkgram.y:2562 +#, c-format +msgid "%s: close failed (%s)" +msgstr "%s: tancament erroni (%s)" + +#: awkgram.y:2684 +msgid "shadow_funcs() called twice!" +msgstr "shadow_funcs() crida dos vegades!" + +#: awkgram.y:2711 +msgid "there were shadowed variables." +msgstr "" + +#: awkgram.y:2784 +#, c-format +msgid "function `%s': can't use function name as parameter name" +msgstr "funció «%s»: no pot usar el nom de la funció com a paràmetre" + +#: awkgram.y:2794 +#, c-format +msgid "function name `%s' previously defined" +msgstr "nom de la funció «%s» definida prèviament" + +#: awkgram.y:2945 awkgram.y:2951 +#, c-format +msgid "function `%s' called but never defined" +msgstr "es crida a la funció «%s» però no s'ha definit" + +#: awkgram.y:2954 +#, c-format +msgid "function `%s' defined but never called" +msgstr "es defineix la funció «%s» però no s'ha cridat mai" + +#: awkgram.y:2981 +#, c-format +msgid "regexp constant for parameter #%d yields boolean value" +msgstr "" +"l'expressió regular constant per al paràmetre #%d condueix a un valor booleà" + +#: awkgram.y:2994 +#, c-format +msgid "" +"function `%s' called with space between name and `(',\n" +"%s" +msgstr "" +"s'ha cridat a la funció «%s» amb espai entre el nom i el «(»,\n" +"%s" + +#: awkgram.y:2996 +#, fuzzy +msgid "or used as a variable or an array" +msgstr "no es pot usar el nom de la funció «%s» com a variable o matriu" + +#: builtin.c:137 +#, c-format +msgid "%s to \"%s\" failed (%s)" +msgstr "%s a \"%s\" ha fallat (%s)" + +#: builtin.c:138 +msgid "standard output" +msgstr "eixida estàndard" + +#: builtin.c:139 +msgid "reason unknown" +msgstr "motiu desconegut" + +#: builtin.c:152 +msgid "exp: received non-numeric argument" +msgstr "exp: s'ha rebut un argument que no és un número" + +#: builtin.c:158 +#, c-format +msgid "exp: argument %g is out of range" +msgstr "exp: l'argument %g està fora de rang" + +#: builtin.c:216 +#, c-format +msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing" +msgstr "" +"fflush: no es pot netejar: la canonada «%s» s'ha obert per a lectura, no per " +"a escriptura" + +#: builtin.c:219 +#, c-format +msgid "fflush: cannot flush: file `%s' opened for reading, not writing" +msgstr "" +"fflush: no es pot netejar: el fitxer «%s» s'ha obert per a lectura, no per a " +"escriptura" + +#: builtin.c:231 +#, c-format +msgid "fflush: `%s' is not an open file, pipe or co-process" +msgstr "fflush: «%s» no és un fitxer obert, canonada o co-procés" + +#: builtin.c:325 +msgid "index: received non-string first argument" +msgstr "índex: el primer argument rebut no és una cadena" + +#: builtin.c:327 +msgid "index: received non-string second argument" +msgstr "índex: el segon argument rebut no és una cadena" + +#: builtin.c:437 +msgid "int: received non-numeric argument" +msgstr "int: s'ha rebut un argument no numèric" + +#: builtin.c:454 +msgid "length: received non-string argument" +msgstr "length: s'ha rebut un argument que no és una cadena" + +#: builtin.c:470 +msgid "log: received non-numeric argument" +msgstr "log: s'ha rebut un argument no numèric" + +#: builtin.c:473 +#, c-format +msgid "log: received negative argument %g" +msgstr "log: s'ha rebut l'argument negatiu %g" + +#: builtin.c:635 builtin.c:638 +msgid "must use `count$' on all formats or none" +msgstr "" + +#: builtin.c:740 +msgid "`$' is not permitted in awk formats" +msgstr "no es permeten «$» en els formats awk" + +#: builtin.c:746 +msgid "arg count with `$' must be > 0" +msgstr "el compte d'arguments amb «$» ha de ser > 0" + +#: builtin.c:748 +#, fuzzy, c-format +msgid "arg count %ld greater than total number of supplied arguments" +msgstr "" +"el comte d'arguments %d és major que el nombre total d'arguments " +"proporcionats" + +#: builtin.c:750 +msgid "`$' not permitted after period in format" +msgstr "no es permet «$» després d'un punt en el format" + +#: builtin.c:763 +msgid "no `$' supplied for positional field width or precision" +msgstr "no es proporciona «$» per a l'ample o precisió del camp de posició" + +#: builtin.c:821 +msgid "`l' is meaningless in awk formats; ignored" +msgstr "«l» manca de significat en els formats awk; serà ignorat" + +#: builtin.c:825 +msgid "`l' is not permitted in POSIX awk formats" +msgstr "«l» no està permés en els formats POSIX de awk" + +#: builtin.c:836 +msgid "`L' is meaningless in awk formats; ignored" +msgstr "«L» manca de significat en els formats awk; serà ignorat" + +#: builtin.c:840 +msgid "`L' is not permitted in POSIX awk formats" +msgstr "«L» no està permés en els formats POSIX de awk" + +#: builtin.c:851 +msgid "`h' is meaningless in awk formats; ignored" +msgstr "«h» manca de significat en els formats awk; serà ignorat" + +#: builtin.c:855 +msgid "`h' is not permitted in POSIX awk formats" +msgstr "«h» no està permés en els formats POSIX de awk" + +#: builtin.c:1055 +#, c-format +msgid "[s]printf: value %g is out of range for `%%%c' format" +msgstr "" + +#: builtin.c:1108 +msgid "not enough arguments to satisfy format string" +msgstr "no hi ha prou arguments per a satisfer el format d'una cadena" + +#: builtin.c:1110 +msgid "^ ran out for this one" +msgstr "^ desbordament per a aquest" + +#: builtin.c:1115 +msgid "[s]printf: format specifier does not have control letter" +msgstr "[s]printf: l'especificador de format no conté lletra de control" + +#: builtin.c:1118 +msgid "too many arguments supplied for format string" +msgstr "s'han proporcionat masses arguments per a la cadena de format" + +#: builtin.c:1184 builtin.c:1187 +msgid "printf: no arguments" +msgstr "printf: sense arguments" + +#: builtin.c:1211 +msgid "sqrt: received non-numeric argument" +msgstr "sqrt: s'ha rebut un argument no numèric" + +#: builtin.c:1215 +#, c-format +msgid "sqrt: called with negative argument %g" +msgstr "sqrt: cridat amb l'argument negatiu %g" + +#: builtin.c:1238 +#, c-format +msgid "substr: start index %g is invalid, using 1" +msgstr "substr: l'índex d'inici %g no és vàlid, usant 1" + +#: builtin.c:1243 +#, c-format +msgid "substr: non-integer start index %g will be truncated" +msgstr "substr: l'índex d'inici no enter %g serà truncat" + +#: builtin.c:1262 +#, fuzzy, c-format +msgid "substr: length %g is not >= 1" +msgstr "substr: la longitud %g és <= 0" + +#: builtin.c:1264 +#, fuzzy, c-format +msgid "substr: length %g is not >= 0" +msgstr "substr: la longitud %g és <= 0" + +#: builtin.c:1271 +#, c-format +msgid "substr: non-integer length %g will be truncated" +msgstr "substr: la longitud sobre un nombre no enter %g serà truncada" + +#: builtin.c:1276 +#, c-format +msgid "substr: length %g too big for string indexing, truncating to %g" +msgstr "" + +#: builtin.c:1288 +msgid "substr: source string is zero length" +msgstr "substr: la cadena font és de longitud zero" + +#: builtin.c:1294 +#, fuzzy, c-format +msgid "substr: start index %g is past end of string" +msgstr "substr: l'índex d'inici %d sobrepassa l'acabament de la cadena" + +#: builtin.c:1302 +#, fuzzy, c-format +msgid "" +"substr: length %g at start index %g exceeds length of first argument (%lu)" +msgstr "" +"substr: la longitud %d a l'índex d'inici %d excedeix la longitud del 1er " +"argument (%d)" + +#: builtin.c:1337 +#, fuzzy +msgid "strftime: received non-string first argument" +msgstr "strftime: el primer argument rebut no és una cadena" + +#: builtin.c:1343 +msgid "strftime: received empty format string" +msgstr "strftime: s'ha rebut una cadena de format buida" + +#: builtin.c:1352 +#, fuzzy +msgid "strftime: received non-numeric second argument" +msgstr "strftime: el segon argument rebut no és numèric" + +#: builtin.c:1415 +msgid "mktime: received non-string argument" +msgstr "mktime: s'ha rebut un argument que no és una cadena" + +#: builtin.c:1460 +#, fuzzy +msgid "system: received non-string argument" +msgstr "system: s'ha rebut un argument que no és una cadena" + +#: builtin.c:1581 eval.c:1883 +#, fuzzy, c-format +msgid "reference to uninitialized field `$%d'" +msgstr "referència a una variable sense inicialitzar «%s»" + +#: builtin.c:1608 +#, fuzzy +msgid "tolower: received non-string argument" +msgstr "tolower: s'ha rebut un argument que no és una cadena" + +#: builtin.c:1657 +#, fuzzy +msgid "toupper: received non-string argument" +msgstr "toupper: s'ha rebut un argument que no és una cadena" + +#: builtin.c:1702 +msgid "atan2: received non-numeric first argument" +msgstr "atan2: el primer argument rebut no és numèric" + +#: builtin.c:1704 +msgid "atan2: received non-numeric second argument" +msgstr "atan2: el segon argument rebut no és numèric" + +#: builtin.c:1723 +msgid "sin: received non-numeric argument" +msgstr "sin: s'ha rebut un argument que no és numèric" + +#: builtin.c:1739 +msgid "cos: received non-numeric argument" +msgstr "cos: s'ha rebut un argument que no és numèric" + +#: builtin.c:1788 +msgid "srand: received non-numeric argument" +msgstr "srand: s'ha rebut un argument que no és numèric" + +#: builtin.c:1823 +msgid "match: third argument is not an array" +msgstr "match: el tercer argument no és una matriu" + +#: builtin.c:2307 +msgid "gensub: third argument of 0 treated as 1" +msgstr "gensub: el tercer argument de 0 és tractat com a 1" + +#: builtin.c:2416 builtin.c:2418 +msgid "lshift: received non-numeric first argument" +msgstr "lshift: el primer argument rebut no és numèric" + +#: builtin.c:2420 +#, c-format +msgid "lshift(%lf, %lf): negative values will give strange results" +msgstr "lshift(%lf, %lf): els valors negatius donaran resultats estranys" + +#: builtin.c:2422 +#, c-format +msgid "lshift(%lf, %lf): fractional values will be truncated" +msgstr "lshift(%lf, %lf): els valors fraccionaris sernn truncats" + +#: builtin.c:2424 +#, c-format +msgid "lshift(%lf, %lf): too large shift value will give strange results" +msgstr "" +"lshift(%lf, %lf): un valor de desplaçament massa gran donarà resultats " +"estranys" + +#: builtin.c:2453 builtin.c:2455 +msgid "rshift: received non-numeric first argument" +msgstr "rshift: el primer argument rebut no és numèric" + +#: builtin.c:2457 +#, c-format +msgid "rshift(%lf, %lf): negative values will give strange results" +msgstr "rshift(%lf, %lf): els valors negatius donaran resultats estranys" + +#: builtin.c:2459 +#, c-format +msgid "rshift(%lf, %lf): fractional values will be truncated" +msgstr "rshift(%lf, %lf): els valors fraccionaris seran truncats" + +#: builtin.c:2461 +#, c-format +msgid "rshift(%lf, %lf): too large shift value will give strange results" +msgstr "" +"rshift(%lf, %lf): un valor de desplaçament massa gran donarà resultats " +"estranys" + +#: builtin.c:2490 builtin.c:2492 +msgid "and: received non-numeric first argument" +msgstr "and: el primer argument rebut no és numèric" + +#: builtin.c:2494 +#, c-format +msgid "and(%lf, %lf): negative values will give strange results" +msgstr "and(%lf, %lf): els valors negatius donaran resultats estranys" + +#: builtin.c:2496 +#, c-format +msgid "and(%lf, %lf): fractional values will be truncated" +msgstr "and(%lf, %lf): els valors fraccionaris seran truncats" + +#: builtin.c:2525 builtin.c:2527 +msgid "or: received non-numeric first argument" +msgstr "or: el primer argument rebut no és numèric" + +#: builtin.c:2529 +#, c-format +msgid "or(%lf, %lf): negative values will give strange results" +msgstr "or(%lf, %lf): els valors negatius donaran resultats estranys" + +#: builtin.c:2531 +#, c-format +msgid "or(%lf, %lf): fractional values will be truncated" +msgstr "or(%lf, %lf): els valors fraccionaris seran truncats" + +#: builtin.c:2560 builtin.c:2562 +msgid "xor: received non-numeric first argument" +msgstr "xor: el primer argument rebut no és numèric" + +#: builtin.c:2564 +#, c-format +msgid "xor(%lf, %lf): negative values will give strange results" +msgstr "xor(%lf, %lf): els valors negatius donaran resultats estranys" + +#: builtin.c:2566 +#, c-format +msgid "xor(%lf, %lf): fractional values will be truncated" +msgstr "xor(%lf, %lf): els valors fraccionaris seran truncats" + +#: builtin.c:2594 +msgid "compl: received non-numeric argument" +msgstr "compl: s'ha rebut un argument que no és numèric" + +#: builtin.c:2596 +#, c-format +msgid "compl(%lf): negative value will give strange results" +msgstr "compl(%lf): el valor negatiu donarà resultats estranys" + +#: builtin.c:2598 +#, c-format +msgid "compl(%lf): fractional value will be truncated" +msgstr "compl(%lf): el valor fraccionari serà truncat" + +#: builtin.c:2771 +#, c-format +msgid "dcgettext: `%s' is not a valid locale category" +msgstr "dcgettext: «%s» no és una categoria local vàlida" + +#: eval.c:266 +#, c-format +msgid "unknown nodetype %d" +msgstr "tipo de node %d desconegut" + +#: eval.c:312 +msgid "buffer overflow in genflags2str" +msgstr "desbordament del cau temporal en genflags2str" + +#: eval.c:647 +#, fuzzy, c-format +msgid "for loop: array `%s' changed size from %ld to %ld during loop execution" +msgstr "" +"bucle for: la matriu «%s» ha canviat de mida de %d a %d durant l'execució " +"del bucle" + +#: eval.c:668 +msgid "`break' outside a loop is not portable" +msgstr "«break» a fora d'un bucle no és portable" + +#: eval.c:672 +msgid "`break' outside a loop is not allowed" +msgstr "no es permet «break» a fora d'un bucle" + +#: eval.c:689 +msgid "`continue' outside a loop is not portable" +msgstr "«continue» fora d'un bucle no és portable" + +#: eval.c:693 +msgid "`continue' outside a loop is not allowed" +msgstr "no es permet «continue» a fora d'un bucle" + +#: eval.c:727 +msgid "`next' cannot be called from a BEGIN rule" +msgstr "«next» no es pot cridar des d'una regla BEGIN" + +#: eval.c:729 +msgid "`next' cannot be called from an END rule" +msgstr "«next» no es pot cridar des d'una regla FINAL" + +#: eval.c:738 +msgid "`nextfile' cannot be called from a BEGIN rule" +msgstr "«nextfile» no es pot cridar des d'una regla BEGIN" + +#: eval.c:740 +msgid "`nextfile' cannot be called from an END rule" +msgstr "«nextfile» no es pot cridar des d'una regla FINAL" + +#: eval.c:785 +msgid "statement has no effect" +msgstr "la sentència no té efecte" + +#: eval.c:828 eval.c:1726 +#, c-format +msgid "can't use function name `%s' as variable or array" +msgstr "no es pot usar el nom de la funció «%s» com a variable o matriu" + +#: eval.c:835 eval.c:841 +#, c-format +msgid "reference to uninitialized argument `%s'" +msgstr "referència a un argument sense inicialitzar «%s»" + +#: eval.c:848 eval.c:907 eval.c:1732 eval.c:1742 profile.c:807 +#, c-format +msgid "attempt to use array `%s' in a scalar context" +msgstr "s'ha intentat usar la matriu «%s» en un context escalar" + +#: eval.c:858 eval.c:1752 +#, c-format +msgid "reference to uninitialized variable `%s'" +msgstr "referència a una variable sense inicialitzar «%s»" + +#: eval.c:1007 +msgid "" +"concatenation: side effects in one expression have changed the length of " +"another!" +msgstr "" +"concatenació: els efectes colaterals en una expressió han canviat la " +"longitud d'una altra!" + +#: eval.c:1032 +msgid "assignment used in conditional context" +msgstr "assignació usada en un context condicional" + +#: eval.c:1122 +msgid "division by zero attempted" +msgstr "s'ha intentat una divisió per zero" + +#: eval.c:1137 +#, c-format +msgid "division by zero attempted in `%%'" +msgstr "s'ha intentat una divisió per zero en «%%»" + +#: eval.c:1152 profile.c:683 +#, c-format +msgid "illegal type (%s) in tree_eval" +msgstr "tipus il·legal (%s) en tree_eval" + +#: eval.c:1328 +msgid "division by zero attempted in `/='" +msgstr "s'ha intentat una divisió per zero en «/=»" + +#: eval.c:1346 +#, c-format +msgid "division by zero attempted in `%%='" +msgstr "s'ha intentat una divisió per zero en «%%=»" + +#: eval.c:1586 +#, c-format +msgid "function `%s' called with more arguments than declared" +msgstr "s'ha cridat a la funció «%s» amb més arguments dels declarats" + +#: eval.c:1633 +#, c-format +msgid "function `%s' not defined" +msgstr "la funció «%s» no està definida" + +#: eval.c:1639 +#, c-format +msgid "function %s called\n" +msgstr "s'ha cridat a la funció %s\n" + +#: eval.c:1698 +msgid "" +"\n" +"\t# Function Call Stack:\n" +"\n" +msgstr "" +"\n" +"\t# Pila de Crides a les Funcions:\n" +"\n" + +#: eval.c:1701 +msgid "\t# -- main --\n" +msgstr "\t# -- principal --\n" + +#: eval.c:1867 +msgid "attempt to field reference from non-numeric value" +msgstr "s'ha intentat una referència de camp a partir d'un valor no numèric" + +#: eval.c:1869 +msgid "attempt to reference from null string" +msgstr "s'ha intentat una referència a partir d'una cadena nul·la" + +#: eval.c:1875 +#, c-format +msgid "attempt to access field %d" +msgstr "s'ha intentat accedir al camp %d" + +#: eval.c:1896 eval.c:1903 profile.c:900 +msgid "assignment is not allowed to result of builtin function" +msgstr "" +"no es permet l'assignació per a obtindre un resultat d'una funció interna" + +#: eval.c:1951 +msgid "`IGNORECASE' is a gawk extension" +msgstr "«IGNORECASE» és una extensió de gawk" + +#: eval.c:1980 +msgid "`BINMODE' is a gawk extension" +msgstr "«BINMODE» és una extensió de gawk" + +#: eval.c:2092 +#, c-format +msgid "bad `%sFMT' specification `%s'" +msgstr "«%sFMT» especificació errònia «%s»" + +#: eval.c:2170 +msgid "turning off `--lint' due to assignment to `LINT'" +msgstr "desactivant «--lint» degut a una assignació a «LINT»" + +#: ext.c:60 ext.c:64 +msgid "`extension' is a gawk extension" +msgstr "«extension» és una extensió gawk" + +#: ext.c:74 +#, c-format +msgid "extension: cannot open `%s' (%s)\n" +msgstr "extension: no es pot obrir «%s» (%s)\n" + +#: ext.c:82 +#, c-format +msgid "extension: library `%s': cannot call function `%s' (%s)\n" +msgstr "extension: biblioteca «%s»: no es pot cridar a la funció «%s» (%s)\n" + +#: ext.c:183 +msgid "Operation Not Supported" +msgstr "Operació No Suportada" + +#: field.c:315 +msgid "NF set to negative value" +msgstr "NF s'inicialitza sobre un valor negatiu" + +#: field.c:808 +msgid "split: second argument is not an array" +msgstr "split: el segon argument no és una matriu" + +#: field.c:842 +msgid "split: null string for third arg is a gawk extension" +msgstr "split: la cadena nul·la per al tercer argument és una extensió de gawk" + +#: field.c:894 +msgid "`FIELDWIDTHS' is a gawk extension" +msgstr "«FIELDWIDTHS» és una extensió de gawk" + +#: field.c:921 +#, c-format +msgid "field %d in FIELDWIDTHS, must be > 0" +msgstr "el camp %d en FIELDWIDTHS, hauria de ser > 0" + +#: field.c:994 +msgid "null string for `FS' is a gawk extension" +msgstr "la cadena nul·la per a «FS» és una extensió de gawk" + +#: getopt.c:692 getopt.c:704 +#, c-format +msgid "%s: option `%s' is ambiguous\n" +msgstr "%s: l'opció «%s» és ambigua\n" + +#: getopt.c:737 getopt.c:741 +#, c-format +msgid "%s: option `--%s' doesn't allow an argument\n" +msgstr "%s: l'opció «--%s» no admet cap argument\n" + +#: getopt.c:750 getopt.c:755 +#, c-format +msgid "%s: option `%c%s' doesn't allow an argument\n" +msgstr "%s: l'opció «%c%s» no admet cap argument\n" + +#: getopt.c:791 getopt.c:804 getopt.c:1093 getopt.c:1106 +#, c-format +msgid "%s: option `%s' requires an argument\n" +msgstr "%s: l'opció «%s» requereix un argument\n" + +#: getopt.c:842 getopt.c:845 +#, c-format +msgid "%s: unrecognized option `--%s'\n" +msgstr "%s: no es reconeix l'opció «--%s»\n" + +#: getopt.c:853 getopt.c:856 +#, c-format +msgid "%s: unrecognized option `%c%s'\n" +msgstr "%s: no es reconeix l'opció «%c%s»\n" + +#: getopt.c:903 getopt.c:906 +#, c-format +msgid "%s: illegal option -- %c\n" +msgstr "%s: opció il·legal -- %c\n" + +#: getopt.c:912 getopt.c:915 +#, c-format +msgid "%s: invalid option -- %c\n" +msgstr "%s: opció no vàlida -- %c\n" + +#: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:434 +#, c-format +msgid "%s: option requires an argument -- %c\n" +msgstr "%s: l'opció requereix un argument -- %c\n" + +#: getopt.c:1025 getopt.c:1036 +#, c-format +msgid "%s: option `-W %s' is ambiguous\n" +msgstr "%s: l'opció «-W %s» és ambigua\n" + +#: getopt.c:1060 getopt.c:1072 +#, c-format +msgid "%s: option `-W %s' doesn't allow an argument\n" +msgstr "%s: l'opció «-W %s» no admet cap argument\n" + +#: io.c:305 +#, c-format +msgid "cannot open file `%s' for reading (%s)" +msgstr "no es pot obrir el fitxer «%s» per a lectura (%s)" + +#: io.c:392 +#, c-format +msgid "close of fd %d (`%s') failed (%s)" +msgstr "la finalització del descriptor fd %d («%s») ha fallat (%s)" + +#: io.c:530 +#, c-format +msgid "invalid tree type %s in redirect()" +msgstr "tipus d'arbre %s no vàlid dintre de redirect()" + +#: io.c:536 +#, c-format +msgid "expression in `%s' redirection only has numeric value" +msgstr "l'expressió en la redirecció «%s» solt té un valor numèric" + +#: io.c:542 +#, c-format +msgid "expression for `%s' redirection has null string value" +msgstr "l'expressió per a la redirecció «%s» té un valor de cadena nul·la" + +#: io.c:547 +#, c-format +msgid "filename `%s' for `%s' redirection may be result of logical expression" +msgstr "" +"el fitxer «%s» per a la redirecció «%s» pot ser resultat d'una expressió " +"lògica" + +#: io.c:569 +#, c-format +msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" +msgstr "mescla innecessària de «>» i «>>» per al fitxer «%.*s»" + +#: io.c:621 +#, c-format +msgid "can't open pipe `%s' for output (%s)" +msgstr "no es pot obrir la canonada «%s» per a l'eixida (%s)" + +#: io.c:630 +#, c-format +msgid "can't open pipe `%s' for input (%s)" +msgstr "no es pot obrir la canonada «%s» per a l'entrada (%s)" + +#: io.c:643 +#, c-format +msgid "can't open two way socket `%s' for input/output (%s)" +msgstr "" +"no es pot obrir un socket bidireccional «%s» per a les entrades/eixides (%s)" + +#: io.c:647 +#, c-format +msgid "can't open two way pipe `%s' for input/output (%s)" +msgstr "" +"no es pot obrir una canonada bidireccional «%s» per a les entrades/eixides (%" +"s)" + +#: io.c:723 +#, c-format +msgid "can't redirect from `%s' (%s)" +msgstr "no es pot redirigir des de «%s» (%s)" + +#: io.c:726 +#, c-format +msgid "can't redirect to `%s' (%s)" +msgstr "no es pot redirigir cap a «%s» (%s)" + +#: io.c:765 +msgid "" +"reached system limit for open files: starting to multiplex file descriptors" +msgstr "" +"s'ha arribat al límit del sistema per a fitxers oberts: es començarà a " +"multiplexar els descriptors de fitxer" + +#: io.c:777 +#, c-format +msgid "close of `%s' failed (%s)." +msgstr "la finalització de «%s» ha fallat (%s)" + +#: io.c:784 +msgid "too many pipes or input files open" +msgstr "masses canonades o fitxers d'entrada oberts" + +#: io.c:807 +msgid "close: second argument must be `to' or `from'" +msgstr "close: el segon argument hauria de ser «to» o «from»" + +#: io.c:821 +#, c-format +msgid "close: `%.*s' is not an open file, pipe or co-process" +msgstr "close: «%.*s» no és un fitxer obert, canonada o co-procés" + +#: io.c:825 +msgid "close of redirection that was never opened" +msgstr "finalització d'una redirecció que no s'ha obert" + +#: io.c:862 +#, c-format +msgid "close: redirection `%s' not opened with `|&', second argument ignored" +msgstr "" +"close: la redirecció «%s» no s'obre amb «|&», s'ignora el segon argument" + +#: io.c:924 +#, c-format +msgid "failure status (%d) on pipe close of `%s' (%s)" +msgstr "estaus de falla (%d) en la finalització de la canonada «%s» (%s)" + +#: io.c:927 +#, c-format +msgid "failure status (%d) on file close of `%s' (%s)" +msgstr "estatus de falla (%d) en la finalització del fitxer «%s» (%s)" + +#: io.c:946 +#, c-format +msgid "no explicit close of socket `%s' provided" +msgstr "no s'aporta la finalització explícita del socket «%s»" + +#: io.c:949 +#, c-format +msgid "no explicit close of co-process `%s' provided" +msgstr "no s'aporta la finalització explícita del co-procés «%s»" + +#: io.c:952 +#, c-format +msgid "no explicit close of pipe `%s' provided" +msgstr "no s'aporta la finalització explícita de la canonada «%s»" + +#: io.c:955 +#, c-format +msgid "no explicit close of file `%s' provided" +msgstr "no s'aporta la finalització explícita del fitxer «%s»" + +#: io.c:984 io.c:1038 +#, c-format +msgid "error writing standard output (%s)" +msgstr "error a l'escriure en l'eixida estàndard (%s)" + +#: io.c:988 io.c:1042 +#, c-format +msgid "error writing standard error (%s)" +msgstr "error a l'escriure en l'eixida d'error estàndard (%s)" + +#: io.c:996 +#, c-format +msgid "pipe flush of `%s' failed (%s)." +msgstr "la neteja de la canonada de «%sx» ha fallat (%s)." + +#: io.c:999 +#, c-format +msgid "co-process flush of pipe to `%s' failed (%s)." +msgstr "la neteja de la canonada per al co-procés de «%sx» ha fallat (%s)." + +#: io.c:1002 +#, c-format +msgid "file flush of `%s' failed (%s)." +msgstr "la neteja del fitxer «%sx» ha fallat (%s)." + +#: io.c:1161 +msgid "/inet/raw client not ready yet, sorry" +msgstr "el client /inet/raw encara no està a punt, ho sento" + +#: io.c:1163 io.c:1200 +msgid "only root may use `/inet/raw'." +msgstr "sols el root pot usar «/inet/raw»." + +#: io.c:1198 +msgid "/inet/raw server not ready yet, sorry" +msgstr "el servidor /inet/raw encara no està a punt, ho sento" + +#: io.c:1288 +#, c-format +msgid "no (known) protocol supplied in special filename `%s'" +msgstr "no s'aporta cap protocol (conegut) en el nom del fitxer especial «%s»" + +#: io.c:1306 +#, c-format +msgid "special file name `%s' is incomplete" +msgstr "el nom del fitxer especial «%s» està incomplet" + +#: io.c:1318 +#, c-format +msgid "local port invalid in `%s'" +msgstr "port local no vàlid en «%s»" + +#: io.c:1330 +msgid "must supply a remote hostname to `/inet'" +msgstr "s'ha de subministrar un nom de sistema remot a «/inet»" + +#: io.c:1345 +msgid "must supply a remote port to `/inet'" +msgstr "s'ha de subministrar un port remot a «/inet»" + +#: io.c:1351 +#, c-format +msgid "remote port invalid in `%s'" +msgstr "port remot no vàlid en «%s»" + +#: io.c:1361 +msgid "TCP/IP communications are not supported" +msgstr "les comunicacions TCP/IP no estan suportades" + +#: io.c:1370 io.c:1551 +#, c-format +msgid "file `%s' is a directory" +msgstr "el fitxer «%s» és un directori" + +#: io.c:1440 +#, c-format +msgid "use `PROCINFO[\"%s\"]' instead of `%s'" +msgstr "useu «PROCINFO[\"%s\"]» en comptes de «%s»" + +#: io.c:1472 +msgid "use `PROCINFO[...]' instead of `/dev/user'" +msgstr "useu «PROCINFO[...]» en comptes de «/dev/user»" + +#: io.c:1537 io.c:1711 +#, c-format +msgid "could not open `%s', mode `%s'" +msgstr "no es pot obrir «%s», mode «%s»" + +#: io.c:1762 +#, fuzzy, c-format +msgid "close of master pty failed (%s)" +msgstr "ha fallat la finalització de la canonada (%s)" + +#: io.c:1764 io.c:1916 io.c:2068 +#, c-format +msgid "close of stdout in child failed (%s)" +msgstr "" +"ha fallat la finalització de l'eixida estàndard en els processos fills (%s)" + +#: io.c:1767 +#, fuzzy, c-format +msgid "moving slave pty to stdout in child failed (dup: %s)" +msgstr "" +"ha fallat la redirecció cap a l'eixida estàndard dels processos fills (dup: %" +"s)" + +#: io.c:1769 io.c:1921 +#, c-format +msgid "close of stdin in child failed (%s)" +msgstr "" +"ha fallat la finalització de l'entrada estàndard en els processos fills (%s)" + +#: io.c:1772 +#, fuzzy, c-format +msgid "moving slave pty to stdin in child failed (dup: %s)" +msgstr "" +"ha fallat la redirecció cap a l'entrada estàndard dels processos fills (dup: " +"%s)" + +#: io.c:1774 io.c:1793 +#, fuzzy, c-format +msgid "close of slave pty failed (%s)" +msgstr "ha fallat la finalització de la canonada (%s)" + +#: io.c:1867 io.c:1919 io.c:2049 io.c:2071 +#, c-format +msgid "moving pipe to stdout in child failed (dup: %s)" +msgstr "" +"ha fallat la redirecció cap a l'eixida estàndard dels processos fills (dup: %" +"s)" + +#: io.c:1871 io.c:1924 +#, c-format +msgid "moving pipe to stdin in child failed (dup: %s)" +msgstr "" +"ha fallat la redirecció cap a l'entrada estàndard dels processos fills (dup: " +"%s)" + +#: io.c:1888 io.c:2062 +msgid "restoring stdout in parent process failed\n" +msgstr "ha fallat la restauració de l'eixida estàndard en el procés pare\n" + +#: io.c:1893 +msgid "restoring stdin in parent process failed\n" +msgstr "ha fallat la restauració de l'entrada estàndard en el procés pare\n" + +#: io.c:1927 io.c:2073 io.c:2084 +#, c-format +msgid "close of pipe failed (%s)" +msgstr "ha fallat la finalització de la canonada (%s)" + +#: io.c:1972 +msgid "`|&' not supported" +msgstr "«|&» no està suportat" + +#: io.c:2039 +#, c-format +msgid "cannot open pipe `%s' (%s)" +msgstr "no es pot obrir la canonada «%s» (%s)" + +#: io.c:2080 +#, c-format +msgid "cannot create child process for `%s' (fork: %s)" +msgstr "no es pot crear el procés fill per a «%s» (fork: %s)" + +#: io.c:2423 +#, c-format +msgid "data file `%s' is empty" +msgstr "el fitxer de dades «%s» està buit" + +#: io.c:2466 io.c:2474 +msgid "could not allocate more input memory" +msgstr "" + +#: io.c:2832 io.c:2895 +#, c-format +msgid "error reading input file `%s': %s" +msgstr "error en llegir el fitxer d'entrada «%s»: %s" + +#: io.c:3020 +msgid "multicharacter value of `RS' is a gawk extension" +msgstr "el valor multicaràcter de «RS» és una extensió de gawk" + +#: main.c:324 +msgid "`-m[fr]' option irrelevant in gawk" +msgstr "l'opción «-m[fr]» és irrellevant en gawk" + +#: main.c:326 +msgid "-m option usage: `-m[fr] nnn'" +msgstr "ús de l'opció -m: «-m[fr] nnn»" + +#: main.c:343 +#, c-format +msgid "%s: option `-W %s' unrecognized, ignored\n" +msgstr "%s: no es reconeix l'opció «-W %s», serà ignorada\n" + +#: main.c:380 +msgid "empty argument to `--source' ignored" +msgstr "s'igonarà l'argument buit per a l'opció «--source»" + +#: main.c:451 +msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" +msgstr "" +"la variable d'entorn «POSIXLY_CORRECT» està establerta: usant «--posix»" + +#: main.c:456 +msgid "`--posix' overrides `--traditional'" +msgstr "«--posix» solapa a «--traditional»" + +#: main.c:467 +msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" +msgstr "«--posix» i «--traditional» solapen a «--non-decimal-data»" + +#: main.c:471 +#, fuzzy, c-format +msgid "running %s setuid root may be a security problem" +msgstr "executar %s com a setuid root pot ser un problema de seguretat" + +#: main.c:512 +#, fuzzy, c-format +msgid "can't set binary mode on stdin (%s)" +msgstr "no es pot establir el mode en l'entrada estàndard (%s)" + +#: main.c:515 +#, fuzzy, c-format +msgid "can't set binary mode on stdout (%s)" +msgstr "no es pot establir el mode en l'eixida estàndard (%s)" + +#: main.c:517 +#, fuzzy, c-format +msgid "can't set binary mode on stderr (%s)" +msgstr "no es pot establir el mode en l'eixida d'error estàndard (%s)" + +#: main.c:547 +msgid "no program text at all!" +msgstr "no hi ha cap text per al programa!" + +#: main.c:620 +#, c-format +msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" +msgstr "Ús: %s [opcions d'estil POSIX o GNU] -f fitx_prog [--] fitxer ...\n" + +#: main.c:622 +#, c-format +msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" +msgstr "Ús: %s [opcions d'estil POSIX o GNU] [--] %cprograma%c fitxer ...\n" + +#: main.c:627 +msgid "POSIX options:\t\tGNU long options:\n" +msgstr "Opcions POSIX:\t\tOpcions llargues GNU:\n" + +#: main.c:628 +msgid "\t-f progfile\t\t--file=progfile\n" +msgstr "\t-f fitx_prog\t\t--file=fitx_prog\n" + +#: main.c:629 +msgid "\t-F fs\t\t\t--field-separator=fs\n" +msgstr "\t-F fs\t\t\t--field-separator=fs (fs=sep_camp)\n" + +#: main.c:630 +msgid "\t-v var=val\t\t--assign=var=val\n" +msgstr "\t-v var=valor\t\t--assign=var=valor\n" + +#: main.c:631 +msgid "\t-m[fr] val\n" +msgstr "\t-m[fr] valor\n" + +#: main.c:632 +msgid "\t-W compat\t\t--compat\n" +msgstr "\t-W compat\t\t--compat\n" + +#: main.c:633 +msgid "\t-W copyleft\t\t--copyleft\n" +msgstr "\t-W copyleft\t\t--copyleft\n" + +#: main.c:634 +msgid "\t-W copyright\t\t--copyright\n" +msgstr "\t-W copyright\t\t--copyright\n" + +#: main.c:635 +msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n" +msgstr "\t-W dump-variables[=fitxer] --dump-variables[=fitxer]\n" + +#: main.c:636 +msgid "\t-W gen-po\t\t--gen-po\n" +msgstr "\t-W gen-po\t\t--gen-po\n" + +#: main.c:637 +msgid "\t-W help\t\t\t--help\n" +msgstr "\t-W help\t\t\t--help\n" + +#: main.c:638 +msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n" +msgstr "\t-W lint[=fatal]\t\t--lint[=fatal]\n" + +#: main.c:639 +msgid "\t-W lint-old\t\t--lint-old\n" +msgstr "\t-W lint-old\t\t--lint-old\n" + +#: main.c:640 +msgid "\t-W non-decimal-data\t--non-decimal-data\n" +msgstr "\t-W non-decimal-data\t--non-decimal-data\n" + +#: main.c:642 +msgid "\t-W nostalgia\t\t--nostalgia\n" +msgstr "\t-W nostalgia\t\t--nostalgia\n" + +#: main.c:645 +msgid "\t-W parsedebug\t\t--parsedebug\n" +msgstr "\t-W parsedebug\t\t--parsedebug\n" + +#: main.c:647 +msgid "\t-W profile[=file]\t--profile[=file]\n" +msgstr "\t-W profile[=fitxer]\t--profile[=fitxer]\n" + +#: main.c:648 +msgid "\t-W posix\t\t--posix\n" +msgstr "\t-W posix\t\t--posix\n" + +#: main.c:649 +msgid "\t-W re-interval\t\t--re-interval\n" +msgstr "\t-W re-interval\t\t--re-interval\n" + +#: main.c:650 +msgid "\t-W source=program-text\t--source=program-text\n" +msgstr "\t-W source=text_prog\t--source=text_prog\n" + +#: main.c:651 +msgid "\t-W traditional\t\t--traditional\n" +msgstr "\t-W traditional\t\t--traditional\n" + +#: main.c:652 +msgid "\t-W usage\t\t--usage\n" +msgstr "\t-W usage\t\t--usage\n" + +#: main.c:653 +msgid "\t-W version\t\t--version\n" +msgstr "\t-W version\t\t--version\n" + +#: main.c:657 +#, fuzzy +msgid "" +"\n" +"To report bugs, see node `Bugs' in `gawk.info', which is\n" +"section `Reporting Problems and Bugs' in the printed version.\n" +"\n" +msgstr "a la secció «Reporting Problems and Bugs» de la versió impresa.\n" + +#: main.c:661 +msgid "" +"gawk is a pattern scanning and processing language.\n" +"By default it reads standard input and writes standard output.\n" +"\n" +msgstr "" + +#: main.c:665 +msgid "" +"Examples:\n" +"\tgawk '{ sum += $1 }; END { print sum }' file\n" +"\tgawk -F: '{ print $1 }' /etc/passwd\n" +msgstr "" + +#: main.c:682 +#, c-format +msgid "" +"Copyright (C) 1989, 1991-%d Free Software Foundation.\n" +"\n" +"This program is free software; you can redistribute it and/or modify\n" +"it under the terms of the GNU General Public License as published by\n" +"the Free Software Foundation; either version 2 of the License, or\n" +"(at your option) any later version.\n" +"\n" +msgstr "" +"Copyright (C) 1989, 1991-%d Free Software Foundation.\n" +"\n" +"Aquest programa és programari lliure; pot redistribuir-se i/o modificar-se\n" +"sota els termes de la Llicència Pública General de GNU tal i como està\n" +"publicada per la Free Software Foundation; ja siga en la versió 2 de la\n" +"Llicència, o (a la vostra elecció) qualsevol versió posterior.\n" +"\n" + +#: main.c:690 +msgid "" +"This program is distributed in the hope that it will be useful,\n" +"but WITHOUT ANY WARRANTY; without even the implied warranty of\n" +"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" +"GNU General Public License for more details.\n" +"\n" +msgstr "" +"Aquest programa es distribueix amb l'esperança de que serà d'utilitat,\n" +"però SENSE CAP GARANTIA; fins i tot sense la garantia implícita de\n" +"COMERCIABILITAT o IDONEÏTAT PER A UN PROPÒSIT EN PARTICULAR.\n" +"Per a més detalls consulteu la Llicència Pública General de GNU.\n" +"\n" + +#: main.c:696 +msgid "" +"You should have received a copy of the GNU General Public License\n" +"along with this program; if not, write to the Free Software\n" +"Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n" +msgstr "" +"Junt amb aquest programa hauríeu d'haber rebut una còpia de la Llicència\n" +"Pública General de GNU; si no és així, escriviu a la Free Software\n" +"Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n" + +#: main.c:730 +msgid "-Ft does not set FS to tab in POSIX awk" +msgstr "-Ft no permet inicialitzar FS a un tabulador en la versió POSIX de awk" + +#: main.c:956 +#, c-format +msgid "" +"%s: `%s' argument to `-v' not in `var=value' form\n" +"\n" +msgstr "" + +#: main.c:976 +#, c-format +msgid "`%s' is not a legal variable name" +msgstr "" + +#: main.c:979 +#, c-format +msgid "`%s' is not a variable name, looking for file `%s=%s'" +msgstr "" + +#: main.c:1012 +msgid "floating point exception" +msgstr "excepció de coma flotant" + +#: main.c:1019 +msgid "fatal error: internal error" +msgstr "error fatal: error intern" + +#: main.c:1069 +#, c-format +msgid "no pre-opened fd %d" +msgstr "no s'ha pre-obert el descriptor fd per a %d" + +#: main.c:1074 +#, c-format +msgid "could not pre-open /dev/null for fd %d" +msgstr "no es pot pre-obrir /dev/null per al descriptor fd %d" + +#: main.c:1097 main.c:1106 +#, c-format +msgid "could not find groups: %s" +msgstr "no es poden trobar els grups: %s" + +#: msg.c:54 +msgid "cmd. line:" +msgstr "línia cmd.:" + +#: msg.c:120 +msgid "warning: " +msgstr "ADVERTIMENT: " + +#: msg.c:142 +msgid "error: " +msgstr "Error: " + +#: msg.c:178 +msgid "fatal: " +msgstr "Fatal: " + +#: node.c:58 node.c:65 node.c:74 node.c:88 node.c:115 +msgid "can't convert string to float" +msgstr "no es pot convertir la cadena a coma flotant" + +#: node.c:355 +msgid "backslash at end of string" +msgstr "barra invertida al final de la cadena" + +#: node.c:539 +msgid "POSIX does not allow `\\x' escapes" +msgstr "POSIX no permet seqüències d'escapada «\\x»" + +#: node.c:545 +msgid "no hex digits in `\\x' escape sequence" +msgstr "no hi ha dígits hexadecimals en la seqüència d'escapada «\\x»" + +#: node.c:579 +#, c-format +msgid "escape sequence `\\%c' treated as plain `%c'" +msgstr "la seqüència d'escapada «\\%c» és tractada com a una simple «%c»" + +#: posix/gawkmisc.c:172 +#, c-format +msgid "%s %s `%s': could not set close-on-exec: (fcntl: %s)" +msgstr "%s %s «%s»: no es pot inicialitzar close-on-exec: (fcntl: %s)" + +#: profile.c:91 +#, c-format +msgid "could not open `%s' for writing: %s" +msgstr "no es pot obrir «%s» per a escriptura: %s" + +#: profile.c:449 +#, fuzzy, c-format +msgid "internal error: %s with null vname" +msgstr "error intern: Node_var amb vname nul" + +#: profile.c:512 +msgid "# treated internally as `delete'" +msgstr "" + +#: profile.c:1162 +#, c-format +msgid "\t# gawk profile, created %s\n" +msgstr "\t# perfil gawk, creat %s\n" + +#: profile.c:1165 +msgid "" +"\t# BEGIN block(s)\n" +"\n" +msgstr "" +"\t# Bloc(s) INICI\n" +"\n" + +#: profile.c:1175 +msgid "" +"\t# Rule(s)\n" +"\n" +msgstr "" +"\t# Regla(es)\n" +"\n" + +#: profile.c:1181 +msgid "" +"\t# END block(s)\n" +"\n" +msgstr "" +"\t# Bloc(s) FINAL\n" +"\n" + +#: profile.c:1201 +msgid "" +"\n" +"\t# Functions, listed alphabetically\n" +msgstr "" +"\n" +"\t# Funcions, llistades alfabèticament\n" + +#: profile.c:1413 +#, c-format +msgid "unexpected type %s in prec_level" +msgstr "tipus %s inesperat en prec_level" + +#: re.c:193 +#, c-format +msgid "regex match failed, not enough memory to match string \"%.*s%s\"" +msgstr "" + +#: regcomp.c:136 +msgid "Success" +msgstr "Èxit" + +#: regcomp.c:139 +msgid "No match" +msgstr "No hi ha concordança" + +#: regcomp.c:142 +msgid "Invalid regular expression" +msgstr "Expressió regular no vàlida" + +#: regcomp.c:145 +msgid "Invalid collation character" +msgstr "Caràcter de comparació no vàlid" + +#: regcomp.c:148 +msgid "Invalid character class name" +msgstr "Nom de classe de caràcters no vàlid" + +#: regcomp.c:151 +msgid "Trailing backslash" +msgstr "Barra invertida extra al final" + +#: regcomp.c:154 +msgid "Invalid back reference" +msgstr "Referència cap enradera no vàlida" + +#: regcomp.c:157 +msgid "Unmatched [ or [^" +msgstr "[ o [^ desemparellats" + +#: regcomp.c:160 +msgid "Unmatched ( or \\(" +msgstr "( o \\( desemparellats" + +#: regcomp.c:163 +msgid "Unmatched \\{" +msgstr "\\{ desemparellat" + +#: regcomp.c:166 +msgid "Invalid content of \\{\\}" +msgstr "Contingut no vàlid de \\{\\}" + +#: regcomp.c:169 +msgid "Invalid range end" +msgstr "Final de rang no vàlid" + +#: regcomp.c:172 +msgid "Memory exhausted" +msgstr "Memòria exhaurida" + +#: regcomp.c:175 +msgid "Invalid preceding regular expression" +msgstr "Expressió regular precedent no vàlida" + +#: regcomp.c:178 +msgid "Premature end of regular expression" +msgstr "Fí prematura de l'expressió regular" + +#: regcomp.c:181 +msgid "Regular expression too big" +msgstr "L'expressió regular és massa gran" + +#: regcomp.c:184 +msgid "Unmatched ) or \\)" +msgstr ") o \\) desemparellats" + +#: regcomp.c:621 +msgid "No previous regular expression" +msgstr "No hi ha una expressió regular prèvia" + +#, fuzzy +#~ msgid "substr: length %g is < 0" +#~ msgstr "substr: la longitud %g és <= 0" + +#~ msgid "delete: illegal use of variable `%s' as array" +#~ msgstr "delete: ús il·legal de la variable «%s» com a una matriu" + +#, fuzzy +#~ msgid "%s: gvar_ref to %s\n" +#~ msgstr "%s: ref_matriu a %s\n" + +#~ msgid "asort: first argument is not an array" +#~ msgstr "asort: el primer argument no és una matriu" + +#~ msgid "asort: second argument is not an array" +#~ msgstr "asort: el segon argument no és una matriu" + +#, fuzzy +#~ msgid "" +#~ "attempt to use array parameter `%s' that was passed from global scalar `%" +#~ "s'" +#~ msgstr "s'ha intentat usar un paràmetre escalar «%s» com a una matriu" + +#~ msgid "internal error: Node_var_array with null vname" +#~ msgstr "error intern: Node_var_array amb vname nul" + +#~ msgid "" +#~ "\n" +#~ "To report bugs, see node `Bugs' in `gawk.info', which is\n" +#~ msgstr "" +#~ "\n" +#~ "Per a informar d'errors, consulteu el node «Bugs» en «gawk.info», que " +#~ "està\n" + +#~ msgid "invalid syntax in name `%s' for variable assignment" +#~ msgstr "sintaxi no vàlida en el nom «%s» per a l'asignació de la variable" + +#~ msgid "or used in other expression context" +#~ msgstr "o s'ha emprat en un altre context de l'expressió" + +#~ msgid "attempt to use function `%s' as array" +#~ msgstr "s'ha intentat usar la funció «%s» com a una matriu" + +#~ msgid "`%s' is a function, assignment is not allowed" +#~ msgstr "«%s» és una funció, l'assignació no és permesa" + +#~ msgid "BEGIN blocks must have an action part" +#~ msgstr "Els blocs INICI han de tindre una part d'acció" + +#~ msgid "`nextfile' used in BEGIN or END action" +#~ msgstr "«nextfile» és usat dintre de l'acció BEGIN o END" + +#~ msgid "non-redirected `getline' undefined inside BEGIN or END action" +#~ msgstr "«getline» no redirigit sense definir dintre de l'acció BEGIN o END" + +#~ msgid "fptr %x not in tokentab\n" +#~ msgstr "fptr %x no està en la taula de referència\n" + +#~ msgid "gsub third parameter is not a changeable object" +#~ msgstr "gsub: el tercer argument no és un objecte intercanviable" + +#~ msgid "Unfinished \\ escape" +#~ msgstr "seqüència d'escapada \\ sense finalitzar" + +#~ msgid "unfinished repeat count" +#~ msgstr "repetició del comptador sense finalitzar" + +#~ msgid "malformed repeat count" +#~ msgstr "repetició del comptador malformada" + +#~ msgid "Unbalanced [" +#~ msgstr "[ sense aparellar" + +#~ msgid "Unbalanced (" +#~ msgstr "( sense aparellar" + +#~ msgid "No regexp syntax bits specified" +#~ msgstr "No s'especifiquen els bits de sintaxi de l'expressió regular" + +#~ msgid "Unbalanced )" +#~ msgstr ") sense aparellar" + +#~ msgid "out of memory" +#~ msgstr "memòria esgotada" + +#~ msgid "internal error: file `%s', line %d\n" +#~ msgstr "error intern: fitxer «%s», línia %d\n" Binary files differ@@ -5,7 +5,8 @@ msgid "" msgstr "" "Project-Id-Version: gawk 3.1.31\n" -"POT-Creation-Date: 2003-03-19 14:25+0200\n" +"Report-Msgid-Bugs-To: arnold@skeeve.com\n" +"POT-Creation-Date: 2003-07-07 11:20-0700\n" "PO-Revision-Date: 2002-11-09 10:09+0100\n" "Last-Translator: Keld Simonsen <keld@dkuug.dk>\n" "Language-Team: Danish <dansk@klid.dk>\n" @@ -13,64 +14,61 @@ msgstr "" "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 +#: array.c:112 +#, c-format +msgid "attempt to use scalar parameter `%s' as an array" +msgstr "forsøg på at bruge skalarparameteren \"%s\" som en vektor" + +#: array.c:113 #, c-format msgid "attempt to use scalar `%s' as array" msgstr "forsøg på at bruge skalaren \"%s\" som vektor" -#: array.c:338 +#: array.c:151 +#, fuzzy, c-format +msgid "from %s" +msgstr "%s (fra %s)" + +#: array.c:506 #, c-format msgid "reference to uninitialized element `%s[\"%s\"]'" msgstr "reference til ikke-initieret element \"%s[\"%s\"]\"" -#: array.c:344 +#: array.c:512 #, 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 +#: array.c:609 #, 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 +#: array.c:769 #, c-format msgid "%s: empty (null)\n" msgstr "%s: tom (nil)\n" -#: array.c:638 +#: array.c:774 #, c-format msgid "%s: empty (zero)\n" msgstr "%s: tom (nul)\n" -#: array.c:642 +#: array.c:778 #, c-format msgid "%s: table_size = %d, array_size = %d\n" msgstr "%s: tabelstørrelse = %d, vektorstørrelse = %d\n" -#: array.c:671 +#: array.c:807 #, fuzzy, c-format msgid "%s: is parameter\n" msgstr "%s: er en parameter\n" -#: array.c:676 +#: array.c:812 #, 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" @@ -91,269 +89,282 @@ msgstr "\"%s\" er en indbygget funktion, den kan ikke omdefineres" msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "regexp-konstanten \"/%s/\" ser ud som en C-kommentar, men er det ikke" -#: awkgram.y:340 +#: awkgram.y:340 awkgram.y:615 msgid "statement may have no effect" msgstr "kommandoen har måske ikke nogen effekt" -#: awkgram.y:431 awkgram.y:451 +#: awkgram.y:435 awkgram.y:455 #, fuzzy, c-format msgid "`%s' used in %s action" msgstr "\"next\" brugt i BEGIN- eller END-handling" -#: awkgram.y:444 awkgram.y:447 +#: awkgram.y:448 awkgram.y:451 msgid "`nextfile' is a gawk extension" msgstr "\"nextfile\" er en gawk-udvidelse" -#: awkgram.y:461 +#: awkgram.y:465 msgid "`return' used outside function context" msgstr "\"return\" brugt uden for funktion" -#: awkgram.y:500 +#: awkgram.y:504 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" msgstr "" "alenestående \"print\" i BEGIN eller END-regel bør muligvis være 'print \"\"'" -#: awkgram.y:513 awkgram.y:520 +#: awkgram.y:517 awkgram.y:524 msgid "`delete array' is a gawk extension" msgstr "\"delete array\" er en gawk-udvidelse" -#: awkgram.y:528 awkgram.y:535 +#: awkgram.y:532 awkgram.y:539 #, fuzzy msgid "`delete(array)' is a non-portable tawk extension" msgstr "\"delete array\" er en gawk-udvidelse" -#: awkgram.y:578 +#: awkgram.y:583 +#, c-format +msgid "duplicate case values in switch body: %s" +msgstr "" + +#: awkgram.y:593 +msgid "Duplicate `default' detected in switch body" +msgstr "" + +#: awkgram.y:681 msgid "multistage two-way pipelines don't work" msgstr "flertrins dobbeltrettede datakanaler fungerer ikke" -#: awkgram.y:669 +#: awkgram.y:772 msgid "regular expression on right of assignment" msgstr "regulært udtryk i højreleddet af en tildeling" -#: awkgram.y:679 +#: awkgram.y:782 msgid "regular expression on left of `~' or `!~' operator" msgstr "regulært udtryk på venstre side af en \"~\"- eller \"!~\"-operator" -#: awkgram.y:687 +#: awkgram.y:790 msgid "regular expression on right of comparison" msgstr "regulært udtryk i højreleddet af en sammenligning" -#: awkgram.y:754 +#: awkgram.y:857 msgid "non-redirected `getline' undefined inside END action" msgstr "ikke-omdirigeret \"getline\" udefineret inde i END-handling" -#: awkgram.y:781 +#: awkgram.y:884 msgid "call of `length' without parentheses is not portable" msgstr "kald af \"length\" uden parenteser er ikke portabelt" -#: awkgram.y:784 +#: awkgram.y:887 msgid "call of `length' without parentheses is deprecated by POSIX" msgstr "kald af \"length\" uden parenteser er forældet ifølge POSIX" -#: awkgram.y:835 +#: awkgram.y:940 +msgid "use of non-array as array" +msgstr "" + +#: awkgram.y:942 msgid "invalid subscript expression" msgstr "ugyldig indeksudtryk" -#: awkgram.y:1020 +#: awkgram.y:1140 #, fuzzy msgid "unexpected newline or end of string" msgstr "uventet nylinjetegn" -#: awkgram.y:1115 +#: awkgram.y:1235 msgid "empty program text on command line" msgstr "tom programtekst på kommandolinjen" -#: awkgram.y:1172 +#: awkgram.y:1292 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "kan ikke åbne kildefilen \"%s\" for læsning (%s)" -#: awkgram.y:1207 +#: awkgram.y:1327 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "kan ikke læse kildefilen \"%s\" (%s)" -#: awkgram.y:1215 +#: awkgram.y:1335 #, 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 +#: awkgram.y:1537 awkgram.y:1647 awkgram.y:1665 awkgram.y:2015 awkgram.y:2100 msgid "source file does not end in newline" msgstr "kildefilen slutter ikke med en ny linje" -#: awkgram.y:1481 +#: awkgram.y:1601 msgid "unterminated regexp ends with `\\' at end of file" msgstr "uafsluttet regulært udtryk slutter med \"\\\" i slutningen af filen" -#: awkgram.y:1501 +#: awkgram.y:1621 msgid "unterminated regexp" msgstr "uafsluttet regulært udtryk" -#: awkgram.y:1504 +#: awkgram.y:1624 msgid "unterminated regexp at end of file" msgstr "uafsluttet regulært udtryk i slutningen af filen" -#: awkgram.y:1571 +#: awkgram.y:1691 msgid "use of `\\ #...' line continuation is not portable" msgstr "Brug af \"\\ #...\" for linjefortsættelse er ikke portabelt" -#: awkgram.y:1583 +#: awkgram.y:1703 msgid "backslash not last character on line" msgstr "sidste tegn på linjen er ikke en omvendt skråstreg" -#: awkgram.y:1628 +#: awkgram.y:1748 msgid "POSIX does not allow operator `**='" msgstr "POSIX tillader ikke operatoren \"**=\"" -#: awkgram.y:1630 +#: awkgram.y:1750 msgid "old awk does not support operator `**='" msgstr "gamle awk understøtter ikke operatoren \"**=\"" -#: awkgram.y:1639 +#: awkgram.y:1759 msgid "POSIX does not allow operator `**'" msgstr "POSIX tillader ikke operatoren \"**\"" -#: awkgram.y:1641 +#: awkgram.y:1761 msgid "old awk does not support operator `**'" msgstr "gamle awk understøtter ikke operatoren \"**\"" -#: awkgram.y:1672 +#: awkgram.y:1792 msgid "operator `^=' is not supported in old awk" msgstr "operatoren \"^=\" understøttes ikke i gamle awk" -#: awkgram.y:1680 +#: awkgram.y:1800 msgid "operator `^' is not supported in old awk" msgstr "operatoren \"^\" understøttes ikke i gamle awk" -#: awkgram.y:1764 awkgram.y:1781 +#: awkgram.y:1884 awkgram.y:1901 msgid "unterminated string" msgstr "uafsluttet streng" -#: awkgram.y:1941 +#: awkgram.y:2061 #, c-format msgid "invalid char '%c' in expression" msgstr "ugyldigt tegn \"%c\" i udtryk" -#: awkgram.y:2001 +#: awkgram.y:2121 #, c-format msgid "`%s' is a gawk extension" msgstr "\"%s\" er en gawk-udvidelse" -#: awkgram.y:2004 +#: awkgram.y:2124 #, c-format msgid "`%s' is a Bell Labs extension" msgstr "\"%s\" er en Bell Labs-udvidelse" -#: awkgram.y:2007 +#: awkgram.y:2127 #, c-format msgid "POSIX does not allow `%s'" msgstr "POSIX tillader ikke \"%s\"" -#: awkgram.y:2011 +#: awkgram.y:2131 #, c-format msgid "`%s' is not supported in old awk" msgstr "\"%s\" understøttes ikke i gamle awk" -#: awkgram.y:2038 +#: awkgram.y:2158 msgid "`goto' considered harmful!\n" msgstr "\"goto\" anses for skadlig!\n" -#: awkgram.y:2102 +#: awkgram.y:2220 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "%d er et ugyldigt antal argumenter for %s" -#: awkgram.y:2121 awkgram.y:2124 +#: awkgram.y:2239 awkgram.y:2242 msgid "match: third argument is a gawk extension" msgstr "match: tredje argument er en gawk-udvidelse" -#: awkgram.y:2137 +#: awkgram.y:2255 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "" "%s: bogstavelig streng som sidste argument til erstatning har ingen effekt" -#: awkgram.y:2140 +#: awkgram.y:2258 #, fuzzy, c-format msgid "%s third parameter is not a changeable object" msgstr "sub: tredje argument er ikke et ændringsbart objekt" -#: awkgram.y:2167 awkgram.y:2170 +#: awkgram.y:2285 awkgram.y:2288 msgid "close: second argument is a gawk extension" msgstr "close: andet argument er en gawk-udvidelse" -#: awkgram.y:2180 +#: awkgram.y:2298 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "brug af dcgettext(_\"...\") er fejlagtigt: fjern det indledende " "understregningstegn" -#: awkgram.y:2195 +#: awkgram.y:2313 #, fuzzy msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "brug af dcgettext(_\"...\") er fejlagtigt: fjern det indledende " "understregningstegn" -#: awkgram.y:2266 +#: awkgram.y:2384 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "funktionen \"%s\": parameter %d, \"%s\", er samme som parameter %d" -#: awkgram.y:2299 +#: awkgram.y:2417 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "funktionen \"%s\": parameteren \"%s\" overskygger en global variabel" -#: awkgram.y:2411 +#: awkgram.y:2529 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "kunne ikke åbne \"%s\" for skrivning (%s)" -#: awkgram.y:2412 profile.c:93 +#: awkgram.y:2530 profile.c:93 msgid "sending profile to standard error" msgstr "sender profilen til standard fejl" -#: awkgram.y:2442 +#: awkgram.y:2562 #, c-format msgid "%s: close failed (%s)" msgstr "%s: mislykkedes at lukke (%s)" -#: awkgram.y:2566 +#: awkgram.y:2684 msgid "shadow_funcs() called twice!" msgstr "shadow_funcs() kaldt to gange!" -#: awkgram.y:2593 +#: awkgram.y:2711 msgid "there were shadowed variables." msgstr "" -#: awkgram.y:2666 +#: awkgram.y:2784 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "funktionen \"%s\": kan ikke bruge funktionsnavn som parameternavn" -#: awkgram.y:2676 +#: awkgram.y:2794 #, c-format msgid "function name `%s' previously defined" msgstr "funktionsnavnet \"%s\" er allerede defineret" -#: awkgram.y:2827 awkgram.y:2833 +#: awkgram.y:2945 awkgram.y:2951 #, c-format msgid "function `%s' called but never defined" msgstr "funktionen \"%s\" kaldt, men aldrig defineret" -#: awkgram.y:2836 +#: awkgram.y:2954 #, c-format msgid "function `%s' defined but never called" msgstr "funktionen \"%s\" defineret, men aldrig kaldt" -#: awkgram.y:2863 +#: awkgram.y:2981 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "konstant regulært udtryk for parameter %d giver en boolesk værdi" -#: awkgram.y:2876 +#: awkgram.y:2994 #, c-format msgid "" "function `%s' called with space between name and `(',\n" @@ -362,192 +373,197 @@ msgstr "" "funktionen \"%s\" kaldt med blanktegn mellem navnet og \"(\",\n" "%s" -#: awkgram.y:2878 +#: awkgram.y:2996 #, fuzzy msgid "or used as a variable or an array" msgstr "kan ikke bruge funktionsnavnet \"%s\" som variabel eller vektor" -#: builtin.c:111 +#: builtin.c:137 #, c-format msgid "%s to \"%s\" failed (%s)" msgstr "%s til \"%s\" mislykkedes (%s)" -#: builtin.c:112 +#: builtin.c:138 msgid "standard output" msgstr "standard ud" -#: builtin.c:113 +#: builtin.c:139 msgid "reason unknown" msgstr "ukendt årsag" -#: builtin.c:126 +#: builtin.c:152 msgid "exp: received non-numeric argument" msgstr "exp: fik et ikke-numerisk argument" -#: builtin.c:132 +#: builtin.c:158 #, c-format msgid "exp: argument %g is out of range" msgstr "exp: argumentet %g er uden for tilladt område" -#: builtin.c:190 +#: builtin.c:216 #, c-format msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing" msgstr "" "fflush: kan ikke spole: datakanalen \"%s\" åbnet for læsning, ikke skrivning" -#: builtin.c:193 +#: builtin.c:219 #, c-format msgid "fflush: cannot flush: file `%s' opened for reading, not writing" msgstr "fflush: kan ikke spole: filen \"%s\" åbnet for læsning, ikke skrivning" -#: builtin.c:205 +#: builtin.c:231 #, c-format msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "fflush: \"%s\" er ikke en åben fil, datakanal eller ko proces" -#: builtin.c:299 +#: builtin.c:325 msgid "index: received non-string first argument" msgstr "indeks: første argument er ikke en streng" -#: builtin.c:301 +#: builtin.c:327 msgid "index: received non-string second argument" msgstr "indeks: andet argument er ikke en streng" -#: builtin.c:411 +#: builtin.c:437 msgid "int: received non-numeric argument" msgstr "int: fik et ikke-numerisk argument" -#: builtin.c:428 +#: builtin.c:454 msgid "length: received non-string argument" msgstr "length: fik et argument som ikke er en streng" -#: builtin.c:444 +#: builtin.c:470 msgid "log: received non-numeric argument" msgstr "log: fik et ikke-numerisk argument" -#: builtin.c:447 +#: builtin.c:473 #, c-format msgid "log: received negative argument %g" msgstr "log: fik et negativt argument %g" -#: builtin.c:609 builtin.c:612 +#: builtin.c:635 builtin.c:638 msgid "must use `count$' on all formats or none" msgstr "" -#: builtin.c:714 +#: builtin.c:740 msgid "`$' is not permitted in awk formats" msgstr "\"$\" tillades ikke i awkformat" -#: builtin.c:720 +#: builtin.c:746 msgid "arg count with `$' must be > 0" msgstr "argumentantallet med \"$\" skal være > 0" -#: builtin.c:722 +#: builtin.c:748 #, fuzzy, c-format msgid "arg count %ld greater than total number of supplied arguments" msgstr "argumentantallet %d er større end antal givne argumenter" -#: builtin.c:724 +#: builtin.c:750 msgid "`$' not permitted after period in format" msgstr "\"$\" tillades ikke efter et punktum i formatet" -#: builtin.c:737 +#: builtin.c:763 msgid "no `$' supplied for positional field width or precision" msgstr "intet \"$\" angivet for positionsangivet feltbredde eller præcision" -#: builtin.c:795 +#: builtin.c:821 msgid "`l' is meaningless in awk formats; ignored" msgstr "\"l\" er meningsløst i awk-formater, ignoreret" -#: builtin.c:799 +#: builtin.c:825 msgid "`l' is not permitted in POSIX awk formats" msgstr "\"l\" tillades ikke i POSIX awk-formater" -#: builtin.c:810 +#: builtin.c:836 msgid "`L' is meaningless in awk formats; ignored" msgstr "\"L\" er meningsløst i awk-formater, ignoreret" -#: builtin.c:814 +#: builtin.c:840 msgid "`L' is not permitted in POSIX awk formats" msgstr "\"L\" tillades ikke i POSIX awk-formater" -#: builtin.c:825 +#: builtin.c:851 msgid "`h' is meaningless in awk formats; ignored" msgstr "\"h\" er meningsløst i awk-formater, ignoreret" -#: builtin.c:829 +#: builtin.c:855 msgid "`h' is not permitted in POSIX awk formats" msgstr "\"h\" tillades ikke i POSIX awk-formater" -#: builtin.c:1078 +#: builtin.c:1055 +#, c-format +msgid "[s]printf: value %g is out of range for `%%%c' format" +msgstr "" + +#: builtin.c:1108 msgid "not enough arguments to satisfy format string" msgstr "for få argumenter til formatstrengen" -#: builtin.c:1080 +#: builtin.c:1110 msgid "^ ran out for this one" msgstr "^ sluttede her" -#: builtin.c:1085 +#: builtin.c:1115 msgid "[s]printf: format specifier does not have control letter" msgstr "[s]printf: formatspecifiereren har intet kommandobogstav" -#: builtin.c:1088 +#: builtin.c:1118 msgid "too many arguments supplied for format string" msgstr "for mange argumenter til formatstrengen" -#: builtin.c:1154 builtin.c:1157 +#: builtin.c:1184 builtin.c:1187 msgid "printf: no arguments" msgstr "printf: ingen argumenter" -#: builtin.c:1181 +#: builtin.c:1211 msgid "sqrt: received non-numeric argument" msgstr "sqrt: fik ikke-numerisk argument" -#: builtin.c:1185 +#: builtin.c:1215 #, c-format msgid "sqrt: called with negative argument %g" msgstr "sqrt: kaldt med negativt argument %g" -#: builtin.c:1207 +#: builtin.c:1238 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "substr: startindeks %g er ugyldigt, bruger 1" -#: builtin.c:1212 +#: builtin.c:1243 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "substr: startindeks %g som ikke er et heltal bliver trunkeret" -#: builtin.c:1231 -#, c-format -msgid "substr: length %g is <= 0" +#: builtin.c:1262 +#, fuzzy, c-format +msgid "substr: length %g is not >= 1" msgstr "substr: længden %g er <= 0" -#: builtin.c:1233 +#: builtin.c:1264 #, fuzzy, c-format -msgid "substr: length %g is < 0" +msgid "substr: length %g is not >= 0" msgstr "substr: længden %g er <= 0" -#: builtin.c:1240 +#: builtin.c:1271 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "substr: længden %g som ikke er et heltal bliver trunkeret" -#: builtin.c:1245 +#: builtin.c:1276 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" msgstr "" -#: builtin.c:1257 +#: builtin.c:1288 msgid "substr: source string is zero length" msgstr "substr: kildestrengen er tom" -#: builtin.c:1263 +#: builtin.c:1294 #, fuzzy, c-format msgid "substr: start index %g is past end of string" msgstr "substr: startindeks %d er forbi slutningen på strengen" -#: builtin.c:1271 +#: builtin.c:1302 #, fuzzy, c-format msgid "" "substr: length %g at start index %g exceeds length of first argument (%lu)" @@ -555,295 +571,295 @@ msgstr "" "substr: længden %d ved startindeks %d overskrider længden af første argument " "(%d)" -#: builtin.c:1306 +#: builtin.c:1337 #, fuzzy msgid "strftime: received non-string first argument" msgstr "strftime: fik et første argument som ikke er en streng" -#: builtin.c:1312 +#: builtin.c:1343 msgid "strftime: received empty format string" msgstr "strftime: fik en tom formatstreng" -#: builtin.c:1321 +#: builtin.c:1352 #, fuzzy msgid "strftime: received non-numeric second argument" msgstr "strftime: fik et ikke-numerisk andet argument" -#: builtin.c:1384 +#: builtin.c:1415 msgid "mktime: received non-string argument" msgstr "mktime: fik et argument som ikke er en streng" -#: builtin.c:1429 +#: builtin.c:1460 #, fuzzy msgid "system: received non-string argument" msgstr "system: fik et argument som ikke er en streng" -#: builtin.c:1573 +#: builtin.c:1581 eval.c:1883 +#, fuzzy, c-format +msgid "reference to uninitialized field `$%d'" +msgstr "reference til ikke-initieret variabel \"%s\"" + +#: builtin.c:1608 #, fuzzy msgid "tolower: received non-string argument" msgstr "tolower: fik et argument som ikke er en streng" -#: builtin.c:1622 +#: builtin.c:1657 #, fuzzy msgid "toupper: received non-string argument" msgstr "toupper: fik et argument som ikke er en streng" -#: builtin.c:1667 +#: builtin.c:1702 msgid "atan2: received non-numeric first argument" msgstr "atan2: fik et ikke-numerisk første argument" -#: builtin.c:1669 +#: builtin.c:1704 msgid "atan2: received non-numeric second argument" msgstr "atan2: fik et ikke-numerisk andet argument" -#: builtin.c:1688 +#: builtin.c:1723 msgid "sin: received non-numeric argument" msgstr "sin: fik et ikke-numerisk argument" -#: builtin.c:1704 +#: builtin.c:1739 msgid "cos: received non-numeric argument" msgstr "cos: fik et ikke-numerisk argument" -#: builtin.c:1748 +#: builtin.c:1788 msgid "srand: received non-numeric argument" msgstr "srand: fik et ikke-numerisk argument" -#: builtin.c:1787 +#: builtin.c:1823 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" +#: builtin.c:2307 +msgid "gensub: third argument of 0 treated as 1" msgstr "gensub: Nullet i tredje argument behandlet som et ét-tal" -#: builtin.c:2375 builtin.c:2377 +#: builtin.c:2416 builtin.c:2418 msgid "lshift: received non-numeric first argument" msgstr "lshift: fik et ikke-numerisk første argument" -#: builtin.c:2379 +#: builtin.c:2420 #, c-format msgid "lshift(%lf, %lf): negative values will give strange results" msgstr "lshift(%lf, %lf): negative værdier vil give mærkelige resultater" -#: builtin.c:2381 +#: builtin.c:2422 #, c-format msgid "lshift(%lf, %lf): fractional values will be truncated" msgstr "lshift(%lf, %lf): flydendetalsværdier vil blive trunkeret" -#: builtin.c:2383 +#: builtin.c:2424 #, c-format msgid "lshift(%lf, %lf): too large shift value will give strange results" msgstr "" "lshift(%lf, %lf): for store skifteværdier vil give mærkelige resultater" -#: builtin.c:2412 builtin.c:2414 +#: builtin.c:2453 builtin.c:2455 msgid "rshift: received non-numeric first argument" msgstr "rshift: fik et ikke-numerisk første argument" -#: builtin.c:2416 +#: builtin.c:2457 #, c-format msgid "rshift(%lf, %lf): negative values will give strange results" msgstr "rshift(%lf, %lf): negative værdier vil give mærkelige resultater" -#: builtin.c:2418 +#: builtin.c:2459 #, c-format msgid "rshift(%lf, %lf): fractional values will be truncated" msgstr "rshift(%lf, %lf): flydendetalsværdier vil blive trunkeret" -#: builtin.c:2420 +#: builtin.c:2461 #, c-format msgid "rshift(%lf, %lf): too large shift value will give strange results" msgstr "" "rshift(%lf, %lf): for store skifteværdier vil give mærkelige resultater" -#: builtin.c:2449 builtin.c:2451 +#: builtin.c:2490 builtin.c:2492 msgid "and: received non-numeric first argument" msgstr "and: fik et ikke-numerisk første argument" -#: builtin.c:2453 +#: builtin.c:2494 #, c-format msgid "and(%lf, %lf): negative values will give strange results" msgstr "and(%lf, %lf): negative værdier vil give mærkelige resultater" -#: builtin.c:2455 +#: builtin.c:2496 #, c-format msgid "and(%lf, %lf): fractional values will be truncated" msgstr "and(%lf, %lf): flydendetalsværdier vil blive trunkeret" -#: builtin.c:2484 builtin.c:2486 +#: builtin.c:2525 builtin.c:2527 msgid "or: received non-numeric first argument" msgstr "or: fik et ikke-numerisk første argument" -#: builtin.c:2488 +#: builtin.c:2529 #, c-format msgid "or(%lf, %lf): negative values will give strange results" msgstr "or(%lf, %lf): negative værdier vil give mærkelige resultater" -#: builtin.c:2490 +#: builtin.c:2531 #, c-format msgid "or(%lf, %lf): fractional values will be truncated" msgstr "or(%lf, %lf): flydendetalsværdier vil blive trunkeret" -#: builtin.c:2519 builtin.c:2521 +#: builtin.c:2560 builtin.c:2562 msgid "xor: received non-numeric first argument" msgstr "xor: fik et ikke-numerisk første argument" -#: builtin.c:2523 +#: builtin.c:2564 #, c-format msgid "xor(%lf, %lf): negative values will give strange results" msgstr "xor(%lf, %lf): negative værdier vil give mærkelige resultater" -#: builtin.c:2525 +#: builtin.c:2566 #, c-format msgid "xor(%lf, %lf): fractional values will be truncated" msgstr "xor(%lf, %lf): flydendetalsværdier vil blive trunkeret" -#: builtin.c:2553 +#: builtin.c:2594 msgid "compl: received non-numeric argument" msgstr "compl: fik et ikke-numerisk argument" -#: builtin.c:2555 +#: builtin.c:2596 #, c-format msgid "compl(%lf): negative value will give strange results" msgstr "compl(%lf): negative værdier vil give mærkelige resultater" -#: builtin.c:2557 +#: builtin.c:2598 #, c-format msgid "compl(%lf): fractional value will be truncated" msgstr "compl(%lf): flydendetalsværdier vil blive trunkeret" -#: builtin.c:2728 +#: builtin.c:2771 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "dcgettext: \"%s\" er ikke en gyldig lokalekategori" -#: eval.c:262 +#: eval.c:266 #, c-format msgid "unknown nodetype %d" msgstr "ukendt nodetype %d" -#: eval.c:310 +#: eval.c:312 msgid "buffer overflow in genflags2str" msgstr "bufferoverløb i genflags2str" -#: eval.c:555 +#: eval.c:647 #, fuzzy, c-format msgid "for loop: array `%s' changed size from %ld to %ld during loop execution" msgstr "" "for-løkke: vektoren \"%s\" ændrede størrelse fra %d til %d under løkke-" "udførelsen" -#: eval.c:576 +#: eval.c:668 msgid "`break' outside a loop is not portable" msgstr "\"break\" uden for en løkke er ikke portabelt" -#: eval.c:580 +#: eval.c:672 msgid "`break' outside a loop is not allowed" msgstr "\"break\" uden for en løkke er ikke tilladt" -#: eval.c:597 +#: eval.c:689 msgid "`continue' outside a loop is not portable" msgstr "\"continue\" uden for en løkke er ikke portabelt" -#: eval.c:601 +#: eval.c:693 msgid "`continue' outside a loop is not allowed" msgstr "\"continue\" uden for en løkke er ikke tilladt" -#: eval.c:635 +#: eval.c:727 msgid "`next' cannot be called from a BEGIN rule" msgstr "\"next\" kan ikke kaldes fra en BEGIN-regel" -#: eval.c:637 +#: eval.c:729 msgid "`next' cannot be called from an END rule" msgstr "\"next\" kan ikke kaldes fra en END-regel" -#: eval.c:646 +#: eval.c:738 msgid "`nextfile' cannot be called from a BEGIN rule" msgstr "\"nextfile\" kan ikke kaldes fra en BEGIN-regel" -#: eval.c:648 +#: eval.c:740 msgid "`nextfile' cannot be called from an END rule" msgstr "\"nextfile\" kan ikke kaldes fra en END-regel" -#: eval.c:696 +#: eval.c:785 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 +#: eval.c:828 eval.c:1726 #, c-format msgid "can't use function name `%s' as variable or array" msgstr "kan ikke bruge funktionsnavnet \"%s\" som variabel eller vektor" -#: eval.c:746 eval.c:752 +#: eval.c:835 eval.c:841 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "reference til ikke-initieret argument \"%s\"" -#: eval.c:810 eval.c:1728 profile.c:773 +#: eval.c:848 eval.c:907 eval.c:1732 eval.c:1742 profile.c:807 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "forsøg på at bruge vektoren \"%s\" i skalarsammenhæng" -#: eval.c:910 +#: eval.c:858 eval.c:1752 +#, c-format +msgid "reference to uninitialized variable `%s'" +msgstr "reference til ikke-initieret variabel \"%s\"" + +#: eval.c:1007 msgid "" "concatenation: side effects in one expression have changed the length of " "another!" msgstr "" "concatenation: sideeffekter i et udtryk har ændret længden af et andet!" -#: eval.c:935 +#: eval.c:1032 msgid "assignment used in conditional context" msgstr "tildeling brugt i sammenligningsammenhæng" -#: eval.c:1026 +#: eval.c:1122 msgid "division by zero attempted" msgstr "forsøgte at dividere med nul" -#: eval.c:1041 +#: eval.c:1137 #, c-format msgid "division by zero attempted in `%%'" msgstr "forsøgte at dividere med nul i \"%%\"" -#: eval.c:1056 profile.c:649 +#: eval.c:1152 profile.c:683 #, c-format msgid "illegal type (%s) in tree_eval" msgstr "ikke tilladt type (%s) i tree_eval" -#: eval.c:1232 +#: eval.c:1328 msgid "division by zero attempted in `/='" msgstr "forsøgte at dividere med nul i \"/=\"" -#: eval.c:1250 +#: eval.c:1346 #, 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 +#: eval.c:1586 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "funktionen \"%s\" kaldt med flere argumenter end deklareret" -#: eval.c:1628 +#: eval.c:1633 #, c-format msgid "function `%s' not defined" msgstr "funktionen \"%s\" er ikke defineret" -#: eval.c:1634 +#: eval.c:1639 #, c-format msgid "function %s called\n" msgstr "funktionen %s kaldt\n" -#: eval.c:1693 +#: eval.c:1698 msgid "" "\n" "\t# Function Call Stack:\n" @@ -853,46 +869,41 @@ msgstr "" "\t# Funktionskaldsstak:\n" "\n" -#: eval.c:1696 +#: eval.c:1701 msgid "\t# -- main --\n" msgstr "\t# -- main --\n" -#: eval.c:1850 +#: eval.c:1867 msgid "attempt to field reference from non-numeric value" msgstr "forsøg på at feltreferere fra ikke-numerisk værdi" -#: eval.c:1852 +#: eval.c:1869 msgid "attempt to reference from null string" msgstr "forsøg på at referere fra tom streng" -#: eval.c:1858 +#: eval.c:1875 #, 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 +#: eval.c:1896 eval.c:1903 profile.c:900 msgid "assignment is not allowed to result of builtin function" msgstr "tildeling er ikke tilladt til resultatet fra en indbygget funktion" -#: eval.c:1941 +#: eval.c:1951 msgid "`IGNORECASE' is a gawk extension" msgstr "\"IGNORECASE\" er en gawk-udvidelse" -#: eval.c:1970 +#: eval.c:1980 msgid "`BINMODE' is a gawk extension" msgstr "\"BINMODE\" er en gawk-udvidelse" -#: eval.c:2082 +#: eval.c:2092 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "fejlagtig \"%sFMT\"-specifikation \"%s\"" -#: eval.c:2160 +#: eval.c:2170 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "deaktiverer \"--lint\" på grund af en tildeling til \"LINT\"" @@ -910,32 +921,32 @@ msgstr "extension: kan ikke åbne \"%s\" (%s)\n" msgid "extension: library `%s': cannot call function `%s' (%s)\n" msgstr "extension: bibliotek \"%s\": kan ikke kalde funktionen \"%s\" (%s)\n" -#: ext.c:181 +#: ext.c:183 msgid "Operation Not Supported" msgstr "Operationen understøttes ikke" -#: field.c:321 +#: field.c:315 msgid "NF set to negative value" msgstr "NF sat til en negativ værdi" -#: field.c:819 +#: field.c:808 msgid "split: second argument is not an array" msgstr "split: andet argument er ikke en vektor" -#: field.c:854 +#: field.c:842 msgid "split: null string for third arg is a gawk extension" msgstr "split: tom streng som tredje argument er en gawk-udvidelse" -#: field.c:906 +#: field.c:894 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "\"FIELDWIDTHS\" er en gawk-udvidelse" -#: field.c:933 +#: field.c:921 #, c-format msgid "field %d in FIELDWIDTHS, must be > 0" msgstr "felt %d i FIELDWIDTHS skal være > 0" -#: field.c:1006 +#: field.c:994 msgid "null string for `FS' is a gawk extension" msgstr "tom streng som \"FS\" er en gawk-udvidelse" @@ -979,7 +990,7 @@ msgstr "%s: ikke tilladt flag -- %c\n" 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 +#: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:434 #, c-format msgid "%s: option requires an argument -- %c\n" msgstr "%s: flaget kræver et argument -- %c\n" @@ -994,468 +1005,468 @@ msgstr "%s: flaget \"-W %s\" er flertydigt\n" msgid "%s: option `-W %s' doesn't allow an argument\n" msgstr "%s: flaget \"-W %s\" tillader ikke noget argument\n" -#: io.c:257 +#: io.c:305 #, c-format msgid "cannot open file `%s' for reading (%s)" msgstr "kan ikke åbne filen \"%s\" for læsning (%s)" -#: io.c:344 +#: io.c:392 #, c-format msgid "close of fd %d (`%s') failed (%s)" msgstr "lukning af fd %d (\"%s\") mislykkedes (%s)" -#: io.c:482 +#: io.c:530 #, c-format msgid "invalid tree type %s in redirect()" msgstr "ugyldig trætype %s i redirect()" -#: io.c:488 +#: io.c:536 #, c-format msgid "expression in `%s' redirection only has numeric value" msgstr "udtrykket i \"%s\"-omdirigering har kun numerisk værdi" -#: io.c:494 +#: io.c:542 #, c-format msgid "expression for `%s' redirection has null string value" msgstr "udtrykket for \"%s\"-omdirigering har en tom streng som værdi" -#: io.c:499 +#: io.c:547 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" msgstr "" "filnavnet \"%s\" for \"%s\"-omdirigering kan være resultatet af et logisk " "udtryk" -#: io.c:521 +#: io.c:569 #, c-format msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" msgstr "unødig blanding af \">\" og \">>\" for filen \"%.*s\"" -#: io.c:573 +#: io.c:621 #, c-format msgid "can't open pipe `%s' for output (%s)" msgstr "kan ikke åbne røret \"%s\" for udskrivning (%s)" -#: io.c:582 +#: io.c:630 #, c-format msgid "can't open pipe `%s' for input (%s)" msgstr "kan ikke åbne røret \"%s\" for indtastning (%s)" -#: io.c:595 +#: io.c:643 #, c-format msgid "can't open two way socket `%s' for input/output (%s)" msgstr "kan ikke åbne tovejssoklen \"%s\" for ind-/uddata (%s)" -#: io.c:599 +#: io.c:647 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" msgstr "kan ikke åbne tovejsrøret \"%s\" for ind-/uddata (%s)" -#: io.c:675 +#: io.c:723 #, c-format msgid "can't redirect from `%s' (%s)" msgstr "kan ikke omdirigere fra \"%s\" (%s)" -#: io.c:678 +#: io.c:726 #, c-format msgid "can't redirect to `%s' (%s)" msgstr "kan ikke omdirigere til \"%s\" (%s)" -#: io.c:717 +#: io.c:765 msgid "" "reached system limit for open files: starting to multiplex file descriptors" msgstr "" "nåede systembegrænsningen for åbne filer: begynder at multiplekse " "fildeskriptorer" -#: io.c:729 +#: io.c:777 #, c-format msgid "close of `%s' failed (%s)." msgstr "lukning af \"%s\" mislykkedes (%s)" -#: io.c:736 +#: io.c:784 msgid "too many pipes or input files open" msgstr "for mange rør eller inddatafiler åbne" -#: io.c:759 +#: io.c:807 msgid "close: second argument must be `to' or `from'" msgstr "close: andet argument skal være \"to\" eller \"from\"" -#: io.c:773 +#: io.c:821 #, c-format msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "close: \"%.*s\" er ikke en åben fil, datakanal eller ko-proces" -#: io.c:777 +#: io.c:825 msgid "close of redirection that was never opened" msgstr "lukning af omdirigering som aldrig åbnedes" -#: io.c:804 +#: io.c:862 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" msgstr "" "close: omdirigeringen \"%s\" åbnedes ikke med \"|&\", andet argument " "ignoreret" -#: io.c:866 +#: io.c:924 #, c-format msgid "failure status (%d) on pipe close of `%s' (%s)" msgstr "fejlstatus (%d) fra rørlukning af \"%s\" (%s)" -#: io.c:869 +#: io.c:927 #, c-format msgid "failure status (%d) on file close of `%s' (%s)" msgstr "fejlstatus (%d) fra fillukning af \"%s\" (%s)" -#: io.c:888 +#: io.c:946 #, c-format msgid "no explicit close of socket `%s' provided" msgstr "ingen eksplicit lukning af soklen \"%s\" angivet" -#: io.c:891 +#: io.c:949 #, c-format msgid "no explicit close of co-process `%s' provided" msgstr "ingen eksplicit lukning af ko-processen \"%s\" angivet" -#: io.c:894 +#: io.c:952 #, c-format msgid "no explicit close of pipe `%s' provided" msgstr "ingen eksplicit lukning af røret \"%s\" angivet" -#: io.c:897 +#: io.c:955 #, c-format msgid "no explicit close of file `%s' provided" msgstr "ingen eksplicit lukning af filen \"%s\" angivet" -#: io.c:926 io.c:980 +#: io.c:984 io.c:1038 #, c-format msgid "error writing standard output (%s)" msgstr "fejl ved skrivning til standard ud (%s)" -#: io.c:930 io.c:984 +#: io.c:988 io.c:1042 #, c-format msgid "error writing standard error (%s)" msgstr "fejl ved skrivning til standard fejl (%s)" -#: io.c:938 +#: io.c:996 #, c-format msgid "pipe flush of `%s' failed (%s)." msgstr "rørspuling af \"%s\" mislykkedes (%s)" -#: io.c:941 +#: io.c:999 #, c-format msgid "co-process flush of pipe to `%s' failed (%s)." msgstr "ko-processpuling af røret til \"%s\" mislykkedes (%s)" -#: io.c:944 +#: io.c:1002 #, c-format msgid "file flush of `%s' failed (%s)." msgstr "filspuling af \"%s\" mislykkedes (%s)" -#: io.c:1103 +#: io.c:1161 msgid "/inet/raw client not ready yet, sorry" msgstr "/inet/raw-klient er desværre ikke klar endnu" -#: io.c:1105 io.c:1142 +#: io.c:1163 io.c:1200 msgid "only root may use `/inet/raw'." msgstr "kun root kan bruge \"/inet/raw\"." -#: io.c:1140 +#: io.c:1198 msgid "/inet/raw server not ready yet, sorry" msgstr "/inet/raw-server er desværre ikke klar endnu" -#: io.c:1230 +#: io.c:1288 #, c-format msgid "no (known) protocol supplied in special filename `%s'" msgstr "ingen (kendt) protokol opgivet i special-filnavn \"%s\"" -#: io.c:1248 +#: io.c:1306 #, c-format msgid "special file name `%s' is incomplete" msgstr "special-filnavn \"%s\" er ufuldstændigt" -#: io.c:1260 +#: io.c:1318 #, c-format msgid "local port invalid in `%s'" msgstr "lokal port ugyldig i \"%s\"" -#: io.c:1272 +#: io.c:1330 msgid "must supply a remote hostname to `/inet'" msgstr "skal angive et fjernmaskinenavn til \"/inet\"" -#: io.c:1287 +#: io.c:1345 msgid "must supply a remote port to `/inet'" msgstr "skal angive en fjernport til \"/inet\"" -#: io.c:1293 +#: io.c:1351 #, c-format msgid "remote port invalid in `%s'" msgstr "fjernporten ugyldig i \"%s\"" -#: io.c:1303 +#: io.c:1361 msgid "TCP/IP communications are not supported" msgstr "TCP/IP-kommunikation understøttes ikke" -#: io.c:1312 io.c:1492 +#: io.c:1370 io.c:1551 #, c-format msgid "file `%s' is a directory" msgstr "filen \"%s\" er et katalog" -#: io.c:1381 +#: io.c:1440 #, c-format msgid "use `PROCINFO[\"%s\"]' instead of `%s'" msgstr "brug \"PROCINFO[\"%s\"]\" i stedet for \"%s\"" -#: io.c:1413 +#: io.c:1472 msgid "use `PROCINFO[...]' instead of `/dev/user'" msgstr "brug \"PROCINFO[...]\" i stedet for \"dev/user\"" -#: io.c:1478 io.c:1652 +#: io.c:1537 io.c:1711 #, c-format msgid "could not open `%s', mode `%s'" msgstr "kunne ikke åbne \"%s\", tilstand \"%s\"" -#: io.c:1703 +#: io.c:1762 #, 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 +#: io.c:1764 io.c:1916 io.c:2068 #, c-format msgid "close of stdout in child failed (%s)" msgstr "lukning af standard ud i barnet mislykkedes (%s)" -#: io.c:1708 +#: io.c:1767 #, fuzzy, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" msgstr "flytning af rør til standard ud i barnet mislykkedes (dup: %s)" -#: io.c:1710 io.c:1862 +#: io.c:1769 io.c:1921 #, c-format msgid "close of stdin in child failed (%s)" msgstr "lukning af standard ind i barnet mislykkedes (%s)" -#: io.c:1713 +#: io.c:1772 #, fuzzy, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" msgstr "flytning af rør til standard ind i barnet mislykkedes (dup: %s)" -#: io.c:1715 io.c:1734 +#: io.c:1774 io.c:1793 #, fuzzy, c-format msgid "close of slave pty failed (%s)" msgstr "lukning af røret mislykkedes (%s)" -#: io.c:1808 io.c:1860 io.c:1990 io.c:2012 +#: io.c:1867 io.c:1919 io.c:2049 io.c:2071 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "flytning af rør til standard ud i barnet mislykkedes (dup: %s)" -#: io.c:1812 io.c:1865 +#: io.c:1871 io.c:1924 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "flytning af rør til standard ind i barnet mislykkedes (dup: %s)" -#: io.c:1829 io.c:2003 +#: io.c:1888 io.c:2062 msgid "restoring stdout in parent process failed\n" msgstr "genskabelse af standard ud i forælderprocessen mislykkedes\n" -#: io.c:1834 +#: io.c:1893 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 +#: io.c:1927 io.c:2073 io.c:2084 #, c-format msgid "close of pipe failed (%s)" msgstr "lukning af røret mislykkedes (%s)" -#: io.c:1913 +#: io.c:1972 msgid "`|&' not supported" msgstr "\"|&\" understøttes ikke" -#: io.c:1980 +#: io.c:2039 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "kan ikke åbne røret \"%s\" (%s)" -#: io.c:2021 +#: io.c:2080 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "kan ikke oprette barneproces for \"%s\" (fork: %s)" -#: io.c:2364 +#: io.c:2423 #, c-format msgid "data file `%s' is empty" msgstr "datafilen \"%s\" er tom" -#: io.c:2407 io.c:2415 +#: io.c:2466 io.c:2474 msgid "could not allocate more input memory" msgstr "" -#: io.c:2540 io.c:2782 io.c:3046 +#: io.c:2832 io.c:2895 #, c-format msgid "error reading input file `%s': %s" msgstr "fejl ved læsning af inddatafilen \"%s\": %s" -#: io.c:3281 +#: io.c:3020 msgid "multicharacter value of `RS' is a gawk extension" msgstr "flertegnsværdien af \"RS\" er en gawk-udvidelse" -#: main.c:322 +#: main.c:324 msgid "`-m[fr]' option irrelevant in gawk" msgstr "\"-m[fr]\"-flaget er irrelevant i gawk" -#: main.c:324 +#: main.c:326 msgid "-m option usage: `-m[fr] nnn'" msgstr "-m-flagets brug: \"-m[fr] nnn\"" -#: main.c:341 +#: main.c:343 #, c-format msgid "%s: option `-W %s' unrecognized, ignored\n" msgstr "%s: flaget \"-W %s\" ukendt, ignoreret\n" -#: main.c:378 +#: main.c:380 msgid "empty argument to `--source' ignored" msgstr "tomt argument til \"--source\" ignoreret" -#: main.c:448 +#: main.c:451 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "miljøvariablen \"POSIXLY_CORRECT\" sat: aktiverer \"--posix\"" -#: main.c:453 +#: main.c:456 msgid "`--posix' overrides `--traditional'" msgstr "\"--posix\" tilsidesætter \"--traditional\"" -#: main.c:464 +#: main.c:467 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "\"--posix\"/\"--traditional\" tilsidesætter \"--non-decimal-data\"" -#: main.c:468 +#: main.c:471 #, fuzzy, c-format msgid "running %s setuid root may be a security problem" msgstr "at køre %s setuid root kan være et sikkerhedsproblem" -#: main.c:509 +#: main.c:512 #, fuzzy, c-format msgid "can't set binary mode on stdin (%s)" msgstr "kan ikke sætte tilstand på standard ind (%s)" -#: main.c:512 +#: main.c:515 #, fuzzy, c-format msgid "can't set binary mode on stdout (%s)" msgstr "kan ikke sætte tilstand på standard ud (%s)" -#: main.c:514 +#: main.c:517 #, fuzzy, c-format msgid "can't set binary mode on stderr (%s)" msgstr "kan ikke sætte tilstand på standard fejl (%s)" -#: main.c:544 +#: main.c:547 msgid "no program text at all!" msgstr "ingen programtekst overhovedet!" -#: main.c:612 +#: main.c:620 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "Brug: %s [POSIX- eller GNU-stilflag] -f progfil [--] fil ...\n" -#: main.c:614 +#: main.c:622 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "Brug: %s [POSIX- eller GNU-stilflag] %cprogram%c fil ...\n" -#: main.c:619 +#: main.c:627 msgid "POSIX options:\t\tGNU long options:\n" msgstr "POSIX-flag:\t\tGNU lange flag:\n" -#: main.c:620 +#: main.c:628 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "\t-f progfil\t\t--file=progfil\n" -#: main.c:621 +#: main.c:629 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "\t-F fs\t\t\t--field-separator=fs\n" -#: main.c:622 +#: main.c:630 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "\t-v var=værdi\t\t--assign=var=værdi\n" -#: main.c:623 +#: main.c:631 msgid "\t-m[fr] val\n" msgstr "\t-m[fr] værdi\n" -#: main.c:624 +#: main.c:632 msgid "\t-W compat\t\t--compat\n" msgstr "\t-W compat\t\t--compat\n" -#: main.c:625 +#: main.c:633 msgid "\t-W copyleft\t\t--copyleft\n" msgstr "\t-W copyleft\t\t--copyleft\n" -#: main.c:626 +#: main.c:634 msgid "\t-W copyright\t\t--copyright\n" msgstr "\t-W copyright\t\t--copyright\n" -#: main.c:627 +#: main.c:635 msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n" msgstr "\t-W dump-variables[=fil]\t--dump-variables[=fil]\n" -#: main.c:628 +#: main.c:636 msgid "\t-W gen-po\t\t--gen-po\n" msgstr "\t-W gen-po\t\t--gen-po\n" -#: main.c:629 +#: main.c:637 msgid "\t-W help\t\t\t--help\n" msgstr "\t-W help\t\t\t--help\n" -#: main.c:630 +#: main.c:638 msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n" msgstr "\t-W lint[=fatal]\t\t--lint[=fatal]\n" -#: main.c:631 +#: main.c:639 msgid "\t-W lint-old\t\t--lint-old\n" msgstr "\t-W lint-old\t\t--lint-old\n" -#: main.c:632 +#: main.c:640 msgid "\t-W non-decimal-data\t--non-decimal-data\n" msgstr "\t-W non-decimal-data\t--non-decimal-data\n" -#: main.c:634 +#: main.c:642 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "\t-W nostalgia\t\t--nostalgia\n" -#: main.c:637 +#: main.c:645 msgid "\t-W parsedebug\t\t--parsedebug\n" msgstr "\t-W parsedebug\t\t--parsedebug\n" -#: main.c:639 +#: main.c:647 msgid "\t-W profile[=file]\t--profile[=file]\n" msgstr "\t-W profile[=fil]\t--profile[=fil]\n" -#: main.c:640 +#: main.c:648 msgid "\t-W posix\t\t--posix\n" msgstr "\t-W posix\t\t--posix\n" -#: main.c:641 +#: main.c:649 msgid "\t-W re-interval\t\t--re-interval\n" msgstr "\t-W re-interval\t\t--re-interval\n" -#: main.c:642 +#: main.c:650 msgid "\t-W source=program-text\t--source=program-text\n" msgstr "\t-W source=programtekst\t--source=programtekst\n" -#: main.c:643 +#: main.c:651 msgid "\t-W traditional\t\t--traditional\n" msgstr "\t-W traditional\t\t--traditional\n" -#: main.c:644 +#: main.c:652 msgid "\t-W usage\t\t--usage\n" msgstr "\t-W usage\t\t--usage\n" -#: main.c:645 +#: main.c:653 msgid "\t-W version\t\t--version\n" msgstr "\t-W version\t\t--version\n" -#: main.c:649 +#: main.c:657 #, fuzzy msgid "" "\n" @@ -1466,21 +1477,21 @@ 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 +#: main.c:661 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" "\n" msgstr "" -#: main.c:657 +#: main.c:665 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" "\tgawk -F: '{ print $1 }' /etc/passwd\n" msgstr "" -#: main.c:669 +#: main.c:682 #, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -1499,7 +1510,7 @@ msgstr "" "enhver senere version.\n" "\n" -#: main.c:677 +#: main.c:690 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -1513,7 +1524,7 @@ msgstr "" "General Public License for yderligere information.\n" "\n" -#: main.c:683 +#: main.c:696 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program; if not, write to the Free Software\n" @@ -1523,46 +1534,46 @@ msgstr "" "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 +#: main.c:730 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "-Ft sætter ikke FS til tab i POSIX-awk" -#: main.c:944 +#: main.c:956 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" "\n" msgstr "" -#: main.c:964 +#: main.c:976 #, c-format msgid "`%s' is not a legal variable name" msgstr "" -#: main.c:967 +#: main.c:979 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "" -#: main.c:995 +#: main.c:1012 msgid "floating point exception" msgstr "flydendetalsundtagelse" -#: main.c:1002 +#: main.c:1019 msgid "fatal error: internal error" msgstr "fatal fejl: intern fejl" -#: main.c:1052 +#: main.c:1069 #, c-format msgid "no pre-opened fd %d" msgstr "ingen for-åbnet fd %d" -#: main.c:1057 +#: main.c:1074 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "kunne ikke for-åbne /dev/null for fd %d" -#: main.c:1080 main.c:1089 +#: main.c:1097 main.c:1106 #, c-format msgid "could not find groups: %s" msgstr "kunne ikke finde grupper: %s" @@ -1583,23 +1594,23 @@ msgstr "fejl: " msgid "fatal: " msgstr "fatal: " -#: node.c:59 node.c:66 node.c:75 node.c:89 node.c:116 +#: node.c:58 node.c:65 node.c:74 node.c:88 node.c:115 msgid "can't convert string to float" msgstr "kan ikke konvertere en streng til flydende tal" -#: node.c:357 +#: node.c:355 msgid "backslash at end of string" msgstr "omvendt skråstreg i slutningen af strengen" -#: node.c:544 +#: node.c:539 msgid "POSIX does not allow `\\x' escapes" msgstr "POSIX tillader ikke \"\\x\"-kontrolsekvenser" -#: node.c:550 +#: node.c:545 msgid "no hex digits in `\\x' escape sequence" msgstr "ingen heksadecimale cifre i \"\\x\"-kontrolsekvenser" -#: node.c:584 +#: node.c:579 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "kontrolsekvensen \"\\%c\" behandlet som kun \"%c\"" @@ -1614,24 +1625,21 @@ msgstr "%s %s \"%s\": kunne ikke sætte luk-ved-exec (fcntl: %s)" 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" +#: profile.c:449 +#, fuzzy, c-format +msgid "internal error: %s with null vname" msgstr "intern fejl: Node_var med null vname" -#: profile.c:471 +#: profile.c:512 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 +#: profile.c:1162 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "\t# gawkprofil, oprettet %s\n" -#: profile.c:1130 +#: profile.c:1165 msgid "" "\t# BEGIN block(s)\n" "\n" @@ -1639,7 +1647,7 @@ msgstr "" "\t# BEGIN-blok\n" "\n" -#: profile.c:1140 +#: profile.c:1175 msgid "" "\t# Rule(s)\n" "\n" @@ -1647,7 +1655,7 @@ msgstr "" "\t# Regel/regler\n" "\n" -#: profile.c:1146 +#: profile.c:1181 msgid "" "\t# END block(s)\n" "\n" @@ -1655,7 +1663,7 @@ msgstr "" "\t# END-blok\n" "\n" -#: profile.c:1166 +#: profile.c:1201 msgid "" "\n" "\t# Functions, listed alphabetically\n" @@ -1663,7 +1671,7 @@ msgstr "" "\n" "\t# Funktioner, listede alfabetisk\n" -#: profile.c:1376 +#: profile.c:1413 #, c-format msgid "unexpected type %s in prec_level" msgstr "uventet type %s i prec_level" @@ -1745,6 +1753,32 @@ msgstr "Ubalanceret ) eller \\)" msgid "No previous regular expression" msgstr "Intet foregående regulært udtryk" +#, fuzzy +#~ msgid "substr: length %g is < 0" +#~ msgstr "substr: længden %g er <= 0" + +#~ msgid "delete: illegal use of variable `%s' as array" +#~ msgstr "delete: ikke tilladt brug af variablen \"%s\" som vektor" + +#, fuzzy +#~ msgid "%s: gvar_ref to %s\n" +#~ msgstr "%s: vektorreference til %s\n" + +#~ msgid "asort: first argument is not an array" +#~ msgstr "asort: første argument er ikke en vektor" + +#~ msgid "asort: second argument is not an array" +#~ msgstr "asort: andet argument er ikke en vektor" + +#, fuzzy +#~ msgid "" +#~ "attempt to use array parameter `%s' that was passed from global scalar `%" +#~ "s'" +#~ msgstr "forsøg på at bruge skalarparameteren \"%s\" som en vektor" + +#~ msgid "internal error: Node_var_array with null vname" +#~ msgstr "intern fejl: Node_var_vektor med null vname" + #~ msgid "BEGIN blocks must have an action part" #~ msgstr "BEGIN-blok skal have en handlingsdel" @@ -5,7 +5,8 @@ msgid "" msgstr "" "Project-Id-Version: gawk 3.1.0\n" -"POT-Creation-Date: 2003-03-19 14:25+0200\n" +"Report-Msgid-Bugs-To: arnold@skeeve.com\n" +"POT-Creation-Date: 2003-07-07 11:20-0700\n" "PO-Revision-Date: 2002-04-03 18:55+02:00\n" "Last-Translator: Christian Kirsch <ck@held.mind.de>\n" "Language-Team: German <de@li.org>\n" @@ -13,64 +14,61 @@ msgstr "" "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 +#: array.c:112 +#, c-format +msgid "attempt to use scalar parameter `%s' as an array" +msgstr "Versuch den skalaren Parameter '%s' als Array zu benutzen." + +#: array.c:113 #, c-format msgid "attempt to use scalar `%s' as array" msgstr "Versuch, Skalar '%s' als Array zu verwenden." -#: array.c:338 +#: array.c:151 +#, fuzzy, c-format +msgid "from %s" +msgstr "%s (von %s)" + +#: array.c:506 #, c-format msgid "reference to uninitialized element `%s[\"%s\"]'" msgstr "Bezug auf nicht-initialisiertes Element »%s[\"%s\"]«" -#: array.c:344 +#: array.c:512 #, c-format msgid "subscript of array `%s' is null string" msgstr "Index in Array »%s« ist Nullstring." -#: array.c:412 array.c:425 array.c:466 +#: array.c:609 #, c-format msgid "delete: index `%s' not in array `%s'" msgstr "delete: Index »%s« nicht in Feld »%s« vorhanden." -#: 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 +#: array.c:769 #, c-format msgid "%s: empty (null)\n" msgstr "%s: leer (Null)\n" -#: array.c:638 +#: array.c:774 #, c-format msgid "%s: empty (zero)\n" msgstr "%s: leer (0)\n" -#: array.c:642 +#: array.c:778 #, c-format msgid "%s: table_size = %d, array_size = %d\n" msgstr "%s: Table_size = %d, array_size = %d\n" -#: array.c:671 +#: array.c:807 #, fuzzy, c-format msgid "%s: is parameter\n" msgstr "%s: ist ein Parameter\n" -#: array.c:676 +#: array.c:812 #, c-format msgid "%s: array_ref to %s\n" msgstr "%s: Array-Referenz auf %s\n" -#: array.c:975 -msgid "asort: first argument is not an array" -msgstr "asort: Erstes Argument ist kein Array." - -#: array.c:984 -msgid "asort: second argument is not an array" -msgstr "asort: Zweites Argument ist kein array." - #: awkgram.y:208 #, fuzzy, c-format msgid "%s blocks must have an action part" @@ -93,272 +91,285 @@ msgstr "" "Konstanter Regulärer Ausdruck '/%s' sieht wie ein C-Kommentar aus, ist aber " "keiner." -#: awkgram.y:340 +#: awkgram.y:340 awkgram.y:615 msgid "statement may have no effect" msgstr "Statement möglicherweise ohne Effekt." -#: awkgram.y:431 awkgram.y:451 +#: awkgram.y:435 awkgram.y:455 #, fuzzy, c-format msgid "`%s' used in %s action" msgstr "'next' in BEGIN- oder END-Aktion benutzt." -#: awkgram.y:444 awkgram.y:447 +#: awkgram.y:448 awkgram.y:451 msgid "`nextfile' is a gawk extension" msgstr "'nextfile' ist eine gawk-Erweiterung." -#: awkgram.y:461 +#: awkgram.y:465 msgid "`return' used outside function context" msgstr "'return' außerhalb einer Funktion benutzt." -#: awkgram.y:500 +#: awkgram.y:504 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" msgstr "" "Einfaches 'print' in BEGIN- oder END-Regel soll vermutlich 'print \"\"' sein." -#: awkgram.y:513 awkgram.y:520 +#: awkgram.y:517 awkgram.y:524 msgid "`delete array' is a gawk extension" msgstr "'delete array' ist eine gawk-Erweiterung." -#: awkgram.y:528 awkgram.y:535 +#: awkgram.y:532 awkgram.y:539 #, fuzzy msgid "`delete(array)' is a non-portable tawk extension" msgstr "'delete array' ist eine gawk-Erweiterung." -#: awkgram.y:578 +#: awkgram.y:583 +#, c-format +msgid "duplicate case values in switch body: %s" +msgstr "" + +#: awkgram.y:593 +msgid "Duplicate `default' detected in switch body" +msgstr "" + +#: awkgram.y:681 msgid "multistage two-way pipelines don't work" msgstr "'multistage' Zweiwege-Pipes funktionieren nicht." -#: awkgram.y:669 +#: awkgram.y:772 msgid "regular expression on right of assignment" msgstr "Regulärer Ausdruck auf der rechten Seite einer Zuweisung." -#: awkgram.y:679 +#: awkgram.y:782 msgid "regular expression on left of `~' or `!~' operator" msgstr "Regulärer Ausdruck links vom '~'- oder '!~'-Operator." -#: awkgram.y:687 +#: awkgram.y:790 msgid "regular expression on right of comparison" msgstr "Regulärer Ausdruck rechts von einem Vergleich." -#: awkgram.y:754 +#: awkgram.y:857 msgid "non-redirected `getline' undefined inside END action" msgstr "" "Nicht-umgelenktes 'getline' ist innerhalb der END-Aktion nicht definiert." -#: awkgram.y:781 +#: awkgram.y:884 msgid "call of `length' without parentheses is not portable" msgstr "Aufruf von 'length' ohne Klammern ist nicht portabel." -#: awkgram.y:784 +#: awkgram.y:887 msgid "call of `length' without parentheses is deprecated by POSIX" msgstr "Aufruf von 'length' ohne Klammern ist in POSIX-Mode veraltet." -#: awkgram.y:835 +#: awkgram.y:940 +msgid "use of non-array as array" +msgstr "" + +#: awkgram.y:942 msgid "invalid subscript expression" msgstr "Ungültiger Index-Ausdruck." -#: awkgram.y:1020 +#: awkgram.y:1140 #, fuzzy msgid "unexpected newline or end of string" msgstr "Unerwartetes Zeilenende" -#: awkgram.y:1115 +#: awkgram.y:1235 msgid "empty program text on command line" msgstr "Kein Programmtext auf der Kommandozeile." -#: awkgram.y:1172 +#: awkgram.y:1292 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "Kann Quelldatei '%s' nicht zum Lesen öffnen (%s)." -#: awkgram.y:1207 +#: awkgram.y:1327 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "Kann Quelldatei '%s' nicht lesen (%s)." -#: awkgram.y:1215 +#: awkgram.y:1335 #, 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 +#: awkgram.y:1537 awkgram.y:1647 awkgram.y:1665 awkgram.y:2015 awkgram.y:2100 msgid "source file does not end in newline" msgstr "Quelldatei hört nicht mit Zeilenende auf." -#: awkgram.y:1481 +#: awkgram.y:1601 msgid "unterminated regexp ends with `\\' at end of file" msgstr "" "Nicht-beendeter Regulärer Ausdruck (hört mit '\\' auf) am Ende der Datei." -#: awkgram.y:1501 +#: awkgram.y:1621 msgid "unterminated regexp" msgstr "Nicht-beendeter Regulärer Ausdruck" -#: awkgram.y:1504 +#: awkgram.y:1624 msgid "unterminated regexp at end of file" msgstr "Nicht-beendeter Regulärer Ausdruck am Dateiende." -#: awkgram.y:1571 +#: awkgram.y:1691 msgid "use of `\\ #...' line continuation is not portable" msgstr "" "Die Verwendung von '\\#...' zur Fortsetzung von Zeilen ist nicht portabel." -#: awkgram.y:1583 +#: awkgram.y:1703 msgid "backslash not last character on line" msgstr "Backslash ist nicht letztes Zeichen auf der Zeile." -#: awkgram.y:1628 +#: awkgram.y:1748 msgid "POSIX does not allow operator `**='" msgstr "POSIX erlaubt den Operator '**=' nicht." -#: awkgram.y:1630 +#: awkgram.y:1750 msgid "old awk does not support operator `**='" msgstr "Das alte awk erlaubt den Operator '**=' nicht." -#: awkgram.y:1639 +#: awkgram.y:1759 msgid "POSIX does not allow operator `**'" msgstr "POSIX erlaubt den Operator '**' nicht." -#: awkgram.y:1641 +#: awkgram.y:1761 msgid "old awk does not support operator `**'" msgstr "Das alte awk erlaubt den Operator '**' nicht." -#: awkgram.y:1672 +#: awkgram.y:1792 msgid "operator `^=' is not supported in old awk" msgstr "Das alte awk kennt den Operator '^=' nicht." -#: awkgram.y:1680 +#: awkgram.y:1800 msgid "operator `^' is not supported in old awk" msgstr "Das alte awk kennt den Operator '^' nicht." -#: awkgram.y:1764 awkgram.y:1781 +#: awkgram.y:1884 awkgram.y:1901 msgid "unterminated string" msgstr "Nicht-beendeter String" -#: awkgram.y:1941 +#: awkgram.y:2061 #, c-format msgid "invalid char '%c' in expression" msgstr "Ungültiges Zeichen '%c' in einem Ausdruck." -#: awkgram.y:2001 +#: awkgram.y:2121 #, c-format msgid "`%s' is a gawk extension" msgstr "'%s' ist eine gawk-Erweiterung" -#: awkgram.y:2004 +#: awkgram.y:2124 #, c-format msgid "`%s' is a Bell Labs extension" msgstr "'%s' ist eine Erweiterung der Bell Labs." -#: awkgram.y:2007 +#: awkgram.y:2127 #, c-format msgid "POSIX does not allow `%s'" msgstr "POSIX gestattet '%s' nicht." -#: awkgram.y:2011 +#: awkgram.y:2131 #, c-format msgid "`%s' is not supported in old awk" msgstr "Das alte awk gestattet '%s' nicht." -#: awkgram.y:2038 +#: awkgram.y:2158 msgid "`goto' considered harmful!\n" msgstr "'goto' gilt als schlechter Stil!\n" -#: awkgram.y:2102 +#: awkgram.y:2220 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "Unzulässige Argumentzahl %d für %s." -#: awkgram.y:2121 awkgram.y:2124 +#: awkgram.y:2239 awkgram.y:2242 msgid "match: third argument is a gawk extension" msgstr "match: Das dritte Argument ist eine gawk-Erweiterung." -#: awkgram.y:2137 +#: awkgram.y:2255 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "%s: Ein String als letztes Argument von substitute hat keinen Effekt." -#: awkgram.y:2140 +#: awkgram.y:2258 #, fuzzy, c-format msgid "%s third parameter is not a changeable object" msgstr "Der dritte Parameter von sub ist ein unveränderliches Objekt." -#: awkgram.y:2167 awkgram.y:2170 +#: awkgram.y:2285 awkgram.y:2288 msgid "close: second argument is a gawk extension" msgstr "close: Das zweite Argument ist eine gawk-Erweiterung." -#: awkgram.y:2180 +#: awkgram.y:2298 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "Fehlerhafte Verwendung von dcgettext(_\"...\"): \n" "Entfernen Sie den führenden Unterstrich." -#: awkgram.y:2195 +#: awkgram.y:2313 #, fuzzy msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "Fehlerhafte Verwendung von dcgettext(_\"...\"): \n" "Entfernen Sie den führenden Unterstrich." -#: awkgram.y:2266 +#: awkgram.y:2384 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "Funktion '%s': Parameter #%d, '%s' wiederholt Parameter #%d." -#: awkgram.y:2299 +#: awkgram.y:2417 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "Funktion '%s': Parameter '%s' verdeckt eine globale Variable." -#: awkgram.y:2411 +#: awkgram.y:2529 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "Kann '%s' nicht zum Schreiben öffnen (%s)." -#: awkgram.y:2412 profile.c:93 +#: awkgram.y:2530 profile.c:93 msgid "sending profile to standard error" msgstr "Schicke Profile auf Stadard-Fehlerausgabe." -#: awkgram.y:2442 +#: awkgram.y:2562 #, c-format msgid "%s: close failed (%s)" msgstr "%s: close gescheitert (%s)." -#: awkgram.y:2566 +#: awkgram.y:2684 msgid "shadow_funcs() called twice!" msgstr "shadow_funcs() zweimal aufgerufen!" -#: awkgram.y:2593 +#: awkgram.y:2711 msgid "there were shadowed variables." msgstr "" -#: awkgram.y:2666 +#: awkgram.y:2784 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "Funktion '%s': Kann Funktionsnamen nicht als Parameternamen benutzen." -#: awkgram.y:2676 +#: awkgram.y:2794 #, c-format msgid "function name `%s' previously defined" msgstr "Funktion '%s' ist bereits definiert." -#: awkgram.y:2827 awkgram.y:2833 +#: awkgram.y:2945 awkgram.y:2951 #, c-format msgid "function `%s' called but never defined" msgstr "Aufgerufene funktion '%s' ist nirgends definiert." -#: awkgram.y:2836 +#: awkgram.y:2954 #, c-format msgid "function `%s' defined but never called" msgstr "Funktion '%s' wird nirgends aufgerufen." -#: awkgram.y:2863 +#: awkgram.y:2981 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "" "Konstanter Regulärer Ausdruck für Parameter #%d ergibt einen logischen Wert." -#: awkgram.y:2876 +#: awkgram.y:2994 #, c-format msgid "" "function `%s' called with space between name and `(',\n" @@ -367,196 +378,201 @@ msgstr "" "Funktion '%s' mit Leerzeichen zwischen Name und '(' aufgerufen, \n" "%s" -#: awkgram.y:2878 +#: awkgram.y:2996 #, fuzzy msgid "or used as a variable or an array" msgstr "Kann Funktion '%s' nicht als Variable oder Array verwenden." -#: builtin.c:111 +#: builtin.c:137 #, c-format msgid "%s to \"%s\" failed (%s)" msgstr "%s to \"%s\" fehlgeschlagen (%s)" -#: builtin.c:112 +#: builtin.c:138 msgid "standard output" msgstr "Standardausgabe" -#: builtin.c:113 +#: builtin.c:139 msgid "reason unknown" msgstr "Unbekannte Ursache" -#: builtin.c:126 +#: builtin.c:152 msgid "exp: received non-numeric argument" msgstr "exp: Argument ist keine Zahl." -#: builtin.c:132 +#: builtin.c:158 #, c-format msgid "exp: argument %g is out of range" msgstr "exp: Argument %g außerhalb des gültigen Zahlenbereichs." -#: builtin.c:190 +#: builtin.c:216 #, c-format msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing" msgstr "" "fflush: Leeren der Puffer nicht möglich, Pipe »%s« ist nur zum Lesen " "geöffnet." -#: builtin.c:193 +#: builtin.c:219 #, c-format msgid "fflush: cannot flush: file `%s' opened for reading, not writing" msgstr "" "fflush: Leeren der Puffer nicht möglich, Datei »%s« ist nur zum Lesen " "geöffnet." -#: builtin.c:205 +#: builtin.c:231 #, c-format msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "fflush: »%s« ist keine geöffnete Datei, Pipe oder Prozess." -#: builtin.c:299 +#: builtin.c:325 msgid "index: received non-string first argument" msgstr "index: Erstes Argument ist kein String." -#: builtin.c:301 +#: builtin.c:327 msgid "index: received non-string second argument" msgstr "index: Zweites Argument ist kein string." -#: builtin.c:411 +#: builtin.c:437 msgid "int: received non-numeric argument" msgstr "Argument ist keine Zahl." -#: builtin.c:428 +#: builtin.c:454 msgid "length: received non-string argument" msgstr "length: Argument ist kein String." -#: builtin.c:444 +#: builtin.c:470 msgid "log: received non-numeric argument" msgstr "log: Argument ist keine Zahl." -#: builtin.c:447 +#: builtin.c:473 #, c-format msgid "log: received negative argument %g" msgstr "log: Negatives Argument %g." -#: builtin.c:609 builtin.c:612 +#: builtin.c:635 builtin.c:638 msgid "must use `count$' on all formats or none" msgstr "" -#: builtin.c:714 +#: builtin.c:740 msgid "`$' is not permitted in awk formats" msgstr "»$« ist in awk-Formaten nicht zulässig." -#: builtin.c:720 +#: builtin.c:746 msgid "arg count with `$' must be > 0" msgstr "Argumentnummer bei »$« muss > 0 sein." -#: builtin.c:722 +#: builtin.c:748 #, fuzzy, c-format msgid "arg count %ld greater than total number of supplied arguments" msgstr "Argumentnummer %d ist größer als Anzahl angegebener Argumente." -#: builtin.c:724 +#: builtin.c:750 msgid "`$' not permitted after period in format" msgstr "»$« nach Punkt in Formatangabe nicht zulässig." -#: builtin.c:737 +#: builtin.c:763 msgid "no `$' supplied for positional field width or precision" msgstr "»$« fehlt in positionsabhängiger Feldbreite oder Genauigkeit." # -#: builtin.c:795 +#: builtin.c:821 msgid "`l' is meaningless in awk formats; ignored" msgstr "»l« ist in awk-Formaten bedeutungslos, ignoriert." -#: builtin.c:799 +#: builtin.c:825 msgid "`l' is not permitted in POSIX awk formats" msgstr "»l« in POSIX-awk-Formaten nicht zulässig." -#: builtin.c:810 +#: builtin.c:836 msgid "`L' is meaningless in awk formats; ignored" msgstr "»L« ist in awk-Formaten bedeutungslos, ignoriert." -#: builtin.c:814 +#: builtin.c:840 msgid "`L' is not permitted in POSIX awk formats" msgstr "»L« in POSIX-awk-Formaten nicht zulässig." -#: builtin.c:825 +#: builtin.c:851 msgid "`h' is meaningless in awk formats; ignored" msgstr "»h« ist in awk-Formaten bedeutungslos, ignoriert." -#: builtin.c:829 +#: builtin.c:855 msgid "`h' is not permitted in POSIX awk formats" msgstr "»h« in POSIX-awk-Formaten nicht zulässig.<" -#: builtin.c:1078 +#: builtin.c:1055 +#, c-format +msgid "[s]printf: value %g is out of range for `%%%c' format" +msgstr "" + +#: builtin.c:1108 msgid "not enough arguments to satisfy format string" msgstr "Nicht genügend Argumente für Formatangabe." -#: builtin.c:1080 +#: builtin.c:1110 msgid "^ ran out for this one" msgstr "^ ran out for this one" -#: builtin.c:1085 +#: builtin.c:1115 msgid "[s]printf: format specifier does not have control letter" msgstr "[s]printf: Format-Specifier hat keinen Controlcode." -#: builtin.c:1088 +#: builtin.c:1118 msgid "too many arguments supplied for format string" msgstr "Zu viele Argumente für Formatstring." -#: builtin.c:1154 builtin.c:1157 +#: builtin.c:1184 builtin.c:1187 msgid "printf: no arguments" msgstr "printf: Keine Argumente" -#: builtin.c:1181 +#: builtin.c:1211 msgid "sqrt: received non-numeric argument" msgstr "sqrt: Argument ist keine Zahl." -#: builtin.c:1185 +#: builtin.c:1215 #, c-format msgid "sqrt: called with negative argument %g" msgstr "sqrt: Argument %g ist negativ." -#: builtin.c:1207 +#: builtin.c:1238 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "substr: Start-Index %g ist ungültig, 1 wird benutzt." -#: builtin.c:1212 +#: builtin.c:1243 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "substr: Start-Wert %g wird abgeschnitten." -#: builtin.c:1231 -#, c-format -msgid "substr: length %g is <= 0" +#: builtin.c:1262 +#, fuzzy, c-format +msgid "substr: length %g is not >= 1" msgstr "substr: Länge %g ist kleiner oder gleich 0." -#: builtin.c:1233 +#: builtin.c:1264 #, fuzzy, c-format -msgid "substr: length %g is < 0" +msgid "substr: length %g is not >= 0" msgstr "substr: Länge %g ist kleiner oder gleich 0." -#: builtin.c:1240 +#: builtin.c:1271 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "substr: Länge %g wird abgeschnitten." -#: builtin.c:1245 +#: builtin.c:1276 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" msgstr "" -#: builtin.c:1257 +#: builtin.c:1288 msgid "substr: source string is zero length" msgstr "substr: String ist leer." -#: builtin.c:1263 +#: builtin.c:1294 #, fuzzy, c-format msgid "substr: start index %g is past end of string" msgstr "substr: Start-Wert %d liegt hinter dem Ende des Strings." -#: builtin.c:1271 +#: builtin.c:1302 #, fuzzy, c-format msgid "" "substr: length %g at start index %g exceeds length of first argument (%lu)" @@ -564,242 +580,247 @@ msgstr "" "substr: Länge %d am Start-Wert %d überschreitet Länge des ersten Arguments (%" "d)." -#: builtin.c:1306 +#: builtin.c:1337 #, fuzzy msgid "strftime: received non-string first argument" msgstr "strftime: Erstes Argument ist kein String." -#: builtin.c:1312 +#: builtin.c:1343 msgid "strftime: received empty format string" msgstr "strftime: Format-String ist leer." -#: builtin.c:1321 +#: builtin.c:1352 #, fuzzy msgid "strftime: received non-numeric second argument" msgstr "strftime. Zweites Argument ist keine Zahl." -#: builtin.c:1384 +#: builtin.c:1415 msgid "mktime: received non-string argument" msgstr "mktime: Argument ist kein String." -#: builtin.c:1429 +#: builtin.c:1460 #, fuzzy msgid "system: received non-string argument" msgstr "system: Argument ist kein String." -#: builtin.c:1573 +#: builtin.c:1581 eval.c:1883 +#, fuzzy, c-format +msgid "reference to uninitialized field `$%d'" +msgstr "Referenz auf die nicht-initialisierte Variable '%s'." + +#: builtin.c:1608 #, fuzzy msgid "tolower: received non-string argument" msgstr "tolower: Argument ist kein String." -#: builtin.c:1622 +#: builtin.c:1657 #, fuzzy msgid "toupper: received non-string argument" msgstr "toupper: Argument ist kein String." -#: builtin.c:1667 +#: builtin.c:1702 msgid "atan2: received non-numeric first argument" msgstr "atan2: Erstes Argument ist keine Zahl." -#: builtin.c:1669 +#: builtin.c:1704 msgid "atan2: received non-numeric second argument" msgstr "atan2: Zweites Argument ist keine Zahl." -#: builtin.c:1688 +#: builtin.c:1723 msgid "sin: received non-numeric argument" msgstr "sin: Argument istk eine Zahl." -#: builtin.c:1704 +#: builtin.c:1739 msgid "cos: received non-numeric argument" msgstr "cos: Argument ist keine Zahl." -#: builtin.c:1748 +#: builtin.c:1788 msgid "srand: received non-numeric argument" msgstr "srand: Argument ist keine Zahl." -#: builtin.c:1787 +#: builtin.c:1823 msgid "match: third argument is not an array" msgstr "match: Drittes Argument ist kein Array." -#: builtin.c:2264 -msgid "gensub: 3rd argument of 0 treated as 1" +#: builtin.c:2307 +msgid "gensub: third argument of 0 treated as 1" msgstr "gensub: Drittes Argument 0 als 1 interpretiert" -#: builtin.c:2375 builtin.c:2377 +#: builtin.c:2416 builtin.c:2418 msgid "lshift: received non-numeric first argument" msgstr "lshift: Erstes Argument ist keine Zahl." -#: builtin.c:2379 +#: builtin.c:2420 #, c-format msgid "lshift(%lf, %lf): negative values will give strange results" msgstr "" "lshift(%lf, %lf): Negative Werte werden merkwürdige Ergebnisse liefern." -#: builtin.c:2381 +#: builtin.c:2422 #, c-format msgid "lshift(%lf, %lf): fractional values will be truncated" msgstr "lshift(%lf, %lf): Dezimalteil wird abgeschnitten." -#: builtin.c:2383 +#: builtin.c:2424 #, c-format msgid "lshift(%lf, %lf): too large shift value will give strange results" msgstr "" "lshift(%lf, %lf): Zu große Shift-Werte werden merkwürdige Ergebnisse liefern." -#: builtin.c:2412 builtin.c:2414 +#: builtin.c:2453 builtin.c:2455 msgid "rshift: received non-numeric first argument" msgstr "rshift: Erstes Argument ist keine Zahl." -#: builtin.c:2416 +#: builtin.c:2457 #, c-format msgid "rshift(%lf, %lf): negative values will give strange results" msgstr "" "rshift (%lf, %lf): Negative Werte werden merkwürdige Ergebnisse liefern." -#: builtin.c:2418 +#: builtin.c:2459 #, c-format msgid "rshift(%lf, %lf): fractional values will be truncated" msgstr "rshift(%lf, %lf): Dezimalteil wird abgeschnitten." -#: builtin.c:2420 +#: builtin.c:2461 #, c-format msgid "rshift(%lf, %lf): too large shift value will give strange results" msgstr "" "rshift(%lf, %lf): Zu große Shift-Werte werden merkwürdige Ergebnisse liefern." -#: builtin.c:2449 builtin.c:2451 +#: builtin.c:2490 builtin.c:2492 msgid "and: received non-numeric first argument" msgstr "and: Erstes Argument ist keine Zahl." -#: builtin.c:2453 +#: builtin.c:2494 #, c-format msgid "and(%lf, %lf): negative values will give strange results" msgstr "and(%lf, %lf): Negative Werte werden merkwürdige Ergebnisse liefern." -#: builtin.c:2455 +#: builtin.c:2496 #, c-format msgid "and(%lf, %lf): fractional values will be truncated" msgstr "and(%lf, %lf): Dezimalteil wird abgeschnitten." -#: builtin.c:2484 builtin.c:2486 +#: builtin.c:2525 builtin.c:2527 msgid "or: received non-numeric first argument" msgstr "or: Erstes Argument ist keine Zahl." -#: builtin.c:2488 +#: builtin.c:2529 #, c-format msgid "or(%lf, %lf): negative values will give strange results" msgstr "or(%lf, %lf): Negative Werte werden merkwürdige Ergebnisse liefern." -#: builtin.c:2490 +#: builtin.c:2531 #, c-format msgid "or(%lf, %lf): fractional values will be truncated" msgstr "or(%lf, %lf): Dezimalteil wird abgeschnitten." -#: builtin.c:2519 builtin.c:2521 +#: builtin.c:2560 builtin.c:2562 msgid "xor: received non-numeric first argument" msgstr "xor: Erstes Argument ist keine Zahl." -#: builtin.c:2523 +#: builtin.c:2564 #, c-format msgid "xor(%lf, %lf): negative values will give strange results" msgstr "xor(%lf, %lf: Negative Werte werden merkwürdige Ergebnisse liefern." -#: builtin.c:2525 +#: builtin.c:2566 #, c-format msgid "xor(%lf, %lf): fractional values will be truncated" msgstr "xor(%lf, %lf): Dezimalteil wird abgeschnitten." -#: builtin.c:2553 +#: builtin.c:2594 msgid "compl: received non-numeric argument" msgstr "compl: Erstes Argument ist keine Zahl." -#: builtin.c:2555 +#: builtin.c:2596 #, c-format msgid "compl(%lf): negative value will give strange results" msgstr "compl(%lf): Negativer Wert wird merkwürdige Ergebnisse liefern." -#: builtin.c:2557 +#: builtin.c:2598 #, c-format msgid "compl(%lf): fractional value will be truncated" msgstr "compl(%lf): Dezimalteil wird abgeschnitten." -#: builtin.c:2728 +#: builtin.c:2771 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "dcgettext: '%s' ist keine gültige Locale-Kategorie." -#: eval.c:262 +#: eval.c:266 #, c-format msgid "unknown nodetype %d" msgstr "Unbekannter Knotentyp %d" -#: eval.c:310 +#: eval.c:312 msgid "buffer overflow in genflags2str" msgstr "Pufferüberlauf in genflags2str." -#: eval.c:555 +#: eval.c:647 #, fuzzy, c-format msgid "for loop: array `%s' changed size from %ld to %ld during loop execution" msgstr "" "for-Schleife: Array '%s' ändert Größse von %d zu %d innerhalb der Schleife." -#: eval.c:576 +#: eval.c:668 msgid "`break' outside a loop is not portable" msgstr "'break' außerhalb einer Schleife ist nicht portabel." -#: eval.c:580 +#: eval.c:672 msgid "`break' outside a loop is not allowed" msgstr "'break' außerhalb einer Schleife ist nicht zulässig." -#: eval.c:597 +#: eval.c:689 msgid "`continue' outside a loop is not portable" msgstr "'continue' außerhalb einer Schleife ist nicht portabel." -#: eval.c:601 +#: eval.c:693 msgid "`continue' outside a loop is not allowed" msgstr "'continue' außerhalb einer Schleife ist nicht zulässig." -#: eval.c:635 +#: eval.c:727 msgid "`next' cannot be called from a BEGIN rule" msgstr "'next' kann nicht in einer BEGIN-Regel benutzt werden." -#: eval.c:637 +#: eval.c:729 msgid "`next' cannot be called from an END rule" msgstr "'next' kann nicht in einer END-Regel benutzt werden." -#: eval.c:646 +#: eval.c:738 msgid "`nextfile' cannot be called from a BEGIN rule" msgstr "'nextfile' kann nicht in einer BEGIN-Regel benutzt werden." -#: eval.c:648 +#: eval.c:740 msgid "`nextfile' cannot be called from an END rule" msgstr "'nextfile' kann nicht in einer END-Regel benutzt werden." -#: eval.c:696 +#: eval.c:785 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 +#: eval.c:828 eval.c:1726 #, c-format msgid "can't use function name `%s' as variable or array" msgstr "Kann Funktion '%s' nicht als Variable oder Array verwenden." -#: eval.c:746 eval.c:752 +#: eval.c:835 eval.c:841 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "Referenz auf nicht-initialisiertes Argument '%s'." -#: eval.c:810 eval.c:1728 profile.c:773 +#: eval.c:848 eval.c:907 eval.c:1732 eval.c:1742 profile.c:807 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "Versuch, das Array '%s' in Skalarkontext zu verwenden." -#: eval.c:910 +#: eval.c:858 eval.c:1752 +#, c-format +msgid "reference to uninitialized variable `%s'" +msgstr "Referenz auf die nicht-initialisierte Variable '%s'." + +#: eval.c:1007 msgid "" "concatenation: side effects in one expression have changed the length of " "another!" @@ -807,54 +828,49 @@ msgstr "" "Konkatenierung: Seiteneffekte in einem Ausdruck haben die Länge des anderen\n" "geändert!" -#: eval.c:935 +#: eval.c:1032 msgid "assignment used in conditional context" msgstr "Zuweisung in einer Bedingung." -#: eval.c:1026 +#: eval.c:1122 msgid "division by zero attempted" msgstr "Division durch Null versucht." -#: eval.c:1041 +#: eval.c:1137 #, c-format msgid "division by zero attempted in `%%'" msgstr "Division durch Null versucht in '%%'." -#: eval.c:1056 profile.c:649 +#: eval.c:1152 profile.c:683 #, c-format msgid "illegal type (%s) in tree_eval" msgstr "Illegaler Typ (%s) in tree_eval" -#: eval.c:1232 +#: eval.c:1328 msgid "division by zero attempted in `/='" msgstr "Division durch Null versucht in '/='." -#: eval.c:1250 +#: eval.c:1346 #, 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 +#: eval.c:1586 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "Funktion '%s' mit zu vielen Argumenten aufgerufen." -#: eval.c:1628 +#: eval.c:1633 #, c-format msgid "function `%s' not defined" msgstr "Funktion '%s' ist nicht definiert." -#: eval.c:1634 +#: eval.c:1639 #, c-format msgid "function %s called\n" msgstr "Funktion %s aufgerufen\n" -#: eval.c:1693 +#: eval.c:1698 msgid "" "\n" "\t# Function Call Stack:\n" @@ -864,47 +880,42 @@ msgstr "" "\t# Funktion Aufruf-Stack\n" "\n" -#: eval.c:1696 +#: eval.c:1701 msgid "\t# -- main --\n" msgstr "\t# -- main --\n" -#: eval.c:1850 +#: eval.c:1867 msgid "attempt to field reference from non-numeric value" msgstr "Nicht-numerischer Wert für Feldreferenz verwendet." -#: eval.c:1852 +#: eval.c:1869 msgid "attempt to reference from null string" msgstr "Referenz von einem Null-String" -#: eval.c:1858 +#: eval.c:1875 #, 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 +#: eval.c:1896 eval.c:1903 profile.c:900 msgid "assignment is not allowed to result of builtin function" msgstr "" "Zuweisungen an das Ergebnis einer eingebauten Funktion sind nicht erlaubt." -#: eval.c:1941 +#: eval.c:1951 msgid "`IGNORECASE' is a gawk extension" msgstr "'IGNORECASE' ist eine gawk-Erweiterung" -#: eval.c:1970 +#: eval.c:1980 msgid "`BINMODE' is a gawk extension" msgstr "'BINMODE' ist eine gawk-Erweiterung." -#: eval.c:2082 +#: eval.c:2092 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "Falsche '%sFMT'-Angabe '%s'" -#: eval.c:2160 +#: eval.c:2170 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "'--lint' wird abgeschaltet, da 'LINT' gesetzt ist." @@ -922,32 +933,32 @@ 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:181 +#: ext.c:183 msgid "Operation Not Supported" msgstr "Operation nicht möglich." -#: field.c:321 +#: field.c:315 msgid "NF set to negative value" msgstr "" -#: field.c:819 +#: field.c:808 msgid "split: second argument is not an array" msgstr "split: Zweites Argument ist kein Array." -#: field.c:854 +#: field.c:842 msgid "split: null string for third arg is a gawk extension" msgstr "split: Null-String als drittes Argument ist eine gawk-Erweiterung." -#: field.c:906 +#: field.c:894 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "'FIELDWIDTHS' ist eine gawk-Erweiterung." -#: field.c:933 +#: field.c:921 #, c-format msgid "field %d in FIELDWIDTHS, must be > 0" msgstr "Feld %d in FIELDWIDTHS muss > 0 sein." -#: field.c:1006 +#: field.c:994 msgid "null string for `FS' is a gawk extension" msgstr "Null-String für 'FS' ist eine gawk-Erweiterung." @@ -991,7 +1002,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:431 +#: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:434 #, c-format msgid "%s: option requires an argument -- %c\n" msgstr "%s Option erfordert ein Argument -- %c.\n" @@ -1006,469 +1017,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" -#: io.c:257 +#: io.c:305 #, c-format msgid "cannot open file `%s' for reading (%s)" msgstr "Kann Datei '%s' nicht zum Lesen öffnen (%s)." -#: io.c:344 +#: io.c:392 #, c-format msgid "close of fd %d (`%s') failed (%s)" msgstr "Schließen von Dateideskriptor %d ('%s') gescheitert (%s)." -#: io.c:482 +#: io.c:530 #, c-format msgid "invalid tree type %s in redirect()" msgstr "Ungültiger Tree-Typ %s in redirect()." -#: io.c:488 +#: io.c:536 #, c-format msgid "expression in `%s' redirection only has numeric value" msgstr "Ausdruck in '%s' Umlenkung hat nur einen numerischen Wert." -#: io.c:494 +#: io.c:542 #, c-format msgid "expression for `%s' redirection has null string value" msgstr "Ausdruck für '%s' Umlenkung ist ein leerer String." -#: io.c:499 +#: io.c:547 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" msgstr "" "Dateiname '%s' für '%s' Umlenkung kann Ergebnis eines logischen Ausdrucks " "sein." -#: io.c:521 +#: io.c:569 #, c-format msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" msgstr "Unnötige Kombination von '>' und '>>' für Datei '%.*s'." -#: io.c:573 +#: io.c:621 #, c-format msgid "can't open pipe `%s' for output (%s)" msgstr "Kann Pipe '%s' nicht für Ausgabe öffnen (%s)." -#: io.c:582 +#: io.c:630 #, c-format msgid "can't open pipe `%s' for input (%s)" msgstr "Kann Pipe '%s' nicht für Eingabe öffnen (%s)." -#: io.c:595 +#: io.c:643 #, c-format msgid "can't open two way socket `%s' for input/output (%s)" msgstr "Kann bidirektionalen Socket '%s' nicht für Ein-/Ausgabe öffnen (%s)." -#: io.c:599 +#: io.c:647 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" msgstr "Kann bidirektionale Pipe '%s' nicht für Ein-/Ausgabe öffnen (%s)." -#: io.c:675 +#: io.c:723 #, c-format msgid "can't redirect from `%s' (%s)" msgstr "Kann nicht von '%s' umlenken (%s)." -#: io.c:678 +#: io.c:726 #, c-format msgid "can't redirect to `%s' (%s)" msgstr "Kann nicht auf '%s' umlenken (%s)." -#: io.c:717 +#: io.c:765 msgid "" "reached system limit for open files: starting to multiplex file descriptors" msgstr "" "Systemgrenze offener Dateien erreicht; beginne mit Multiplexing von " "Dateideskriptoren." -#: io.c:729 +#: io.c:777 #, c-format msgid "close of `%s' failed (%s)." msgstr "Schließen von '%s' gescheitert (%s)." -#: io.c:736 +#: io.c:784 msgid "too many pipes or input files open" msgstr "Zu viele Pipes oder Eingabedateien offen." -#: io.c:759 +#: io.c:807 msgid "close: second argument must be `to' or `from'" msgstr "close: Zweites Argument muss 'to' oder 'from' sein." -#: io.c:773 +#: io.c:821 #, c-format msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "close: '%.*s' ist keine offene Datei, Pipe oder Ko-Prozess." -#: io.c:777 +#: io.c:825 msgid "close of redirection that was never opened" msgstr "'close' für eine Umlenkung, die nie geöffnet wurde." -#: io.c:804 +#: io.c:862 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" msgstr "" "close: Umlenkung '%s' nicht mit '[&' geöffnet, zweites Argument wird " "ignoriert." -#: io.c:866 +#: io.c:924 #, c-format msgid "failure status (%d) on pipe close of `%s' (%s)" msgstr "Fehlerstatus (%d) beim Schließen der Pipe '%s' (%s)." -#: io.c:869 +#: io.c:927 #, c-format msgid "failure status (%d) on file close of `%s' (%s)" msgstr "Fehlerstatus (%d) beim Schließen de rDatei '%s' (%s)." -#: io.c:888 +#: io.c:946 #, c-format msgid "no explicit close of socket `%s' provided" msgstr "Das explizite des Sockets '%s' fehlt." -#: io.c:891 +#: io.c:949 #, c-format msgid "no explicit close of co-process `%s' provided" msgstr "Das explizite Schließen des Ko-Prozesses '%s' fehlt." -#: io.c:894 +#: io.c:952 #, c-format msgid "no explicit close of pipe `%s' provided" msgstr "Das explizite Schließen der Pipe '%s' fehlt." -#: io.c:897 +#: io.c:955 #, 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 +#: io.c:984 io.c:1038 #, c-format msgid "error writing standard output (%s)" msgstr "Fehler beim Schreiben auf stdout (%s)." -#: io.c:930 io.c:984 +#: io.c:988 io.c:1042 #, c-format msgid "error writing standard error (%s)" msgstr "Fehler beim Schreiben auf stderr (%s)." -#: io.c:938 +#: io.c:996 #, c-format msgid "pipe flush of `%s' failed (%s)." msgstr "Leeren der Pipe '%s' gescheitert (%s)." -#: io.c:941 +#: io.c:999 #, c-format msgid "co-process flush of pipe to `%s' failed (%s)." msgstr "Ko-Prozess: Leeren der Pipe zu '%s' gescheitert (%s)." -#: io.c:944 +#: io.c:1002 #, c-format msgid "file flush of `%s' failed (%s)." msgstr "Flush der Datei '%s' gescheitert (%s)." -#: io.c:1103 +#: io.c:1161 msgid "/inet/raw client not ready yet, sorry" msgstr "/inet/raw Client noch nicht fertig." -#: io.c:1105 io.c:1142 +#: io.c:1163 io.c:1200 msgid "only root may use `/inet/raw'." msgstr "Nur root darf '/inet/raw' benutzen" -#: io.c:1140 +#: io.c:1198 msgid "/inet/raw server not ready yet, sorry" msgstr "'/inet/raw'-Server noch nicht fertig." -#: io.c:1230 +#: io.c:1288 #, c-format msgid "no (known) protocol supplied in special filename `%s'" msgstr "Kein bekanntes Protokoll in Dateinamen '%s' angegeben." -#: io.c:1248 +#: io.c:1306 #, c-format msgid "special file name `%s' is incomplete" msgstr "Dateiname '%s' ist unvollständig." -#: io.c:1260 +#: io.c:1318 #, c-format msgid "local port invalid in `%s'" msgstr "Lokaler Port in '%s' ist ungültig." -#: io.c:1272 +#: io.c:1330 msgid "must supply a remote hostname to `/inet'" msgstr "Sie müssen einen Rechnernamen in '/inet' angeben." -#: io.c:1287 +#: io.c:1345 msgid "must supply a remote port to `/inet'" msgstr "Sie müssen einen Port in '/inet' angeben." -#: io.c:1293 +#: io.c:1351 #, c-format msgid "remote port invalid in `%s'" msgstr "Port-Angabe in '%s' ist ungültig." -#: io.c:1303 +#: io.c:1361 msgid "TCP/IP communications are not supported" msgstr "TCP/IP-Verbindungen sind nicht möglich." -#: io.c:1312 io.c:1492 +#: io.c:1370 io.c:1551 #, c-format msgid "file `%s' is a directory" msgstr "Datei '%s' ist ein Verzeichnis." -#: io.c:1381 +#: io.c:1440 #, c-format msgid "use `PROCINFO[\"%s\"]' instead of `%s'" msgstr "Benutzen Sie 'PROCINFO[\"%s\"]' statt '%s'" -#: io.c:1413 +#: io.c:1472 msgid "use `PROCINFO[...]' instead of `/dev/user'" msgstr "Benutzen Sie 'PROCINFO[...] statt '/dev/user'." -#: io.c:1478 io.c:1652 +#: io.c:1537 io.c:1711 #, c-format msgid "could not open `%s', mode `%s'" msgstr "Konnte '%s' nicht öffnen, Mode '%s'." -#: io.c:1703 +#: io.c:1762 #, 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 +#: io.c:1764 io.c:1916 io.c:2068 #, c-format msgid "close of stdout in child failed (%s)" msgstr "Schließen von stdout in Kindprozess gescheitert (%s)." -#: io.c:1708 +#: io.c:1767 #, fuzzy, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" msgstr "Verschieben der Pipe zu stdout in Kindprozess gescheitert (dup: %s)." -#: io.c:1710 io.c:1862 +#: io.c:1769 io.c:1921 #, c-format msgid "close of stdin in child failed (%s)" msgstr "Schließen von stdin im Kindprozess gescheitert (%s)." -#: io.c:1713 +#: io.c:1772 #, fuzzy, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" msgstr "Verschieben der Pipe zu stdin in Kindprozess gescheitert (dup: %s)." -#: io.c:1715 io.c:1734 +#: io.c:1774 io.c:1793 #, fuzzy, c-format msgid "close of slave pty failed (%s)" msgstr "Schließen der Pipe gescheitert (%s)." -#: io.c:1808 io.c:1860 io.c:1990 io.c:2012 +#: io.c:1867 io.c:1919 io.c:2049 io.c:2071 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "Verschieben der Pipe zu stdout in Kindprozess gescheitert (dup: %s)." -#: io.c:1812 io.c:1865 +#: io.c:1871 io.c:1924 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "Verschieben der Pipe zu stdin in Kindprozess gescheitert (dup: %s)." -#: io.c:1829 io.c:2003 +#: io.c:1888 io.c:2062 msgid "restoring stdout in parent process failed\n" msgstr "" -#: io.c:1834 +#: io.c:1893 msgid "restoring stdin in parent process failed\n" msgstr "" -#: io.c:1868 io.c:2014 io.c:2025 +#: io.c:1927 io.c:2073 io.c:2084 #, c-format msgid "close of pipe failed (%s)" msgstr "Schließen der Pipe gescheitert (%s)." -#: io.c:1913 +#: io.c:1972 msgid "`|&' not supported" msgstr "'|&' nicht möglich." -#: io.c:1980 +#: io.c:2039 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "Kann Pipe '%s' nicht öffnen (%s)." -#: io.c:2021 +#: io.c:2080 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "Kann Kindprozess für '%s' nicht erzeugen (fork: %s)." -#: io.c:2364 +#: io.c:2423 #, c-format msgid "data file `%s' is empty" msgstr "Datei '%s' ist leer." -#: io.c:2407 io.c:2415 +#: io.c:2466 io.c:2474 msgid "could not allocate more input memory" msgstr "" -#: io.c:2540 io.c:2782 io.c:3046 +#: io.c:2832 io.c:2895 #, c-format msgid "error reading input file `%s': %s" msgstr "Fehler beim Lesen der Eingabedatei '%s': %s." -#: io.c:3281 +#: io.c:3020 msgid "multicharacter value of `RS' is a gawk extension" msgstr "Multicharacter-Wert von 'RS' ist eine gawk-Erweiterung." -#: main.c:322 +#: main.c:324 msgid "`-m[fr]' option irrelevant in gawk" msgstr "Option '-m[fr]' ist in gawk bedeutungslos." -#: main.c:324 +#: main.c:326 msgid "-m option usage: `-m[fr] nnn'" msgstr "Anwendung der Option -m: '-m[fr] nnn'" -#: main.c:341 +#: main.c:343 #, c-format msgid "%s: option `-W %s' unrecognized, ignored\n" msgstr "%s: Option '-W %s' unbekannt, ignoriert.\n" -#: main.c:378 +#: main.c:380 msgid "empty argument to `--source' ignored" msgstr "Leeres Argument für '--source' ignoriert." -#: main.c:448 +#: main.c:451 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "" "Umgebungsvariable 'POSIXLY_CORRECT' ist gesetzt: '--posix' angeschaltet." -#: main.c:453 +#: main.c:456 msgid "`--posix' overrides `--traditional'" msgstr "'--posix' hat Vorrang vor '--traditional'" -#: main.c:464 +#: main.c:467 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "'--posix' /'--traditional' hat Vorrang vor '--non-decimal-data'." -#: main.c:468 +#: main.c:471 #, fuzzy, c-format msgid "running %s setuid root may be a security problem" msgstr "%s als setuid root auszuführen, kann zu Sicherheitsproblemen führen." -#: main.c:509 +#: main.c:512 #, fuzzy, c-format msgid "can't set binary mode on stdin (%s)" msgstr "Kann Mode für stdin nicht setzen (%s)." -#: main.c:512 +#: main.c:515 #, fuzzy, c-format msgid "can't set binary mode on stdout (%s)" msgstr "Kann Mode für stdout nicht setzen (%s)." -#: main.c:514 +#: main.c:517 #, fuzzy, c-format msgid "can't set binary mode on stderr (%s)" msgstr "Kann Mode für stderr nicht setzen (%s)." -#: main.c:544 +#: main.c:547 msgid "no program text at all!" msgstr "Kein Programmtext." -#: main.c:612 +#: main.c:620 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "Anwendung: %s [POSIX- oder GNU-Optionen] -f PROGRAM [--] Datei ...\n" -#: main.c:614 +#: main.c:622 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "Anwendung: %s [POSIX- oder GNU-Optionen] -- %cPROGRAM%c Datei ...\n" -#: main.c:619 +#: main.c:627 msgid "POSIX options:\t\tGNU long options:\n" msgstr "POSIX-Optionen\t\tGNU-Optionen (lang):\n" -#: main.c:620 +#: main.c:628 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "\t-f PROGRAM\t\t--file=PROGRAM\n" -#: main.c:621 +#: main.c:629 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "\t-F Feldtrenner\t\t\t--field-separator=Feldtrenner\n" -#: main.c:622 +#: main.c:630 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "\t-v var=Wert\t\t--assign=var=Wert\n" -#: main.c:623 +#: main.c:631 msgid "\t-m[fr] val\n" msgstr "\t-m[fr] Wert\n" -#: main.c:624 +#: main.c:632 msgid "\t-W compat\t\t--compat\n" msgstr "\t-W compat\t\t--compat\n" -#: main.c:625 +#: main.c:633 msgid "\t-W copyleft\t\t--copyleft\n" msgstr "\t-W copyleft\t\t--copyleft\n" -#: main.c:626 +#: main.c:634 msgid "\t-W copyright\t\t--copyright\n" msgstr "\t-W copyright\t\t--copyright\n" -#: main.c:627 +#: main.c:635 msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n" msgstr "\t-W dump-variables[=Datei]\t--dump-variables[=Datei]\n" -#: main.c:628 +#: main.c:636 msgid "\t-W gen-po\t\t--gen-po\n" msgstr "\t-W gen-po\t\t--gen-po\n" -#: main.c:629 +#: main.c:637 msgid "\t-W help\t\t\t--help\n" msgstr "\t-W help\t\t\t--help\n" -#: main.c:630 +#: main.c:638 msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n" msgstr "\t-W lint[=fatal]\t\t--lint[=fatal]\n" -#: main.c:631 +#: main.c:639 msgid "\t-W lint-old\t\t--lint-old\n" msgstr "\t-W lint-old\t\t--lint-old\n" -#: main.c:632 +#: main.c:640 msgid "\t-W non-decimal-data\t--non-decimal-data\n" msgstr "\t-W non-decimal-data\t--non-decimal-data\n" -#: main.c:634 +#: main.c:642 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "\t-W nostalgia\t\t--nostalgia\n" -#: main.c:637 +#: main.c:645 msgid "\t-W parsedebug\t\t--parsedebug\n" msgstr "\t-W parsedebug\t\t--parsedebug\n" -#: main.c:639 +#: main.c:647 msgid "\t-W profile[=file]\t--profile[=file]\n" msgstr "\t-W profile[=Datei]\t--profile[=Datei]\n" -#: main.c:640 +#: main.c:648 msgid "\t-W posix\t\t--posix\n" msgstr "\t-W posix\t\t--posix\n" -#: main.c:641 +#: main.c:649 msgid "\t-W re-interval\t\t--re-interval\n" msgstr "\t-W re-interval\t\t--re-interval\n" -#: main.c:642 +#: main.c:650 msgid "\t-W source=program-text\t--source=program-text\n" msgstr "\t-W source=Programmtext\t--source=Programmtext\n" -#: main.c:643 +#: main.c:651 msgid "\t-W traditional\t\t--traditional\n" msgstr "\t-W traditional\t\t--traditional\n" -#: main.c:644 +#: main.c:652 msgid "\t-W usage\t\t--usage\n" msgstr "\t-W usage\t\t--usage\n" -#: main.c:645 +#: main.c:653 msgid "\t-W version\t\t--version\n" msgstr "\t-W version\t\t--version\n" -#: main.c:649 +#: main.c:657 #, fuzzy msgid "" "\n" @@ -1479,21 +1490,21 @@ msgstr "" "den Sie im Kapitel 'Reporting Problems and Bugs' in der \n" "gedruckten Version finden.\n" -#: main.c:653 +#: main.c:661 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" "\n" msgstr "" -#: main.c:657 +#: main.c:665 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" "\tgawk -F: '{ print $1 }' /etc/passwd\n" msgstr "" -#: main.c:669 +#: main.c:682 #, fuzzy, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -1513,7 +1524,7 @@ msgstr "" "spätere Version.\n" "\n" -#: main.c:677 +#: main.c:690 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -1527,7 +1538,7 @@ msgstr "" "GNU General Public License for more details.\n" "\n" -#: main.c:683 +#: main.c:696 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program; if not, write to the Free Software\n" @@ -1538,46 +1549,46 @@ msgstr "" "Software Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-" "1307, USA.\n" -#: main.c:713 +#: main.c:730 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "-Ft setzt FS im POSIX-awk nicht auf Tab." -#: main.c:944 +#: main.c:956 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" "\n" msgstr "" -#: main.c:964 +#: main.c:976 #, c-format msgid "`%s' is not a legal variable name" msgstr "" -#: main.c:967 +#: main.c:979 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "" -#: main.c:995 +#: main.c:1012 msgid "floating point exception" msgstr "Floating point exception" -#: main.c:1002 +#: main.c:1019 msgid "fatal error: internal error" msgstr "Fataler Fehler: interner Fehler" -#: main.c:1052 +#: main.c:1069 #, c-format msgid "no pre-opened fd %d" msgstr "Kein geöffneter Dateideskriptor %d" -#: main.c:1057 +#: main.c:1074 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "Konnte /dev/null nicht für Dateideskriptor %d öffnen." -#: main.c:1080 main.c:1089 +#: main.c:1097 main.c:1106 #, c-format msgid "could not find groups: %s" msgstr "Konnte Gruppen nicht finden: %s" @@ -1598,23 +1609,23 @@ msgstr "Fehler: " msgid "fatal: " msgstr "Fatal: " -#: node.c:59 node.c:66 node.c:75 node.c:89 node.c:116 +#: node.c:58 node.c:65 node.c:74 node.c:88 node.c:115 msgid "can't convert string to float" msgstr "Kann String nicht in Gleitkommazahl konvertieren." -#: node.c:357 +#: node.c:355 msgid "backslash at end of string" msgstr "Backslash am String-Ende." -#: node.c:544 +#: node.c:539 msgid "POSIX does not allow `\\x' escapes" msgstr "POSIX erlabut keine '\\x'-Escapes." -#: node.c:550 +#: node.c:545 msgid "no hex digits in `\\x' escape sequence" msgstr "Keine Hex-Ziffern in '\\x'-Escape." -#: node.c:584 +#: node.c:579 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "Escape-Sequenz '\\%c' als '%c' behandelt." @@ -1629,24 +1640,21 @@ msgstr "%s %s '%s': Konnte close-on-exec nicht setzen: %s" msgid "could not open `%s' for writing: %s" msgstr "Konnte '%s' nicht zum Schreiben öffnen: %s" -#: profile.c:409 -msgid "internal error: Node_var with null vname" +#: profile.c:449 +#, fuzzy, c-format +msgid "internal error: %s with null vname" msgstr "Interner Fehler: Node_var with null vname." -#: profile.c:471 +#: profile.c:512 msgid "# treated internally as `delete'" msgstr "" -#: profile.c:545 -msgid "internal error: Node_var_array with null vname" -msgstr "Interner Fehler: Node_var_array with null vname." - -#: profile.c:1127 +#: profile.c:1162 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "\t# gawk-Profil, erzeugt %s\n" -#: profile.c:1130 +#: profile.c:1165 msgid "" "\t# BEGIN block(s)\n" "\n" @@ -1654,7 +1662,7 @@ msgstr "" "\t# BEGIN block(s)\n" "\n" -#: profile.c:1140 +#: profile.c:1175 msgid "" "\t# Rule(s)\n" "\n" @@ -1662,7 +1670,7 @@ msgstr "" "\t# Rule(s)\n" "\n" -#: profile.c:1146 +#: profile.c:1181 msgid "" "\t# END block(s)\n" "\n" @@ -1670,7 +1678,7 @@ msgstr "" "\t# END block(s)\n" "\n" -#: profile.c:1166 +#: profile.c:1201 msgid "" "\n" "\t# Functions, listed alphabetically\n" @@ -1678,7 +1686,7 @@ msgstr "" "\n" "\t# Functionen, alphabetisch sortiert\n" -#: profile.c:1376 +#: profile.c:1413 #, c-format msgid "unexpected type %s in prec_level" msgstr "Unerwarteter Typ %s in prec_level." @@ -1760,6 +1768,32 @@ msgstr ") oder \\) nicht geöffnet" msgid "No previous regular expression" msgstr "Kein vorangehender Regulärer Ausdruck." +#, fuzzy +#~ msgid "substr: length %g is < 0" +#~ msgstr "substr: Länge %g ist kleiner oder gleich 0." + +#~ msgid "delete: illegal use of variable `%s' as array" +#~ msgstr "delete: Benutzung der Variablen »%s« als Array ist nicht zulässig." + +#, fuzzy +#~ msgid "%s: gvar_ref to %s\n" +#~ msgstr "%s: Array-Referenz auf %s\n" + +#~ msgid "asort: first argument is not an array" +#~ msgstr "asort: Erstes Argument ist kein Array." + +#~ msgid "asort: second argument is not an array" +#~ msgstr "asort: Zweites Argument ist kein array." + +#, fuzzy +#~ msgid "" +#~ "attempt to use array parameter `%s' that was passed from global scalar `%" +#~ "s'" +#~ msgstr "Versuch den skalaren Parameter '%s' als Array zu benutzen." + +#~ msgid "internal error: Node_var_array with null vname" +#~ msgstr "Interner Fehler: Node_var_array with null vname." + #~ msgid "BEGIN blocks must have an action part" #~ msgstr "BEGIN-Blöcke müssen einen Aktionsteil haben." diff --git a/po/en@boldquot.header b/po/en@boldquot.header new file mode 100644 index 00000000..fedb6a06 --- /dev/null +++ b/po/en@boldquot.header @@ -0,0 +1,25 @@ +# All this catalog "translates" are quotation characters. +# The msgids must be ASCII and therefore cannot contain real quotation +# characters, only substitutes like grave accent (0x60), apostrophe (0x27) +# and double quote (0x22). These substitutes look strange; see +# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html +# +# This catalog translates grave accent (0x60) and apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019). +# It also translates pairs of apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019) +# and pairs of quotation mark (0x22) to +# left double quotation mark (U+201C) and right double quotation mark (U+201D). +# +# When output to an UTF-8 terminal, the quotation characters appear perfectly. +# When output to an ISO-8859-1 terminal, the single quotation marks are +# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to +# grave/acute accent (by libiconv), and the double quotation marks are +# transliterated to 0x22. +# When output to an ASCII terminal, the single quotation marks are +# transliterated to apostrophes, and the double quotation marks are +# transliterated to 0x22. +# +# This catalog furthermore displays the text between the quotation marks in +# bold face, assuming the VT100/XTerm escape sequences. +# diff --git a/po/en@quot.header b/po/en@quot.header new file mode 100644 index 00000000..a9647fc3 --- /dev/null +++ b/po/en@quot.header @@ -0,0 +1,22 @@ +# All this catalog "translates" are quotation characters. +# The msgids must be ASCII and therefore cannot contain real quotation +# characters, only substitutes like grave accent (0x60), apostrophe (0x27) +# and double quote (0x22). These substitutes look strange; see +# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html +# +# This catalog translates grave accent (0x60) and apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019). +# It also translates pairs of apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019) +# and pairs of quotation mark (0x22) to +# left double quotation mark (U+201C) and right double quotation mark (U+201D). +# +# When output to an UTF-8 terminal, the quotation characters appear perfectly. +# When output to an ISO-8859-1 terminal, the single quotation marks are +# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to +# grave/acute accent (by libiconv), and the double quotation marks are +# transliterated to 0x22. +# When output to an ASCII terminal, the single quotation marks are +# transliterated to apostrophes, and the double quotation marks are +# transliterated to 0x22. +# Binary files differ@@ -1,76 +1,74 @@ -# Mensajes en español para gawk-3.1.1m. +# Mensajes en español para gawk-3.1.2g. # Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. # Cristian Othón Martínez Vera <cfuga@itam.mx>, 2001, 2002, 2003. # msgid "" msgstr "" -"Project-Id-Version: gawk 3.1.1m\n" -"POT-Creation-Date: 2003-03-19 14:25+0200\n" -"PO-Revision-Date: 2003-02-27 17:38-0600\n" +"Project-Id-Version: gawk 3.1.2g\n" +"Report-Msgid-Bugs-To: arnold@skeeve.com\n" +"POT-Creation-Date: 2003-07-07 11:20-0700\n" +"PO-Revision-Date: 2003-06-29 14:53-0500\n" "Last-Translator: Cristian Othón Martínez Vera <cfuga@itam.mx>\n" "Language-Team: Spanish <es@li.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8bit\n" -#: array.c:274 array.c:309 array.c:314 eval.c:494 +#: array.c:112 +#, c-format +msgid "attempt to use scalar parameter `%s' as an array" +msgstr "se intentó usar el parámetro escalar `%s como una matriz'" + +#: array.c:113 #, c-format msgid "attempt to use scalar `%s' as array" -msgstr "se intentó usar el dato escalar `%s' como un arreglo" +msgstr "se intentó usar el dato escalar `%s' como una matriz" + +#: array.c:151 +#, c-format +msgid "from %s" +msgstr "desde %s" -#: array.c:338 +#: array.c:506 #, c-format msgid "reference to uninitialized element `%s[\"%s\"]'" msgstr "referencia al elemento sin valor inicial `%s[\"%s\"]'" -#: array.c:344 +#: array.c:512 #, c-format msgid "subscript of array `%s' is null string" msgstr "el subíndice de la matriz `%s' es la cadena nula" -#: array.c:412 array.c:425 array.c:466 +#: array.c:609 #, c-format msgid "delete: index `%s' not in array `%s'" msgstr "delete: el índice `%s' no está en la matriz `%s'" -#: array.c: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 +#: array.c:769 #, c-format msgid "%s: empty (null)\n" msgstr "%s: vacío (nulo)\n" -#: array.c:638 +#: array.c:774 #, c-format msgid "%s: empty (zero)\n" msgstr "%s: vacío (cero)\n" -#: array.c:642 +#: array.c:778 #, c-format msgid "%s: table_size = %d, array_size = %d\n" msgstr "%s: tamaño_tabla = %d, tamaño_matriz = %d\n" -#: array.c:671 +#: array.c:807 #, c-format msgid "%s: is parameter\n" msgstr "%s: es un parámetro\n" -#: array.c:676 +#: array.c:812 #, c-format msgid "%s: array_ref to %s\n" msgstr "%s: array_ref a %s\n" -#: array.c:975 -msgid "asort: first argument is not an array" -msgstr "asort: el primer argumento no es una matriz" - -#: array.c:984 -msgid "asort: second argument is not an array" -msgstr "asort: el segundo argumento no es una matriz" - #: awkgram.y:208 #, c-format msgid "%s blocks must have an action part" @@ -92,266 +90,279 @@ msgstr "" "la constante de expresión regular `/%s/' parece un comentario de C, pero no " "lo es" -#: awkgram.y:340 +#: awkgram.y:340 awkgram.y:615 msgid "statement may have no effect" msgstr "la sentencia puede no tener efecto" -#: awkgram.y:431 awkgram.y:451 +#: awkgram.y:435 awkgram.y:455 #, c-format msgid "`%s' used in %s action" msgstr "se usó `%s' en la acción %s" -#: awkgram.y:444 awkgram.y:447 +#: awkgram.y:448 awkgram.y:451 msgid "`nextfile' is a gawk extension" msgstr "`nextfile' es una extensión de gawk" -#: awkgram.y:461 +#: awkgram.y:465 msgid "`return' used outside function context" msgstr "se usó `return' fuera del contexto de la función" -#: awkgram.y:500 +#: awkgram.y:504 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" msgstr "" "el `print' simple en la regla BEGIN o END probablemente debe ser `print \"\"'" -#: awkgram.y:513 awkgram.y:520 +#: awkgram.y:517 awkgram.y:524 msgid "`delete array' is a gawk extension" msgstr "`delete array' es una extensión de gawk" -#: awkgram.y:528 awkgram.y:535 +#: awkgram.y:532 awkgram.y:539 msgid "`delete(array)' is a non-portable tawk extension" msgstr "`delete(array)' es una extensión de gawk que no es transportable" -#: awkgram.y:578 +#: awkgram.y:583 +#, c-format +msgid "duplicate case values in switch body: %s" +msgstr "valores case duplicados en el cuerpo de un switch: %s" + +#: awkgram.y:593 +msgid "Duplicate `default' detected in switch body" +msgstr "Se detectó un `default' duplicado en el cuerpo de un switch" + +#: awkgram.y:681 msgid "multistage two-way pipelines don't work" msgstr "las líneas de trabajo de dos vías multiestado no funcionan" -#: awkgram.y:669 +#: awkgram.y:772 msgid "regular expression on right of assignment" msgstr "expresión regular del lado derecho de una asignación" -#: awkgram.y:679 +#: awkgram.y:782 msgid "regular expression on left of `~' or `!~' operator" msgstr "expresión regular a la izquierda del operador `~' o `!~'" -#: awkgram.y:687 +#: awkgram.y:790 msgid "regular expression on right of comparison" msgstr "expresión regular a la derecha de una comparación" -#: awkgram.y:754 +#: awkgram.y:857 msgid "non-redirected `getline' undefined inside END action" msgstr "`getline' no redirigido indefinido dentro de la acción de END" -#: awkgram.y:781 +#: awkgram.y:884 msgid "call of `length' without parentheses is not portable" msgstr "la llamada de `length' sin paréntesis no es transportable" -#: awkgram.y:784 +#: awkgram.y:887 msgid "call of `length' without parentheses is deprecated by POSIX" msgstr "la llamada de `length' sin paréntesis está obsoleta por POSIX" -#: awkgram.y:835 +#: awkgram.y:940 +msgid "use of non-array as array" +msgstr "uso de una matriz que no es matriz" + +#: awkgram.y:942 msgid "invalid subscript expression" msgstr "expresión de subíndice inválida" -#: awkgram.y:1020 +#: awkgram.y:1140 msgid "unexpected newline or end of string" msgstr "nueva línea o fin de la cadena inesperados" -#: awkgram.y:1115 +#: awkgram.y:1235 msgid "empty program text on command line" msgstr "texto de programa vacío en la linea de comando" -#: awkgram.y:1172 +#: awkgram.y:1292 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "no se puede abrir el fichero fuente `%s' para lectura (%s)" -#: awkgram.y:1207 +#: awkgram.y:1327 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "no se puede leer el fichero fuente `%s' (%s)" -#: awkgram.y:1215 +#: awkgram.y:1335 #, 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 +#: awkgram.y:1537 awkgram.y:1647 awkgram.y:1665 awkgram.y:2015 awkgram.y:2100 msgid "source file does not end in newline" msgstr "el fichero fuente no termina con línea nueva" -#: awkgram.y:1481 +#: awkgram.y:1601 msgid "unterminated regexp ends with `\\' at end of file" msgstr "expresión regular sin terminar termina con `\\` al final del fichero" -#: awkgram.y:1501 +#: awkgram.y:1621 msgid "unterminated regexp" msgstr "expresión regular sin terminar" -#: awkgram.y:1504 +#: awkgram.y:1624 msgid "unterminated regexp at end of file" msgstr "expresión regular sin terminar al final del fichero" -#: awkgram.y:1571 +#: awkgram.y:1691 msgid "use of `\\ #...' line continuation is not portable" msgstr "el uso de la continuación de línea `\\ #...' no es transportable" -#: awkgram.y:1583 +#: awkgram.y:1703 msgid "backslash not last character on line" msgstr "la barra invertida no es el último caracter en la línea" -#: awkgram.y:1628 +#: awkgram.y:1748 msgid "POSIX does not allow operator `**='" msgstr "POSIX no permite el operador `**='" -#: awkgram.y:1630 +#: awkgram.y:1750 msgid "old awk does not support operator `**='" msgstr "el awk antiguo no da soporte al operador `**='" -#: awkgram.y:1639 +#: awkgram.y:1759 msgid "POSIX does not allow operator `**'" msgstr "POSIX no permite el operador `**'" -#: awkgram.y:1641 +#: awkgram.y:1761 msgid "old awk does not support operator `**'" msgstr "el awk antiguo no da soporte al operador `**='" -#: awkgram.y:1672 +#: awkgram.y:1792 msgid "operator `^=' is not supported in old awk" msgstr "el operador `^=' no tiene soporte en el awk antiguo" -#: awkgram.y:1680 +#: awkgram.y:1800 msgid "operator `^' is not supported in old awk" msgstr "el operador `^' no tiene soporte en el awk antiguo" -#: awkgram.y:1764 awkgram.y:1781 +#: awkgram.y:1884 awkgram.y:1901 msgid "unterminated string" msgstr "cadena sin terminar" -#: awkgram.y:1941 +#: awkgram.y:2061 #, c-format msgid "invalid char '%c' in expression" msgstr "caracter '%c' inválido en la expresión" -#: awkgram.y:2001 +#: awkgram.y:2121 #, c-format msgid "`%s' is a gawk extension" msgstr "`%s' es una extensión de gawk" -#: awkgram.y:2004 +#: awkgram.y:2124 #, c-format msgid "`%s' is a Bell Labs extension" msgstr "`%s' es una extensión de Bell Labs" -#: awkgram.y:2007 +#: awkgram.y:2127 #, c-format msgid "POSIX does not allow `%s'" msgstr "POSIX no permite `%s'" -#: awkgram.y:2011 +#: awkgram.y:2131 #, c-format msgid "`%s' is not supported in old awk" msgstr "`%s' no tiene soporte en el awk antiguo" -#: awkgram.y:2038 +#: awkgram.y:2158 msgid "`goto' considered harmful!\n" msgstr "¡`goto' se considera dañino!\n" -#: awkgram.y:2102 +#: awkgram.y:2220 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "%d es inválido como número de argumentos para %s" -#: awkgram.y:2121 awkgram.y:2124 +#: awkgram.y:2239 awkgram.y:2242 msgid "match: third argument is a gawk extension" msgstr "match: el tercer argumento es una extensión de gawk" -#: awkgram.y:2137 +#: awkgram.y:2255 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "" "%s: la literal de cadena como último argumento de substitute no tiene efecto" -#: awkgram.y:2140 +#: awkgram.y:2258 #, c-format msgid "%s third parameter is not a changeable object" msgstr "el tercer argumento de %s no es un objecto que se puede cambiar" -#: awkgram.y:2167 awkgram.y:2170 +#: awkgram.y:2285 awkgram.y:2288 msgid "close: second argument is a gawk extension" msgstr "close: el segundo argumento es una extensión de gawk" -#: awkgram.y:2180 +#: awkgram.y:2298 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "el uso de dcgettext(_\"...\") es incorrecto: quite el subrayado inicial" -#: awkgram.y:2195 +#: awkgram.y:2313 msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "el uso de dcngettext(_\"...\") es incorrecto: quite el subrayado inicial" -#: awkgram.y:2266 +#: awkgram.y:2384 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "función `%s': parámetro #%d, `%s', duplica el parámetro #%d" -#: awkgram.y:2299 +#: awkgram.y:2417 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "función `%s': parámetro `%s' obscurece la variable global" -#: awkgram.y:2411 +#: awkgram.y:2529 #, 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 +#: awkgram.y:2530 profile.c:93 msgid "sending profile to standard error" msgstr "enviando perfil a la salida estándar de error" -#: awkgram.y:2442 +#: awkgram.y:2562 #, c-format msgid "%s: close failed (%s)" msgstr "%s: falló close (%s)" -#: awkgram.y:2566 +#: awkgram.y:2684 msgid "shadow_funcs() called twice!" msgstr "¡shadow_funcs() llamada dos veces!" -#: awkgram.y:2593 +#: awkgram.y:2711 msgid "there were shadowed variables." msgstr "hay variables opacadas." -#: awkgram.y:2666 +#: awkgram.y:2784 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "" "función `%s': no se puede usar un nombre de función como nombre de parámetro" -#: awkgram.y:2676 +#: awkgram.y:2794 #, c-format msgid "function name `%s' previously defined" msgstr "el nombre de función `%s' se definió previamente" -#: awkgram.y:2827 awkgram.y:2833 +#: awkgram.y:2945 awkgram.y:2951 #, c-format msgid "function `%s' called but never defined" msgstr "se llamó a la función `%s' pero nunca se definió" -#: awkgram.y:2836 +#: awkgram.y:2954 #, c-format msgid "function `%s' defined but never called" msgstr "la función `%s' está definida pero nunca se llamó" -#: awkgram.y:2863 +#: awkgram.y:2981 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "" "la constante de expresión regular para el parámetro #%d da un valor booleano" -#: awkgram.y:2876 +#: awkgram.y:2994 #, c-format msgid "" "function `%s' called with space between name and `(',\n" @@ -360,199 +371,204 @@ msgstr "" "se llamó la función `%s' con espacio entre el nombre y el `(',\n" "%s" -#: awkgram.y:2878 +#: awkgram.y:2996 msgid "or used as a variable or an array" msgstr "o se usó como una variable o una matriz" -#: builtin.c:111 +#: builtin.c:137 #, c-format msgid "%s to \"%s\" failed (%s)" msgstr "falló %s a \"%s\" (%s)" -#: builtin.c:112 +#: builtin.c:138 msgid "standard output" msgstr "salida estándar" -#: builtin.c:113 +#: builtin.c:139 msgid "reason unknown" msgstr "razón desconocida" -#: builtin.c:126 +#: builtin.c:152 msgid "exp: received non-numeric argument" msgstr "exp: se recibió un argumento que no es un número" -#: builtin.c:132 +#: builtin.c:158 #, c-format msgid "exp: argument %g is out of range" msgstr "exp: el argumento %g está fuera de rango" -#: builtin.c:190 +#: builtin.c:216 #, c-format msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing" msgstr "" "fflush: no se puede limpiar: se abrió la tubería `%s' para lectura, no para " "escritura" -#: builtin.c:193 +#: builtin.c:219 #, c-format msgid "fflush: cannot flush: file `%s' opened for reading, not writing" msgstr "" "fflush: no se puede limpiar: se abrió el fichero `%s' para lectura, no para " "escritura" -#: builtin.c:205 +#: builtin.c:231 #, c-format msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "fflush: `%s' no es un fichero abierto, tubería o co-proceso" -#: builtin.c:299 +#: builtin.c:325 msgid "index: received non-string first argument" msgstr "index: el primer argumento recibido no es una cadena" -#: builtin.c:301 +#: builtin.c:327 msgid "index: received non-string second argument" msgstr "index: el segundo argumento recibido no es una cadena" -#: builtin.c:411 +#: builtin.c:437 msgid "int: received non-numeric argument" msgstr "int: se recibió un argumento que no es un número" -#: builtin.c:428 +#: builtin.c:454 msgid "length: received non-string argument" msgstr "length: se recibió un argumento que no es una cadena" -#: builtin.c:444 +#: builtin.c:470 msgid "log: received non-numeric argument" msgstr "log: se recibió un argumento que no es un número" -#: builtin.c:447 +#: builtin.c:473 #, c-format msgid "log: received negative argument %g" msgstr "log: se recibió el argumento negativo %g" -#: builtin.c:609 builtin.c:612 +#: builtin.c:635 builtin.c:638 msgid "must use `count$' on all formats or none" msgstr "se debe utilizar `count$' en todos los formatos o en ninguno" -#: builtin.c:714 +#: builtin.c:740 msgid "`$' is not permitted in awk formats" msgstr "no se permite `$' en los formatos de awk" -#: builtin.c:720 +#: builtin.c:746 msgid "arg count with `$' must be > 0" msgstr "la cuenta de argumentos con `$' debe ser > 0" -#: builtin.c:722 +#: builtin.c:748 #, c-format msgid "arg count %ld greater than total number of supplied arguments" msgstr "" "la cuenta de argumentos %ld es mayor que el número total de argumentos " "proporcionados" -#: builtin.c:724 +#: builtin.c:750 msgid "`$' not permitted after period in format" msgstr "no se permite `$' después de un punto en el formato" -#: builtin.c:737 +#: builtin.c:763 msgid "no `$' supplied for positional field width or precision" msgstr "" "no se proporciona `$' para el ancho o la precisión del campo posicional" -#: builtin.c:795 +#: builtin.c:821 msgid "`l' is meaningless in awk formats; ignored" msgstr "`l' no tiene significado en los formatos de awk; ignorado" -#: builtin.c:799 +#: builtin.c:825 msgid "`l' is not permitted in POSIX awk formats" msgstr "no se permite `l' en los formatos POSIX de awk" -#: builtin.c:810 +#: builtin.c:836 msgid "`L' is meaningless in awk formats; ignored" msgstr "`L' no tiene significado en los formatos de awk; ignorado" -#: builtin.c:814 +#: builtin.c:840 msgid "`L' is not permitted in POSIX awk formats" msgstr "no se permite `L' en los formatos POSIX de awk" -#: builtin.c:825 +#: builtin.c:851 msgid "`h' is meaningless in awk formats; ignored" msgstr "`h' no tiene significado en los formatos de awk; ignorado" -#: builtin.c:829 +#: builtin.c:855 msgid "`h' is not permitted in POSIX awk formats" msgstr "no se permite `h' en los formatos POSIX de awk" -#: builtin.c:1078 +#: builtin.c:1055 +#, c-format +msgid "[s]printf: value %g is out of range for `%%%c' format" +msgstr "[s]printf: el valor %g está fuera del rango del formato `%%%c'" + +#: builtin.c:1108 msgid "not enough arguments to satisfy format string" msgstr "no hay suficientes argumentos para satisfacer a la cadena de formato" -#: builtin.c:1080 +#: builtin.c:1110 msgid "^ ran out for this one" msgstr "se acabó ^ para éste" -#: builtin.c:1085 +#: builtin.c:1115 msgid "[s]printf: format specifier does not have control letter" msgstr "[s]printf: el especificador de formato no tiene letras de control" -#: builtin.c:1088 +#: builtin.c:1118 msgid "too many arguments supplied for format string" msgstr "se proporcionaron demasiados argumentos para la cadena de formato" -#: builtin.c:1154 builtin.c:1157 +#: builtin.c:1184 builtin.c:1187 msgid "printf: no arguments" msgstr "printf: sin argumentos" -#: builtin.c:1181 +#: builtin.c:1211 msgid "sqrt: received non-numeric argument" msgstr "sqrt: se recibió un argumento que no es un número" -#: builtin.c:1185 +#: builtin.c:1215 #, c-format msgid "sqrt: called with negative argument %g" msgstr "sqrt: llamado con el argumento negativo %g" -#: builtin.c:1207 +#: builtin.c:1238 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "substr: el índice de inicio %g es inválido, usando 1" -#: builtin.c:1212 +#: builtin.c:1243 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "substr: el índice de inicio no entero %g será truncado" -#: builtin.c:1231 -#, c-format -msgid "substr: length %g is <= 0" +#: builtin.c:1262 +#, fuzzy, c-format +msgid "substr: length %g is not >= 1" msgstr "substr: la longitud %g es <= 0" -#: builtin.c:1233 -#, c-format -msgid "substr: length %g is < 0" -msgstr "substr: la longitud %g es < 0" +#: builtin.c:1264 +#, fuzzy, c-format +msgid "substr: length %g is not >= 0" +msgstr "substr: la longitud %g es <= 0" -#: builtin.c:1240 +#: builtin.c:1271 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "substr: la longitud no entera %g será truncada" -#: builtin.c:1245 +#: builtin.c:1276 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" msgstr "" "substr: la longitud %g es demasiado grande para ser índice de cadena, se " "trunca a %g" -#: builtin.c:1257 +#: builtin.c:1288 msgid "substr: source string is zero length" msgstr "substr: la cadena de origen es de longitud cero" -#: builtin.c:1263 +#: builtin.c:1294 #, c-format msgid "substr: start index %g is past end of string" msgstr "substr: el índice de inicio %g está después del fin de la cadena" -#: builtin.c:1271 +#: builtin.c:1302 #, c-format msgid "" "substr: length %g at start index %g exceeds length of first argument (%lu)" @@ -560,238 +576,243 @@ msgstr "" "substr: la cadena %g en el índice de inicio %g excede la longitud del primer " "argumento (%lu)" -#: builtin.c:1306 +#: builtin.c:1337 msgid "strftime: received non-string first argument" msgstr "strftime: el primer argumento que se recibió no es una cadena" -#: builtin.c:1312 +#: builtin.c:1343 msgid "strftime: received empty format string" msgstr "strftime: se recibió una cadena de formato vacía" -#: builtin.c:1321 +#: builtin.c:1352 msgid "strftime: received non-numeric second argument" msgstr "strftime: el segundo argumento que se recibió no es un número" -#: builtin.c:1384 +#: builtin.c:1415 msgid "mktime: received non-string argument" msgstr "mktime: se recibió un argumento que no es una cadena" -#: builtin.c:1429 +#: builtin.c:1460 msgid "system: received non-string argument" msgstr "system: se recibió un argumento que no es una cadena" -#: builtin.c:1573 +#: builtin.c:1581 eval.c:1883 +#, c-format +msgid "reference to uninitialized field `$%d'" +msgstr "referencia al campo sin inicializar `$%d'" + +#: builtin.c:1608 msgid "tolower: received non-string argument" msgstr "tolower: se recibió un argumento que no es una cadena" -#: builtin.c:1622 +#: builtin.c:1657 msgid "toupper: received non-string argument" msgstr "toupper: se recibió un argumento que no es una cadena" -#: builtin.c:1667 +#: builtin.c:1702 msgid "atan2: received non-numeric first argument" msgstr "atan2: el primer argumento recibido no es un número" -#: builtin.c:1669 +#: builtin.c:1704 msgid "atan2: received non-numeric second argument" msgstr "atan2: el segundo argumento recibido no es un número" -#: builtin.c:1688 +#: builtin.c:1723 msgid "sin: received non-numeric argument" msgstr "sin: se recibió un argumento que no es un número" -#: builtin.c:1704 +#: builtin.c:1739 msgid "cos: received non-numeric argument" msgstr "cos: se recibió un argumento que no es un número" -#: builtin.c:1748 +#: builtin.c:1788 msgid "srand: received non-numeric argument" msgstr "srand: se recibió un argumento que no es un número" -#: builtin.c:1787 +#: builtin.c:1823 msgid "match: third argument is not an array" msgstr "match: el tercer argumento no es una matriz" -#: builtin.c:2264 -msgid "gensub: 3rd argument of 0 treated as 1" +#: builtin.c:2307 +msgid "gensub: third argument of 0 treated as 1" msgstr "gensub: el tercer argumento de 0 se trata como 1" -#: builtin.c:2375 builtin.c:2377 +#: builtin.c:2416 builtin.c:2418 msgid "lshift: received non-numeric first argument" msgstr "lshift: el primer argumento recibido no es un número" -#: builtin.c:2379 +#: builtin.c:2420 #, c-format msgid "lshift(%lf, %lf): negative values will give strange results" msgstr "lshift(%lf, %lf): los valores negativos darán resultados extraños" -#: builtin.c:2381 +#: builtin.c:2422 #, c-format msgid "lshift(%lf, %lf): fractional values will be truncated" msgstr "lshift(%lf, %lf): los valores fraccionarios serán truncados" -#: builtin.c:2383 +#: builtin.c:2424 #, c-format msgid "lshift(%lf, %lf): too large shift value will give strange results" msgstr "" "lshift(%lf, %lf): un valor de desplazamiento muy grande dará resultados " "extraños" -#: builtin.c:2412 builtin.c:2414 +#: builtin.c:2453 builtin.c:2455 msgid "rshift: received non-numeric first argument" msgstr "rshift: el primer argumento recibido no es un número" -#: builtin.c:2416 +#: builtin.c:2457 #, c-format msgid "rshift(%lf, %lf): negative values will give strange results" msgstr "rshift(%lf, %lf): los valores negativos darán resultados extraños" -#: builtin.c:2418 +#: builtin.c:2459 #, c-format msgid "rshift(%lf, %lf): fractional values will be truncated" msgstr "rshift(%lf, %lf): los valores fraccionarios serán truncados" -#: builtin.c:2420 +#: builtin.c:2461 #, c-format msgid "rshift(%lf, %lf): too large shift value will give strange results" msgstr "" "rshift(%lf, %lf): un valor de desplazamiento muy grande dará resultados " "extraños" -#: builtin.c:2449 builtin.c:2451 +#: builtin.c:2490 builtin.c:2492 msgid "and: received non-numeric first argument" msgstr "and: el primer argumento recibido no es un número" -#: builtin.c:2453 +#: builtin.c:2494 #, c-format msgid "and(%lf, %lf): negative values will give strange results" msgstr "and(%lf, %lf): los valores negativos darán resultados extraños" -#: builtin.c:2455 +#: builtin.c:2496 #, c-format msgid "and(%lf, %lf): fractional values will be truncated" msgstr "and(%lf, %lf): los valores fraccionarios serán truncados" -#: builtin.c:2484 builtin.c:2486 +#: builtin.c:2525 builtin.c:2527 msgid "or: received non-numeric first argument" msgstr "or: el primer argumento recibido no es un número" -#: builtin.c:2488 +#: builtin.c:2529 #, c-format msgid "or(%lf, %lf): negative values will give strange results" msgstr "or(%lf, %lf): los valores negativos darán resultados extraños" -#: builtin.c:2490 +#: builtin.c:2531 #, c-format msgid "or(%lf, %lf): fractional values will be truncated" msgstr "or(%lf, %lf): los valores fraccionarios serán truncados" -#: builtin.c:2519 builtin.c:2521 +#: builtin.c:2560 builtin.c:2562 msgid "xor: received non-numeric first argument" msgstr "xor: el primer argumento recibido no es un número" -#: builtin.c:2523 +#: builtin.c:2564 #, c-format msgid "xor(%lf, %lf): negative values will give strange results" msgstr "xor(%lf, %lf): los valores negativos darán resultados extraños" -#: builtin.c:2525 +#: builtin.c:2566 #, c-format msgid "xor(%lf, %lf): fractional values will be truncated" msgstr "xor(%lf, %lf): los valores fraccionarios serán truncados" -#: builtin.c:2553 +#: builtin.c:2594 msgid "compl: received non-numeric argument" msgstr "compl: se recibió un argumento que no es un número" -#: builtin.c:2555 +#: builtin.c:2596 #, c-format msgid "compl(%lf): negative value will give strange results" msgstr "compl(%lf): el valor negativo dará resultados extraños" -#: builtin.c:2557 +#: builtin.c:2598 #, c-format msgid "compl(%lf): fractional value will be truncated" msgstr "compl(%lf): el valor fraccionario será truncado" -#: builtin.c:2728 +#: builtin.c:2771 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "dcgettext: `%s' no es una categoría local válida" -#: eval.c:262 +#: eval.c:266 #, c-format msgid "unknown nodetype %d" msgstr "tipo de nodo %d desconocido" -#: eval.c:310 +#: eval.c:312 msgid "buffer overflow in genflags2str" msgstr "desbordamiento de almacenamiento temporal en genflags2str" -#: eval.c:555 +#: eval.c:647 #, c-format msgid "for loop: array `%s' changed size from %ld to %ld during loop execution" msgstr "" "ciclo for: la matriz `%s' cambió de tamaño de %ld a %ld durante la ejecución " "del ciclo" -#: eval.c:576 +#: eval.c:668 msgid "`break' outside a loop is not portable" msgstr "`break' fuera de un ciclo no es transportable" -#: eval.c:580 +#: eval.c:672 msgid "`break' outside a loop is not allowed" msgstr "no se permite `break' fuera de un ciclo" -#: eval.c:597 +#: eval.c:689 msgid "`continue' outside a loop is not portable" msgstr "`continue' fuera de un ciclo no es transportable" -#: eval.c:601 +#: eval.c:693 msgid "`continue' outside a loop is not allowed" msgstr "no se permite `continue' fuera de un ciclo" -#: eval.c:635 +#: eval.c:727 msgid "`next' cannot be called from a BEGIN rule" msgstr "`next' no se puede llamar desde una regla BEGIN" -#: eval.c:637 +#: eval.c:729 msgid "`next' cannot be called from an END rule" msgstr "`next' no se puede llamar desde una regla END" -#: eval.c:646 +#: eval.c:738 msgid "`nextfile' cannot be called from a BEGIN rule" msgstr "`nextfile' no se puede llamar desde una regla BEGIN" -#: eval.c:648 +#: eval.c:740 msgid "`nextfile' cannot be called from an END rule" msgstr "`nextfile' no se puede llamar desde una regla END" -#: eval.c:696 +#: eval.c:785 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 +#: eval.c:828 eval.c:1726 #, c-format msgid "can't use function name `%s' as variable or array" msgstr "no se puede usar el nombre de la función `%s' como variable o matriz" -#: eval.c:746 eval.c:752 +#: eval.c:835 eval.c:841 #, c-format msgid "reference to uninitialized argument `%s'" -msgstr "referencia al argumento sin iniciar `%s'" +msgstr "referencia al argumento sin inicializar `%s'" -#: eval.c:810 eval.c:1728 profile.c:773 +#: eval.c:848 eval.c:907 eval.c:1732 eval.c:1742 profile.c:807 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "se intentó usar la matriz `%s' en un contexto escalar" -#: eval.c:910 +#: eval.c:858 eval.c:1752 +#, c-format +msgid "reference to uninitialized variable `%s'" +msgstr "referencia a la variable sin inicializar `%s'" + +#: eval.c:1007 msgid "" "concatenation: side effects in one expression have changed the length of " "another!" @@ -799,54 +820,49 @@ msgstr "" "concatenación: ¡Los efectos laterales en una expresión han cambiado la " "longitud de otra!" -#: eval.c:935 +#: eval.c:1032 msgid "assignment used in conditional context" msgstr "se usó una asignación en un contexto condicional" -#: eval.c:1026 +#: eval.c:1122 msgid "division by zero attempted" msgstr "se intentó una división por cero" -#: eval.c:1041 +#: eval.c:1137 #, c-format msgid "division by zero attempted in `%%'" msgstr "se intentó una división por cero en `%%'" -#: eval.c:1056 profile.c:649 +#: eval.c:1152 profile.c:683 #, c-format msgid "illegal type (%s) in tree_eval" msgstr "tipo ilegal (%s) en tree_eval" -#: eval.c:1232 +#: eval.c:1328 msgid "division by zero attempted in `/='" msgstr "se intentó una división por cero en `/='" -#: eval.c:1250 +#: eval.c:1346 #, 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 +#: eval.c:1586 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "se llamó a la función `%s' con más argumentos de los declarados" -#: eval.c:1628 +#: eval.c:1633 #, c-format msgid "function `%s' not defined" msgstr "la función `%s' no está definida" -#: eval.c:1634 +#: eval.c:1639 #, c-format msgid "function %s called\n" msgstr "se llamó a la función %s\n" -#: eval.c:1693 +#: eval.c:1698 msgid "" "\n" "\t# Function Call Stack:\n" @@ -856,46 +872,41 @@ msgstr "" "\t# Pila de Llamadas de Funciones:\n" "\n" -#: eval.c:1696 +#: eval.c:1701 msgid "\t# -- main --\n" msgstr "\t# -- principal --\n" -#: eval.c:1850 +#: eval.c:1867 msgid "attempt to field reference from non-numeric value" msgstr "se intentó una referencia de campo desde un valor que no es un número" -#: eval.c:1852 +#: eval.c:1869 msgid "attempt to reference from null string" msgstr "se intentó una referencia desde una cadena nula" -#: eval.c:1858 +#: eval.c:1875 #, 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 +#: eval.c:1896 eval.c:1903 profile.c:900 msgid "assignment is not allowed to result of builtin function" msgstr "no se permite asignación como resultado de una función interna" -#: eval.c:1941 +#: eval.c:1951 msgid "`IGNORECASE' is a gawk extension" msgstr "`IGNORECASE' es una extensión de gawk" -#: eval.c:1970 +#: eval.c:1980 msgid "`BINMODE' is a gawk extension" msgstr "`BINMODE' es una extensión de gawk" -#: eval.c:2082 +#: eval.c:2092 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "especificación `%sFMT' `%s' errónea" -#: eval.c:2160 +#: eval.c:2170 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "desactivando `--lint' debido a una asignación a `LINT'" @@ -914,33 +925,33 @@ 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:181 +#: ext.c:183 msgid "Operation Not Supported" msgstr "No Se Da Soporte A La Operación" -#: field.c:321 +#: field.c:315 msgid "NF set to negative value" msgstr "NF con un valor negativo" -#: field.c:819 +#: field.c:808 msgid "split: second argument is not an array" msgstr "split: el segundo argumento no es una matriz" -#: field.c:854 +#: field.c:842 msgid "split: null string for third arg is a gawk extension" msgstr "" "split: la cadena nula para el tercer argumento es una extensión de gawk" -#: field.c:906 +#: field.c:894 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "`FIELDWIDTHS' es una extensión gawk" -#: field.c:933 +#: field.c:921 #, c-format msgid "field %d in FIELDWIDTHS, must be > 0" msgstr "el campo %d en FIELDWIDTHS, debe ser > 0" -#: field.c:1006 +#: field.c:994 msgid "null string for `FS' is a gawk extension" msgstr "la cadena nula para `FS' es una extensión de gawk" @@ -984,7 +995,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:431 +#: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:434 #, c-format msgid "%s: option requires an argument -- %c\n" msgstr "%s: la opción requiere un argumento -- %c\n" @@ -999,484 +1010,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" -#: io.c:257 +#: io.c:305 #, c-format msgid "cannot open file `%s' for reading (%s)" msgstr "no se puede abrir el fichero `%s' para lectura (%s)" -#: io.c:344 +#: io.c:392 #, c-format msgid "close of fd %d (`%s') failed (%s)" msgstr "falló al cerrar el df %d (`%s') (%s)" -#: io.c:482 +#: io.c:530 #, c-format msgid "invalid tree type %s in redirect()" msgstr "tipo de árbol %s inválido en redirect()" -#: io.c:488 +#: io.c:536 #, c-format msgid "expression in `%s' redirection only has numeric value" msgstr "la expresión en la redirección `%s' sólo tiene un valor numérico" -#: io.c:494 +#: io.c:542 #, c-format msgid "expression for `%s' redirection has null string value" msgstr "la expresión para la redirección `%s' tiene un valor de cadena nula" -#: io.c:499 +#: io.c:547 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" msgstr "" "el fichero `%s' para la redirección `%s' puede ser resultado de una " "expresión lógica" -#: io.c:521 +#: io.c:569 #, c-format msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" msgstr "mezcla innecesaria de `>' y `>>' para el fichero `%.*s'" -#: io.c:573 +#: io.c:621 #, c-format msgid "can't open pipe `%s' for output (%s)" msgstr "no se puede abrir la tubería `%s' para la salida (%s)" -#: io.c:582 +#: io.c:630 #, c-format msgid "can't open pipe `%s' for input (%s)" msgstr "no se puede abrir la tubería `%s' para la entrada (%s)" -#: io.c:595 +#: io.c:643 #, c-format msgid "can't open two way socket `%s' for input/output (%s)" msgstr "" "no se puede abrir el `socket' de dos vías `%s' para entrada/salida (%s)" -#: io.c:599 +#: io.c:647 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" msgstr "no se puede abrir la tubería de dos vías `%s' para entrada/salida (%s)" -#: io.c:675 +#: io.c:723 #, c-format msgid "can't redirect from `%s' (%s)" msgstr "no se puede redirigir desde `%s' (%s)" -#: io.c:678 +#: io.c:726 #, c-format msgid "can't redirect to `%s' (%s)" msgstr "no se puede redirigir a `%s' (%s)" -#: io.c:717 +#: io.c:765 msgid "" "reached system limit for open files: starting to multiplex file descriptors" msgstr "" "se alcanzó el límite del sistema para ficheros abiertos: comenzando a " "multiplexar los descriptores de fichero" -#: io.c:729 +#: io.c:777 #, c-format msgid "close of `%s' failed (%s)." msgstr "falló al cerrar `%s' (%s)." -#: io.c:736 +#: io.c:784 msgid "too many pipes or input files open" msgstr "demasiadas tuberías o ficheros de entrada abiertos" -#: io.c:759 +#: io.c:807 msgid "close: second argument must be `to' or `from'" msgstr "close: el segundo argumento debe ser `to' o `from'" -#: io.c:773 +#: io.c:821 #, c-format msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "close: `%.*s' no es un fichero abierto, tubería o co-proceso" -#: io.c:777 +#: io.c:825 msgid "close of redirection that was never opened" msgstr "cerrado de una redirección que nunca fue abierta" -#: io.c:804 +#: io.c:862 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" msgstr "" "close: la redirección `%s' no se abre con `|&', se ignoró el segundo " "argumento" -#: io.c:866 +#: io.c:924 #, c-format msgid "failure status (%d) on pipe close of `%s' (%s)" msgstr "estado de fallo (%d) al cerrar la tubería de `%s' (%s)" -#: io.c:869 +#: io.c:927 #, c-format msgid "failure status (%d) on file close of `%s' (%s)" msgstr "estado de fallo (%d) al cerrar el fichero de `%s' (%s)" -#: io.c:888 +#: io.c:946 #, c-format msgid "no explicit close of socket `%s' provided" msgstr "no se provee el cerrado explícito del `socket' `%s'" -#: io.c:891 +#: io.c:949 #, c-format msgid "no explicit close of co-process `%s' provided" msgstr "no se provee el cerrado explícito del co-proceso `%s'" -#: io.c:894 +#: io.c:952 #, c-format msgid "no explicit close of pipe `%s' provided" msgstr "no se provee el cerrado explícito del la tubería `%s'" -#: io.c:897 +#: io.c:955 #, c-format msgid "no explicit close of file `%s' provided" msgstr "no se provee el cerrado explícito del fichero `%s'" -#: io.c:926 io.c:980 +#: io.c:984 io.c:1038 #, c-format msgid "error writing standard output (%s)" msgstr "error al escribir en la salida estándar (%s)" -#: io.c:930 io.c:984 +#: io.c:988 io.c:1042 #, c-format msgid "error writing standard error (%s)" msgstr "error al escribir en la salida estándar de error (%s)" -#: io.c:938 +#: io.c:996 #, c-format msgid "pipe flush of `%s' failed (%s)." msgstr "falló la limpieza de la tubería de `%s' (%s)." -#: io.c:941 +#: io.c:999 #, c-format msgid "co-process flush of pipe to `%s' failed (%s)." msgstr "falló la limpieza del co-proceso de la tubería a `%s' (%s)." -#: io.c:944 +#: io.c:1002 #, c-format msgid "file flush of `%s' failed (%s)." msgstr "falló la limpieza del fichero de `%s' (%s)." -#: io.c:1103 +#: io.c:1161 msgid "/inet/raw client not ready yet, sorry" msgstr "el cliente /inet/raw no está listo aún, perdón" -#: io.c:1105 io.c:1142 +#: io.c:1163 io.c:1200 msgid "only root may use `/inet/raw'." msgstr "sólo root puede utilizar `/inet/raw'." -#: io.c:1140 +#: io.c:1198 msgid "/inet/raw server not ready yet, sorry" msgstr "el servidor /inet/raw no está listo aún, perdón" -#: io.c:1230 +#: io.c:1288 #, c-format msgid "no (known) protocol supplied in special filename `%s'" msgstr "" "no se proporciona algún protocolo (conocido) en el nombre de fichero " "especial `%s'" -#: io.c:1248 +#: io.c:1306 #, c-format msgid "special file name `%s' is incomplete" msgstr "el nombre de fichero especial `%s' está incompleto" -#: io.c:1260 +#: io.c:1318 #, c-format msgid "local port invalid in `%s'" msgstr "puerto local inválido en `%s'" -#: io.c:1272 +#: io.c:1330 msgid "must supply a remote hostname to `/inet'" msgstr "se debe proporcionar a `/inet' un nombre de anfitrión remoto" -#: io.c:1287 +#: io.c:1345 msgid "must supply a remote port to `/inet'" msgstr "se debe proporcionar a `/inet' un puerto remoto" -#: io.c:1293 +#: io.c:1351 #, c-format msgid "remote port invalid in `%s'" msgstr "puerto remoto inválido en `%s'" -#: io.c:1303 +#: io.c:1361 msgid "TCP/IP communications are not supported" msgstr "No tienen soporte las comunicaciones TCP/IP" -#: io.c:1312 io.c:1492 +#: io.c:1370 io.c:1551 #, c-format msgid "file `%s' is a directory" msgstr "el fichero `%s' es un directorio" -#: io.c:1381 +#: io.c:1440 #, c-format msgid "use `PROCINFO[\"%s\"]' instead of `%s'" msgstr "use `PROCINFO[\"%s\"]' en lugar de `%s'" -#: io.c:1413 +#: io.c:1472 msgid "use `PROCINFO[...]' instead of `/dev/user'" msgstr "use `PROCINFO[...]' en lugar de `/dev/user'" -#: io.c:1478 io.c:1652 +#: io.c:1537 io.c:1711 #, c-format msgid "could not open `%s', mode `%s'" msgstr "no se puede abrir `%s', modo `%s'" -#: io.c:1703 +#: io.c:1762 #, 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 +#: io.c:1764 io.c:1916 io.c:2068 #, c-format msgid "close of stdout in child failed (%s)" msgstr "falló al cerrar la salida estándar en el hijo (%s)" -#: io.c:1708 +#: io.c:1767 #, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" msgstr "" "falló el movimiento del pty esclavo a la salida estándar en el hijo (dup: %s)" -#: io.c:1710 io.c:1862 +#: io.c:1769 io.c:1921 #, c-format msgid "close of stdin in child failed (%s)" msgstr "falló al cerrar la entrada estándar en el hijo (%s)" -#: io.c:1713 +#: io.c:1772 #, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" msgstr "" "falló el movimiento del pty esclavo a la entrada estándar en el hijo (dup: %" "s)" -#: io.c:1715 io.c:1734 +#: io.c:1774 io.c:1793 #, c-format msgid "close of slave pty failed (%s)" msgstr "falló al cerrar el pty esclavo (%s)" -#: io.c:1808 io.c:1860 io.c:1990 io.c:2012 +#: io.c:1867 io.c:1919 io.c:2049 io.c:2071 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "falló el movimiento a la salida estándar en el hijo (dup: %s)" -#: io.c:1812 io.c:1865 +#: io.c:1871 io.c:1924 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "" "falló el movimiento de la tubería a la entrada estándar en el hijo (dup: %s)" -#: io.c:1829 io.c:2003 +#: io.c:1888 io.c:2062 msgid "restoring stdout in parent process failed\n" msgstr "falló la restauración de la salida estándar en el proceso padre\n" -#: io.c:1834 +#: io.c:1893 msgid "restoring stdin in parent process failed\n" msgstr "falló la restauración de la entrada estándar en el proceso padre\n" -#: io.c:1868 io.c:2014 io.c:2025 +#: io.c:1927 io.c:2073 io.c:2084 #, c-format msgid "close of pipe failed (%s)" msgstr "falló al cerrar la tubería (%s)" -#: io.c:1913 +#: io.c:1972 msgid "`|&' not supported" msgstr "`|&' no tiene soporte" -#: io.c:1980 +#: io.c:2039 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "no se puede abrir la tubería `%s' (%s)" -#: io.c:2021 +#: io.c:2080 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "no se puede crear el proceso hijo para `%s' (fork: %s)" -#: io.c:2364 +#: io.c:2423 #, c-format msgid "data file `%s' is empty" msgstr "el fichero de datos `%s' está vacío" -#: io.c:2407 io.c:2415 +#: io.c:2466 io.c:2474 msgid "could not allocate more input memory" msgstr "no se puede reservar más memoria de entrada" -#: io.c:2540 io.c:2782 io.c:3046 +#: io.c:2832 io.c:2895 #, c-format msgid "error reading input file `%s': %s" msgstr "error al leer el fichero de entrada `%s': %s" -#: io.c:3281 +#: io.c:3020 msgid "multicharacter value of `RS' is a gawk extension" msgstr "el valor multicaracter de `RS' es una extensión de gawk" -#: main.c:322 +#: main.c:324 msgid "`-m[fr]' option irrelevant in gawk" msgstr "la opción -m[fr] es irrelevante en gawk" -#: main.c:324 +#: main.c:326 msgid "-m option usage: `-m[fr] nnn'" msgstr "uso de la opción -m: `-m[fr]' nnn" -#: main.c:341 +#: main.c:343 #, c-format msgid "%s: option `-W %s' unrecognized, ignored\n" msgstr "%s: no se reconoce la opción `-W %s', se ignora\n" -#: main.c:378 +#: main.c:380 msgid "empty argument to `--source' ignored" msgstr "se ignora el argumento vacío para `--source'" -#: main.c:448 +#: main.c:451 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "" "la variable de ambiente `POSIXLY_CORRECT' está establecida: activando `--" "posix'" -#: main.c:453 +#: main.c:456 msgid "`--posix' overrides `--traditional'" msgstr "`--posix' se impone a `--traditional'" -#: main.c:464 +#: main.c:467 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "`--posix'/`--traditional' se imponen a `--non-decimal-data'" -#: main.c:468 +#: main.c:471 #, c-format msgid "running %s setuid root may be a security problem" msgstr "ejecutar %s como setuid root puede ser un problema de seguridad" -#: main.c:509 +#: main.c:512 #, c-format msgid "can't set binary mode on stdin (%s)" msgstr "no se puede establecer el modo binario en la entrada estándar (%s)" -#: main.c:512 +#: main.c:515 #, c-format msgid "can't set binary mode on stdout (%s)" msgstr "no se puede establecer el modo binario en la salida estándar (%s)" -#: main.c:514 +#: main.c:517 #, c-format msgid "can't set binary mode on stderr (%s)" msgstr "" "no se puede establecer el modo binario en la salida estándar de error (%s)" -#: main.c:544 +#: main.c:547 msgid "no program text at all!" msgstr "¡No hay ningún programa de texto!" -#: main.c:612 +#: main.c:620 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "" "Modo de empleo: %s [opciones estilo POSIX o GNU] -f fichprog [--] " "fichero ...\n" -#: main.c:614 +#: main.c:622 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "" "Modo de empleo: %s [opciones estilo POSIX o GNU] [--] %cprograma%c " "fichero ...\n" -#: main.c:619 +#: main.c:627 msgid "POSIX options:\t\tGNU long options:\n" msgstr "Opciones POSIX:\t\tOpciones largas GNU:\n" -#: main.c:620 +#: main.c:628 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "\t-f fichprog\t\t--file=fichprog\n" -#: main.c:621 +#: main.c:629 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "\t-F sc\t\t\t--field-separator=sc\n" -#: main.c:622 +#: main.c:630 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "\t-v var=valor\t\t--assign=var=valor\n" -#: main.c:623 +#: main.c:631 msgid "\t-m[fr] val\n" msgstr "\t-m[fr] valor\n" -#: main.c:624 +#: main.c:632 msgid "\t-W compat\t\t--compat\n" msgstr "\t-W compat\t\t--compat\n" -#: main.c:625 +#: main.c:633 msgid "\t-W copyleft\t\t--copyleft\n" msgstr "\t-W copyleft\t\t--copyleft\n" -#: main.c:626 +#: main.c:634 msgid "\t-W copyright\t\t--copyright\n" msgstr "\t-W copyright\t\t--copyright\n" -#: main.c:627 +#: main.c:635 msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n" msgstr "\t-W dump-variables[=fichero]\t--dump-variables[=fichero]\n" -#: main.c:628 +#: main.c:636 msgid "\t-W gen-po\t\t--gen-po\n" msgstr "\t-W gen-po\t\t--gen-po\n" -#: main.c:629 +#: main.c:637 msgid "\t-W help\t\t\t--help\n" msgstr "\t-W help\t\t\t--help\n" -#: main.c:630 +#: main.c:638 msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n" msgstr "\t-W lint[=fatal]\t\t--lint[=fatal]\n" -#: main.c:631 +#: main.c:639 msgid "\t-W lint-old\t\t--lint-old\n" msgstr "\t-W lint-old\t\t--lint-old\n" -#: main.c:632 +#: main.c:640 msgid "\t-W non-decimal-data\t--non-decimal-data\n" msgstr "\t-W non-decimal-data\t--non-decimal-data\n" -#: main.c:634 +#: main.c:642 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "\t-W nostalgia\t\t--nostalgia\n" -#: main.c:637 +#: main.c:645 msgid "\t-W parsedebug\t\t--parsedebug\n" msgstr "\t-W parsedebug\t\t--parsedebug\n" -#: main.c:639 +#: main.c:647 msgid "\t-W profile[=file]\t--profile[=file]\n" msgstr "\t-W profile[=fichero]\t--profile[=fichero]\n" -#: main.c:640 +#: main.c:648 msgid "\t-W posix\t\t--posix\n" msgstr "\t-W posix\t\t--posix\n" -#: main.c:641 +#: main.c:649 msgid "\t-W re-interval\t\t--re-interval\n" msgstr "\t-W re-interval\t\t--re-interval\n" # Esta es la línea más larga de la lista de argumentos. # Probar con gawk para revisar tabuladores. cfuga -#: main.c:642 +#: main.c:650 msgid "\t-W source=program-text\t--source=program-text\n" msgstr "\t-W source=texto-prog\t--source=texto-prog\n" -#: main.c:643 +#: main.c:651 msgid "\t-W traditional\t\t--traditional\n" msgstr "\t-W traditional\t\t--traditional\n" -#: main.c:644 +#: main.c:652 msgid "\t-W usage\t\t--usage\n" msgstr "\t-W usage\t\t--usage\n" -#: main.c:645 +#: main.c:653 msgid "\t-W version\t\t--version\n" msgstr "\t-W version\t\t--version\n" -#: main.c:649 +#: main.c:657 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" @@ -1489,7 +1500,7 @@ msgstr "" "impresa.\n" "\n" -#: main.c:653 +#: main.c:661 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" @@ -1499,7 +1510,7 @@ msgstr "" "Por omisión lee la entrada estándar y escribe en la salida estándar.\n" "\n" -#: main.c:657 +#: main.c:665 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" @@ -1509,7 +1520,7 @@ msgstr "" "\tgawk '{ sum += $1 }; END { print sum }' fichero\n" "\tgawk -F: '{ print $1 }' /etc/passwd\n" -#: main.c:669 +#: main.c:682 #, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -1529,7 +1540,7 @@ msgstr "" "(a su elección) cualquier versión posterior.\n" "\n" -#: main.c:677 +#: main.c:690 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -1543,7 +1554,7 @@ msgstr "" "Licencia Pública General de GNU para más detalles.\n" "\n" -#: main.c:683 +#: main.c:696 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program; if not, write to the Free Software\n" @@ -1553,11 +1564,11 @@ 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:713 +#: main.c:730 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "-Ft no establece FS a tabulador en el awk de POSIX" -#: main.c:944 +#: main.c:956 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" @@ -1566,35 +1577,35 @@ msgstr "" "%s: el argumento `%s' para `-v' no es de la forma `var=valor'\n" "\n" -#: main.c:964 +#: main.c:976 #, c-format msgid "`%s' is not a legal variable name" msgstr "`%s' no es un nombre de variable legal" -#: main.c:967 +#: main.c:979 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "`%s' no es un nombre de variable, se busca el fichero `%s=%s'" -#: main.c:995 +#: main.c:1012 msgid "floating point exception" msgstr "excepción de coma flotante" -#: main.c:1002 +#: main.c:1019 msgid "fatal error: internal error" msgstr "error fatal: error interno" -#: main.c:1052 +#: main.c:1069 #, c-format msgid "no pre-opened fd %d" msgstr "no existe el df %d abierto previamente" -#: main.c:1057 +#: main.c:1074 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "no se puede abrir previamente /dev/null para el df %d" -#: main.c:1080 main.c:1089 +#: main.c:1097 main.c:1106 #, c-format msgid "could not find groups: %s" msgstr "no se pueden encontrar los grupos: %s" @@ -1615,23 +1626,23 @@ msgstr "error: " msgid "fatal: " msgstr "fatal: " -#: node.c:59 node.c:66 node.c:75 node.c:89 node.c:116 +#: node.c:58 node.c:65 node.c:74 node.c:88 node.c:115 msgid "can't convert string to float" msgstr "no se puede convertir una cadena a coma flotante" -#: node.c:357 +#: node.c:355 msgid "backslash at end of string" msgstr "barra invertida al final de la cadena" -#: node.c:544 +#: node.c:539 msgid "POSIX does not allow `\\x' escapes" msgstr "POSIX no permite escapes `\\x'" -#: node.c:550 +#: node.c:545 msgid "no hex digits in `\\x' escape sequence" msgstr "no hay dígitos hexadecimales en la secuencia de escape `\\x'" -#: node.c:584 +#: node.c:579 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "la secuencia de escape `\\%c' tratada como una simple `%c'" @@ -1646,24 +1657,21 @@ msgstr "%s %s `%s': no se puede establecer close-on-exec: (fcntl: %s)" msgid "could not open `%s' for writing: %s" msgstr "no se puede abrir `%s' para escritura: %s" -#: profile.c:409 -msgid "internal error: Node_var with null vname" -msgstr "error interno: Node_var con vname nulo" +#: profile.c:449 +#, c-format +msgid "internal error: %s with null vname" +msgstr "error interno: %s con vname nulo" -#: profile.c:471 +#: profile.c:512 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 +#: profile.c:1162 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "\t# perfil de gawk, creado %s\n" -#: profile.c:1130 +#: profile.c:1165 msgid "" "\t# BEGIN block(s)\n" "\n" @@ -1671,7 +1679,7 @@ msgstr "" "\t# bloque(s) BEGIN\n" "\n" -#: profile.c:1140 +#: profile.c:1175 msgid "" "\t# Rule(s)\n" "\n" @@ -1679,7 +1687,7 @@ msgstr "" "\t# Regla(s)\n" "\n" -#: profile.c:1146 +#: profile.c:1181 msgid "" "\t# END block(s)\n" "\n" @@ -1687,7 +1695,7 @@ msgstr "" "\t# bloque(s) END\n" "\n" -#: profile.c:1166 +#: profile.c:1201 msgid "" "\n" "\t# Functions, listed alphabetically\n" @@ -1695,7 +1703,7 @@ msgstr "" "\n" "\t# Funciones, enumeradas alfabéticamente\n" -#: profile.c:1376 +#: profile.c:1413 #, c-format msgid "unexpected type %s in prec_level" msgstr "tipo %s inesperado en prec_level" @@ -1779,6 +1787,21 @@ msgstr ") o \\) desemparejados" msgid "No previous regular expression" msgstr "No hay una expresión regular previa" +#~ msgid "substr: length %g is < 0" +#~ msgstr "substr: la longitud %g es < 0" + +#~ msgid "delete: illegal use of variable `%s' as array" +#~ msgstr "delete: uso ilegal de la variable `%s' como una matriz" + +#~ msgid "asort: first argument is not an array" +#~ msgstr "asort: el primer argumento no es una matriz" + +#~ msgid "asort: second argument is not an array" +#~ msgstr "asort: el segundo argumento no es una matriz" + +#~ msgid "internal error: Node_var_array with null vname" +#~ msgstr "error interno: Node_var_array con vname nulo" + #~ msgid "invalid syntax in name `%s' for variable assignment" #~ msgstr "sintaxis inválida en el nombre `%s' para la asignación de variable" @@ -4,73 +4,72 @@ # msgid "" msgstr "" -"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" +"Project-Id-Version: gawk 3.1.2g\n" +"Report-Msgid-Bugs-To: arnold@skeeve.com\n" +"POT-Creation-Date: 2003-07-07 11:20-0700\n" +"PO-Revision-Date: 2003-06-26 08:00-0500\n" "Last-Translator: Michel Robitaille <robitail@IRO.UMontreal.CA>\n" "Language-Team: French <traduc@traduc.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8bit\n" -#: array.c:274 array.c:309 array.c:314 eval.c:494 +#: array.c:112 +#, c-format +msgid "attempt to use scalar parameter `%s' as an array" +msgstr "" +"tentative d'utilisation d'un paramètre scalaire « %s » comme un tableau" + +#: array.c:113 #, c-format msgid "attempt to use scalar `%s' as array" msgstr "tentative d'utilisation du scalaire « %s » comme un tableau" -#: array.c:338 +#: array.c:151 +#, c-format +msgid "from %s" +msgstr "de %s" + +#: array.c:506 #, c-format msgid "reference to uninitialized element `%s[\"%s\"]'" msgstr "référence à un élément non initialisé « %s[\"%s\"] »" -#: array.c:344 +#: array.c:512 #, c-format msgid "subscript of array `%s' is null string" msgstr "sous-description du tableau « %s » contient une chaîne nulle" -#: array.c:412 array.c:425 array.c:466 +#: array.c:609 #, c-format msgid "delete: index `%s' not in array `%s'" msgstr "destruction: index « %s » n'est pas dans le tableau « %s »" -#: array.c: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 +#: array.c:769 #, c-format msgid "%s: empty (null)\n" msgstr "%s: vide (null)\n" -#: array.c:638 +#: array.c:774 #, c-format msgid "%s: empty (zero)\n" msgstr "%s: vide (zéro)\n" -#: array.c:642 +#: array.c:778 #, c-format msgid "%s: table_size = %d, array_size = %d\n" msgstr "%s: table_size = %d, array_size = %d\n" -#: array.c:671 +#: array.c:807 #, c-format msgid "%s: is parameter\n" msgstr "%s: est un paramètre\n" -#: array.c:676 +#: array.c:812 #, c-format msgid "%s: array_ref to %s\n" msgstr "%s: array_ref de %s\n" -#: 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:984 -msgid "asort: second argument is not an array" -msgstr "asort(): le second argument fourni n'est pas dans le tableau" - #: awkgram.y:208 #, c-format msgid "%s blocks must have an action part" @@ -92,272 +91,285 @@ msgstr "" "la constante d'expression régulière « /%s/ » ressemble à un commentaire en " "C, mais ne l'est pas" -#: awkgram.y:340 +#: awkgram.y:340 awkgram.y:615 msgid "statement may have no effect" msgstr "la déclaration peut n'avoir aucun effet" -#: awkgram.y:431 awkgram.y:451 +#: awkgram.y:435 awkgram.y:455 #, c-format msgid "`%s' used in %s action" msgstr "« %s » utilisé dans l'action %s" -#: awkgram.y:444 awkgram.y:447 +#: awkgram.y:448 awkgram.y:451 msgid "`nextfile' is a gawk extension" msgstr "« nextfile » est une extension de gawk" -#: awkgram.y:461 +#: awkgram.y:465 msgid "`return' used outside function context" msgstr "« return » utilisé en dehors du contexte d'une fonction" -#: awkgram.y:500 +#: awkgram.y:504 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" msgstr "" "utilisation de « print » dans une règle BEGIN ou END doit être probablement " "« print \"\" »" -#: awkgram.y:513 awkgram.y:520 +#: awkgram.y:517 awkgram.y:524 msgid "`delete array' is a gawk extension" msgstr "« delete array » est une extension de gawk" -#: awkgram.y:528 awkgram.y:535 +#: awkgram.y:532 awkgram.y:539 msgid "`delete(array)' is a non-portable tawk extension" msgstr "« delete(array) » est une extension tawk non portable" -#: awkgram.y:578 +#: awkgram.y:583 +#, c-format +msgid "duplicate case values in switch body: %s" +msgstr "valeur de case en double dans le corp du switch: %s" + +#: awkgram.y:593 +msgid "Duplicate `default' detected in switch body" +msgstr "Double « default » détecté dans le corps du switch" + +#: awkgram.y:681 msgid "multistage two-way pipelines don't work" msgstr "pipelines bidirectionnel à multi-étapes ne fonctionnent pas" -#: awkgram.y:669 +#: awkgram.y:772 msgid "regular expression on right of assignment" msgstr "expression régulière à la droite de l'affectation" -#: awkgram.y:679 +#: awkgram.y:782 msgid "regular expression on left of `~' or `!~' operator" msgstr "expression régulière sur la gauche de l'opérateur « ~ » ou « !~ »" -#: awkgram.y:687 +#: awkgram.y:790 msgid "regular expression on right of comparison" msgstr "expression régulière sur la droite de la comparaison" -#: awkgram.y:754 +#: awkgram.y:857 msgid "non-redirected `getline' undefined inside END action" msgstr "« getline » non redirigé indéfini à l'intérieur de l'action END" -#: awkgram.y:781 +#: awkgram.y:884 msgid "call of `length' without parentheses is not portable" msgstr "l'appel de « length » sans les parenthèses n'est pas portable" -#: awkgram.y:784 +#: awkgram.y:887 msgid "call of `length' without parentheses is deprecated by POSIX" msgstr "l'appel de « length » sans les parenthèses est déprécié par POSIX" -#: awkgram.y:835 +#: awkgram.y:940 +msgid "use of non-array as array" +msgstr "utilisation d'un non-tableau comme tableau" + +#: awkgram.y:942 msgid "invalid subscript expression" msgstr "sous-expression invalide" -#: awkgram.y:1020 +#: awkgram.y:1140 msgid "unexpected newline or end of string" msgstr "nouvelle ligne inattendue ou fin de chaîne" -#: awkgram.y:1115 +#: awkgram.y:1235 msgid "empty program text on command line" msgstr "texte du programme sur la ligne de commande est vide" -#: awkgram.y:1172 +#: awkgram.y:1292 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "ne peut ouvrir le fichier source « %s » pour lecture (%s)" -#: awkgram.y:1207 +#: awkgram.y:1327 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "ne peut lire le fichier source « %s » (%s)" -#: awkgram.y:1215 +#: awkgram.y:1335 #, 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 +#: awkgram.y:1537 awkgram.y:1647 awkgram.y:1665 awkgram.y:2015 awkgram.y:2100 msgid "source file does not end in newline" msgstr "fichier source ne se termine pas par un retour de chariot" -#: awkgram.y:1481 +#: awkgram.y:1601 msgid "unterminated regexp ends with `\\' at end of file" msgstr "" "expression régulière non termineé se terminant par « \\ » à la fin du fichier" -#: awkgram.y:1501 +#: awkgram.y:1621 msgid "unterminated regexp" msgstr "expression régulière non terminée" -#: awkgram.y:1504 +#: awkgram.y:1624 msgid "unterminated regexp at end of file" msgstr "expression régulière non terminée à la fin du fichier" -#: awkgram.y:1571 +#: awkgram.y:1691 msgid "use of `\\ #...' line continuation is not portable" msgstr "" "utilisation de « \\ #... » comme continuation de ligne n'est pas portable" -#: awkgram.y:1583 +#: awkgram.y:1703 msgid "backslash not last character on line" msgstr "la barre oblique inverse n'est pas le dernier caractère sur la ligne" -#: awkgram.y:1628 +#: awkgram.y:1748 msgid "POSIX does not allow operator `**='" msgstr "POSIX ne permet un opérateur « **= »" -#: awkgram.y:1630 +#: awkgram.y:1750 msgid "old awk does not support operator `**='" msgstr "l'ancien awk ne supporte pas l'opérateur « **= »" -#: awkgram.y:1639 +#: awkgram.y:1759 msgid "POSIX does not allow operator `**'" msgstr "POSIX ne permet pas l'opérateur « ** »" -#: awkgram.y:1641 +#: awkgram.y:1761 msgid "old awk does not support operator `**'" msgstr "l'ancien awk ne supporte pas l'opérateur « ** »" -#: awkgram.y:1672 +#: awkgram.y:1792 msgid "operator `^=' is not supported in old awk" msgstr "l'opérateur « ^= » n'est pas supporté dans l'ancien awk" -#: awkgram.y:1680 +#: awkgram.y:1800 msgid "operator `^' is not supported in old awk" msgstr "l'opérateur « ^ » n'est pas supporté dans l'ancien awk" -#: awkgram.y:1764 awkgram.y:1781 +#: awkgram.y:1884 awkgram.y:1901 msgid "unterminated string" msgstr "chaîne non complétée" -#: awkgram.y:1941 +#: awkgram.y:2061 #, c-format msgid "invalid char '%c' in expression" msgstr "caractère invalide « %c » dans l'expression" -#: awkgram.y:2001 +#: awkgram.y:2121 #, c-format msgid "`%s' is a gawk extension" msgstr "« %s » est une extension de gawk" -#: awkgram.y:2004 +#: awkgram.y:2124 #, c-format msgid "`%s' is a Bell Labs extension" msgstr "« %s » est une extension de Bell Labs" -#: awkgram.y:2007 +#: awkgram.y:2127 #, c-format msgid "POSIX does not allow `%s'" msgstr "POSIX ne permet pas « %s »" -#: awkgram.y:2011 +#: awkgram.y:2131 #, c-format msgid "`%s' is not supported in old awk" msgstr "« %s » n'est pas supporté dans l'ancien awk" -#: awkgram.y:2038 +#: awkgram.y:2158 msgid "`goto' considered harmful!\n" msgstr "« goto » considéré néfaste!\n" -#: awkgram.y:2102 +#: awkgram.y:2220 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "%d est invalide comme nombre d'arguments pour %s" -#: awkgram.y:2121 awkgram.y:2124 +#: awkgram.y:2239 awkgram.y:2242 msgid "match: third argument is a gawk extension" msgstr "match: 3e argument est une extension de gawk" -#: awkgram.y:2137 +#: awkgram.y:2255 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "" "%s: la chaîne litérale comme dernier argument d'une substitution n'a aucun " "effet" -#: awkgram.y:2140 +#: awkgram.y:2258 #, c-format msgid "%s third parameter is not a changeable object" msgstr "3e paramètre %s n'est pas un objet modifiable" -#: awkgram.y:2167 awkgram.y:2170 +#: awkgram.y:2285 awkgram.y:2288 msgid "close: second argument is a gawk extension" msgstr "close: 2e argument est une extension de gawk" -#: awkgram.y:2180 +#: awkgram.y:2298 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "utilisation de dcgettext(_\"...\") est incorrect: enlever les soulignés en " "en-tête" -#: awkgram.y:2195 +#: awkgram.y:2313 msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "utilisation de dcgettext(_\"...\") est incorrecte: enlever les soulignés de " "l'en-tête" -#: awkgram.y:2266 +#: awkgram.y:2384 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "fonction « %s »: paramètre #%d, « %s » est un double du paramètre #%d" -#: awkgram.y:2299 +#: awkgram.y:2417 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "fonction « %s »: paramètre « %s » porte ombrage à la variable globale" -#: awkgram.y:2411 +#: awkgram.y:2529 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "ne peut ourvrir « %s » en écriture (%s)" -#: awkgram.y:2412 profile.c:93 +#: awkgram.y:2530 profile.c:93 msgid "sending profile to standard error" msgstr "redirection du profile vers stderr" -#: awkgram.y:2442 +#: awkgram.y:2562 #, c-format msgid "%s: close failed (%s)" msgstr "%s: échec de fermeture (%s)" -#: awkgram.y:2566 +#: awkgram.y:2684 msgid "shadow_funcs() called twice!" msgstr "shadows_funcs() appelé deux fois!" -#: awkgram.y:2593 +#: awkgram.y:2711 msgid "there were shadowed variables." msgstr "il y a quelques variables qui sont cachées par ombrage" -#: awkgram.y:2666 +#: awkgram.y:2784 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "fonction « %s »: ne peut utilise le nom de la fonction comme paramètre" -#: awkgram.y:2676 +#: awkgram.y:2794 #, 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 +#: awkgram.y:2945 awkgram.y:2951 #, c-format msgid "function `%s' called but never defined" msgstr "fonction « %s » appelé mais jamais définie" -#: awkgram.y:2836 +#: awkgram.y:2954 #, c-format msgid "function `%s' defined but never called" msgstr "fonction « %s » définie mais jamais utilisée" -#: awkgram.y:2863 +#: awkgram.y:2981 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "" "expression régulière constante pour le paramètre #%d conduit à une valeur " "booléenne" -#: awkgram.y:2876 +#: awkgram.y:2994 #, c-format msgid "" "function `%s' called with space between name and `(',\n" @@ -366,195 +378,200 @@ msgstr "" "fonction « %s » appelée avec un espace entre le nom et « ( »,\n" "%s" -#: awkgram.y:2878 +#: awkgram.y:2996 msgid "or used as a variable or an array" msgstr "ou utilisé comme une variable ou un tableau" -#: builtin.c:111 +#: builtin.c:137 #, c-format msgid "%s to \"%s\" failed (%s)" msgstr "%s vers « %s » échec (%s)" -#: builtin.c:112 +#: builtin.c:138 msgid "standard output" msgstr "sortie standard" -#: builtin.c:113 +#: builtin.c:139 msgid "reason unknown" msgstr "raison inconnue" -#: builtin.c:126 +#: builtin.c:152 msgid "exp: received non-numeric argument" msgstr "exp: argument fourni n'est pas numérique" -#: builtin.c:132 +#: builtin.c:158 #, c-format msgid "exp: argument %g is out of range" msgstr "exp: argument fourni %g est hors gamme" -#: builtin.c:190 +#: builtin.c:216 #, c-format msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing" msgstr "" "fflush: ne peut vider: le pipe « %s » est oouvert en lecture, pas en écriture" -#: builtin.c:193 +#: builtin.c:219 #, c-format msgid "fflush: cannot flush: file `%s' opened for reading, not writing" msgstr "" "fflush: ne peut vider: fichier « %s » ouvert en lecture, pas en écriture" -#: builtin.c:205 +#: builtin.c:231 #, c-format msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "" "fflush: « %s » n'est pas ni un fichier ouvert, un pipe ou un co-processus" -#: builtin.c:299 +#: builtin.c:325 msgid "index: received non-string first argument" msgstr "index: premier argument fourni n'est pas une chaîne" -#: builtin.c:301 +#: builtin.c:327 msgid "index: received non-string second argument" msgstr "index: second argument fourni n'est pas une chaîne" -#: builtin.c:411 +#: builtin.c:437 msgid "int: received non-numeric argument" msgstr "int: argument fourni n'est pas numérique" -#: builtin.c:428 +#: builtin.c:454 msgid "length: received non-string argument" msgstr "length: argument fourni n'est pas une chaîne" -#: builtin.c:444 +#: builtin.c:470 msgid "log: received non-numeric argument" msgstr "log: argument fourni n'est pas numérique" -#: builtin.c:447 +#: builtin.c:473 #, c-format msgid "log: received negative argument %g" msgstr "log: argument fourni négatif %g" -#: builtin.c:609 builtin.c:612 +#: builtin.c:635 builtin.c:638 msgid "must use `count$' on all formats or none" msgstr "doit utiliser « count$ » pour tous les formats ou aucun" -#: builtin.c:714 +#: builtin.c:740 msgid "`$' is not permitted in awk formats" msgstr "« $ » n'est pas permis dans les formats awk" -#: builtin.c:720 +#: builtin.c:746 msgid "arg count with `$' must be > 0" msgstr "décompte d'arguments avec « $ » doit être > 0" -#: builtin.c:722 +#: builtin.c:748 #, c-format msgid "arg count %ld greater than total number of supplied arguments" msgstr "compteur d'arguments %ld est > que le nombre total fournis d'arguments" -#: builtin.c:724 +#: builtin.c:750 msgid "`$' not permitted after period in format" msgstr "« $ » n'est pas permis après le point" -#: builtin.c:737 +#: builtin.c:763 msgid "no `$' supplied for positional field width or precision" msgstr "aucun « $ » fourni dans le champ positionnel (longueur ou précision)" -#: builtin.c:795 +#: builtin.c:821 msgid "`l' is meaningless in awk formats; ignored" msgstr "« l » n'a aucun sens dans les formats de awk; ignoré" -#: builtin.c:799 +#: builtin.c:825 msgid "`l' is not permitted in POSIX awk formats" msgstr "« l » n'est pas permis dans les format POSIX de awk" -#: builtin.c:810 +#: builtin.c:836 msgid "`L' is meaningless in awk formats; ignored" msgstr "« L » n'a aucun sens dans les formats s de awk; ignoré" -#: builtin.c:814 +#: builtin.c:840 msgid "`L' is not permitted in POSIX awk formats" msgstr "« L » n'est pas permis dans les formats POSIX de awk" -#: builtin.c:825 +#: builtin.c:851 msgid "`h' is meaningless in awk formats; ignored" msgstr "« h » n'a aucun send dans les formats de awk; ignoré" -#: builtin.c:829 +#: builtin.c:855 msgid "`h' is not permitted in POSIX awk formats" msgstr "« h » n'est pas permis dans les formats POSIX de awk" -#: builtin.c:1078 +#: builtin.c:1055 +#, c-format +msgid "[s]printf: value %g is out of range for `%%%c' format" +msgstr "[s]printf: valeur %g est hors gamme pour le format « %%%c »" + +#: builtin.c:1108 msgid "not enough arguments to satisfy format string" msgstr "pas assez d'arguments pour satisfaire le format d'une chaîne" -#: builtin.c:1080 +#: builtin.c:1110 msgid "^ ran out for this one" msgstr "^ débordement pour celle-ci" -#: builtin.c:1085 +#: builtin.c:1115 msgid "[s]printf: format specifier does not have control letter" msgstr "" "[s]printf: spécificateur de format ne contient pas de lettre de contrôle" -#: builtin.c:1088 +#: builtin.c:1118 msgid "too many arguments supplied for format string" msgstr "trop d'arguments pour la chaîne de format" -#: builtin.c:1154 builtin.c:1157 +#: builtin.c:1184 builtin.c:1187 msgid "printf: no arguments" msgstr "printf: aucun argument" -#: builtin.c:1181 +#: builtin.c:1211 msgid "sqrt: received non-numeric argument" msgstr "sqrt: argument fourni n'est pas numérique" -#: builtin.c:1185 +#: builtin.c:1215 #, c-format msgid "sqrt: called with negative argument %g" msgstr "sqrt: appelé avec un argument négatif %g" -#: builtin.c:1207 +#: builtin.c:1238 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "substr: début de l'index %g est invalide, utilise 1" -#: builtin.c:1212 +#: builtin.c:1243 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "substr: début avec un nombre non entier %g sera tronqué" -#: builtin.c:1231 -#, c-format -msgid "substr: length %g is <= 0" +#: builtin.c:1262 +#, fuzzy, c-format +msgid "substr: length %g is not >= 1" msgstr "substr: longueur %g est <= 0" -#: builtin.c:1233 -#, c-format -msgid "substr: length %g is < 0" -msgstr "substr: longueur %g est < 0" +#: builtin.c:1264 +#, fuzzy, c-format +msgid "substr: length %g is not >= 0" +msgstr "substr: longueur %g est <= 0" -#: builtin.c:1240 +#: builtin.c:1271 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "substr: longueur avec un nombre non entier %g sera tronqué" -#: builtin.c:1245 +#: builtin.c:1276 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" msgstr "" "substr: longueur %g trop grande pour l'indexation de chaîne, troncation à %g" -#: builtin.c:1257 +#: builtin.c:1288 msgid "substr: source string is zero length" msgstr "substr: chaîne de départ est de longueur zéro" -#: builtin.c:1263 +#: builtin.c:1294 #, c-format msgid "substr: start index %g is past end of string" msgstr "substr: début de l'index %g dépasse la fin de la chaîne" -#: builtin.c:1271 +#: builtin.c:1302 #, c-format msgid "" "substr: length %g at start index %g exceeds length of first argument (%lu)" @@ -562,235 +579,240 @@ msgstr "" "substr: longueur %g débute avec l'index %g déborde la longueur du 1er " "argument (%lu)" -#: builtin.c:1306 +#: builtin.c:1337 msgid "strftime: received non-string first argument" msgstr "strftime: premier argument fourni n'est pas une chaîne" -#: builtin.c:1312 +#: builtin.c:1343 msgid "strftime: received empty format string" msgstr "strftime: chaîne de format vide" -#: builtin.c:1321 +#: builtin.c:1352 msgid "strftime: received non-numeric second argument" msgstr "strftime: second argument fourni n'est pas numérique" -#: builtin.c:1384 +#: builtin.c:1415 msgid "mktime: received non-string argument" msgstr "mktime: argument fourni n'est pas une chaîne" -#: builtin.c:1429 +#: builtin.c:1460 msgid "system: received non-string argument" msgstr "system: argument fourni n'est pas une chaîne" -#: builtin.c:1573 +#: builtin.c:1581 eval.c:1883 +#, c-format +msgid "reference to uninitialized field `$%d'" +msgstr "référence à un champ non initialisée « $%d »" + +#: builtin.c:1608 msgid "tolower: received non-string argument" msgstr "tolower: argument fourni n'est pas une chaîne" -#: builtin.c:1622 +#: builtin.c:1657 msgid "toupper: received non-string argument" msgstr "toupper: argument fourni n'est pas une chaîne" -#: builtin.c:1667 +#: builtin.c:1702 msgid "atan2: received non-numeric first argument" msgstr "atan2: premier argument fourni n'est pas numérique" -#: builtin.c:1669 +#: builtin.c:1704 msgid "atan2: received non-numeric second argument" msgstr "atan2: second argument fourni n'est pas numérique" -#: builtin.c:1688 +#: builtin.c:1723 msgid "sin: received non-numeric argument" msgstr "sin: argument fourni n'est pas numérique" -#: builtin.c:1704 +#: builtin.c:1739 msgid "cos: received non-numeric argument" msgstr "cos: argument fourni n'est pas numérique" -#: builtin.c:1748 +#: builtin.c:1788 msgid "srand: received non-numeric argument" msgstr "srand: argument fourni n'est pas numérique" -#: builtin.c:1787 +#: builtin.c:1823 msgid "match: third argument is not an array" msgstr "match: le 3e argument fourni n'est pas un tableau" -#: builtin.c:2264 -msgid "gensub: 3rd argument of 0 treated as 1" +#: builtin.c:2307 +msgid "gensub: third argument of 0 treated as 1" msgstr "gensub: le 3e argument fourni de 0 traité comme un 1" -#: builtin.c:2375 builtin.c:2377 +#: builtin.c:2416 builtin.c:2418 msgid "lshift: received non-numeric first argument" msgstr "lshift: premier argument fourni n'est pas numérique" -#: builtin.c:2379 +#: builtin.c:2420 #, c-format msgid "lshift(%lf, %lf): negative values will give strange results" msgstr "lshift(%lf, %lf): valeurs négatives donneront d'étranges résultats" -#: builtin.c:2381 +#: builtin.c:2422 #, c-format msgid "lshift(%lf, %lf): fractional values will be truncated" msgstr "lshift(%lf, %lf): valeurs fractionnaires seront tronquées" -#: builtin.c:2383 +#: builtin.c:2424 #, c-format msgid "lshift(%lf, %lf): too large shift value will give strange results" msgstr "lshift(%lf, %lf): trop grand déplacement donnera d'étranges résultats" -#: builtin.c:2412 builtin.c:2414 +#: builtin.c:2453 builtin.c:2455 msgid "rshift: received non-numeric first argument" msgstr "rshift: premier argument fourni n'est pas numérique" -#: builtin.c:2416 +#: builtin.c:2457 #, c-format msgid "rshift(%lf, %lf): negative values will give strange results" msgstr "rshift(%lf, %lf): valeurs négatives donneront d'étranges résultats" -#: builtin.c:2418 +#: builtin.c:2459 #, c-format msgid "rshift(%lf, %lf): fractional values will be truncated" msgstr "rshift(%lf, %lf): valeurs fractionnaires seront tronquées" -#: builtin.c:2420 +#: builtin.c:2461 #, c-format msgid "rshift(%lf, %lf): too large shift value will give strange results" msgstr "rshift(%lf, %lf): trop grand déplacement donnera d'étranges résultats" -#: builtin.c:2449 builtin.c:2451 +#: builtin.c:2490 builtin.c:2492 msgid "and: received non-numeric first argument" msgstr "and: premier argument fourni n'est pas numérique" -#: builtin.c:2453 +#: builtin.c:2494 #, c-format msgid "and(%lf, %lf): negative values will give strange results" msgstr "and(%lf, %lf): valeurs négatives donneront d'étranges résultats" -#: builtin.c:2455 +#: builtin.c:2496 #, c-format msgid "and(%lf, %lf): fractional values will be truncated" msgstr "and(%lf, %lf): valeurs fractionnaires seront tronquées" -#: builtin.c:2484 builtin.c:2486 +#: builtin.c:2525 builtin.c:2527 msgid "or: received non-numeric first argument" msgstr "or: premier argument fourni n'est pas numérique" -#: builtin.c:2488 +#: builtin.c:2529 #, c-format msgid "or(%lf, %lf): negative values will give strange results" msgstr "or(%lf, %lf): valeurs négatives donneront d'étranges résultats" -#: builtin.c:2490 +#: builtin.c:2531 #, c-format msgid "or(%lf, %lf): fractional values will be truncated" msgstr "or(%lf, %lf): valeurs fractionnaires seront tronquées" -#: builtin.c:2519 builtin.c:2521 +#: builtin.c:2560 builtin.c:2562 msgid "xor: received non-numeric first argument" msgstr "xor: premier argument fourni n'est pas numérique" -#: builtin.c:2523 +#: builtin.c:2564 #, c-format msgid "xor(%lf, %lf): negative values will give strange results" msgstr "xor(%lf, %lf): valeurs négatives donneront d'étranges résultats" -#: builtin.c:2525 +#: builtin.c:2566 #, c-format msgid "xor(%lf, %lf): fractional values will be truncated" msgstr "xor(%lf, %lf): valeurs fractionnaires seront tronquées" -#: builtin.c:2553 +#: builtin.c:2594 msgid "compl: received non-numeric argument" msgstr "compl: argument fourni n'est pas numérique" -#: builtin.c:2555 +#: builtin.c:2596 #, c-format msgid "compl(%lf): negative value will give strange results" msgstr "compl(%lf): valeurs négatives donneront d'étranges résultats" -#: builtin.c:2557 +#: builtin.c:2598 #, c-format msgid "compl(%lf): fractional value will be truncated" msgstr "compl(%lf): valeurs fractionnaires seront tronquées" -#: builtin.c:2728 +#: builtin.c:2771 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "dcgettext: « %s » n'est pas dans un catégorie de localisation valide" -#: eval.c:262 +#: eval.c:266 #, c-format msgid "unknown nodetype %d" msgstr "type de noeud inconnu %d" -#: eval.c:310 +#: eval.c:312 msgid "buffer overflow in genflags2str" msgstr "débordement de tampo dans genflag2str" -#: eval.c:555 +#: eval.c:647 #, c-format msgid "for loop: array `%s' changed size from %ld to %ld during loop execution" msgstr "" "for loop: tableau « %s » a changé de taille de %ld à %ld durant l'exécution " "de la boucle" -#: eval.c:576 +#: eval.c:668 msgid "`break' outside a loop is not portable" msgstr "« break » en dehors de la boucle n'est pas portable" -#: eval.c:580 +#: eval.c:672 msgid "`break' outside a loop is not allowed" msgstr "« break » en dehors de la boucle n'est pas permis" -#: eval.c:597 +#: eval.c:689 msgid "`continue' outside a loop is not portable" msgstr "« continue » en dehors de la boucle n'est pas portable" -#: eval.c:601 +#: eval.c:693 msgid "`continue' outside a loop is not allowed" msgstr "« continue » en dehors de la boucle n'est pas permis" -#: eval.c:635 +#: eval.c:727 msgid "`next' cannot be called from a BEGIN rule" msgstr "« next » ne peut être appelé depuis une règle BEGIN" -#: eval.c:637 +#: eval.c:729 msgid "`next' cannot be called from an END rule" msgstr "« next » ne peut être appelé depuis une règle END" -#: eval.c:646 +#: eval.c:738 msgid "`nextfile' cannot be called from a BEGIN rule" msgstr "« nextfile » ne peut être appelé depuis une règle BEGIN" -#: eval.c:648 +#: eval.c:740 msgid "`nextfile' cannot be called from an END rule" msgstr "« nextfile » ne peut être appelé depuis une règle END" -#: eval.c:696 +#: eval.c:785 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 +#: eval.c:828 eval.c:1726 #, c-format msgid "can't use function name `%s' as variable or array" msgstr "" "ne peut utiliser le nom de la fonction « %s » comme variable ou tableau" -#: eval.c:746 eval.c:752 +#: eval.c:835 eval.c:841 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "référence à un argument non initialisé « %s »" -#: eval.c:810 eval.c:1728 profile.c:773 +#: eval.c:848 eval.c:907 eval.c:1732 eval.c:1742 profile.c:807 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "tentative d'utilisation du tableau « %s » dans un contexte scalaire" -#: eval.c:910 +#: eval.c:858 eval.c:1752 +#, c-format +msgid "reference to uninitialized variable `%s'" +msgstr "référence à une variable non initialisée « %s »" + +#: eval.c:1007 msgid "" "concatenation: side effects in one expression have changed the length of " "another!" @@ -798,54 +820,49 @@ msgstr "" "concaténation: effects de bord dans une expression a modifié la longueur " "d'une autre!" -#: eval.c:935 +#: eval.c:1032 msgid "assignment used in conditional context" msgstr "affectation utilisé dans un contexte conditionnel" -#: eval.c:1026 +#: eval.c:1122 msgid "division by zero attempted" msgstr "tentative de division par zéro" -#: eval.c:1041 +#: eval.c:1137 #, c-format msgid "division by zero attempted in `%%'" msgstr "tentative de division par zéro dans « %% »" -#: eval.c:1056 profile.c:649 +#: eval.c:1152 profile.c:683 #, c-format msgid "illegal type (%s) in tree_eval" msgstr "type illégal (%s) dans tree_eval" -#: eval.c:1232 +#: eval.c:1328 msgid "division by zero attempted in `/='" msgstr "tentative de division par zéro dans « /= »" -#: eval.c:1250 +#: eval.c:1346 #, 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 +#: eval.c:1586 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "fonction « %s » appelée avec plus d'arguments que déclarées" -#: eval.c:1628 +#: eval.c:1633 #, c-format msgid "function `%s' not defined" msgstr "fonction « %s » non définie" -#: eval.c:1634 +#: eval.c:1639 #, c-format msgid "function %s called\n" msgstr "fonction %s appelée\n" -#: eval.c:1693 +#: eval.c:1698 msgid "" "\n" "\t# Function Call Stack:\n" @@ -855,49 +872,43 @@ msgstr "" "\t# Appel d'une fonction sur la pile:\n" "\n" -#: eval.c:1696 +#: eval.c:1701 msgid "\t# -- main --\n" msgstr "#t# -- main --\n" -#: eval.c:1850 +#: eval.c:1867 msgid "attempt to field reference from non-numeric value" msgstr "tentative de référence un champ à partir d'une valeur non numérique" -#: eval.c:1852 +#: eval.c:1869 msgid "attempt to reference from null string" msgstr "tentative de référence à partir d'une chaîne nulle" -#: eval.c:1858 +#: eval.c:1875 #, 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 +#: eval.c:1896 eval.c:1903 profile.c:900 msgid "assignment is not allowed to result of builtin function" msgstr "" "l'affectation n'est pas permise pour obtenir un résultat d'une fonction " "interne" -#: eval.c:1941 +#: eval.c:1951 msgid "`IGNORECASE' is a gawk extension" msgstr "« IGNORECASE » est une extension de gawk" -#: eval.c:1970 +#: eval.c:1980 msgid "`BINMODE' is a gawk extension" msgstr "« BINMODE » est une extension de gawk" -#: eval.c:2082 +#: eval.c:2092 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "« %sFMT » spécification erronée « %s »" -#: eval.c:2160 +#: eval.c:2170 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "désactivation « --lint » en raison d'une affectation à « LINT »" @@ -915,32 +926,32 @@ 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:181 +#: ext.c:183 msgid "Operation Not Supported" msgstr "Opération non supportée" -#: field.c:321 +#: field.c:315 msgid "NF set to negative value" msgstr "NF initialisé avec une valeur négative" -#: field.c:819 +#: field.c:808 msgid "split: second argument is not an array" msgstr "split: 2e argument n'est pas un tableau" -#: field.c:854 +#: field.c:842 msgid "split: null string for third arg is a gawk extension" msgstr "split: chaîne vide pour le 3e argument est une extension de gawk" -#: field.c:906 +#: field.c:894 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "« FIELDWIDTHS » est une extension de gawk" -#: field.c:933 +#: field.c:921 #, c-format msgid "field %d in FIELDWIDTHS, must be > 0" msgstr "champ %d dans FIELDWIDTHS, doit être > 0" -#: field.c:1006 +#: field.c:994 msgid "null string for `FS' is a gawk extension" msgstr "chaîne vide pour « FS » est une extension de gawk" @@ -984,7 +995,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:431 +#: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:434 #, c-format msgid "%s: option requires an argument -- %c\n" msgstr "%s: l'option requiert un argument -- %c\n" @@ -999,478 +1010,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" -#: io.c:257 +#: io.c:305 #, c-format msgid "cannot open file `%s' for reading (%s)" msgstr "ne peut ouvrir le fichier « %s » en lecture (%s)" -#: io.c:344 +#: io.c:392 #, c-format msgid "close of fd %d (`%s') failed (%s)" msgstr "fermeture de fd %d (« %s ») en échec (%s)" -#: io.c:482 +#: io.c:530 #, c-format msgid "invalid tree type %s in redirect()" msgstr "type d'arbre invalide %s dans redirect()" -#: io.c:488 +#: io.c:536 #, c-format msgid "expression in `%s' redirection only has numeric value" msgstr "" "l'expression de la redirection de « %s » a seulement une valeur numérique" -#: io.c:494 +#: io.c:542 #, c-format msgid "expression for `%s' redirection has null string value" msgstr "" "l'expression de la redirection de « %s » a une valeur nulle pour la chaîne" -#: io.c:499 +#: io.c:547 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" msgstr "" "nom de fichier « %s » pour le redirection « %s » peut être le résultat d'une " "expression logique" -#: io.c:521 +#: io.c:569 #, c-format msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" msgstr "mélange non nécessaire de « > » et de « >> » pour le fichier « %.*s »" -#: io.c:573 +#: io.c:621 #, c-format msgid "can't open pipe `%s' for output (%s)" msgstr "ne peut ouvrir un pipe « %s » en sortie (%s)" -#: io.c:582 +#: io.c:630 #, c-format msgid "can't open pipe `%s' for input (%s)" msgstr "ne peut ouvrir un pipe « %s » en entrée (%s)" -#: io.c:595 +#: io.c:643 #, c-format msgid "can't open two way socket `%s' for input/output (%s)" msgstr "" "ne peut ouvrir un socket bidirectionnel « %s » pour les entrées/sorties (%s)" -#: io.c:599 +#: io.c:647 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" msgstr "" "ne peut ouvrir un pipe bidirectionnel « %s » pour les entrées/sorties (%s)" -#: io.c:675 +#: io.c:723 #, c-format msgid "can't redirect from `%s' (%s)" msgstr "ne peut rediriger de « %s » (%s)" -#: io.c:678 +#: io.c:726 #, c-format msgid "can't redirect to `%s' (%s)" msgstr "ne peut rediriger vers « %s » (%s)" -#: io.c:717 +#: io.c:765 msgid "" "reached system limit for open files: starting to multiplex file descriptors" msgstr "" "limite système atteinte pour l'ouverture des fichiers: début du multiplexage " "des descripteurs de fichiers" -#: io.c:729 +#: io.c:777 #, c-format msgid "close of `%s' failed (%s)." msgstr "fermeture de « %s » en échec (%s)" -#: io.c:736 +#: io.c:784 msgid "too many pipes or input files open" msgstr "trop de pipes ou de fichiers en lecture ouverts" -#: io.c:759 +#: io.c:807 msgid "close: second argument must be `to' or `from'" msgstr "close: 2e argument doit être « to » ou « from »" -#: io.c:773 +#: io.c:821 #, c-format msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "close: « %.*s » n'est pas ni un fichier ouvert, pipe ou co-processus" -#: io.c:777 +#: io.c:825 msgid "close of redirection that was never opened" msgstr "fermeture de la redirection qui n'a jamais été ouverte" -#: io.c:804 +#: io.c:862 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" msgstr "" "close: redirection « %s » n'a pas été ouverte ave « |& » 2e argument ignoré" -#: io.c:866 +#: io.c:924 #, c-format msgid "failure status (%d) on pipe close of `%s' (%s)" msgstr "constat d'échec (%d) lors de la fermeture du pipe « %s » (%s)" -#: io.c:869 +#: io.c:927 #, c-format msgid "failure status (%d) on file close of `%s' (%s)" msgstr "constat d'échec (%d) lors de la fermeture du fichier « %s » (%s)" -#: io.c:888 +#: io.c:946 #, c-format msgid "no explicit close of socket `%s' provided" msgstr "aucune fermeture explicite du socket « %s » fournie" -#: io.c:891 +#: io.c:949 #, c-format msgid "no explicit close of co-process `%s' provided" msgstr "aucune fermeture explicite du co-processus « %s » fournie" -#: io.c:894 +#: io.c:952 #, c-format msgid "no explicit close of pipe `%s' provided" msgstr "aucune fermeture explicite du pipe « %s » fournie" -#: io.c:897 +#: io.c:955 #, c-format msgid "no explicit close of file `%s' provided" msgstr "aucune fermeture explicite du fichier « %s » fournie" -#: io.c:926 io.c:980 +#: io.c:984 io.c:1038 #, c-format msgid "error writing standard output (%s)" msgstr "erreur lors de l'écriture vers stdout (%s)" -#: io.c:930 io.c:984 +#: io.c:988 io.c:1042 #, c-format msgid "error writing standard error (%s)" msgstr "erreur lors de l'écriture vers stderr (%s)" -#: io.c:938 +#: io.c:996 #, c-format msgid "pipe flush of `%s' failed (%s)." msgstr "vidange du pipie de « %s » en échec (%s)" -#: io.c:941 +#: io.c:999 #, c-format msgid "co-process flush of pipe to `%s' failed (%s)." msgstr "vidange du pipe par le co-processus vers « %s » en échec (%s)" -#: io.c:944 +#: io.c:1002 #, c-format msgid "file flush of `%s' failed (%s)." msgstr "vidange du fichier « %s » en échec (%s)" -#: io.c:1103 +#: io.c:1161 msgid "/inet/raw client not ready yet, sorry" msgstr "le client /inet/raw n'est pas encore prêt, désolé" -#: io.c:1105 io.c:1142 +#: io.c:1163 io.c:1200 msgid "only root may use `/inet/raw'." msgstr "seul root peut utiliser « /inet/raw »" -#: io.c:1140 +#: io.c:1198 msgid "/inet/raw server not ready yet, sorry" msgstr "le serveur /inet/raw n'est pas encore prêt, désolé" -#: io.c:1230 +#: io.c:1288 #, c-format msgid "no (known) protocol supplied in special filename `%s'" msgstr "aucun protocole (connu) fourni dans le nom de fichier spécial « %s »" -#: io.c:1248 +#: io.c:1306 #, c-format msgid "special file name `%s' is incomplete" msgstr "nom spécial de fichier « %s » est incomplet" -#: io.c:1260 +#: io.c:1318 #, c-format msgid "local port invalid in `%s'" msgstr "port local invalide dans « %s »" -#: io.c:1272 +#: io.c:1330 msgid "must supply a remote hostname to `/inet'" msgstr "un nom de hôte distant doit être fourni à « /inet »" -#: io.c:1287 +#: io.c:1345 msgid "must supply a remote port to `/inet'" msgstr "un port distant doit être fournis à « /inet »" -#: io.c:1293 +#: io.c:1351 #, c-format msgid "remote port invalid in `%s'" msgstr "port distant invalide dans « %s »" -#: io.c:1303 +#: io.c:1361 msgid "TCP/IP communications are not supported" msgstr "les communications TCP/IP ne sont pas supportées" -#: io.c:1312 io.c:1492 +#: io.c:1370 io.c:1551 #, c-format msgid "file `%s' is a directory" msgstr "le fichier « %s » est un répertoire" -#: io.c:1381 +#: io.c:1440 #, c-format msgid "use `PROCINFO[\"%s\"]' instead of `%s'" msgstr "utliser « PROCINFO[\"%s\"] » au lieu de « %s »" -#: io.c:1413 +#: io.c:1472 msgid "use `PROCINFO[...]' instead of `/dev/user'" msgstr "utliser « PROCINFO[\"%s\"] » au lieu de « /dev/user »" -#: io.c:1478 io.c:1652 +#: io.c:1537 io.c:1711 #, c-format msgid "could not open `%s', mode `%s'" msgstr "ne peut ouvrir « %s », mode « %s »" -#: io.c:1703 +#: io.c:1762 #, 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 +#: io.c:1764 io.c:1916 io.c:2068 #, c-format msgid "close of stdout in child failed (%s)" msgstr "échec de fermeture de stdout du processus fils (%s)" -#: io.c:1708 +#: io.c:1767 #, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" msgstr "" "échec de redirection du pty esclave vers stdout du processus fils (dup: %s)" -#: io.c:1710 io.c:1862 +#: io.c:1769 io.c:1921 #, c-format msgid "close of stdin in child failed (%s)" msgstr "échec de fermeture de stdin du processus fils (%s)" -#: io.c:1713 +#: io.c:1772 #, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" msgstr "" "échec de redirection du pty esclave vers stdin du processus fils (dup: %s)" -#: io.c:1715 io.c:1734 +#: io.c:1774 io.c:1793 #, c-format msgid "close of slave pty failed (%s)" msgstr "échec de la fermeture du pty esclave (%s)" -#: io.c:1808 io.c:1860 io.c:1990 io.c:2012 +#: io.c:1867 io.c:1919 io.c:2049 io.c:2071 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "échec de redirection du pipe vers stdout du processus fils (dup: %s)" -#: io.c:1812 io.c:1865 +#: io.c:1871 io.c:1924 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "échec de redirection du pipe vers stdin du processus fils (dup: %s)" -#: io.c:1829 io.c:2003 +#: io.c:1888 io.c:2062 msgid "restoring stdout in parent process failed\n" msgstr "restauration de stdout par le processus parent a échoué\n" -#: io.c:1834 +#: io.c:1893 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 +#: io.c:1927 io.c:2073 io.c:2084 #, c-format msgid "close of pipe failed (%s)" msgstr "échec de la fermeture du pipe (%s)" -#: io.c:1913 +#: io.c:1972 msgid "`|&' not supported" msgstr "« |& » non supporté" -#: io.c:1980 +#: io.c:2039 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "ne ouvrir un pipe « %s » (%s)" -#: io.c:2021 +#: io.c:2080 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "ne créer le processus fils pour « %s » (fork: %s)" -#: io.c:2364 +#: io.c:2423 #, c-format msgid "data file `%s' is empty" msgstr "le fichier de données « %s » est vide" -#: io.c:2407 io.c:2415 +#: io.c:2466 io.c:2474 msgid "could not allocate more input memory" msgstr "ne peut allouer plus de mémoire pour l'entrée" -#: io.c:2540 io.c:2782 io.c:3046 +#: io.c:2832 io.c:2895 #, c-format msgid "error reading input file `%s': %s" msgstr "erreur lors de la lecture du fichier source « %s »: %s" -#: io.c:3281 +#: io.c:3020 msgid "multicharacter value of `RS' is a gawk extension" msgstr "valeur de « RS » avec multiple caractères est une extension gawk" -#: main.c:322 +#: main.c:324 msgid "`-m[fr]' option irrelevant in gawk" msgstr "« -m[fr] » est une option non pertinente en gawk" -#: main.c:324 +#: main.c:326 msgid "-m option usage: `-m[fr] nnn'" msgstr "-m usage de l'option: « -m[fr] nnn »" -#: main.c:341 +#: main.c:343 #, c-format msgid "%s: option `-W %s' unrecognized, ignored\n" msgstr "%s: l'option « -W %s » n'est pas reconnue, ignorée\n" -#: main.c:378 +#: main.c:380 msgid "empty argument to `--source' ignored" msgstr "argument vide à l'option « --source », ignorée" -#: main.c:448 +#: main.c:451 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "" "variable d'environnement « POSIXLY__CORRECT » initialisée: utilisation de « " "--posix »" -#: main.c:453 +#: main.c:456 msgid "`--posix' overrides `--traditional'" msgstr "« --posix » écrase « --traditional »" -#: main.c:464 +#: main.c:467 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "« --posix »/« --traditional » écrase « --non-decimal-data »" -#: main.c:468 +#: main.c:471 #, c-format msgid "running %s setuid root may be a security problem" msgstr "" "l'exécution de %s en mode setuid root peut causer un problème de sécurité" -#: main.c:509 +#: main.c:512 #, c-format msgid "can't set binary mode on stdin (%s)" msgstr "ne peut initialiser le mode binaire sur stdin (%s)" -#: main.c:512 +#: main.c:515 #, c-format msgid "can't set binary mode on stdout (%s)" msgstr "ne peut initialiser le mode binaire sur stdout (%s)" -#: main.c:514 +#: main.c:517 #, c-format msgid "can't set binary mode on stderr (%s)" msgstr "ne peut initialiser le mode binaire sur stderr (%s)" -#: main.c:544 +#: main.c:547 msgid "no program text at all!" msgstr "aucun programme!" -#: main.c:612 +#: main.c:620 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "" "Usage: %s [style des options POSIX ou GNU] -f fichierprog [--] fichier ...\n" -#: main.c:614 +#: main.c:622 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "" "Usage: %s [style des options POSIX ou GNU] [--] %cprogram%c fichier ...\n" -#: main.c:619 +#: main.c:627 msgid "POSIX options:\t\tGNU long options:\n" msgstr "Options POSIX:\t\toptions de long format GNU:\n" -#: main.c:620 +#: main.c:628 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "\t-f fichierprog\t\t--file=fichierprog\n" -#: main.c:621 +#: main.c:629 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "#t-F fs\t\t\t--field-separator=fs\n" -#: main.c:622 +#: main.c:630 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "#t-v var=valeur\t\t--assign=var=valeur\n" -#: main.c:623 +#: main.c:631 msgid "\t-m[fr] val\n" msgstr "\t-m[fr] valeur\n" -#: main.c:624 +#: main.c:632 msgid "\t-W compat\t\t--compat\n" msgstr "\t-W compat\t\t--compat\n" -#: main.c:625 +#: main.c:633 msgid "\t-W copyleft\t\t--copyleft\n" msgstr "\t-W copyleft\t\t--copyleft\n" -#: main.c:626 +#: main.c:634 msgid "\t-W copyright\t\t--copyright\n" msgstr "\t-W copyright\t\t--copyright\n" -#: main.c:627 +#: main.c:635 msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n" msgstr "\t-W dump-variables[=fichier]\t--dump-variables[=fichier]\n" -#: main.c:628 +#: main.c:636 msgid "\t-W gen-po\t\t--gen-po\n" msgstr "\t-W gen-po\t\t--gen-po\n" -#: main.c:629 +#: main.c:637 msgid "\t-W help\t\t\t--help\n" msgstr "\t-W help\t\t\t--help\n" -#: main.c:630 +#: main.c:638 msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n" msgstr "\t-W lint[=fatal]\t\t--lint[=fatal]\n" -#: main.c:631 +#: main.c:639 msgid "\t-W lint-old\t\t--lint-old\n" msgstr "\t-W lint-old\t\t--lint-old\n" -#: main.c:632 +#: main.c:640 msgid "\t-W non-decimal-data\t--non-decimal-data\n" msgstr "\t-W non-decimal-data\t--non-decimal-data\n" -#: main.c:634 +#: main.c:642 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "\t-W nostalgia\t\t--nostalgia\n" -#: main.c:637 +#: main.c:645 msgid "\t-W parsedebug\t\t--parsedebug\n" msgstr "\t-W parsedebug\t\t--parsedebug\n" -#: main.c:639 +#: main.c:647 msgid "\t-W profile[=file]\t--profile[=file]\n" msgstr "\t-W profile[=fichier]\t--profile[=fichier]\n" -#: main.c:640 +#: main.c:648 msgid "\t-W posix\t\t--posix\n" msgstr "\t-W posix\t\t--posix\n" -#: main.c:641 +#: main.c:649 msgid "\t-W re-interval\t\t--re-interval\n" msgstr "\t-W re-interval\t\t--re-interval\n" -#: main.c:642 +#: main.c:650 msgid "\t-W source=program-text\t--source=program-text\n" msgstr "\t-W source=program-text\t--source=program-text\n" -#: main.c:643 +#: main.c:651 msgid "\t-W traditional\t\t--traditional\n" msgstr "\t-W traditional\t\t--traditional\n" -#: main.c:644 +#: main.c:652 msgid "\t-W usage\t\t--usage\n" msgstr "\t-W usage\t\t--usage\n" -#: main.c:645 +#: main.c:653 msgid "\t-W version\t\t--version\n" msgstr "\t-W version\t\t--version\n" -#: main.c:649 +#: main.c:657 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" @@ -1481,7 +1492,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:653 +#: main.c:661 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" @@ -1491,7 +1502,7 @@ msgstr "" "Par défaut, il lit de l'entrée standard et écrit sur la sortie standard.\n" "\n" -#: main.c:657 +#: main.c:665 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" @@ -1501,7 +1512,7 @@ msgstr "" "\tgawk '{ sum += $1 }; END { print sum }' fichier\n" "\tgawk -F: '{ print $1 }' /etc/passwd\n" -#: main.c:669 +#: main.c:682 #, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -1520,7 +1531,7 @@ msgstr "" "soit (selon vos préférences) toute version ultérieure.\n" "\n" -#: main.c:677 +#: main.c:690 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -1535,7 +1546,7 @@ msgstr "" "Pour plus d'informations à ce sujet, consulter la « GNU General Public " "License ».\n" -#: main.c:683 +#: main.c:696 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program; if not, write to the Free Software\n" @@ -1545,13 +1556,13 @@ 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:713 +#: main.c:730 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "" "-Ft ne permet pas d'initialiser FS à un tabulateur dans la version POSIX de " "awk" -#: main.c:944 +#: main.c:956 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" @@ -1560,35 +1571,35 @@ msgstr "" "%s: `%s' argument à `-v' n'a pas le format `var=valeur'\n" "\n" -#: main.c:964 +#: main.c:976 #, c-format msgid "`%s' is not a legal variable name" msgstr "`%s' n'est pas un nom de variable légal" -#: main.c:967 +#: main.c:979 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "`%s' n'est pas un nom de variable, recherche du fichier `%s=%s'" -#: main.c:995 +#: main.c:1012 msgid "floating point exception" msgstr "exception de la virgule flottante" -#: main.c:1002 +#: main.c:1019 msgid "fatal error: internal error" msgstr "erreur fatale: erreur interne" -#: main.c:1052 +#: main.c:1069 #, c-format msgid "no pre-opened fd %d" msgstr "aucun fd pré-ouvert pour %d" -#: main.c:1057 +#: main.c:1074 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "ne peut pré-ouvrir /dev/null pour le descripteud fd %d" -#: main.c:1080 main.c:1089 +#: main.c:1097 main.c:1106 #, c-format msgid "could not find groups: %s" msgstr "n'a pu trouvé les groupes: %s" @@ -1609,23 +1620,23 @@ msgstr "Erreur: " msgid "fatal: " msgstr "Fatal: " -#: node.c:59 node.c:66 node.c:75 node.c:89 node.c:116 +#: node.c:58 node.c:65 node.c:74 node.c:88 node.c:115 msgid "can't convert string to float" msgstr "ne peut convertir la chaîne en nombre flottant" -#: node.c:357 +#: node.c:355 msgid "backslash at end of string" msgstr "barre oblique inverse à la fin de la chaîne" -#: node.c:544 +#: node.c:539 msgid "POSIX does not allow `\\x' escapes" msgstr "POSIX ne permet pas de séquence d'échappement « \\x »" -#: node.c:550 +#: node.c:545 msgid "no hex digits in `\\x' escape sequence" msgstr "aucun chiffre hexadécimal dans la séquence d'échappement « \\x » " -#: node.c:584 +#: node.c:579 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "séquence d'échappement « \\%c » traitée simplement comme « %c »" @@ -1640,24 +1651,21 @@ msgstr "%s %s « %s »: ne peut initialiser close-on-exec: (fcntl: %s)" msgid "could not open `%s' for writing: %s" msgstr "ne peut ouvrir « %s » en écriture: %s" -#: profile.c:409 -msgid "internal error: Node_var with null vname" -msgstr "erreur interne: Node_var avec un vname nul" +#: profile.c:449 +#, c-format +msgid "internal error: %s with null vname" +msgstr "erreur interne: %s avec un vname nul" -#: profile.c:471 +#: profile.c:512 msgid "# treated internally as `delete'" msgstr "# traitée de manière interne comme « delete »" -#: 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 +#: profile.c:1162 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "\t# profile gawk, créé %s\n" -#: profile.c:1130 +#: profile.c:1165 msgid "" "\t# BEGIN block(s)\n" "\n" @@ -1665,7 +1673,7 @@ msgstr "" "#t# DÉBUT de bloc(s)\n" "\n" -#: profile.c:1140 +#: profile.c:1175 msgid "" "\t# Rule(s)\n" "\n" @@ -1673,7 +1681,7 @@ msgstr "" "\t# Règle(s)\n" "\n" -#: profile.c:1146 +#: profile.c:1181 msgid "" "\t# END block(s)\n" "\n" @@ -1681,7 +1689,7 @@ msgstr "" "\t# FIN de bloc(s)\n" "\n" -#: profile.c:1166 +#: profile.c:1201 msgid "" "\n" "\t# Functions, listed alphabetically\n" @@ -1689,7 +1697,7 @@ msgstr "" "\n" "\t# Liste alphabétique des fonctions\n" -#: profile.c:1376 +#: profile.c:1413 #, c-format msgid "unexpected type %s in prec_level" msgstr "type %s inattendu dans prec_level" @@ -1773,6 +1781,22 @@ msgstr "Non appariement de ) ou \\)" msgid "No previous regular expression" msgstr "Aucune expression régulière antérieure" +#~ msgid "substr: length %g is < 0" +#~ msgstr "substr: longueur %g est < 0" + +#~ msgid "delete: illegal use of variable `%s' as array" +#~ msgstr "" +#~ "destruction: utilisation illégale d'une variable « %s » comme tableau" + +#~ msgid "asort: first argument is not an array" +#~ msgstr "asort(): le premier argument fourni n'est pas dans le tableau" + +#~ msgid "asort: second argument is not an array" +#~ msgstr "asort(): le second argument fourni n'est pas dans le tableau" + +#~ msgid "internal error: Node_var_array with null vname" +#~ msgstr "erreur interne: Node_var_array avec un vname nul" + #~ msgid "invalid syntax in name `%s' for variable assignment" #~ msgstr "syntaxe invalide dans le nom « %s » pour l'affectation de variable" diff --git a/po/gawk.pot b/po/gawk.pot index acc0be7a..125798e3 100644 --- a/po/gawk.pot +++ b/po/gawk.pot @@ -7,7 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2003-03-19 14:25+0200\n" +"Report-Msgid-Bugs-To: arnold@skeeve.com\n" +"POT-Creation-Date: 2003-07-07 11:20-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -15,64 +16,61 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: array.c:274 array.c:309 array.c:314 eval.c:494 +#: array.c:112 +#, c-format +msgid "attempt to use scalar parameter `%s' as an array" +msgstr "" + +#: array.c:113 #, c-format msgid "attempt to use scalar `%s' as array" msgstr "" -#: array.c:338 +#: array.c:151 #, c-format -msgid "reference to uninitialized element `%s[\"%s\"]'" +msgid "from %s" msgstr "" -#: array.c:344 +#: array.c:506 #, c-format -msgid "subscript of array `%s' is null string" +msgid "reference to uninitialized element `%s[\"%s\"]'" msgstr "" -#: array.c:412 array.c:425 array.c:466 +#: array.c:512 #, c-format -msgid "delete: index `%s' not in array `%s'" +msgid "subscript of array `%s' is null string" msgstr "" -#: array.c:432 array.c:515 +#: array.c:609 #, c-format -msgid "delete: illegal use of variable `%s' as array" +msgid "delete: index `%s' not in array `%s'" msgstr "" -#: array.c:633 +#: array.c:769 #, c-format msgid "%s: empty (null)\n" msgstr "" -#: array.c:638 +#: array.c:774 #, c-format msgid "%s: empty (zero)\n" msgstr "" -#: array.c:642 +#: array.c:778 #, c-format msgid "%s: table_size = %d, array_size = %d\n" msgstr "" -#: array.c:671 +#: array.c:807 #, c-format msgid "%s: is parameter\n" msgstr "" -#: array.c:676 +#: array.c:812 #, c-format msgid "%s: array_ref to %s\n" msgstr "" -#: array.c:975 -msgid "asort: first argument is not an array" -msgstr "" - -#: array.c:984 -msgid "asort: second argument is not an array" -msgstr "" - #: awkgram.y:208 #, c-format msgid "%s blocks must have an action part" @@ -92,780 +90,793 @@ msgstr "" msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "" -#: awkgram.y:340 +#: awkgram.y:340 awkgram.y:615 msgid "statement may have no effect" msgstr "" -#: awkgram.y:431 awkgram.y:451 +#: awkgram.y:435 awkgram.y:455 #, c-format msgid "`%s' used in %s action" msgstr "" -#: awkgram.y:444 awkgram.y:447 +#: awkgram.y:448 awkgram.y:451 msgid "`nextfile' is a gawk extension" msgstr "" -#: awkgram.y:461 +#: awkgram.y:465 msgid "`return' used outside function context" msgstr "" -#: awkgram.y:500 +#: awkgram.y:504 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" msgstr "" -#: awkgram.y:513 awkgram.y:520 +#: awkgram.y:517 awkgram.y:524 msgid "`delete array' is a gawk extension" msgstr "" -#: awkgram.y:528 awkgram.y:535 +#: awkgram.y:532 awkgram.y:539 msgid "`delete(array)' is a non-portable tawk extension" msgstr "" -#: awkgram.y:578 +#: awkgram.y:583 +#, c-format +msgid "duplicate case values in switch body: %s" +msgstr "" + +#: awkgram.y:593 +msgid "Duplicate `default' detected in switch body" +msgstr "" + +#: awkgram.y:681 msgid "multistage two-way pipelines don't work" msgstr "" -#: awkgram.y:669 +#: awkgram.y:772 msgid "regular expression on right of assignment" msgstr "" -#: awkgram.y:679 +#: awkgram.y:782 msgid "regular expression on left of `~' or `!~' operator" msgstr "" -#: awkgram.y:687 +#: awkgram.y:790 msgid "regular expression on right of comparison" msgstr "" -#: awkgram.y:754 +#: awkgram.y:857 msgid "non-redirected `getline' undefined inside END action" msgstr "" -#: awkgram.y:781 +#: awkgram.y:884 msgid "call of `length' without parentheses is not portable" msgstr "" -#: awkgram.y:784 +#: awkgram.y:887 msgid "call of `length' without parentheses is deprecated by POSIX" msgstr "" -#: awkgram.y:835 +#: awkgram.y:940 +msgid "use of non-array as array" +msgstr "" + +#: awkgram.y:942 msgid "invalid subscript expression" msgstr "" -#: awkgram.y:1020 +#: awkgram.y:1140 msgid "unexpected newline or end of string" msgstr "" -#: awkgram.y:1115 +#: awkgram.y:1235 msgid "empty program text on command line" msgstr "" -#: awkgram.y:1172 +#: awkgram.y:1292 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "" -#: awkgram.y:1207 +#: awkgram.y:1327 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "" -#: awkgram.y:1215 +#: awkgram.y:1335 #, c-format msgid "source file `%s' is empty" msgstr "" -#: awkgram.y:1417 awkgram.y:1527 awkgram.y:1545 awkgram.y:1895 awkgram.y:1980 +#: awkgram.y:1537 awkgram.y:1647 awkgram.y:1665 awkgram.y:2015 awkgram.y:2100 msgid "source file does not end in newline" msgstr "" -#: awkgram.y:1481 +#: awkgram.y:1601 msgid "unterminated regexp ends with `\\' at end of file" msgstr "" -#: awkgram.y:1501 +#: awkgram.y:1621 msgid "unterminated regexp" msgstr "" -#: awkgram.y:1504 +#: awkgram.y:1624 msgid "unterminated regexp at end of file" msgstr "" -#: awkgram.y:1571 +#: awkgram.y:1691 msgid "use of `\\ #...' line continuation is not portable" msgstr "" -#: awkgram.y:1583 +#: awkgram.y:1703 msgid "backslash not last character on line" msgstr "" -#: awkgram.y:1628 +#: awkgram.y:1748 msgid "POSIX does not allow operator `**='" msgstr "" -#: awkgram.y:1630 +#: awkgram.y:1750 msgid "old awk does not support operator `**='" msgstr "" -#: awkgram.y:1639 +#: awkgram.y:1759 msgid "POSIX does not allow operator `**'" msgstr "" -#: awkgram.y:1641 +#: awkgram.y:1761 msgid "old awk does not support operator `**'" msgstr "" -#: awkgram.y:1672 +#: awkgram.y:1792 msgid "operator `^=' is not supported in old awk" msgstr "" -#: awkgram.y:1680 +#: awkgram.y:1800 msgid "operator `^' is not supported in old awk" msgstr "" -#: awkgram.y:1764 awkgram.y:1781 +#: awkgram.y:1884 awkgram.y:1901 msgid "unterminated string" msgstr "" -#: awkgram.y:1941 +#: awkgram.y:2061 #, c-format msgid "invalid char '%c' in expression" msgstr "" -#: awkgram.y:2001 +#: awkgram.y:2121 #, c-format msgid "`%s' is a gawk extension" msgstr "" -#: awkgram.y:2004 +#: awkgram.y:2124 #, c-format msgid "`%s' is a Bell Labs extension" msgstr "" -#: awkgram.y:2007 +#: awkgram.y:2127 #, c-format msgid "POSIX does not allow `%s'" msgstr "" -#: awkgram.y:2011 +#: awkgram.y:2131 #, c-format msgid "`%s' is not supported in old awk" msgstr "" -#: awkgram.y:2038 +#: awkgram.y:2158 msgid "`goto' considered harmful!\n" msgstr "" -#: awkgram.y:2102 +#: awkgram.y:2220 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "" -#: awkgram.y:2121 awkgram.y:2124 +#: awkgram.y:2239 awkgram.y:2242 msgid "match: third argument is a gawk extension" msgstr "" -#: awkgram.y:2137 +#: awkgram.y:2255 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "" -#: awkgram.y:2140 +#: awkgram.y:2258 #, c-format msgid "%s third parameter is not a changeable object" msgstr "" -#: awkgram.y:2167 awkgram.y:2170 +#: awkgram.y:2285 awkgram.y:2288 msgid "close: second argument is a gawk extension" msgstr "" -#: awkgram.y:2180 +#: awkgram.y:2298 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "" -#: awkgram.y:2195 +#: awkgram.y:2313 msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "" -#: awkgram.y:2266 +#: awkgram.y:2384 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "" -#: awkgram.y:2299 +#: awkgram.y:2417 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "" -#: awkgram.y:2411 +#: awkgram.y:2529 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "" -#: awkgram.y:2412 profile.c:93 +#: awkgram.y:2530 profile.c:93 msgid "sending profile to standard error" msgstr "" -#: awkgram.y:2442 +#: awkgram.y:2562 #, c-format msgid "%s: close failed (%s)" msgstr "" -#: awkgram.y:2566 +#: awkgram.y:2684 msgid "shadow_funcs() called twice!" msgstr "" -#: awkgram.y:2593 +#: awkgram.y:2711 msgid "there were shadowed variables." msgstr "" -#: awkgram.y:2666 +#: awkgram.y:2784 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "" -#: awkgram.y:2676 +#: awkgram.y:2794 #, c-format msgid "function name `%s' previously defined" msgstr "" -#: awkgram.y:2827 awkgram.y:2833 +#: awkgram.y:2945 awkgram.y:2951 #, c-format msgid "function `%s' called but never defined" msgstr "" -#: awkgram.y:2836 +#: awkgram.y:2954 #, c-format msgid "function `%s' defined but never called" msgstr "" -#: awkgram.y:2863 +#: awkgram.y:2981 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "" -#: awkgram.y:2876 +#: awkgram.y:2994 #, c-format msgid "" "function `%s' called with space between name and `(',\n" "%s" msgstr "" -#: awkgram.y:2878 +#: awkgram.y:2996 msgid "or used as a variable or an array" msgstr "" -#: builtin.c:111 +#: builtin.c:137 #, c-format msgid "%s to \"%s\" failed (%s)" msgstr "" -#: builtin.c:112 +#: builtin.c:138 msgid "standard output" msgstr "" -#: builtin.c:113 +#: builtin.c:139 msgid "reason unknown" msgstr "" -#: builtin.c:126 +#: builtin.c:152 msgid "exp: received non-numeric argument" msgstr "" -#: builtin.c:132 +#: builtin.c:158 #, c-format msgid "exp: argument %g is out of range" msgstr "" -#: builtin.c:190 +#: builtin.c:216 #, c-format msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing" msgstr "" -#: builtin.c:193 +#: builtin.c:219 #, c-format msgid "fflush: cannot flush: file `%s' opened for reading, not writing" msgstr "" -#: builtin.c:205 +#: builtin.c:231 #, c-format msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "" -#: builtin.c:299 +#: builtin.c:325 msgid "index: received non-string first argument" msgstr "" -#: builtin.c:301 +#: builtin.c:327 msgid "index: received non-string second argument" msgstr "" -#: builtin.c:411 +#: builtin.c:437 msgid "int: received non-numeric argument" msgstr "" -#: builtin.c:428 +#: builtin.c:454 msgid "length: received non-string argument" msgstr "" -#: builtin.c:444 +#: builtin.c:470 msgid "log: received non-numeric argument" msgstr "" -#: builtin.c:447 +#: builtin.c:473 #, c-format msgid "log: received negative argument %g" msgstr "" -#: builtin.c:609 builtin.c:612 +#: builtin.c:635 builtin.c:638 msgid "must use `count$' on all formats or none" msgstr "" -#: builtin.c:714 +#: builtin.c:740 msgid "`$' is not permitted in awk formats" msgstr "" -#: builtin.c:720 +#: builtin.c:746 msgid "arg count with `$' must be > 0" msgstr "" -#: builtin.c:722 +#: builtin.c:748 #, c-format msgid "arg count %ld greater than total number of supplied arguments" msgstr "" -#: builtin.c:724 +#: builtin.c:750 msgid "`$' not permitted after period in format" msgstr "" -#: builtin.c:737 +#: builtin.c:763 msgid "no `$' supplied for positional field width or precision" msgstr "" -#: builtin.c:795 +#: builtin.c:821 msgid "`l' is meaningless in awk formats; ignored" msgstr "" -#: builtin.c:799 +#: builtin.c:825 msgid "`l' is not permitted in POSIX awk formats" msgstr "" -#: builtin.c:810 +#: builtin.c:836 msgid "`L' is meaningless in awk formats; ignored" msgstr "" -#: builtin.c:814 +#: builtin.c:840 msgid "`L' is not permitted in POSIX awk formats" msgstr "" -#: builtin.c:825 +#: builtin.c:851 msgid "`h' is meaningless in awk formats; ignored" msgstr "" -#: builtin.c:829 +#: builtin.c:855 msgid "`h' is not permitted in POSIX awk formats" msgstr "" -#: builtin.c:1078 +#: builtin.c:1055 +#, c-format +msgid "[s]printf: value %g is out of range for `%%%c' format" +msgstr "" + +#: builtin.c:1108 msgid "not enough arguments to satisfy format string" msgstr "" -#: builtin.c:1080 +#: builtin.c:1110 msgid "^ ran out for this one" msgstr "" -#: builtin.c:1085 +#: builtin.c:1115 msgid "[s]printf: format specifier does not have control letter" msgstr "" -#: builtin.c:1088 +#: builtin.c:1118 msgid "too many arguments supplied for format string" msgstr "" -#: builtin.c:1154 builtin.c:1157 +#: builtin.c:1184 builtin.c:1187 msgid "printf: no arguments" msgstr "" -#: builtin.c:1181 +#: builtin.c:1211 msgid "sqrt: received non-numeric argument" msgstr "" -#: builtin.c:1185 +#: builtin.c:1215 #, c-format msgid "sqrt: called with negative argument %g" msgstr "" -#: builtin.c:1207 +#: builtin.c:1238 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "" -#: builtin.c:1212 +#: builtin.c:1243 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "" -#: builtin.c:1231 +#: builtin.c:1262 #, c-format -msgid "substr: length %g is <= 0" +msgid "substr: length %g is not >= 1" msgstr "" -#: builtin.c:1233 +#: builtin.c:1264 #, c-format -msgid "substr: length %g is < 0" +msgid "substr: length %g is not >= 0" msgstr "" -#: builtin.c:1240 +#: builtin.c:1271 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "" -#: builtin.c:1245 +#: builtin.c:1276 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" msgstr "" -#: builtin.c:1257 +#: builtin.c:1288 msgid "substr: source string is zero length" msgstr "" -#: builtin.c:1263 +#: builtin.c:1294 #, c-format msgid "substr: start index %g is past end of string" msgstr "" -#: builtin.c:1271 +#: builtin.c:1302 #, c-format msgid "" "substr: length %g at start index %g exceeds length of first argument (%lu)" msgstr "" -#: builtin.c:1306 +#: builtin.c:1337 msgid "strftime: received non-string first argument" msgstr "" -#: builtin.c:1312 +#: builtin.c:1343 msgid "strftime: received empty format string" msgstr "" -#: builtin.c:1321 +#: builtin.c:1352 msgid "strftime: received non-numeric second argument" msgstr "" -#: builtin.c:1384 +#: builtin.c:1415 msgid "mktime: received non-string argument" msgstr "" -#: builtin.c:1429 +#: builtin.c:1460 msgid "system: received non-string argument" msgstr "" -#: builtin.c:1573 +#: builtin.c:1581 eval.c:1883 +#, c-format +msgid "reference to uninitialized field `$%d'" +msgstr "" + +#: builtin.c:1608 msgid "tolower: received non-string argument" msgstr "" -#: builtin.c:1622 +#: builtin.c:1657 msgid "toupper: received non-string argument" msgstr "" -#: builtin.c:1667 +#: builtin.c:1702 msgid "atan2: received non-numeric first argument" msgstr "" -#: builtin.c:1669 +#: builtin.c:1704 msgid "atan2: received non-numeric second argument" msgstr "" -#: builtin.c:1688 +#: builtin.c:1723 msgid "sin: received non-numeric argument" msgstr "" -#: builtin.c:1704 +#: builtin.c:1739 msgid "cos: received non-numeric argument" msgstr "" -#: builtin.c:1748 +#: builtin.c:1788 msgid "srand: received non-numeric argument" msgstr "" -#: builtin.c:1787 +#: builtin.c:1823 msgid "match: third argument is not an array" msgstr "" -#: builtin.c:2264 -msgid "gensub: 3rd argument of 0 treated as 1" +#: builtin.c:2307 +msgid "gensub: third argument of 0 treated as 1" msgstr "" -#: builtin.c:2375 builtin.c:2377 +#: builtin.c:2416 builtin.c:2418 msgid "lshift: received non-numeric first argument" msgstr "" -#: builtin.c:2379 +#: builtin.c:2420 #, c-format msgid "lshift(%lf, %lf): negative values will give strange results" msgstr "" -#: builtin.c:2381 +#: builtin.c:2422 #, c-format msgid "lshift(%lf, %lf): fractional values will be truncated" msgstr "" -#: builtin.c:2383 +#: builtin.c:2424 #, c-format msgid "lshift(%lf, %lf): too large shift value will give strange results" msgstr "" -#: builtin.c:2412 builtin.c:2414 +#: builtin.c:2453 builtin.c:2455 msgid "rshift: received non-numeric first argument" msgstr "" -#: builtin.c:2416 +#: builtin.c:2457 #, c-format msgid "rshift(%lf, %lf): negative values will give strange results" msgstr "" -#: builtin.c:2418 +#: builtin.c:2459 #, c-format msgid "rshift(%lf, %lf): fractional values will be truncated" msgstr "" -#: builtin.c:2420 +#: builtin.c:2461 #, c-format msgid "rshift(%lf, %lf): too large shift value will give strange results" msgstr "" -#: builtin.c:2449 builtin.c:2451 +#: builtin.c:2490 builtin.c:2492 msgid "and: received non-numeric first argument" msgstr "" -#: builtin.c:2453 +#: builtin.c:2494 #, c-format msgid "and(%lf, %lf): negative values will give strange results" msgstr "" -#: builtin.c:2455 +#: builtin.c:2496 #, c-format msgid "and(%lf, %lf): fractional values will be truncated" msgstr "" -#: builtin.c:2484 builtin.c:2486 +#: builtin.c:2525 builtin.c:2527 msgid "or: received non-numeric first argument" msgstr "" -#: builtin.c:2488 +#: builtin.c:2529 #, c-format msgid "or(%lf, %lf): negative values will give strange results" msgstr "" -#: builtin.c:2490 +#: builtin.c:2531 #, c-format msgid "or(%lf, %lf): fractional values will be truncated" msgstr "" -#: builtin.c:2519 builtin.c:2521 +#: builtin.c:2560 builtin.c:2562 msgid "xor: received non-numeric first argument" msgstr "" -#: builtin.c:2523 +#: builtin.c:2564 #, c-format msgid "xor(%lf, %lf): negative values will give strange results" msgstr "" -#: builtin.c:2525 +#: builtin.c:2566 #, c-format msgid "xor(%lf, %lf): fractional values will be truncated" msgstr "" -#: builtin.c:2553 +#: builtin.c:2594 msgid "compl: received non-numeric argument" msgstr "" -#: builtin.c:2555 +#: builtin.c:2596 #, c-format msgid "compl(%lf): negative value will give strange results" msgstr "" -#: builtin.c:2557 +#: builtin.c:2598 #, c-format msgid "compl(%lf): fractional value will be truncated" msgstr "" -#: builtin.c:2728 +#: builtin.c:2771 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "" -#: eval.c:262 +#: eval.c:266 #, c-format msgid "unknown nodetype %d" msgstr "" -#: eval.c:310 +#: eval.c:312 msgid "buffer overflow in genflags2str" msgstr "" -#: eval.c:555 +#: eval.c:647 #, c-format msgid "for loop: array `%s' changed size from %ld to %ld during loop execution" msgstr "" -#: eval.c:576 +#: eval.c:668 msgid "`break' outside a loop is not portable" msgstr "" -#: eval.c:580 +#: eval.c:672 msgid "`break' outside a loop is not allowed" msgstr "" -#: eval.c:597 +#: eval.c:689 msgid "`continue' outside a loop is not portable" msgstr "" -#: eval.c:601 +#: eval.c:693 msgid "`continue' outside a loop is not allowed" msgstr "" -#: eval.c:635 +#: eval.c:727 msgid "`next' cannot be called from a BEGIN rule" msgstr "" -#: eval.c:637 +#: eval.c:729 msgid "`next' cannot be called from an END rule" msgstr "" -#: eval.c:646 +#: eval.c:738 msgid "`nextfile' cannot be called from a BEGIN rule" msgstr "" -#: eval.c:648 +#: eval.c:740 msgid "`nextfile' cannot be called from an END rule" msgstr "" -#: eval.c:696 +#: eval.c:785 msgid "statement has no effect" msgstr "" -#: eval.c:731 eval.c:761 eval.c:1733 -#, c-format -msgid "reference to uninitialized variable `%s'" -msgstr "" - -#: eval.c:739 eval.c:1721 +#: eval.c:828 eval.c:1726 #, c-format msgid "can't use function name `%s' as variable or array" msgstr "" -#: eval.c:746 eval.c:752 +#: eval.c:835 eval.c:841 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "" -#: eval.c:810 eval.c:1728 profile.c:773 +#: eval.c:848 eval.c:907 eval.c:1732 eval.c:1742 profile.c:807 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "" -#: eval.c:910 +#: eval.c:858 eval.c:1752 +#, c-format +msgid "reference to uninitialized variable `%s'" +msgstr "" + +#: eval.c:1007 msgid "" "concatenation: side effects in one expression have changed the length of " "another!" msgstr "" -#: eval.c:935 +#: eval.c:1032 msgid "assignment used in conditional context" msgstr "" -#: eval.c:1026 +#: eval.c:1122 msgid "division by zero attempted" msgstr "" -#: eval.c:1041 +#: eval.c:1137 #, c-format msgid "division by zero attempted in `%%'" msgstr "" -#: eval.c:1056 profile.c:649 +#: eval.c:1152 profile.c:683 #, c-format msgid "illegal type (%s) in tree_eval" msgstr "" -#: eval.c:1232 +#: eval.c:1328 msgid "division by zero attempted in `/='" msgstr "" -#: eval.c:1250 +#: eval.c:1346 #, c-format msgid "division by zero attempted in `%%='" msgstr "" -#: eval.c:1510 -#, c-format -msgid "%s (from %s)" -msgstr "" - -#: eval.c:1569 +#: eval.c:1586 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "" -#: eval.c:1628 +#: eval.c:1633 #, c-format msgid "function `%s' not defined" msgstr "" -#: eval.c:1634 +#: eval.c:1639 #, c-format msgid "function %s called\n" msgstr "" -#: eval.c:1693 +#: eval.c:1698 msgid "" "\n" "\t# Function Call Stack:\n" "\n" msgstr "" -#: eval.c:1696 +#: eval.c:1701 msgid "\t# -- main --\n" msgstr "" -#: eval.c:1850 +#: eval.c:1867 msgid "attempt to field reference from non-numeric value" msgstr "" -#: eval.c:1852 +#: eval.c:1869 msgid "attempt to reference from null string" msgstr "" -#: eval.c:1858 +#: eval.c:1875 #, c-format msgid "attempt to access field %d" msgstr "" -#: eval.c:1874 -#, c-format -msgid "attempt to use scalar parameter `%s' as an array" -msgstr "" - -#: eval.c:1886 eval.c:1893 profile.c:865 +#: eval.c:1896 eval.c:1903 profile.c:900 msgid "assignment is not allowed to result of builtin function" msgstr "" -#: eval.c:1941 +#: eval.c:1951 msgid "`IGNORECASE' is a gawk extension" msgstr "" -#: eval.c:1970 +#: eval.c:1980 msgid "`BINMODE' is a gawk extension" msgstr "" -#: eval.c:2082 +#: eval.c:2092 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "" -#: eval.c:2160 +#: eval.c:2170 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "" @@ -883,32 +894,32 @@ msgstr "" msgid "extension: library `%s': cannot call function `%s' (%s)\n" msgstr "" -#: ext.c:181 +#: ext.c:183 msgid "Operation Not Supported" msgstr "" -#: field.c:321 +#: field.c:315 msgid "NF set to negative value" msgstr "" -#: field.c:819 +#: field.c:808 msgid "split: second argument is not an array" msgstr "" -#: field.c:854 +#: field.c:842 msgid "split: null string for third arg is a gawk extension" msgstr "" -#: field.c:906 +#: field.c:894 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "" -#: field.c:933 +#: field.c:921 #, c-format msgid "field %d in FIELDWIDTHS, must be > 0" msgstr "" -#: field.c:1006 +#: field.c:994 msgid "null string for `FS' is a gawk extension" msgstr "" @@ -952,7 +963,7 @@ msgstr "" msgid "%s: invalid option -- %c\n" msgstr "" -#: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:431 +#: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:434 #, c-format msgid "%s: option requires an argument -- %c\n" msgstr "" @@ -967,462 +978,462 @@ msgstr "" msgid "%s: option `-W %s' doesn't allow an argument\n" msgstr "" -#: io.c:257 +#: io.c:305 #, c-format msgid "cannot open file `%s' for reading (%s)" msgstr "" -#: io.c:344 +#: io.c:392 #, c-format msgid "close of fd %d (`%s') failed (%s)" msgstr "" -#: io.c:482 +#: io.c:530 #, c-format msgid "invalid tree type %s in redirect()" msgstr "" -#: io.c:488 +#: io.c:536 #, c-format msgid "expression in `%s' redirection only has numeric value" msgstr "" -#: io.c:494 +#: io.c:542 #, c-format msgid "expression for `%s' redirection has null string value" msgstr "" -#: io.c:499 +#: io.c:547 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" msgstr "" -#: io.c:521 +#: io.c:569 #, c-format msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" msgstr "" -#: io.c:573 +#: io.c:621 #, c-format msgid "can't open pipe `%s' for output (%s)" msgstr "" -#: io.c:582 +#: io.c:630 #, c-format msgid "can't open pipe `%s' for input (%s)" msgstr "" -#: io.c:595 +#: io.c:643 #, c-format msgid "can't open two way socket `%s' for input/output (%s)" msgstr "" -#: io.c:599 +#: io.c:647 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" msgstr "" -#: io.c:675 +#: io.c:723 #, c-format msgid "can't redirect from `%s' (%s)" msgstr "" -#: io.c:678 +#: io.c:726 #, c-format msgid "can't redirect to `%s' (%s)" msgstr "" -#: io.c:717 +#: io.c:765 msgid "" "reached system limit for open files: starting to multiplex file descriptors" msgstr "" -#: io.c:729 +#: io.c:777 #, c-format msgid "close of `%s' failed (%s)." msgstr "" -#: io.c:736 +#: io.c:784 msgid "too many pipes or input files open" msgstr "" -#: io.c:759 +#: io.c:807 msgid "close: second argument must be `to' or `from'" msgstr "" -#: io.c:773 +#: io.c:821 #, c-format msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "" -#: io.c:777 +#: io.c:825 msgid "close of redirection that was never opened" msgstr "" -#: io.c:804 +#: io.c:862 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" msgstr "" -#: io.c:866 +#: io.c:924 #, c-format msgid "failure status (%d) on pipe close of `%s' (%s)" msgstr "" -#: io.c:869 +#: io.c:927 #, c-format msgid "failure status (%d) on file close of `%s' (%s)" msgstr "" -#: io.c:888 +#: io.c:946 #, c-format msgid "no explicit close of socket `%s' provided" msgstr "" -#: io.c:891 +#: io.c:949 #, c-format msgid "no explicit close of co-process `%s' provided" msgstr "" -#: io.c:894 +#: io.c:952 #, c-format msgid "no explicit close of pipe `%s' provided" msgstr "" -#: io.c:897 +#: io.c:955 #, c-format msgid "no explicit close of file `%s' provided" msgstr "" -#: io.c:926 io.c:980 +#: io.c:984 io.c:1038 #, c-format msgid "error writing standard output (%s)" msgstr "" -#: io.c:930 io.c:984 +#: io.c:988 io.c:1042 #, c-format msgid "error writing standard error (%s)" msgstr "" -#: io.c:938 +#: io.c:996 #, c-format msgid "pipe flush of `%s' failed (%s)." msgstr "" -#: io.c:941 +#: io.c:999 #, c-format msgid "co-process flush of pipe to `%s' failed (%s)." msgstr "" -#: io.c:944 +#: io.c:1002 #, c-format msgid "file flush of `%s' failed (%s)." msgstr "" -#: io.c:1103 +#: io.c:1161 msgid "/inet/raw client not ready yet, sorry" msgstr "" -#: io.c:1105 io.c:1142 +#: io.c:1163 io.c:1200 msgid "only root may use `/inet/raw'." msgstr "" -#: io.c:1140 +#: io.c:1198 msgid "/inet/raw server not ready yet, sorry" msgstr "" -#: io.c:1230 +#: io.c:1288 #, c-format msgid "no (known) protocol supplied in special filename `%s'" msgstr "" -#: io.c:1248 +#: io.c:1306 #, c-format msgid "special file name `%s' is incomplete" msgstr "" -#: io.c:1260 +#: io.c:1318 #, c-format msgid "local port invalid in `%s'" msgstr "" -#: io.c:1272 +#: io.c:1330 msgid "must supply a remote hostname to `/inet'" msgstr "" -#: io.c:1287 +#: io.c:1345 msgid "must supply a remote port to `/inet'" msgstr "" -#: io.c:1293 +#: io.c:1351 #, c-format msgid "remote port invalid in `%s'" msgstr "" -#: io.c:1303 +#: io.c:1361 msgid "TCP/IP communications are not supported" msgstr "" -#: io.c:1312 io.c:1492 +#: io.c:1370 io.c:1551 #, c-format msgid "file `%s' is a directory" msgstr "" -#: io.c:1381 +#: io.c:1440 #, c-format msgid "use `PROCINFO[\"%s\"]' instead of `%s'" msgstr "" -#: io.c:1413 +#: io.c:1472 msgid "use `PROCINFO[...]' instead of `/dev/user'" msgstr "" -#: io.c:1478 io.c:1652 +#: io.c:1537 io.c:1711 #, c-format msgid "could not open `%s', mode `%s'" msgstr "" -#: io.c:1703 +#: io.c:1762 #, c-format msgid "close of master pty failed (%s)" msgstr "" -#: io.c:1705 io.c:1857 io.c:2009 +#: io.c:1764 io.c:1916 io.c:2068 #, c-format msgid "close of stdout in child failed (%s)" msgstr "" -#: io.c:1708 +#: io.c:1767 #, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" msgstr "" -#: io.c:1710 io.c:1862 +#: io.c:1769 io.c:1921 #, c-format msgid "close of stdin in child failed (%s)" msgstr "" -#: io.c:1713 +#: io.c:1772 #, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" msgstr "" -#: io.c:1715 io.c:1734 +#: io.c:1774 io.c:1793 #, c-format msgid "close of slave pty failed (%s)" msgstr "" -#: io.c:1808 io.c:1860 io.c:1990 io.c:2012 +#: io.c:1867 io.c:1919 io.c:2049 io.c:2071 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "" -#: io.c:1812 io.c:1865 +#: io.c:1871 io.c:1924 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "" -#: io.c:1829 io.c:2003 +#: io.c:1888 io.c:2062 msgid "restoring stdout in parent process failed\n" msgstr "" -#: io.c:1834 +#: io.c:1893 msgid "restoring stdin in parent process failed\n" msgstr "" -#: io.c:1868 io.c:2014 io.c:2025 +#: io.c:1927 io.c:2073 io.c:2084 #, c-format msgid "close of pipe failed (%s)" msgstr "" -#: io.c:1913 +#: io.c:1972 msgid "`|&' not supported" msgstr "" -#: io.c:1980 +#: io.c:2039 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "" -#: io.c:2021 +#: io.c:2080 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "" -#: io.c:2364 +#: io.c:2423 #, c-format msgid "data file `%s' is empty" msgstr "" -#: io.c:2407 io.c:2415 +#: io.c:2466 io.c:2474 msgid "could not allocate more input memory" msgstr "" -#: io.c:2540 io.c:2782 io.c:3046 +#: io.c:2832 io.c:2895 #, c-format msgid "error reading input file `%s': %s" msgstr "" -#: io.c:3281 +#: io.c:3020 msgid "multicharacter value of `RS' is a gawk extension" msgstr "" -#: main.c:322 +#: main.c:324 msgid "`-m[fr]' option irrelevant in gawk" msgstr "" -#: main.c:324 +#: main.c:326 msgid "-m option usage: `-m[fr] nnn'" msgstr "" -#: main.c:341 +#: main.c:343 #, c-format msgid "%s: option `-W %s' unrecognized, ignored\n" msgstr "" -#: main.c:378 +#: main.c:380 msgid "empty argument to `--source' ignored" msgstr "" -#: main.c:448 +#: main.c:451 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "" -#: main.c:453 +#: main.c:456 msgid "`--posix' overrides `--traditional'" msgstr "" -#: main.c:464 +#: main.c:467 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "" -#: main.c:468 +#: main.c:471 #, c-format msgid "running %s setuid root may be a security problem" msgstr "" -#: main.c:509 +#: main.c:512 #, c-format msgid "can't set binary mode on stdin (%s)" msgstr "" -#: main.c:512 +#: main.c:515 #, c-format msgid "can't set binary mode on stdout (%s)" msgstr "" -#: main.c:514 +#: main.c:517 #, c-format msgid "can't set binary mode on stderr (%s)" msgstr "" -#: main.c:544 +#: main.c:547 msgid "no program text at all!" msgstr "" -#: main.c:612 +#: main.c:620 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "" -#: main.c:614 +#: main.c:622 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "" -#: main.c:619 +#: main.c:627 msgid "POSIX options:\t\tGNU long options:\n" msgstr "" -#: main.c:620 +#: main.c:628 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "" -#: main.c:621 +#: main.c:629 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "" -#: main.c:622 +#: main.c:630 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "" -#: main.c:623 +#: main.c:631 msgid "\t-m[fr] val\n" msgstr "" -#: main.c:624 +#: main.c:632 msgid "\t-W compat\t\t--compat\n" msgstr "" -#: main.c:625 +#: main.c:633 msgid "\t-W copyleft\t\t--copyleft\n" msgstr "" -#: main.c:626 +#: main.c:634 msgid "\t-W copyright\t\t--copyright\n" msgstr "" -#: main.c:627 +#: main.c:635 msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n" msgstr "" -#: main.c:628 +#: main.c:636 msgid "\t-W gen-po\t\t--gen-po\n" msgstr "" -#: main.c:629 +#: main.c:637 msgid "\t-W help\t\t\t--help\n" msgstr "" -#: main.c:630 +#: main.c:638 msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n" msgstr "" -#: main.c:631 +#: main.c:639 msgid "\t-W lint-old\t\t--lint-old\n" msgstr "" -#: main.c:632 +#: main.c:640 msgid "\t-W non-decimal-data\t--non-decimal-data\n" msgstr "" -#: main.c:634 +#: main.c:642 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "" -#: main.c:637 +#: main.c:645 msgid "\t-W parsedebug\t\t--parsedebug\n" msgstr "" -#: main.c:639 +#: main.c:647 msgid "\t-W profile[=file]\t--profile[=file]\n" msgstr "" -#: main.c:640 +#: main.c:648 msgid "\t-W posix\t\t--posix\n" msgstr "" -#: main.c:641 +#: main.c:649 msgid "\t-W re-interval\t\t--re-interval\n" msgstr "" -#: main.c:642 +#: main.c:650 msgid "\t-W source=program-text\t--source=program-text\n" msgstr "" -#: main.c:643 +#: main.c:651 msgid "\t-W traditional\t\t--traditional\n" msgstr "" -#: main.c:644 +#: main.c:652 msgid "\t-W usage\t\t--usage\n" msgstr "" -#: main.c:645 +#: main.c:653 msgid "\t-W version\t\t--version\n" msgstr "" -#: main.c:649 +#: main.c:657 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" @@ -1430,21 +1441,21 @@ msgid "" "\n" msgstr "" -#: main.c:653 +#: main.c:661 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" "\n" msgstr "" -#: main.c:657 +#: main.c:665 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" "\tgawk -F: '{ print $1 }' /etc/passwd\n" msgstr "" -#: main.c:669 +#: main.c:682 #, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -1456,7 +1467,7 @@ msgid "" "\n" msgstr "" -#: main.c:677 +#: main.c:690 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -1465,53 +1476,53 @@ msgid "" "\n" msgstr "" -#: main.c:683 +#: main.c:696 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program; if not, write to the Free Software\n" "Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n" msgstr "" -#: main.c:713 +#: main.c:730 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "" -#: main.c:944 +#: main.c:956 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" "\n" msgstr "" -#: main.c:964 +#: main.c:976 #, c-format msgid "`%s' is not a legal variable name" msgstr "" -#: main.c:967 +#: main.c:979 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "" -#: main.c:995 +#: main.c:1012 msgid "floating point exception" msgstr "" -#: main.c:1002 +#: main.c:1019 msgid "fatal error: internal error" msgstr "" -#: main.c:1052 +#: main.c:1069 #, c-format msgid "no pre-opened fd %d" msgstr "" -#: main.c:1057 +#: main.c:1074 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "" -#: main.c:1080 main.c:1089 +#: main.c:1097 main.c:1106 #, c-format msgid "could not find groups: %s" msgstr "" @@ -1532,23 +1543,23 @@ msgstr "" msgid "fatal: " msgstr "" -#: node.c:59 node.c:66 node.c:75 node.c:89 node.c:116 +#: node.c:58 node.c:65 node.c:74 node.c:88 node.c:115 msgid "can't convert string to float" msgstr "" -#: node.c:357 +#: node.c:355 msgid "backslash at end of string" msgstr "" -#: node.c:544 +#: node.c:539 msgid "POSIX does not allow `\\x' escapes" msgstr "" -#: node.c:550 +#: node.c:545 msgid "no hex digits in `\\x' escape sequence" msgstr "" -#: node.c:584 +#: node.c:579 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "" @@ -1563,48 +1574,45 @@ msgstr "" msgid "could not open `%s' for writing: %s" msgstr "" -#: profile.c:409 -msgid "internal error: Node_var with null vname" +#: profile.c:449 +#, c-format +msgid "internal error: %s with null vname" msgstr "" -#: profile.c:471 +#: profile.c:512 msgid "# treated internally as `delete'" msgstr "" -#: profile.c:545 -msgid "internal error: Node_var_array with null vname" -msgstr "" - -#: profile.c:1127 +#: profile.c:1162 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "" -#: profile.c:1130 +#: profile.c:1165 msgid "" "\t# BEGIN block(s)\n" "\n" msgstr "" -#: profile.c:1140 +#: profile.c:1175 msgid "" "\t# Rule(s)\n" "\n" msgstr "" -#: profile.c:1146 +#: profile.c:1181 msgid "" "\t# END block(s)\n" "\n" msgstr "" -#: profile.c:1166 +#: profile.c:1201 msgid "" "\n" "\t# Functions, listed alphabetically\n" msgstr "" -#: profile.c:1376 +#: profile.c:1413 #, c-format msgid "unexpected type %s in prec_level" msgstr "" Binary files differ@@ -5,7 +5,8 @@ msgid "" msgstr "" "Project-Id-Version: gawk 3.1.1a\n" -"POT-Creation-Date: 2003-03-19 14:25+0200\n" +"Report-Msgid-Bugs-To: arnold@skeeve.com\n" +"POT-Creation-Date: 2003-07-07 11:20-0700\n" "PO-Revision-Date: 2002-04-28 21:46+0300\n" "Last-Translator: Eli Zaretskii <eliz@gnu.org>\n" "Language-Team: Hebrew <eliz@gnu.org>\n" @@ -13,64 +14,63 @@ msgstr "" "Content-Type: text/plain; charset=ISO-8859-8\n" "Content-Transfer-Encoding: 8-bit\n" -#: array.c:274 array.c:309 array.c:314 eval.c:494 +#: array.c:112 +#, c-format +msgid "attempt to use scalar parameter `%s' as an array" +msgstr "êøòî äéä åìéàë `%s' éøì÷ñ øèîøôá ùåîéù ïåéñð" + +#: array.c:113 #, c-format msgid "attempt to use scalar `%s' as array" msgstr "êøòîë `%s' øàì÷ñá éåâù ùåîéù" -#: array.c:338 +# This is not translated because it cannot be reworded in Hebrew +# without looking awkward. +#: array.c:151 +#, fuzzy, c-format +msgid "from %s" +msgstr "%s (from %s)" + +#: array.c:506 #, c-format msgid "reference to uninitialized element `%s[\"%s\"]'" msgstr "ìçåúî åðéàù `%s[\"%s\"]' èðîìàì äééðô" -#: array.c:344 +#: array.c:512 #, c-format msgid "subscript of array `%s' is null string" msgstr "`%s' êøòî ïééöîë ä÷éø úæåøçîá ùåîéù" -#: array.c:412 array.c:425 array.c:466 +#: array.c:609 #, c-format msgid "delete: index `%s' not in array `%s'" msgstr "`%s' ïééöî ìéëî åðéà `%s' êøòî :delete" -#: array.c:432 array.c:515 -#, c-format -msgid "delete: illegal use of variable `%s' as array" -msgstr "êøòîë `%s' äðúùîá éåâù ùåîéù :delete" - -#: array.c:633 +#: array.c:769 #, c-format msgid "%s: empty (null)\n" msgstr "%s: (ñôåàî) ÷éø\n" -#: array.c:638 +#: array.c:774 #, c-format msgid "%s: empty (zero)\n" msgstr "%s: (ä÷éø hash úìáè) ÷éø\n" -#: array.c:642 +#: array.c:778 #, c-format msgid "%s: table_size = %d, array_size = %d\n" msgstr "%s: table_size = %d, array_size = %d\n" -#: array.c:671 +#: array.c:807 #, c-format msgid "%s: is parameter\n" msgstr "øèîøô åðéä %s\n" -#: array.c:676 +#: array.c:812 #, c-format msgid "%s: array_ref to %s\n" msgstr "%s: %s-ì (array_ref) äéðôä\n" -#: array.c:975 -msgid "asort: first argument is not an array" -msgstr "êøòî åðéà ïåùàø èðîåâøà :asort" - -#: array.c:984 -msgid "asort: second argument is not an array" -msgstr "êøòî åðéà éðù èðîåâøà :asort" - #: awkgram.y:208 #, fuzzy, c-format msgid "%s blocks must have an action part" @@ -91,262 +91,275 @@ msgstr "äúøãâä úà úåðùì ïéà ,úéðáåî äéö÷ðåô äðéä `%s'" msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "äøòä åðéà êà ,C úôùá äøòä åîë äàøð `/%s/' éøìåâø éåèéá" -#: awkgram.y:340 +#: awkgram.y:340 awkgram.y:615 msgid "statement may have no effect" msgstr "úéìëú íåù äéäú àì äæ éåèéáìù ïëúé" -#: awkgram.y:431 awkgram.y:451 +#: awkgram.y:435 awkgram.y:455 #, fuzzy, c-format msgid "`%s' used in %s action" msgstr "END åà BEGIN ìù äìåòô úøãâäá `next'-á ùåîéù" -#: awkgram.y:444 awkgram.y:447 +#: awkgram.y:448 awkgram.y:451 msgid "`nextfile' is a gawk extension" msgstr "gawk-ì úéôéöôñ äáçøä åðéä `nextfile'" -#: awkgram.y:461 +#: awkgram.y:465 msgid "`return' used outside function context" msgstr "äéö÷ðåô ìù èñ÷èðå÷á àìù `return'-á ùåîéù" -#: awkgram.y:500 +#: awkgram.y:504 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" msgstr "`print \"\"' úåéäì íúñä ïî êéøö END åà BEGIN éììëá èåùô `print'" -#: awkgram.y:513 awkgram.y:520 +#: awkgram.y:517 awkgram.y:524 msgid "`delete array' is a gawk extension" msgstr "gawk-ì úéôéöôñ äáçøä åðéä `delete array'" -#: awkgram.y:528 awkgram.y:535 +#: awkgram.y:532 awkgram.y:539 #, fuzzy msgid "`delete(array)' is a non-portable tawk extension" msgstr "gawk-ì úéôéöôñ äáçøä åðéä `delete array'" -#: awkgram.y:578 +#: awkgram.y:583 +#, c-format +msgid "duplicate case values in switch body: %s" +msgstr "" + +#: awkgram.y:593 +msgid "Duplicate `default' detected in switch body" +msgstr "" + +#: awkgram.y:681 msgid "multistage two-way pipelines don't work" msgstr "íéãáåò íðéà íéáìù éáåøî íééðååéë-åã íé÷éôà" -#: awkgram.y:669 +#: awkgram.y:772 msgid "regular expression on right of assignment" msgstr "êøò úîùä úàøåä ìù ïéîé ãöá éøìåâø éåèéá" -#: awkgram.y:679 +#: awkgram.y:782 msgid "regular expression on left of `~' or `!~' operator" msgstr "`!~' åà `~' øåèøôåàì ìàîùî éøìåâø éåèéá" -#: awkgram.y:687 +#: awkgram.y:790 msgid "regular expression on right of comparison" msgstr "äàååùä ìù ïéîé ãöá éøìåâø éåèéá" -#: awkgram.y:754 +#: awkgram.y:857 msgid "non-redirected `getline' undefined inside END action" msgstr "END úìåòô êåúá øãâåî åðéà äééðôä àìì `getline'" -#: awkgram.y:781 +#: awkgram.y:884 msgid "call of `length' without parentheses is not portable" msgstr "úéìéáèøåô äðéà íééøâåñ àìì `length'-ì äàéø÷" -#: awkgram.y:784 +#: awkgram.y:887 msgid "call of `length' without parentheses is deprecated by POSIX" msgstr "POSIX ï÷úì ãåâéðá äðéä íééøâåñ àìì `length'-ì äàéø÷" -#: awkgram.y:835 +#: awkgram.y:940 +msgid "use of non-array as array" +msgstr "" + +#: awkgram.y:942 msgid "invalid subscript expression" msgstr "êøòî ïééöîá éåâù øéáçú ìòá éåèéá" -#: awkgram.y:1020 +#: awkgram.y:1140 #, fuzzy msgid "unexpected newline or end of string" msgstr "éåôö-éúìá íå÷îá äøåù óåñ" -#: awkgram.y:1115 +#: awkgram.y:1235 msgid "empty program text on command line" msgstr "äãå÷ôä úøåùî äìá÷úä ä÷éø úéðëú" -#: awkgram.y:1172 +#: awkgram.y:1292 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "åúàéø÷ íùì `%s' øå÷î õáå÷ úçéúôá (%s) äì÷ú" -#: awkgram.y:1207 +#: awkgram.y:1327 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "`%s' øå÷î õáå÷î äàéø÷á (%s) äì÷ú" -#: awkgram.y:1215 +#: awkgram.y:1335 #, 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 +#: awkgram.y:1537 awkgram.y:1647 awkgram.y:1665 awkgram.y:2015 awkgram.y:2100 msgid "source file does not end in newline" msgstr "äøåù-óåñ åúá íééúñî åðéà øå÷îä õáå÷" -#: awkgram.y:1481 +#: awkgram.y:1601 msgid "unterminated regexp ends with `\\' at end of file" msgstr "õáå÷ä óñá `\\'-á íééúñî øåîâ-éúìá éøìåâø éåèéá" -#: awkgram.y:1501 +#: awkgram.y:1621 msgid "unterminated regexp" msgstr "øåîâ-éúìá éøìåâø éåèéá" -#: awkgram.y:1504 +#: awkgram.y:1624 msgid "unterminated regexp at end of file" msgstr "õáå÷ä óåñá øåîâ-éúìá éøìåâø éåèéá" -#: awkgram.y:1571 +#: awkgram.y:1691 msgid "use of `\\ #...' line continuation is not portable" msgstr "éìéáèøåô åðéà äøåù êùîäì ïîéñë `\\ #...'-á ùåîéù" -#: awkgram.y:1583 +#: awkgram.y:1703 msgid "backslash not last character on line" msgstr "äøåùá ïåøçà åú åðéàù êåôä ïñëåì" -#: awkgram.y:1628 +#: awkgram.y:1748 msgid "POSIX does not allow operator `**='" msgstr "`**=' øåèøôåà äùøî åðéà POSIX" -#: awkgram.y:1630 +#: awkgram.y:1750 msgid "old awk does not support operator `**='" msgstr "`**=' øåèøôåàá êîåú åðéà ïùé awk" -#: awkgram.y:1639 +#: awkgram.y:1759 msgid "POSIX does not allow operator `**'" msgstr "`**' øåèøôåà äùøî åðéà POSIX" -#: awkgram.y:1641 +#: awkgram.y:1761 msgid "old awk does not support operator `**'" msgstr "`**' øåèøôåàá êîåú åðéà ïùé awk" -#: awkgram.y:1672 +#: awkgram.y:1792 msgid "operator `^=' is not supported in old awk" msgstr "ïùé awk-á êîúð åðéà `^=' øåèøôåà" -#: awkgram.y:1680 +#: awkgram.y:1800 msgid "operator `^' is not supported in old awk" msgstr "ïùé awk-á êîúð åðéà `^' øåèøôåà" -#: awkgram.y:1764 awkgram.y:1781 +#: awkgram.y:1884 awkgram.y:1901 msgid "unterminated string" msgstr "äøåîâ-éúìá úæåøçî" -#: awkgram.y:1941 +#: awkgram.y:2061 #, c-format msgid "invalid char '%c' in expression" msgstr "éåèéáá '%c' éåâù åú" -#: awkgram.y:2001 +#: awkgram.y:2121 #, c-format msgid "`%s' is a gawk extension" msgstr "gawk-ì úéôéöôñ äáçøä äðéä `%s'" -#: awkgram.y:2004 +#: awkgram.y:2124 #, c-format msgid "`%s' is a Bell Labs extension" msgstr "Bell úåãáòî úñøâá awk-ì úéôéöôñ äáçøä åðéä `%s'" -#: awkgram.y:2007 +#: awkgram.y:2127 #, c-format msgid "POSIX does not allow `%s'" msgstr "`%s' äùøî åðéà POSIX" -#: awkgram.y:2011 +#: awkgram.y:2131 #, c-format msgid "`%s' is not supported in old awk" msgstr "ïùé awk-á êîúð åðéà `%s'" -#: awkgram.y:2038 +#: awkgram.y:2158 msgid "`goto' considered harmful!\n" msgstr "!òø-òâô áùçð `goto'\n" -#: awkgram.y:2102 +#: awkgram.y:2220 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "íéèðîåâøà øôñîë %d ìá÷ì ìåëé åðéà %s" -#: awkgram.y:2121 awkgram.y:2124 +#: awkgram.y:2239 awkgram.y:2242 msgid "match: third argument is a gawk extension" msgstr "gawk-ì úéôéöôñ äáçøä åðéä `match' ìù éùéìù èðîåâøà" -#: awkgram.y:2137 +#: awkgram.y:2255 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "úéìëú íåù äì ïéà `%s' ìù ïåøçà èðîåâøàë äòåá÷ úæåøçî" -#: awkgram.y:2140 +#: awkgram.y:2258 #, fuzzy, c-format msgid "%s third parameter is not a changeable object" msgstr "éåðéù-øá è÷ééáåà åðéà `sub' ìù éùéìù èðîåâøà" -#: awkgram.y:2167 awkgram.y:2170 +#: awkgram.y:2285 awkgram.y:2288 msgid "close: second argument is a gawk extension" msgstr "gawk-ì úéôéöôñ äáçøä åðéä `close' ìù éðù èðîåâøà" -#: awkgram.y:2180 +#: awkgram.y:2298 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "èðîåâøà úîã÷áù ïåúçú-ó÷î ÷ìñì ùé :dcgettext(_\"...\")-á éåâù ùåîéù" -#: awkgram.y:2195 +#: awkgram.y:2313 msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "èðîåâøà úîã÷áù ïåúçú-ó÷î ÷ìñì ùé :dncgettext(_\"...\")-á éåâù ùåîéù" -#: awkgram.y:2266 +#: awkgram.y:2384 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "`%s' äéö÷ðåôá %d 'ñî øèîøôì ääæ ,`%s' ,%d 'ñî øèîøô ìù åîù" -#: awkgram.y:2299 +#: awkgram.y:2417 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "éìáåìâ äðúùî ìò ìéôàî `%s' äéö÷ðåôá `%s' øèîøô" -#: awkgram.y:2411 +#: awkgram.y:2529 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "äáéúë íùì `%s' úçéúôá (%s) äì÷ú" -#: awkgram.y:2412 profile.c:93 +#: awkgram.y:2530 profile.c:93 msgid "sending profile to standard error" msgstr "éð÷ú úåàéâù õåøòì çìùð òåöéá ìéôåøô" -#: awkgram.y:2442 +#: awkgram.y:2562 #, c-format msgid "%s: close failed (%s)" msgstr "`%s' úøéâñ úòá (%s) äì÷ú" -#: awkgram.y:2566 +#: awkgram.y:2684 msgid "shadow_funcs() called twice!" msgstr "!íééîòô äàø÷ð shadow_funcs()" -#: awkgram.y:2593 +#: awkgram.y:2711 msgid "there were shadowed variables." msgstr "" -#: awkgram.y:2666 +#: awkgram.y:2784 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "øèîøô íùë ùîùì ìåëé åðéà äéö÷ðåô íù :`%s' äéö÷ðåôá" -#: awkgram.y:2676 +#: awkgram.y:2794 #, c-format msgid "function name `%s' previously defined" msgstr "úøãâåî øáë `%s' íùá äéö÷ðåô" -#: awkgram.y:2827 awkgram.y:2833 +#: awkgram.y:2945 awkgram.y:2951 #, c-format msgid "function `%s' called but never defined" msgstr "úøãâåî äðéàù `%s' äéö÷ðåôì äàéø÷" -#: awkgram.y:2836 +#: awkgram.y:2954 #, c-format msgid "function `%s' defined but never called" msgstr "úàø÷ð àì êà ,äøãâåä `%s' äéö÷ðåô" -#: awkgram.y:2863 +#: awkgram.y:2981 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "éðàéìåá êøò áéðî %d 'ñî øèîøôë òåá÷ éøìåâø éåèéá" -#: awkgram.y:2876 +#: awkgram.y:2994 #, c-format msgid "" "function `%s' called with space between name and `(',\n" @@ -355,479 +368,482 @@ msgstr "" ",`(' ïéáì äîù ïéá íéçååø íò `%s' äéö÷ðåôì äàéø÷\n" "%s" -#: awkgram.y:2878 +#: awkgram.y:2996 #, fuzzy msgid "or used as a variable or an array" msgstr "êøòî åà äðúùîë `%s' äéö÷ðåô íùá ùîúùäì ïéà" -#: builtin.c:111 +#: builtin.c:137 #, c-format msgid "%s to \"%s\" failed (%s)" msgstr "%s é\"ò \"%s\"-ì äáéúëá (%s) äì÷ú" -#: builtin.c:112 +#: builtin.c:138 msgid "standard output" msgstr "úéèøãðèñ èìô úãéçé" -#: builtin.c:113 +#: builtin.c:139 msgid "reason unknown" msgstr "äòåãé-éúìá äáéñî" -#: builtin.c:126 +#: builtin.c:152 msgid "exp: received non-numeric argument" msgstr "øôñî åðéà èðîåâøà :exp" -#: builtin.c:132 +#: builtin.c:158 #, c-format msgid "exp: argument %g is out of range" msgstr "øúåîä íåçúá åðéà %g èðîåâøà :exp" -#: builtin.c:190 +#: builtin.c:216 #, c-format msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing" msgstr "äáéúëì àì ,äàéø÷ì çåúô `%s' ÷éôà :õöåçä ï÷åøì ïúéð àì :fflush" -#: builtin.c:193 +#: builtin.c:219 #, c-format msgid "fflush: cannot flush: file `%s' opened for reading, not writing" msgstr "äáéúëì àì ,äàéø÷ì çåúô `%s' õáå÷ :õöåçä ï÷åøì ïúéð àì :fflush" -#: builtin.c:205 +#: builtin.c:231 #, c-format msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "ìéá÷î êéìäú åà çåúô ÷éôà ,çåúô õáå÷ åðéà `%s' :fflush" -#: builtin.c:299 +#: builtin.c:325 msgid "index: received non-string first argument" msgstr "úæåøçî åðéà ïåùàø èðîåâøà :index" -#: builtin.c:301 +#: builtin.c:327 msgid "index: received non-string second argument" msgstr "úæåøçî åðéà éðù èðîåâøà :index" -#: builtin.c:411 +#: builtin.c:437 msgid "int: received non-numeric argument" msgstr "øôñî åðéà èðîåâøà :int" -#: builtin.c:428 +#: builtin.c:454 msgid "length: received non-string argument" msgstr "úæåøçî åðéà èðîåâøà :length" -#: builtin.c:444 +#: builtin.c:470 msgid "log: received non-numeric argument" msgstr "øôñî åðéà èðîåâøà :log" -#: builtin.c:447 +#: builtin.c:473 #, c-format msgid "log: received negative argument %g" msgstr "%g éìéìù èðîåâøà íò àø÷ð :log" -#: builtin.c:609 builtin.c:612 +#: builtin.c:635 builtin.c:638 msgid "must use `count$' on all formats or none" msgstr "ãçà óàá åà íéèîøåôä ìëá åà øúåî `count$'-á ùåîéù" -#: builtin.c:714 +#: builtin.c:740 msgid "`$' is not permitted in awk formats" msgstr "awk ìù íéèîøåôá ùåîéùì øåñà `$'" -#: builtin.c:720 +#: builtin.c:746 msgid "arg count with `$' must be > 0" msgstr "0-î ìåãâ úåéäì áééç `$' ãéì èðîåâøàä äðåî" -#: builtin.c:722 +#: builtin.c:748 #, fuzzy, c-format msgid "arg count %ld greater than total number of supplied arguments" msgstr "íéèðîåâøàä ìù ììåëä íøôñîî ìåãâ %d èðîåâøàä äðåî" -#: builtin.c:724 +#: builtin.c:750 msgid "`$' not permitted after period in format" msgstr "èîøåôá äãå÷ðä éøçà òéôåäì ìåëé åðéà `$'" -#: builtin.c:737 +#: builtin.c:763 msgid "no `$' supplied for positional field width or precision" msgstr "å÷åéã åà äãù áçåø ïééöîá èðîåâøàä äðåî øåáò `$' àöîð àì" -#: builtin.c:795 +#: builtin.c:821 msgid "`l' is meaningless in awk formats; ignored" msgstr "çðæåä ;awk ìù èîøåôá úåòîùî øñç åðéä `l'" -#: builtin.c:799 +#: builtin.c:825 msgid "`l' is not permitted in POSIX awk formats" msgstr "POSIX éô-ìò awk ìù èîøåôá òéôåäì ìåëé åðéà `l'" -#: builtin.c:810 +#: builtin.c:836 msgid "`L' is meaningless in awk formats; ignored" msgstr "çðæåä ;awk ìù èîøåôá úåòîùî øñç åðéä `L'" -#: builtin.c:814 +#: builtin.c:840 msgid "`L' is not permitted in POSIX awk formats" msgstr "POSIX éô-ìò awk ìù èîøåôá òéôåäì ìåëé åðéà `L'" -#: builtin.c:825 +#: builtin.c:851 msgid "`h' is meaningless in awk formats; ignored" msgstr "çðæåä ;awk ìù èîøåôá úåòîùî øñç åðéä `h'" -#: builtin.c:829 +#: builtin.c:855 msgid "`h' is not permitted in POSIX awk formats" msgstr "POSIX éô-ìò awk ìù èîøåôá òéôåäì ìåëé åðéà `h'" -#: builtin.c:1078 +#: builtin.c:1055 +#, c-format +msgid "[s]printf: value %g is out of range for `%%%c' format" +msgstr "" + +#: builtin.c:1108 msgid "not enough arguments to satisfy format string" msgstr "èîøåôä øåáò íéèðîåâøà ÷éôñî ïéà" -#: builtin.c:1080 +#: builtin.c:1110 msgid "^ ran out for this one" msgstr "^ íéèðîåâøàä éì åøîâð ïàë" -#: builtin.c:1085 +#: builtin.c:1115 msgid "[s]printf: format specifier does not have control letter" msgstr "äøîää úø÷á úåà ìéëî åðéà èîøåôä :[s]printf" -#: builtin.c:1088 +#: builtin.c:1118 msgid "too many arguments supplied for format string" msgstr "èîøåôä øåáò íéèðîåâøà éãî øúåé" -#: builtin.c:1154 builtin.c:1157 +#: builtin.c:1184 builtin.c:1187 msgid "printf: no arguments" msgstr "èðîåâøà óà ïéà :printf" -#: builtin.c:1181 +#: builtin.c:1211 msgid "sqrt: received non-numeric argument" msgstr "øôñî åðéà èðîåâøà :sqrt" -#: builtin.c:1185 +#: builtin.c:1215 #, c-format msgid "sqrt: called with negative argument %g" msgstr "%g éìéìù èðîåâøà íò àø÷ð :sqrt" -#: builtin.c:1207 +#: builtin.c:1238 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "1-á óìçåä ,éåâù åðéä %g äìçúä ïééöî :substr" -#: builtin.c:1212 +#: builtin.c:1243 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "õöå÷é ,íìù øôñî åðéàù, %g äìçúä ïééöî ìù åëøò :substr" -#: builtin.c:1231 -#, c-format -msgid "substr: length %g is <= 0" +#: builtin.c:1262 +#, fuzzy, c-format +msgid "substr: length %g is not >= 1" msgstr "0-î ìåãâ øôñî åððéà %g êøåà :substr" -#: builtin.c:1233 +#: builtin.c:1264 #, fuzzy, c-format -msgid "substr: length %g is < 0" +msgid "substr: length %g is not >= 0" msgstr "0-î ìåãâ øôñî åððéà %g êøåà :substr" -#: builtin.c:1240 +#: builtin.c:1271 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "õöå÷é ,íìù øôñî åðéàù ,%g êøåà :substr" -#: builtin.c:1245 +#: builtin.c:1276 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" msgstr "" -#: builtin.c:1257 +#: builtin.c:1288 msgid "substr: source string is zero length" msgstr "ñôà êøåàá äðéä øå÷îä úæåøçî :substr" -#: builtin.c:1263 +#: builtin.c:1294 #, fuzzy, c-format msgid "substr: start index %g is past end of string" msgstr "úæåøçîä óåñì øáòî åðéä %d äìçúä ïééöî :substr" -#: builtin.c:1271 +#: builtin.c:1302 #, fuzzy, c-format msgid "" "substr: length %g at start index %g exceeds length of first argument (%lu)" msgstr "" "%d äëøåàå %d ïééöîá äúìéçúù úæåøçî-úúì ÷éôñî åðéà (%d) úæåøçî êøåà :substr" -#: builtin.c:1306 +#: builtin.c:1337 msgid "strftime: received non-string first argument" msgstr "úæåøçî åðéà ïåùàø èðîåâøà :strftime" -#: builtin.c:1312 +#: builtin.c:1343 msgid "strftime: received empty format string" msgstr "ä÷éø èîøåô úæåøçî :strftime" -#: builtin.c:1321 +#: builtin.c:1352 msgid "strftime: received non-numeric second argument" msgstr "øôñî åðéà éðù èðîåâøà :strftime" -#: builtin.c:1384 +#: builtin.c:1415 msgid "mktime: received non-string argument" msgstr "úæåøçî åðéà èðîåâøà :mktime" -#: builtin.c:1429 +#: builtin.c:1460 msgid "system: received non-string argument" msgstr "úæåøçî åðéà èðîåâøà :system" -#: builtin.c:1573 +#: builtin.c:1581 eval.c:1883 +#, fuzzy, c-format +msgid "reference to uninitialized field `$%d'" +msgstr "`%s' ìçåúî-éúìá äðúùîì äéðôä" + +#: builtin.c:1608 msgid "tolower: received non-string argument" msgstr "úæåøçî åðéà èðîåâøà :tolower" -#: builtin.c:1622 +#: builtin.c:1657 msgid "toupper: received non-string argument" msgstr "úæåøçî åðéà èðîåâøà :toupper" -#: builtin.c:1667 +#: builtin.c:1702 msgid "atan2: received non-numeric first argument" msgstr "øôñî åðéà ïåùàø èðîåâøà :atan2" -#: builtin.c:1669 +#: builtin.c:1704 msgid "atan2: received non-numeric second argument" msgstr "øôñî åðéà éðù èðîåâøà :atan2" -#: builtin.c:1688 +#: builtin.c:1723 msgid "sin: received non-numeric argument" msgstr "øôñî åðéà èðîåâøà :sin" -#: builtin.c:1704 +#: builtin.c:1739 msgid "cos: received non-numeric argument" msgstr "øôñî åðéà èðîåâøà :cos" -#: builtin.c:1748 +#: builtin.c:1788 msgid "srand: received non-numeric argument" msgstr "øôñî åðéà èðîåâøà :srand" -#: builtin.c:1787 +#: builtin.c:1823 msgid "match: third argument is not an array" msgstr "êøòî åðéà éùéìù èðîåâøà :match" -#: builtin.c:2264 -msgid "gensub: 3rd argument of 0 treated as 1" +#: builtin.c:2307 +msgid "gensub: third argument of 0 treated as 1" msgstr "1-á óìçåä 0 åëøòù éùéìù èðîåâøà :gensub" -#: builtin.c:2375 builtin.c:2377 +#: builtin.c:2416 builtin.c:2418 msgid "lshift: received non-numeric first argument" msgstr "øôñî åðéà ïåùàø èðîåâøà :lshift" -#: builtin.c:2379 +#: builtin.c:2420 #, c-format msgid "lshift(%lf, %lf): negative values will give strange results" msgstr "úåéåôö-éúìá úåàöåú åáéðé íééìéìù íéëøò :lshift(%lf, %lf)" -#: builtin.c:2381 +#: builtin.c:2422 #, c-format msgid "lshift(%lf, %lf): fractional values will be truncated" msgstr "åööå÷é íéøåáù íéëøò :lshift(%lf, %lf)" -#: builtin.c:2383 +#: builtin.c:2424 #, c-format msgid "lshift(%lf, %lf): too large shift value will give strange results" msgstr "úåéåôö-éúìá úåàöåú áéðé éãî ìåãâ äææä øåòéù :lshift(%lf, %lf)" -#: builtin.c:2412 builtin.c:2414 +#: builtin.c:2453 builtin.c:2455 msgid "rshift: received non-numeric first argument" msgstr "øôñî åðéà ïåùàø èðîåâøà :rshift" -#: builtin.c:2416 +#: builtin.c:2457 #, c-format msgid "rshift(%lf, %lf): negative values will give strange results" msgstr "úåéåôö-éúìá úåàöåú åáéðé íééìéìù íéëøò :rshift(%lf, %lf)" -#: builtin.c:2418 +#: builtin.c:2459 #, c-format msgid "rshift(%lf, %lf): fractional values will be truncated" msgstr "åööå÷é íéøåáù íéëøò :rshift(%lf, %lf)" -#: builtin.c:2420 +#: builtin.c:2461 #, c-format msgid "rshift(%lf, %lf): too large shift value will give strange results" msgstr "úåéåôö-éúìá úåàöåú áéðé éãî ìåãâ äææä øåòéù :rshift(%lf, %lf)" -#: builtin.c:2449 builtin.c:2451 +#: builtin.c:2490 builtin.c:2492 msgid "and: received non-numeric first argument" msgstr "øôñî åðéà ïåùàø èðîåâøà :and" -#: builtin.c:2453 +#: builtin.c:2494 #, c-format msgid "and(%lf, %lf): negative values will give strange results" msgstr "úåéåôö-éúìá úåàöåú åáéðé íééìéìù íéëøò :and(%lf, %lf)" -#: builtin.c:2455 +#: builtin.c:2496 #, c-format msgid "and(%lf, %lf): fractional values will be truncated" msgstr "åööå÷é íéøåáù íéëøò :and(%lf, %lf)" -#: builtin.c:2484 builtin.c:2486 +#: builtin.c:2525 builtin.c:2527 msgid "or: received non-numeric first argument" msgstr "øôñî åðéà ïåùàø èðîåâøà :or" -#: builtin.c:2488 +#: builtin.c:2529 #, c-format msgid "or(%lf, %lf): negative values will give strange results" msgstr "úåéåôö-éúìá úåàöåú åáéðé íééìéìù íéëøò :or(%lf, %lf)" -#: builtin.c:2490 +#: builtin.c:2531 #, c-format msgid "or(%lf, %lf): fractional values will be truncated" msgstr "åööå÷é íéøåáù íéëøò :or(%lf, %lf)" -#: builtin.c:2519 builtin.c:2521 +#: builtin.c:2560 builtin.c:2562 msgid "xor: received non-numeric first argument" msgstr "øôñî åðéà ïåùàø èðîåâøà :xor" -#: builtin.c:2523 +#: builtin.c:2564 #, c-format msgid "xor(%lf, %lf): negative values will give strange results" msgstr "úåéåôö-éúìá úåàöåú åáéðé íééìéìù íéëøò :xor(%lf, %lf)" -#: builtin.c:2525 +#: builtin.c:2566 #, c-format msgid "xor(%lf, %lf): fractional values will be truncated" msgstr "åööå÷é íéøåáù íéëøò :xor(%lf, %lf)" -#: builtin.c:2553 +#: builtin.c:2594 msgid "compl: received non-numeric argument" msgstr "øôñî åðéà èðîåâøà :compl" -#: builtin.c:2555 +#: builtin.c:2596 #, c-format msgid "compl(%lf): negative value will give strange results" msgstr "úåéåôö-éúìá úåàöåú áéðé éìéìù êøò :compl(%lf)" -#: builtin.c:2557 +#: builtin.c:2598 #, c-format msgid "compl(%lf): fractional value will be truncated" msgstr "õöå÷é øåáù êøò :compl(%lf)" -#: builtin.c:2728 +#: builtin.c:2771 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "äðé÷ú íå÷éî úééøåâè÷ åðéà `%s' :dcgettext" -#: eval.c:262 +#: eval.c:266 #, c-format msgid "unknown nodetype %d" msgstr "%d ääåæî-éúìá âåñ ìòá node" -#: eval.c:310 +#: eval.c:312 msgid "buffer overflow in genflags2str" msgstr "genflags2str-á õöåç úùéìâ" -#: eval.c:555 +#: eval.c:647 #, fuzzy, c-format msgid "for loop: array `%s' changed size from %ld to %ld during loop execution" msgstr "(`%s' êøòî) äàìåìä òåöéá êìäîá %d-î %d-ì äðåù êøòî ìù åìãåâ :for úàìåì" -#: eval.c:576 +#: eval.c:668 msgid "`break' outside a loop is not portable" msgstr "éìéáèøåô åðéà äàìåìì õåçî `break'" -#: eval.c:580 +#: eval.c:672 msgid "`break' outside a loop is not allowed" msgstr "äàìåìì õåçî `break'-á ùîúùäì ïéà" -#: eval.c:597 +#: eval.c:689 msgid "`continue' outside a loop is not portable" msgstr "éìéáèøåô åðéà äàìåìì õåçî `continue'" -#: eval.c:601 +#: eval.c:693 msgid "`continue' outside a loop is not allowed" msgstr "äàìåìì õåçî `continue'-á ùîúùäì ïéà" -#: eval.c:635 +#: eval.c:727 msgid "`next' cannot be called from a BEGIN rule" msgstr "BEGIN éììë êåúî `next'-ì àåø÷ì ïéà" -#: eval.c:637 +#: eval.c:729 msgid "`next' cannot be called from an END rule" msgstr "END éììë êåúî `next'-ì àåø÷ì ïéà" -#: eval.c:646 +#: eval.c:738 msgid "`nextfile' cannot be called from a BEGIN rule" msgstr "BEGIN éììë êåúî `nextfile'-ì àåø÷ì ïéà" -#: eval.c:648 +#: eval.c:740 msgid "`nextfile' cannot be called from an END rule" msgstr "END éììë êåúî `nextfile'-ì àåø÷ì ïéà" -#: eval.c:696 +#: eval.c:785 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 +#: eval.c:828 eval.c:1726 #, c-format msgid "can't use function name `%s' as variable or array" msgstr "êøòî åà äðúùîë `%s' äéö÷ðåô íùá ùîúùäì ïéà" -#: eval.c:746 eval.c:752 +#: eval.c:835 eval.c:841 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "`%s' ìçåúî-éúìá èðîåâøàì äéðôä" -#: eval.c:810 eval.c:1728 profile.c:773 +#: eval.c:848 eval.c:907 eval.c:1732 eval.c:1742 profile.c:807 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "øàì÷ñ ùøåãä èñ÷èðå÷á `%s' êøòîá ùåîéù ïåéñð" -#: eval.c:910 +#: eval.c:858 eval.c:1752 +#, c-format +msgid "reference to uninitialized variable `%s'" +msgstr "`%s' ìçåúî-éúìá äðúùîì äéðôä" + +#: eval.c:1007 msgid "" "concatenation: side effects in one expression have changed the length of " "another!" msgstr "" "!øçà éåèéá ìù åëøåà éåðéùì åîøâ ãçà éåèéá áåùéç ìù éàåì-úåòôåú :concatenation" -#: eval.c:935 +#: eval.c:1032 msgid "assignment used in conditional context" msgstr "éàðú ìù èñ÷èðå÷á äîùäá ùåîéù" -#: eval.c:1026 +#: eval.c:1122 msgid "division by zero attempted" msgstr "ñôàá ä÷åìç ïåéñð" -#: eval.c:1041 +#: eval.c:1137 #, c-format msgid "division by zero attempted in `%%'" msgstr "`%%'-á ñôàá ä÷åìç ïåéñð" -#: eval.c:1056 profile.c:649 +#: eval.c:1152 profile.c:683 #, c-format msgid "illegal type (%s) in tree_eval" msgstr "tree_eval-á (%s) éåâù âåñ" -#: eval.c:1232 +#: eval.c:1328 msgid "division by zero attempted in `/='" msgstr "`/='-á ñôàá ä÷åìç ïåéñð" -#: eval.c:1250 +#: eval.c:1346 #, 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 +#: eval.c:1586 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "äúæøëäá øùàî íéèðîåâøà øúåé íò `%s' äéö÷ðåôì äàéø÷" -#: eval.c:1628 +#: eval.c:1633 #, c-format msgid "function `%s' not defined" msgstr "úøãâåî äðéà `%s' äéö÷ðåô" -#: eval.c:1634 +#: eval.c:1639 #, c-format msgid "function %s called\n" msgstr "`%s' äéö÷ðåôì äàéø÷\n" -#: eval.c:1693 +#: eval.c:1698 msgid "" "\n" "\t# Function Call Stack:\n" @@ -837,46 +853,41 @@ msgstr "" "\t# :úåéö÷ðåôì úåàéø÷ä úéðñçî\n" "\n" -#: eval.c:1696 +#: eval.c:1701 msgid "\t# -- main --\n" msgstr "\t# -- main --\n" -#: eval.c:1850 +#: eval.c:1867 msgid "attempt to field reference from non-numeric value" msgstr "øôñî åðéàù êøò úåòöîàá äãùì äéðôä ïåéñð" -#: eval.c:1852 +#: eval.c:1869 msgid "attempt to reference from null string" msgstr "ä÷éø úæåøçî úåòöîàá äãùì äéðôä ïåéñð" -#: eval.c:1858 +#: eval.c:1875 #, 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 +#: eval.c:1896 eval.c:1903 profile.c:900 msgid "assignment is not allowed to result of builtin function" msgstr "úéðáåî äéö÷ðåô ìù äàöåúá êøò áéöäì ïéà" -#: eval.c:1941 +#: eval.c:1951 msgid "`IGNORECASE' is a gawk extension" msgstr "gawk-ì úéôéöôñ äáçøä åðéä `IGNORECASE'" -#: eval.c:1970 +#: eval.c:1980 msgid "`BINMODE' is a gawk extension" msgstr "gawk-ì úéôéöôñ äáçøä åðéä `BINMODE'" -#: eval.c:2082 +#: eval.c:2092 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "äðé÷ú `%sFMT' úøãâä åðéà `%s'" -#: eval.c:2160 +#: eval.c:2170 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "`LINT'-ì êøò úîùä á÷ò `--lint' ìèáî" @@ -894,32 +905,32 @@ msgstr "`%s' úçéúô úòá (%s) äì÷ú äòøéà :extension\n" msgid "extension: library `%s': cannot call function `%s' (%s)\n" msgstr "`%s' äéøôñî `%s' äéö÷ðåôì äàéø÷á (%s) äì÷ú äòøéà :extension\n" -#: ext.c:181 +#: ext.c:183 msgid "Operation Not Supported" msgstr "úëîúð äðéà åæ äìåòô" -#: field.c:321 +#: field.c:315 msgid "NF set to negative value" msgstr "éìéìù êøò ìáé÷ NF" -#: field.c:819 +#: field.c:808 msgid "split: second argument is not an array" msgstr "êøòî åðéà `split' ìù éðùä èðîåâøàä" -#: field.c:854 +#: field.c:842 msgid "split: null string for third arg is a gawk extension" msgstr "gawk-ì úéôéöôñ äáçøä äðéä `split'-ì éùéìù èðåîâøàë úñôåàî úæåøçî" -#: field.c:906 +#: field.c:894 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "gawk-ì úéôéöôñ äáçøä åðéä `FIELDWIDTHS'" -#: field.c:933 +#: field.c:921 #, c-format msgid "field %d in FIELDWIDTHS, must be > 0" msgstr "0-î ìåãâ úåéäì áééç FIELDWIDTHS-á %d 'ñî äãù" -#: field.c:1006 +#: field.c:994 msgid "null string for `FS' is a gawk extension" msgstr "gawk-ì úéôéöôñ äáçøä äðéä `FS'-ë úñôåàî úæåøçî" @@ -967,7 +978,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:431 +#: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:434 #, c-format msgid "%s: option requires an argument -- %c\n" msgstr "%s: èðîåâøà áééçî ïééôàî -- %c\n" @@ -982,466 +993,466 @@ msgstr "%s úéðëú øåáò éòîùî-ãç åðéà `-W %s' ïééôàî\n" msgid "%s: option `-W %s' doesn't allow an argument\n" msgstr "%s úéðëú øåáò èðîåâøà ìá÷î åðéà `-W %s' ïééôàî\n" -#: io.c:257 +#: io.c:305 #, c-format msgid "cannot open file `%s' for reading (%s)" msgstr "åúàéø÷ íùì `%s' õáå÷ úçéúôá (%s) äì÷ú" -#: io.c:344 +#: io.c:392 #, c-format msgid "close of fd %d (`%s') failed (%s)" msgstr "(%d èìô/èì÷ õåøò) `%s' úøéâñá (%s) äì÷ú" -#: io.c:482 +#: io.c:530 #, c-format msgid "invalid tree type %s in redirect()" msgstr "redirect() äéö÷ðåôá %s éåâù õò âåñ" -#: io.c:488 +#: io.c:536 #, c-format msgid "expression in `%s' redirection only has numeric value" msgstr "ãáìá éøîåð êøò áéðî `%s' èìô/èì÷ úééðôäá éåèéá" -#: io.c:494 +#: io.c:542 #, c-format msgid "expression for `%s' redirection has null string value" msgstr "ä÷éø úæåøçî áéðî `%s' èìô/èì÷ úééðôäá éåèéá" -#: io.c:499 +#: io.c:547 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" msgstr "éâåì éåèéá ìù äàöåú úåéäì ìåìò `%s' õáå÷ íù `%s' èìô/èì÷ úééðôäá" -#: io.c:521 +#: io.c:569 #, c-format msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" msgstr "`%.*s' õáå÷ øåáò `>>'-á ïäå `>'-á ïä øúåéî ùåîéù" -#: io.c:573 +#: io.c:621 #, c-format msgid "can't open pipe `%s' for output (%s)" msgstr "èìô êøåöì `%s' ÷éôà úçéúôá (%s) äì÷ú" -#: io.c:582 +#: io.c:630 #, c-format msgid "can't open pipe `%s' for input (%s)" msgstr "èì÷ êøåöì `%s' ÷éôà úçéúôá (%s) äì÷ú" -#: io.c:595 +#: io.c:643 #, c-format msgid "can't open two way socket `%s' for input/output (%s)" msgstr "èìô/èì÷ êøåöì éðååéë-åã (socket) ò÷ùë `%s' úçéúôá (%s) äì÷ú" -#: io.c:599 +#: io.c:647 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" msgstr "èìô/èì÷ êøåöì éðååéë-åã (pipe) ÷éôàë `%s' úçéúôá (%s) äì÷ú" -#: io.c:675 +#: io.c:723 #, c-format msgid "can't redirect from `%s' (%s)" msgstr "`%s'-î äééðôäá (%s) äì÷ú" -#: io.c:678 +#: io.c:726 #, c-format msgid "can't redirect to `%s' (%s)" msgstr "`%s' ìà äééðôäá (%s) äì÷ú" -#: io.c:717 +#: io.c:765 msgid "" "reached system limit for open files: starting to multiplex file descriptors" msgstr "èìô/èì÷ éöåøò áåáéø úìéçú ;íéçåúô íéöá÷ øôñî ìù úëøòî úìáâîì äòâä" -#: io.c:729 +#: io.c:777 #, c-format msgid "close of `%s' failed (%s)." msgstr "`%s' úøéâñá (%s) äì÷ú" -#: io.c:736 +#: io.c:784 msgid "too many pipes or input files open" msgstr "úéðîæ-åá íéçåúô èì÷ éöá÷ åà (pipes) íé÷éôà éãî øúåé" -#: io.c:759 +#: io.c:807 msgid "close: second argument must be `to' or `from'" msgstr "`from' åà `to' úåéäì áééç `close' ìù éðùä èðîåâøàä" -#: io.c:773 +#: io.c:821 #, c-format msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "ìéá÷î êéìäú åà çåúô ÷éôà ,çåúô õáå÷ åðéà `%.*s' :close" -#: io.c:777 +#: io.c:825 msgid "close of redirection that was never opened" msgstr "íìåòî äçúôð àìù äééðôä úøéâñ" -#: io.c:804 +#: io.c:862 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" msgstr "çðæåä éðùä èðîåâøàä ,`|&' é\"ò äçúôð àì `%s' äééðôä" -#: io.c:866 +#: io.c:924 #, c-format msgid "failure status (%d) on pipe close of `%s' (%s)" msgstr "(%d äì÷ú ãå÷) `%s'-ì ÷éôà úøéâñá (%s) äì÷ú" -#: io.c:869 +#: io.c:927 #, c-format msgid "failure status (%d) on file close of `%s' (%s)" msgstr "(%d äì÷ú ãå÷) `%s' õáå÷ úøéâñá (%s) äì÷ú" -#: io.c:888 +#: io.c:946 #, c-format msgid "no explicit close of socket `%s' provided" msgstr "ùøåôîá øâñð àì (socket) `%s' ò÷ù" -#: io.c:891 +#: io.c:949 #, c-format msgid "no explicit close of co-process `%s' provided" msgstr "ùøåôîá øâñð àì (co-process) `%s' ìéá÷î êéìäú" -#: io.c:894 +#: io.c:952 #, c-format msgid "no explicit close of pipe `%s' provided" msgstr "ùøåôîá øâñð àì (pipe) `%s' ÷éôà" -#: io.c:897 +#: io.c:955 #, c-format msgid "no explicit close of file `%s' provided" msgstr "ùøåôîá øâñð àì `%s' õáå÷" -#: io.c:926 io.c:980 +#: io.c:984 io.c:1038 #, c-format msgid "error writing standard output (%s)" msgstr "éð÷ú èìô õåøòì äáéúëá (%s) äì÷ú" -#: io.c:930 io.c:984 +#: io.c:988 io.c:1042 #, c-format msgid "error writing standard error (%s)" msgstr "éð÷ú úåàéâù õåøòì äáéúëá (%s) äì÷ú" -#: io.c:938 +#: io.c:996 #, c-format msgid "pipe flush of `%s' failed (%s)." msgstr "`%s'-ì ÷éôà ìù õöåç ïå÷éøá (%s) äì÷ú" -#: io.c:941 +#: io.c:999 #, c-format msgid "co-process flush of pipe to `%s' failed (%s)." msgstr "`%s'-ì ìéá÷î êéìäú ÷éôà ìù õöåç ïå÷éøá (%s) äì÷ú" -#: io.c:944 +#: io.c:1002 #, c-format msgid "file flush of `%s' failed (%s)." msgstr "`%s' ìù õáå÷ éðåúð õöåç ïå÷éøá (%s) äì÷ú" -#: io.c:1103 +#: io.c:1161 msgid "/inet/raw client not ready yet, sorry" msgstr "ïëåî íøè /inet/raw çå÷ì ,íéøòèöî" -#: io.c:1105 io.c:1142 +#: io.c:1163 io.c:1200 msgid "only root may use `/inet/raw'." msgstr "ãáìá root ùîúùîì øúåî `inet/raw'-á ùåîéù" -#: io.c:1140 +#: io.c:1198 msgid "/inet/raw server not ready yet, sorry" msgstr "ïëåî íøè /inet/raw úøù ,íéøòèöî" -#: io.c:1230 +#: io.c:1288 #, c-format msgid "no (known) protocol supplied in special filename `%s'" msgstr "`%s' ãçåéî õáå÷ íùá ääåæî-éúìá åà øñç ìå÷åèåøô" -#: io.c:1248 +#: io.c:1306 #, c-format msgid "special file name `%s' is incomplete" msgstr "íìù åðéà `%s' ãçåéî õáå÷" -#: io.c:1260 +#: io.c:1318 #, c-format msgid "local port invalid in `%s'" msgstr "`%s'-á äéåâù úéîå÷î äàéöé" -#: io.c:1272 +#: io.c:1330 msgid "must supply a remote hostname to `/inet'" msgstr "`/inet' øåáò ÷çåøî çøàî-áùçî íù øéãâäì äáåç" -#: io.c:1287 +#: io.c:1345 msgid "must supply a remote port to `/inet'" msgstr "`/inet' øåáò ú÷çåøî äàéöé øéãâäì äáåç" -#: io.c:1293 +#: io.c:1351 #, c-format msgid "remote port invalid in `%s'" msgstr "`%s'-á äéåâù ú÷çåøî äàéöé" -#: io.c:1303 +#: io.c:1361 msgid "TCP/IP communications are not supported" msgstr "TCP/IP úøåù÷úá äëéîú ïéà" -#: io.c:1312 io.c:1492 +#: io.c:1370 io.c:1551 #, c-format msgid "file `%s' is a directory" msgstr "äé÷éú åðéä `%s' õáå÷" -#: io.c:1381 +#: io.c:1440 #, c-format msgid "use `PROCINFO[\"%s\"]' instead of `%s'" msgstr "`PROCINFO[\"%s\"]'-á ùîúùäì óéãò `%s' íå÷îá" -#: io.c:1413 +#: io.c:1472 msgid "use `PROCINFO[...]' instead of `/dev/user'" msgstr "`/dev/user' éðô-ìò óéãò `PROCINFO[...]'-á ùåîéù" # This probably sounds nonsensical in Hebrew, but what can I do, # given the original message text? -#: io.c:1478 io.c:1652 +#: io.c:1537 io.c:1711 #, c-format msgid "could not open `%s', mode `%s'" msgstr "`%s' øåáò `%s' äìåòô ïôåà úçéúôá ïåìùë" -#: io.c:1703 +#: io.c:1762 #, fuzzy, c-format msgid "close of master pty failed (%s)" msgstr "÷éôà úøéâñá (%s) äì÷ú" -#: io.c:1705 io.c:1857 io.c:2009 +#: io.c:1764 io.c:1916 io.c:2068 #, c-format msgid "close of stdout in child failed (%s)" msgstr "úá-úéðëúá stdout úøéâñá (%s) äì÷ú" -#: io.c:1708 +#: io.c:1767 #, fuzzy, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" msgstr "úá-úéðëúá stdout-ì ÷éôà ìåôëùá (dup: %s) äì÷ú" -#: io.c:1710 io.c:1862 +#: io.c:1769 io.c:1921 #, c-format msgid "close of stdin in child failed (%s)" msgstr "úá-úéðëúá stdin úøéâñá (%s) äì÷ú" -#: io.c:1713 +#: io.c:1772 #, fuzzy, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" msgstr "úá-úéðëúá stdin-ì ÷éôà ìåôëùá (dup: %s) äì÷ú" -#: io.c:1715 io.c:1734 +#: io.c:1774 io.c:1793 #, fuzzy, c-format msgid "close of slave pty failed (%s)" msgstr "÷éôà úøéâñá (%s) äì÷ú" -#: io.c:1808 io.c:1860 io.c:1990 io.c:2012 +#: io.c:1867 io.c:1919 io.c:2049 io.c:2071 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "úá-úéðëúá stdout-ì ÷éôà ìåôëùá (dup: %s) äì÷ú" -#: io.c:1812 io.c:1865 +#: io.c:1871 io.c:1924 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "úá-úéðëúá stdin-ì ÷éôà ìåôëùá (dup: %s) äì÷ú" -#: io.c:1829 io.c:2003 +#: io.c:1888 io.c:2062 msgid "restoring stdout in parent process failed\n" msgstr "áà-úéðëúá stdout ÷éôà øåæçùá äì÷ú\n" -#: io.c:1834 +#: io.c:1893 msgid "restoring stdin in parent process failed\n" msgstr "áà-úéðëúá stdin ÷éôà øåæçùá äì÷ú\n" -#: io.c:1868 io.c:2014 io.c:2025 +#: io.c:1927 io.c:2073 io.c:2084 #, c-format msgid "close of pipe failed (%s)" msgstr "÷éôà úøéâñá (%s) äì÷ú" -#: io.c:1913 +#: io.c:1972 msgid "`|&' not supported" msgstr "`|&'-á äëéîú ïéà" -#: io.c:1980 +#: io.c:2039 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "`%s' ÷éôà úçéúôá (%s) äì÷ú" -#: io.c:2021 +#: io.c:2080 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "`%s' úá-úéðëúì êéìäú úøéöéá (fork: %s) äì÷ú" -#: io.c:2364 +#: io.c:2423 #, c-format msgid "data file `%s' is empty" msgstr "÷éø åðéä `%s' íéðåúð õáå÷" -#: io.c:2407 io.c:2415 +#: io.c:2466 io.c:2474 msgid "could not allocate more input memory" msgstr "" -#: io.c:2540 io.c:2782 io.c:3046 +#: io.c:2832 io.c:2895 #, c-format msgid "error reading input file `%s': %s" msgstr "`%s' õáå÷ úàéø÷á (%s) äì÷ú" -#: io.c:3281 +#: io.c:3020 msgid "multicharacter value of `RS' is a gawk extension" msgstr "gawk-ì úéôéöôñ äáçøä äðéä `RS' ìù êøòá íéåú øôñîá äëéîú" -#: main.c:322 +#: main.c:324 msgid "`-m[fr]' option irrelevant in gawk" msgstr "gawk øåáò éèðååìø åðéà `-m[fr]' ïééôàî" -#: main.c:324 +#: main.c:326 msgid "-m option usage: `-m[fr] nnn'" msgstr "`-m[fr] nnn' :-m ïééôàîá ùåîéù ïôåà" -#: main.c:341 +#: main.c:343 #, c-format msgid "%s: option `-W %s' unrecognized, ignored\n" msgstr "çðæåä ,%s úéðëú øåáò øëåî åðéà `-W %s' ïééôàî\n" -#: main.c:378 +#: main.c:380 msgid "empty argument to `--source' ignored" msgstr "çðæåä `--source'-ì ÷éø èðîåâøà" -#: main.c:448 +#: main.c:451 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "`--posix' ìéòôî :øãâåî `POSIXLY_CORRECT' äáéáñ äðúùî" -#: main.c:453 +#: main.c:456 msgid "`--posix' overrides `--traditional'" msgstr "`--traditional' ìò øáåâ `--posix'" -#: main.c:464 +#: main.c:467 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "`--non-decimal-data' ìò øáåâ `--posix'/`--traditional'" -#: main.c:468 +#: main.c:471 #, c-format msgid "running %s setuid root may be a security problem" msgstr "òãéî úçèáàá òåâôì äìåìò setuid root-ë %s úöøä" -#: main.c:509 +#: main.c:512 #, fuzzy, c-format msgid "can't set binary mode on stdin (%s)" msgstr "stdin úìåòô ïôåà úòéá÷á (%s) äì÷ú" -#: main.c:512 +#: main.c:515 #, fuzzy, c-format msgid "can't set binary mode on stdout (%s)" msgstr "stdout úìåòô ïôåà úòéá÷á (%s) äì÷ú" -#: main.c:514 +#: main.c:517 #, fuzzy, c-format msgid "can't set binary mode on stderr (%s)" msgstr "stderr úìåòô ïôåà úòéá÷á (%s) äì÷ú" -#: main.c:544 +#: main.c:547 msgid "no program text at all!" msgstr "!ììë àöîðá äéä àì úéðëú ìù èñ÷è" -#: main.c:612 +#: main.c:620 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "" "%s [GNU åà POSIX ïåðâñá íéðééôàî] -f úéðëú-íù [--] õáå÷-íù ... :ùåîéù ïôåà\n" -#: main.c:614 +#: main.c:622 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "" "%s [GNU åà POSIX ïåðâñá íéðééôàî] [--] %cúéðëú%c õáå÷-íù ... :ùåîéù ïôåà\n" -#: main.c:619 +#: main.c:627 msgid "POSIX options:\t\tGNU long options:\n" msgstr ":POSIX éðééôàî\t\t:íéëåøà GNU éðééôàî\n" -#: main.c:620 +#: main.c:628 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "\t-f úéðëú-õáå÷\t\t--file=úéðëú-õáå÷\n" -#: main.c:621 +#: main.c:629 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "\t-F úåãù-ãéøôî\t\t--field-separator=úåãù-ãéøôî\n" -#: main.c:622 +#: main.c:630 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "\t-v äðúùî=êøò\t\t--assign=äðúùî=êøò\n" -#: main.c:623 +#: main.c:631 msgid "\t-m[fr] val\n" msgstr "\t-m[fr] êøò\n" -#: main.c:624 +#: main.c:632 msgid "\t-W compat\t\t--compat\n" msgstr "\t-W compat\t\t--compat\n" -#: main.c:625 +#: main.c:633 msgid "\t-W copyleft\t\t--copyleft\n" msgstr "\t-W copyleft\t\t--copyleft\n" -#: main.c:626 +#: main.c:634 msgid "\t-W copyright\t\t--copyright\n" msgstr "\t-W copyright\t\t--copyright\n" -#: main.c:627 +#: main.c:635 msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n" msgstr "\t-W dump-variables[=õáå÷-íù]\t--dump-variables[=õáå÷-íù]\n" -#: main.c:628 +#: main.c:636 msgid "\t-W gen-po\t\t--gen-po\n" msgstr "\t-W gen-po\t\t--gen-po\n" -#: main.c:629 +#: main.c:637 msgid "\t-W help\t\t\t--help\n" msgstr "\t-W help\t\t\t--help\n" -#: main.c:630 +#: main.c:638 msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n" msgstr "\t-W lint[=fatal]\t\t--lint[=fatal]\n" -#: main.c:631 +#: main.c:639 msgid "\t-W lint-old\t\t--lint-old\n" msgstr "\t-W lint-old\t\t--lint-old\n" -#: main.c:632 +#: main.c:640 msgid "\t-W non-decimal-data\t--non-decimal-data\n" msgstr "\t-W non-decimal-data\t--non-decimal-data\n" -#: main.c:634 +#: main.c:642 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "\t-W nostalgia\t\t--nostalgia\n" -#: main.c:637 +#: main.c:645 msgid "\t-W parsedebug\t\t--parsedebug\n" msgstr "\t-W parsedebug\t\t--parsedebug\n" -#: main.c:639 +#: main.c:647 msgid "\t-W profile[=file]\t--profile[=file]\n" msgstr "\t-W profile[=õáå÷-íù]\t--profile[=õáå÷-íù]\n" -#: main.c:640 +#: main.c:648 msgid "\t-W posix\t\t--posix\n" msgstr "\t-W posix\t\t--posix\n" -#: main.c:641 +#: main.c:649 msgid "\t-W re-interval\t\t--re-interval\n" msgstr "\t-W re-interval\t\t--re-interval\n" -#: main.c:642 +#: main.c:650 msgid "\t-W source=program-text\t--source=program-text\n" msgstr "\t-W source=úéðëú-èñ÷è\t--source=úéðëú-èñ÷è\n" -#: main.c:643 +#: main.c:651 msgid "\t-W traditional\t\t--traditional\n" msgstr "\t-W traditional\t\t--traditional\n" -#: main.c:644 +#: main.c:652 msgid "\t-W usage\t\t--usage\n" msgstr "\t-W usage\t\t--usage\n" -#: main.c:645 +#: main.c:653 msgid "\t-W version\t\t--version\n" msgstr "\t-W version\t\t--version\n" -#: main.c:649 +#: main.c:657 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" @@ -1453,7 +1464,7 @@ msgstr "" " .ñôãåîä êéøãîá `Reporting Problems and Bugs' ä÷ñô\n" "\n" -#: main.c:653 +#: main.c:661 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" @@ -1462,7 +1473,7 @@ msgstr "" ".èñ÷è úåéðáú ìù ãåáéòå äé÷øñì äôù åðéä gawk\n" ".éð÷ú èìôì áúåëå éð÷ú èì÷ õåøò àøå÷ àåä ìãçî úøéøáë\n" -#: main.c:657 +#: main.c:665 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" @@ -1472,7 +1483,7 @@ msgstr "" "\tgawk '{ sum += $1 }; END { print sum }' file\n" "\tgawk -F: '{ print $1 }' /etc/passwd\n" -#: main.c:669 +#: main.c:682 #, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -1490,7 +1501,7 @@ msgstr "" " íàå ,ïåéùøä ìù 2 àñøâá íà ;Free Software Foundation\n" " .øúåé úøçåàî àñøâ ìëá (íëì äøåîùä äéöôåàë)\n" -#: main.c:677 +#: main.c:690 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -1503,7 +1514,7 @@ msgstr "" ",íéèøôì .úîéåñî úéìëú åæéàì äîàúä åà úåøéçñ ìù\n" " .GNU General Public License-á åðééò àðà\n" -#: main.c:683 +#: main.c:696 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program; if not, write to the Free Software\n" @@ -1513,48 +1524,48 @@ msgstr "" "Free Software Foundation, Inc.-ì åáúë àðà ,åúåà íúìáé÷ àì íà\n" ".59 Temple Place - Suite 330, Boston, MA 02111-1307, USA\n" -#: main.c:713 +#: main.c:730 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "awk ìù POSIX úñøâá TAB úåéäì FS-ì íøåâ åðéà -Ft" -#: main.c:944 +#: main.c:956 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" "\n" msgstr "" -#: main.c:964 +#: main.c:976 #, c-format msgid "`%s' is not a legal variable name" msgstr "" -#: main.c:967 +#: main.c:979 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "" -#: main.c:995 +#: main.c:1012 msgid "floating point exception" msgstr "äôö äãå÷ð éáåùéçá äâéøç" -#: main.c:1002 +#: main.c:1019 msgid "fatal error: internal error" msgstr "úéîéðô äðëú úàéâù :äøåîç äì÷ú" # FIXME: I wonder how many people will understand what "fd 2" means. -#: main.c:1052 +#: main.c:1069 #, c-format msgid "no pre-opened fd %d" msgstr "ùàøî çåúô åðéà %d èìô/èì÷ õåøò" # FIXME: /dev/null might not be known to all. -#: main.c:1057 +#: main.c:1074 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "/dev/null-ì %d èìô/èì÷ õåøò çåúôì ïúéð àì" -#: main.c:1080 main.c:1089 +#: main.c:1097 main.c:1106 #, c-format msgid "could not find groups: %s" msgstr "%s :úëøòîá íéùîúùî úåöåá÷ ìò òãéî ïéà" @@ -1579,23 +1590,23 @@ msgstr "error: " msgid "fatal: " msgstr "fatal: " -#: node.c:59 node.c:66 node.c:75 node.c:89 node.c:116 +#: node.c:58 node.c:65 node.c:74 node.c:88 node.c:115 msgid "can't convert string to float" msgstr "øôñîì äøîäì úðúéð äðéà úæåøçî" -#: node.c:357 +#: node.c:355 msgid "backslash at end of string" msgstr "úæåøçî óåñá êåôä ïñëåì" -#: node.c:544 +#: node.c:539 msgid "POSIX does not allow `\\x' escapes" msgstr "`\\x' âåñî äø÷á úåøãñ äùøî åðéà POSIX ï÷ú" -#: node.c:550 +#: node.c:545 msgid "no hex digits in `\\x' escape sequence" msgstr "`\\x' äø÷á úøãñá úåéìîéöãñ÷ä úåøôñá ùîúùäì ïéà" -#: node.c:584 +#: node.c:579 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "éìåìéî åúë ìôåè `\\%c' äø÷á úøãñá `%c' åú" @@ -1610,24 +1621,21 @@ msgstr "%s %s `%s' øåáò close-on-exec ïééôàî úìòôäá (fcntl: %s) äì÷ú" msgid "could not open `%s' for writing: %s" msgstr "äáéúë êøåöì `%s' úçéúô úòá (%s) äì÷ú" -#: profile.c:409 -msgid "internal error: Node_var with null vname" +#: profile.c:449 +#, fuzzy, c-format +msgid "internal error: %s with null vname" msgstr "ñôåàî åìù vname-äù Node_var :úéîéðô äðëú úàéâù" -#: profile.c:471 +#: profile.c:512 msgid "# treated internally as `delete'" msgstr "" -#: profile.c:545 -msgid "internal error: Node_var_array with null vname" -msgstr "ñôåàî åìù vname-äù Node_var_array :úéîéðô äðëú úàéâù" - -#: profile.c:1127 +#: profile.c:1162 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "\t# %s êéøàúî gawk ìù ìéôåøô\n" -#: profile.c:1130 +#: profile.c:1165 msgid "" "\t# BEGIN block(s)\n" "\n" @@ -1635,7 +1643,7 @@ msgstr "" "\t# BEGIN ÷åìá\n" "\n" -#: profile.c:1140 +#: profile.c:1175 msgid "" "\t# Rule(s)\n" "\n" @@ -1643,7 +1651,7 @@ msgstr "" "\t# (íé)ììë\n" "\n" -#: profile.c:1146 +#: profile.c:1181 msgid "" "\t# END block(s)\n" "\n" @@ -1651,7 +1659,7 @@ msgstr "" "\t# END ÷åìá\n" "\n" -#: profile.c:1166 +#: profile.c:1201 msgid "" "\n" "\t# Functions, listed alphabetically\n" @@ -1659,7 +1667,7 @@ msgstr "" "\n" "\t# úéá-óìà øãñá ,úåéö÷ðåô\n" -#: profile.c:1376 +#: profile.c:1413 #, c-format msgid "unexpected type %s in prec_level" msgstr "prec_level-á %s éåâù âåñ" @@ -1741,6 +1749,32 @@ msgstr "âåæ-ïá åì ïéàù \\) åà )" msgid "No previous regular expression" msgstr "íãå÷ éøìåâø éåèéá ïéà" +#, fuzzy +#~ msgid "substr: length %g is < 0" +#~ msgstr "0-î ìåãâ øôñî åððéà %g êøåà :substr" + +#~ msgid "delete: illegal use of variable `%s' as array" +#~ msgstr "êøòîë `%s' äðúùîá éåâù ùåîéù :delete" + +#, fuzzy +#~ msgid "%s: gvar_ref to %s\n" +#~ msgstr "%s: %s-ì (array_ref) äéðôä\n" + +#~ msgid "asort: first argument is not an array" +#~ msgstr "êøòî åðéà ïåùàø èðîåâøà :asort" + +#~ msgid "asort: second argument is not an array" +#~ msgstr "êøòî åðéà éðù èðîåâøà :asort" + +#, fuzzy +#~ msgid "" +#~ "attempt to use array parameter `%s' that was passed from global scalar `%" +#~ "s'" +#~ msgstr "êøòî äéä åìéàë `%s' éøì÷ñ øèîøôá ùåîéù ïåéñð" + +#~ msgid "internal error: Node_var_array with null vname" +#~ msgstr "ñôåàî åìù vname-äù Node_var_array :úéîéðô äðëú úàéâù" + #~ msgid "BEGIN blocks must have an action part" #~ msgstr "äìåòô úøãâä ìåìëì áééç BEGIN ÷åìá" diff --git a/po/insert-header.sin b/po/insert-header.sin new file mode 100644 index 00000000..b26de01f --- /dev/null +++ b/po/insert-header.sin @@ -0,0 +1,23 @@ +# Sed script that inserts the file called HEADER before the header entry. +# +# At each occurrence of a line starting with "msgid ", we execute the following +# commands. At the first occurrence, insert the file. At the following +# occurrences, do nothing. The distinction between the first and the following +# occurrences is achieved by looking at the hold space. +/^msgid /{ +x +# Test if the hold space is empty. +s/m/m/ +ta +# Yes it was empty. First occurrence. Read the file. +r HEADER +# Output the file's contents by reading the next line. But don't lose the +# current line while doing this. +g +N +bb +:a +# The hold space was nonempty. Following occurrences. Do nothing. +x +:b +} Binary files differ@@ -1,76 +1,74 @@ # Italian messages for GNU Awk # Copyright (C) 2002-2003 Free Software Foundation, Inc. -# Antonio Colombo <azc10@amdahl.com>, 2003. +# Antonio Colombo <azc10@it.ftsi.fujitsu.com>, 2003. # msgid "" msgstr "" "Project-Id-Version: gawk 3.1.35\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" +"Report-Msgid-Bugs-To: arnold@skeeve.com\n" +"POT-Creation-Date: 2003-07-07 11:20-0700\n" +"PO-Revision-Date: 2003-06-10 11:11+0100\n" +"Last-Translator: Antonio Colombo <azc10@it.ftsi.fujitsu.com>\n" "Language-Team: Italian <it@li.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-8\n" "Content-Transfer-Encoding: 8-bit\n" -#: array.c:274 array.c:309 array.c:314 eval.c:494 +#: array.c:112 +#, c-format +msgid "attempt to use scalar parameter `%s' as an array" +msgstr "tentativo di unare il parametro scalare `%s' come un vettore" + +#: array.c:113 #, c-format msgid "attempt to use scalar `%s' as array" msgstr "tentativo di usare scalare '%s' come vettore" -#: array.c:338 +#: array.c:151 +#, c-format +msgid "from %s" +msgstr "da %s" + +#: array.c:506 #, c-format msgid "reference to uninitialized element `%s[\"%s\"]'" msgstr "referenza a elemento non inizializzato `%s[\"%s\"]'" -#: array.c:344 +#: array.c:512 #, c-format msgid "subscript of array `%s' is null string" msgstr "l'indice del vettore '%s' è una stringa nulla" -#: array.c:412 array.c:425 array.c:466 +#: array.c:609 #, c-format msgid "delete: index `%s' not in array `%s'" msgstr "delete: indice `%s' non presente nel vettore `%s'" -#: 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 +#: array.c:769 #, c-format msgid "%s: empty (null)\n" msgstr "%s: vuoto (nullo)\n" -#: array.c:638 +#: array.c:774 #, c-format msgid "%s: empty (zero)\n" msgstr "%s: vuoto (zero)\n" -#: array.c:642 +#: array.c:778 #, c-format msgid "%s: table_size = %d, array_size = %d\n" msgstr "%s: dimensione_tabella = %d, dimensione_vettore = %d\n" -#: array.c:671 +#: array.c:807 #, c-format msgid "%s: is parameter\n" msgstr "%s: è parametro\n" -#: array.c:676 +#: array.c:812 #, c-format msgid "%s: array_ref to %s\n" msgstr "%s: referenza_vettoriale a %s\n" -#: array.c:975 -msgid "asort: first argument is not an array" -msgstr "asort: il primo argomento non è un vettore" - -#: array.c:984 -msgid "asort: second argument is not an array" -msgstr "asort: il secondo argomento non è un vettore" - #: awkgram.y:208 #, c-format msgid "%s blocks must have an action part" @@ -90,264 +88,277 @@ msgstr "`%s' è una funzione interna, non si può ridefinire" msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "costante 'regexp' `/%s/' sembra un commento commento C, ma non lo è" -#: awkgram.y:340 +#: awkgram.y:340 awkgram.y:615 msgid "statement may have no effect" msgstr "istruzione che può non aver alcun effetto" -#: awkgram.y:431 awkgram.y:451 +#: awkgram.y:435 awkgram.y:455 #, c-format msgid "`%s' used in %s action" msgstr "`%s' usato in 'azione' %s" -#: awkgram.y:444 awkgram.y:447 +#: awkgram.y:448 awkgram.y:451 msgid "`nextfile' is a gawk extension" msgstr "`nextfile' è un'estensione gawk" -#: awkgram.y:461 +#: awkgram.y:465 msgid "`return' used outside function context" msgstr "`return' usato fuori da una funzione" -#: awkgram.y:500 +#: awkgram.y:504 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" msgstr "`print' da solo in BEGIN o END dovrebbe forse essere `print \"\"'" -#: awkgram.y:513 awkgram.y:520 +#: awkgram.y:517 awkgram.y:524 msgid "`delete array' is a gawk extension" msgstr "`delete array' è un'estensione gawk" -#: awkgram.y:528 awkgram.y:535 +#: awkgram.y:532 awkgram.y:539 msgid "`delete(array)' is a non-portable tawk extension" msgstr "`delete(array)' è un'estensione tawk non-portabile" -#: awkgram.y:578 +#: awkgram.y:583 +#, c-format +msgid "duplicate case values in switch body: %s" +msgstr "valori di 'case' doppi all'interno di uno 'switch': %s" + +#: awkgram.y:593 +msgid "Duplicate `default' detected in switch body" +msgstr "Valori per difetto doppi all'interno di uno 'switch'" + +#: awkgram.y:681 msgid "multistage two-way pipelines don't work" msgstr "'pipelines' multistadio bidirezionali non funzionano" -#: awkgram.y:669 +#: awkgram.y:772 msgid "regular expression on right of assignment" msgstr "espressione regolare usata per assegnare un valore" -#: awkgram.y:679 +#: awkgram.y:782 msgid "regular expression on left of `~' or `!~' operator" msgstr "espressione regolare prima di operatore `~' o `!~'" -#: awkgram.y:687 +#: awkgram.y:790 msgid "regular expression on right of comparison" msgstr "espressione regolare a destra in un confronto" -#: awkgram.y:754 +#: awkgram.y:857 msgid "non-redirected `getline' undefined inside END action" msgstr "`getline' non re-diretta indefinita dentro 'azione' END" -#: awkgram.y:781 +#: awkgram.y:884 msgid "call of `length' without parentheses is not portable" msgstr "chiamata a `length' senza parentesi non portabile" -#: awkgram.y:784 +#: awkgram.y:887 msgid "call of `length' without parentheses is deprecated by POSIX" msgstr "chiamata a `length' senza parentesi sconsigliata da POSIX" -#: awkgram.y:835 +#: awkgram.y:940 +msgid "use of non-array as array" +msgstr "uso di non-vettore come vettore" + +#: awkgram.y:942 msgid "invalid subscript expression" msgstr "espressione indice invalida" -#: awkgram.y:1020 +#: awkgram.y:1140 msgid "unexpected newline or end of string" msgstr "carattere 'a capo' o fine stringa inaspettati" -#: awkgram.y:1115 +#: awkgram.y:1235 msgid "empty program text on command line" msgstr "programma nullo sulla linea comandi" -#: awkgram.y:1172 +#: awkgram.y:1292 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "non riesco ad aprire file sorgente `%s' in lettura (%s)" -#: awkgram.y:1207 +#: awkgram.y:1327 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "non riesco a leggere file sorgente `%s' (%s)" -#: awkgram.y:1215 +#: awkgram.y:1335 #, 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 +#: awkgram.y:1537 awkgram.y:1647 awkgram.y:1665 awkgram.y:2015 awkgram.y:2100 msgid "source file does not end in newline" msgstr "file sorgente non termina con carattere 'a capo'" -#: awkgram.y:1481 +#: awkgram.y:1601 msgid "unterminated regexp ends with `\\' at end of file" msgstr "espressione regolare non completata termina con `\\' a fine file" -#: awkgram.y:1501 +#: awkgram.y:1621 msgid "unterminated regexp" msgstr "espressione regolare non completata" -#: awkgram.y:1504 +#: awkgram.y:1624 msgid "unterminated regexp at end of file" msgstr "espressione regolare non completata a fine file" -#: awkgram.y:1571 +#: awkgram.y:1691 msgid "use of `\\ #...' line continuation is not portable" msgstr "uso di `\\ #...' continuazione linea non portabile" -#: awkgram.y:1583 +#: awkgram.y:1703 msgid "backslash not last character on line" msgstr "'\\' non è l'ultimo carattere della linea" -#: awkgram.y:1628 +#: awkgram.y:1748 msgid "POSIX does not allow operator `**='" msgstr "POSIX non permette l'operatore `**='" -#: awkgram.y:1630 +#: awkgram.y:1750 msgid "old awk does not support operator `**='" msgstr "il vecchio awk non supporta l'operatore `**='" -#: awkgram.y:1639 +#: awkgram.y:1759 msgid "POSIX does not allow operator `**'" msgstr "POSIX non permette l'operatore `**'" -#: awkgram.y:1641 +#: awkgram.y:1761 msgid "old awk does not support operator `**'" msgstr "il vecchio awk non supporta l'operatore `**'" -#: awkgram.y:1672 +#: awkgram.y:1792 msgid "operator `^=' is not supported in old awk" msgstr "l'operatore `^=' non è supportato nel vecchio awk" -#: awkgram.y:1680 +#: awkgram.y:1800 msgid "operator `^' is not supported in old awk" msgstr "l'operatore `^' non è supportato nel vecchio awk" -#: awkgram.y:1764 awkgram.y:1781 +#: awkgram.y:1884 awkgram.y:1901 msgid "unterminated string" msgstr "stringa non terminata" -#: awkgram.y:1941 +#: awkgram.y:2061 #, c-format msgid "invalid char '%c' in expression" msgstr "carattere '%c' invalido in un'espressione" -#: awkgram.y:2001 +#: awkgram.y:2121 #, c-format msgid "`%s' is a gawk extension" msgstr "`%s' è un'estensione gawk" -#: awkgram.y:2004 +#: awkgram.y:2124 #, c-format msgid "`%s' is a Bell Labs extension" msgstr "`%s' è un'estensione Bell Labs" -#: awkgram.y:2007 +#: awkgram.y:2127 #, c-format msgid "POSIX does not allow `%s'" msgstr "POSIX non permette `%s'" -#: awkgram.y:2011 +#: awkgram.y:2131 #, c-format msgid "`%s' is not supported in old awk" msgstr "`%s' non è supportato nel vecchio awk" -#: awkgram.y:2038 +#: awkgram.y:2158 msgid "`goto' considered harmful!\n" msgstr "`goto' considerato pericoloso!\n" -#: awkgram.y:2102 +#: awkgram.y:2220 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "%d invalido come numero di argomenti per %s" -#: awkgram.y:2121 awkgram.y:2124 +#: awkgram.y:2239 awkgram.y:2242 msgid "match: third argument is a gawk extension" msgstr "match: il terzo argomento è un'estensione gawk" -#: awkgram.y:2137 +#: awkgram.y:2255 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "%s: una stringa come ultimo argomento di 'substitute' non ha effetto" -#: awkgram.y:2140 +#: awkgram.y:2258 #, c-format msgid "%s third parameter is not a changeable object" msgstr "il terzo parametro di '%s' non è un oggetto modificabile" -#: awkgram.y:2167 awkgram.y:2170 +#: awkgram.y:2285 awkgram.y:2288 msgid "close: second argument is a gawk extension" msgstr "close: il secondo argomento è un'estensione gawk" -#: awkgram.y:2180 +#: awkgram.y:2298 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "uso scorretto di dcgettext(_\"...\"): togliere il carattere '_' iniziale" -#: awkgram.y:2195 +#: awkgram.y:2313 msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "uso scorretto di dcngettext(_\"...\"): togliere il carattere '_' iniziale" -#: awkgram.y:2266 +#: awkgram.y:2384 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "funzione `%s': parametro #%d, `%s', duplica parametro #%d" -#: awkgram.y:2299 +#: awkgram.y:2417 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "funzione `%s': parametro `%s' nasconde variabile globale" -#: awkgram.y:2411 +#: awkgram.y:2529 #, 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 +#: awkgram.y:2530 profile.c:93 msgid "sending profile to standard error" msgstr "mando profilo a 'standard error'" -#: awkgram.y:2442 +#: awkgram.y:2562 #, c-format msgid "%s: close failed (%s)" msgstr "%s: 'close' fallita (%s)" -#: awkgram.y:2566 +#: awkgram.y:2684 msgid "shadow_funcs() called twice!" msgstr "shadow_funcs() chiamata due volte!" -#: awkgram.y:2593 +#: awkgram.y:2711 msgid "there were shadowed variables." msgstr "c'erano variabili nascoste." -#: awkgram.y:2666 +#: awkgram.y:2784 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "funzione `%s': non posso usare nome della funzione come nome parametro" -#: awkgram.y:2676 +#: awkgram.y:2794 #, c-format msgid "function name `%s' previously defined" msgstr "funzione di nome `%s' definita in precedenza" -#: awkgram.y:2827 awkgram.y:2833 +#: awkgram.y:2945 awkgram.y:2951 #, c-format msgid "function `%s' called but never defined" msgstr "funzione `%s' chiamata ma mai definita" -#: awkgram.y:2836 +#: awkgram.y:2954 #, c-format msgid "function `%s' defined but never called" msgstr "funzione `%s' definita ma mai chiamata" -#: awkgram.y:2863 +#: awkgram.y:2981 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "" "espressione regolare di valore costante per parametro #%d genera valore " "booleano" -#: awkgram.y:2876 +#: awkgram.y:2994 #, c-format msgid "" "function `%s' called with space between name and `(',\n" @@ -356,194 +367,199 @@ msgstr "" "funzione `%s' chiamata con spazio tra il nome e `(',\n" "%s" -#: awkgram.y:2878 +#: awkgram.y:2996 msgid "or used as a variable or an array" msgstr "o usato come variabile o come vettore" -#: builtin.c:111 +#: builtin.c:137 #, c-format msgid "%s to \"%s\" failed (%s)" msgstr "%s a \"%s\" fallita (%s)" -#: builtin.c:112 +#: builtin.c:138 msgid "standard output" msgstr "standard output" -#: builtin.c:113 +#: builtin.c:139 msgid "reason unknown" msgstr "ragione indeterminata" -#: builtin.c:126 +#: builtin.c:152 msgid "exp: received non-numeric argument" msgstr "exp: argomento non numerico" -#: builtin.c:132 +#: builtin.c:158 #, c-format msgid "exp: argument %g is out of range" msgstr "exp: argomento %g non accettabile" -#: builtin.c:190 +#: builtin.c:216 #, c-format msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing" msgstr "" "fflush: non posso scaricare: 'pipe' `%s' aperta in lettura, non in scrittura" -#: builtin.c:193 +#: builtin.c:219 #, c-format msgid "fflush: cannot flush: file `%s' opened for reading, not writing" msgstr "" "fflush: non posso scaricare: file `%s' aperto in lettura, non in scrittura" -#: builtin.c:205 +#: builtin.c:231 #, c-format msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "fflush: `%s' non è un file aperto, una 'pipe' o un co-processo" -#: builtin.c:299 +#: builtin.c:325 msgid "index: received non-string first argument" msgstr "index: il primo argomento non è una stringa" -#: builtin.c:301 +#: builtin.c:327 msgid "index: received non-string second argument" msgstr "index: il secondo argomento non è una stringa" -#: builtin.c:411 +#: builtin.c:437 msgid "int: received non-numeric argument" msgstr "int: argomento non numerico" -#: builtin.c:428 +#: builtin.c:454 msgid "length: received non-string argument" msgstr "length: l'argomento non è una stringa" -#: builtin.c:444 +#: builtin.c:470 msgid "log: received non-numeric argument" msgstr "log: argomento non numerico" -#: builtin.c:447 +#: builtin.c:473 #, c-format msgid "log: received negative argument %g" msgstr "log: argomento negativo %g" -#: builtin.c:609 builtin.c:612 +#: builtin.c:635 builtin.c:638 msgid "must use `count$' on all formats or none" msgstr "'count$' va usato per tutti i formati o per nessuno" -#: builtin.c:714 +#: builtin.c:740 msgid "`$' is not permitted in awk formats" msgstr "`$' non permesso nei 'format' awk" -#: builtin.c:720 +#: builtin.c:746 msgid "arg count with `$' must be > 0" msgstr "il numero di argomento con `$' deve essere > 0" -#: builtin.c:722 +#: builtin.c:748 #, c-format msgid "arg count %ld greater than total number of supplied arguments" msgstr "" "numero di argomenti (%ld) maggiore del numero totale di argomenti specificati" -#: builtin.c:724 +#: builtin.c:750 msgid "`$' not permitted after period in format" msgstr "`$' non permesso dopo un punto nel 'format'" -#: builtin.c:737 +#: builtin.c:763 msgid "no `$' supplied for positional field width or precision" msgstr "" "nessun `$' specificato per larghezza o precisione di un campo posizionale" -#: builtin.c:795 +#: builtin.c:821 msgid "`l' is meaningless in awk formats; ignored" msgstr "`l' non ha senso nei 'format' awk; ignorata" -#: builtin.c:799 +#: builtin.c:825 msgid "`l' is not permitted in POSIX awk formats" msgstr "`l' non permessa nei 'format' awk POSIX" -#: builtin.c:810 +#: builtin.c:836 msgid "`L' is meaningless in awk formats; ignored" msgstr "`L' non ha senso nei 'format' awk; ignorata" -#: builtin.c:814 +#: builtin.c:840 msgid "`L' is not permitted in POSIX awk formats" msgstr "`L' non permessa nei 'format' awk POSIX" -#: builtin.c:825 +#: builtin.c:851 msgid "`h' is meaningless in awk formats; ignored" msgstr "`h' non ha senso nei 'format' awk; ignorata" -#: builtin.c:829 +#: builtin.c:855 msgid "`h' is not permitted in POSIX awk formats" msgstr "`h' non permessa nei 'format' awk POSIX" -#: builtin.c:1078 +#: builtin.c:1055 +#, c-format +msgid "[s]printf: value %g is out of range for `%%%c' format" +msgstr "[s]printf: valore %g non accettabile per il 'format' `%%%c'" + +#: builtin.c:1108 msgid "not enough arguments to satisfy format string" msgstr "mancano argomenti per completare il 'format'" -#: builtin.c:1080 +#: builtin.c:1110 msgid "^ ran out for this one" msgstr "^ uscito per questo" -#: builtin.c:1085 +#: builtin.c:1115 msgid "[s]printf: format specifier does not have control letter" msgstr "[s]printf: il designatore di 'format' non ha una lettera di controllo" -#: builtin.c:1088 +#: builtin.c:1118 msgid "too many arguments supplied for format string" msgstr "troppi argomenti specificati per il 'format'" -#: builtin.c:1154 builtin.c:1157 +#: builtin.c:1184 builtin.c:1187 msgid "printf: no arguments" msgstr "printf: manca argomento" -#: builtin.c:1181 +#: builtin.c:1211 msgid "sqrt: received non-numeric argument" msgstr "sqrt: argomento non numerico" -#: builtin.c:1185 +#: builtin.c:1215 #, c-format msgid "sqrt: called with negative argument %g" msgstr "sqrt: chiamata con argomento negativo %g" -#: builtin.c:1207 +#: builtin.c:1238 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "substr: indice di partenza %g invalido, uso 1" -#: builtin.c:1212 +#: builtin.c:1243 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "substr: indice di partenza non intero %g: sarà troncato" -#: builtin.c:1231 -#, c-format -msgid "substr: length %g is <= 0" +#: builtin.c:1262 +#, fuzzy, c-format +msgid "substr: length %g is not >= 1" msgstr "substr: lunghezza %g <= 0" -#: builtin.c:1233 -#, c-format -msgid "substr: length %g is < 0" -msgstr "substr: lunghezza %g < 0" +#: builtin.c:1264 +#, fuzzy, c-format +msgid "substr: length %g is not >= 0" +msgstr "substr: lunghezza %g <= 0" -#: builtin.c:1240 +#: builtin.c:1271 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "substr: lunghezza non intera %g: sarà truncata" -#: builtin.c:1245 +#: builtin.c:1276 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" msgstr "substr: lunghezza %g troppo elevata per indice stringa, tronco a %g" -#: builtin.c:1257 +#: builtin.c:1288 msgid "substr: source string is zero length" msgstr "substr: stringa di partenza lunga zero" -#: builtin.c:1263 +#: builtin.c:1294 #, c-format msgid "substr: start index %g is past end of string" msgstr "substr: indice di partenza %g oltre la fine della stringa" -#: builtin.c:1271 +#: builtin.c:1302 #, c-format msgid "" "substr: length %g at start index %g exceeds length of first argument (%lu)" @@ -551,234 +567,239 @@ msgstr "" "substr: lunghezza %g all'indice di partenza %g supera la lunghezza del primo " "argomento (%lu)" -#: builtin.c:1306 +#: builtin.c:1337 msgid "strftime: received non-string first argument" msgstr "strftime: il primo argomento non è una stringa" -#: builtin.c:1312 +#: builtin.c:1343 msgid "strftime: received empty format string" msgstr "strftime: 'format' è una stringa nulla" -#: builtin.c:1321 +#: builtin.c:1352 msgid "strftime: received non-numeric second argument" msgstr "strftime: il secondo argomento non è numerico" -#: builtin.c:1384 +#: builtin.c:1415 msgid "mktime: received non-string argument" msgstr "mktime: l'argomento non è una stringa" -#: builtin.c:1429 +#: builtin.c:1460 msgid "system: received non-string argument" msgstr "system: l'argomento non è una stringa" -#: builtin.c:1573 +#: builtin.c:1581 eval.c:1883 +#, c-format +msgid "reference to uninitialized field `$%d'" +msgstr "referenza a variabile non inizializzata `$%d'" + +#: builtin.c:1608 msgid "tolower: received non-string argument" msgstr "tolower: l'argomento non è una stringa" -#: builtin.c:1622 +#: builtin.c:1657 msgid "toupper: received non-string argument" msgstr "toupper: l'argomento non è una stringa" -#: builtin.c:1667 +#: builtin.c:1702 msgid "atan2: received non-numeric first argument" msgstr "atan2: il primo argomento non è numerico" -#: builtin.c:1669 +#: builtin.c:1704 msgid "atan2: received non-numeric second argument" msgstr "atan2: il secondo argomento non è numerico" -#: builtin.c:1688 +#: builtin.c:1723 msgid "sin: received non-numeric argument" msgstr "sin: l'argomento non è numerico" -#: builtin.c:1704 +#: builtin.c:1739 msgid "cos: received non-numeric argument" msgstr "cos: l'argomento non è numerico" -#: builtin.c:1748 +#: builtin.c:1788 msgid "srand: received non-numeric argument" msgstr "srand: l'argomento non è numerico" -#: builtin.c:1787 +#: builtin.c:1823 msgid "match: third argument is not an array" msgstr "match: il terzo argomento non è un vettore" -#: builtin.c:2264 -msgid "gensub: 3rd argument of 0 treated as 1" +#: builtin.c:2307 +msgid "gensub: third argument of 0 treated as 1" msgstr "gensub: il terzo argomento è 0, trattato come 1" -#: builtin.c:2375 builtin.c:2377 +#: builtin.c:2416 builtin.c:2418 msgid "lshift: received non-numeric first argument" msgstr "lshift: il primo argomento non è numerico" -#: builtin.c:2379 +#: builtin.c:2420 #, c-format msgid "lshift(%lf, %lf): negative values will give strange results" msgstr "lshift(%lf, %lf): valori negativi daranno risultati strani" -#: builtin.c:2381 +#: builtin.c:2422 #, c-format msgid "lshift(%lf, %lf): fractional values will be truncated" msgstr "lshift(%lf, %lf): valori con decimali verranno troncati" -#: builtin.c:2383 +#: builtin.c:2424 #, c-format msgid "lshift(%lf, %lf): too large shift value will give strange results" msgstr "lshift(%lf, %lf): valori troppo alti daranno risultati strani" -#: builtin.c:2412 builtin.c:2414 +#: builtin.c:2453 builtin.c:2455 msgid "rshift: received non-numeric first argument" msgstr "rshift: il primo argomento non è numerico" -#: builtin.c:2416 +#: builtin.c:2457 #, c-format msgid "rshift(%lf, %lf): negative values will give strange results" msgstr "rshift(%lf, %lf): valori negativi daranno risultati strani" -#: builtin.c:2418 +#: builtin.c:2459 #, c-format msgid "rshift(%lf, %lf): fractional values will be truncated" msgstr "rshift(%lf, %lf): valori con decimali verranno troncati" -#: builtin.c:2420 +#: builtin.c:2461 #, c-format msgid "rshift(%lf, %lf): too large shift value will give strange results" msgstr "rshift(%lf, %lf): valori troppo alti daranno risultati strani" -#: builtin.c:2449 builtin.c:2451 +#: builtin.c:2490 builtin.c:2492 msgid "and: received non-numeric first argument" msgstr "and: il primo argomento non è numerico" -#: builtin.c:2453 +#: builtin.c:2494 #, c-format msgid "and(%lf, %lf): negative values will give strange results" msgstr "and(%lf, %lf): valori negativi daranno risultati strani" -#: builtin.c:2455 +#: builtin.c:2496 #, c-format msgid "and(%lf, %lf): fractional values will be truncated" msgstr "and(%lf, %lf): valori con decimali verranno troncati" -#: builtin.c:2484 builtin.c:2486 +#: builtin.c:2525 builtin.c:2527 msgid "or: received non-numeric first argument" msgstr "or: il primo argomento non è numerico" -#: builtin.c:2488 +#: builtin.c:2529 #, c-format msgid "or(%lf, %lf): negative values will give strange results" msgstr "or(%lf, %lf): valori negativi daranno risultati strani" -#: builtin.c:2490 +#: builtin.c:2531 #, c-format msgid "or(%lf, %lf): fractional values will be truncated" msgstr "or(%lf, %lf): valori con decimali verranno troncati" -#: builtin.c:2519 builtin.c:2521 +#: builtin.c:2560 builtin.c:2562 msgid "xor: received non-numeric first argument" msgstr "xor: il primo argomento non è numerico" -#: builtin.c:2523 +#: builtin.c:2564 #, c-format msgid "xor(%lf, %lf): negative values will give strange results" msgstr "xor(%lf, %lf): valori negativi daranno risultati strani" -#: builtin.c:2525 +#: builtin.c:2566 #, c-format msgid "xor(%lf, %lf): fractional values will be truncated" msgstr "xor(%lf, %lf): valori con decimali verranno troncati" -#: builtin.c:2553 +#: builtin.c:2594 msgid "compl: received non-numeric argument" msgstr "compl: l'argomento non è numerico" -#: builtin.c:2555 +#: builtin.c:2596 #, c-format msgid "compl(%lf): negative value will give strange results" msgstr "compl(%lf): valore negativo darà risultati strani" -#: builtin.c:2557 +#: builtin.c:2598 #, c-format msgid "compl(%lf): fractional value will be truncated" msgstr "compl(%lf): valore con decimali verrà troncato" -#: builtin.c:2728 +#: builtin.c:2771 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "dcgettext: `%s' non è una categoria 'locale' valida" -#: eval.c:262 +#: eval.c:266 #, c-format msgid "unknown nodetype %d" msgstr "tipo nodo sconosciuto %d" -#: eval.c:310 +#: eval.c:312 msgid "buffer overflow in genflags2str" msgstr "superament limiti buffer in 'genflags2str'" -#: eval.c:555 +#: eval.c:647 #, c-format msgid "for loop: array `%s' changed size from %ld to %ld during loop execution" msgstr "" "ciclo for: vettore `%s' ha cambiato dimensione da %ld a %ld durante " "l'esecuzione del ciclo" -#: eval.c:576 +#: eval.c:668 msgid "`break' outside a loop is not portable" msgstr "`break' all'esterno di un ciclo non è portabile" -#: eval.c:580 +#: eval.c:672 msgid "`break' outside a loop is not allowed" msgstr "`break' all'esterno di un ciclo non è consentito" -#: eval.c:597 +#: eval.c:689 msgid "`continue' outside a loop is not portable" msgstr "`continue' all'esterno di un ciclo non è portabile" -#: eval.c:601 +#: eval.c:693 msgid "`continue' outside a loop is not allowed" msgstr "`continue' all'esterno di un ciclo non è consentito" -#: eval.c:635 +#: eval.c:727 msgid "`next' cannot be called from a BEGIN rule" msgstr "`next' non può essere chiamato da una regola BEGIN" -#: eval.c:637 +#: eval.c:729 msgid "`next' cannot be called from an END rule" msgstr "`next' non può essere chiamato da una regola END" -#: eval.c:646 +#: eval.c:738 msgid "`nextfile' cannot be called from a BEGIN rule" msgstr "`nextfile' non può essere chiamato da una regola BEGIN" -#: eval.c:648 +#: eval.c:740 msgid "`nextfile' cannot be called from an END rule" msgstr "`nextfile' non può essere chiamato da una regola END" -#: eval.c:696 +#: eval.c:785 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 +#: eval.c:828 eval.c:1726 #, c-format msgid "can't use function name `%s' as variable or array" msgstr "non posso usare nome di funzione `%s' come variabile o vettore" -#: eval.c:746 eval.c:752 +#: eval.c:835 eval.c:841 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "referenza ad argomento non inizializzato `%s'" -#: eval.c:810 eval.c:1728 profile.c:773 +#: eval.c:848 eval.c:907 eval.c:1732 eval.c:1742 profile.c:807 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "tentativo di usare vettore `%s' in un contesto scalare" -#: eval.c:910 +#: eval.c:858 eval.c:1752 +#, c-format +msgid "reference to uninitialized variable `%s'" +msgstr "referenza a variabile non inizializzata `%s'" + +#: eval.c:1007 msgid "" "concatenation: side effects in one expression have changed the length of " "another!" @@ -786,54 +807,49 @@ msgstr "" "concatenatione: effetti secondari in una espressione hanno modificato la " "lunghezza di un'altra espressione!" -#: eval.c:935 +#: eval.c:1032 msgid "assignment used in conditional context" msgstr "assegnamento usato nel contesto di un test condizionale" -#: eval.c:1026 +#: eval.c:1122 msgid "division by zero attempted" msgstr "tentativo di dividere per zero" -#: eval.c:1041 +#: eval.c:1137 #, c-format msgid "division by zero attempted in `%%'" msgstr "divisione per zero tentata in `%%'" -#: eval.c:1056 profile.c:649 +#: eval.c:1152 profile.c:683 #, c-format msgid "illegal type (%s) in tree_eval" msgstr "tipo non ammesso (%s) in 'tree_eval'" -#: eval.c:1232 +#: eval.c:1328 msgid "division by zero attempted in `/='" msgstr "divisione per zero tentata in `/='" -#: eval.c:1250 +#: eval.c:1346 #, 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 +#: eval.c:1586 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "funzione `%s' chiamata con più argomenti di quelli previsti" -#: eval.c:1628 +#: eval.c:1633 #, c-format msgid "function `%s' not defined" msgstr "funzione `%s' non definita" -#: eval.c:1634 +#: eval.c:1639 #, c-format msgid "function %s called\n" msgstr "funzione %s chiamata\n" -#: eval.c:1693 +#: eval.c:1698 msgid "" "\n" "\t# Function Call Stack:\n" @@ -843,46 +859,41 @@ msgstr "" "\t# 'Stack' (Pila) Chiamate Funzione:\n" "\n" -#: eval.c:1696 +#: eval.c:1701 msgid "\t# -- main --\n" msgstr "\t# -- principale --\n" -#: eval.c:1850 +#: eval.c:1867 msgid "attempt to field reference from non-numeric value" msgstr "tentativo di referenziare campo da valore non numerico" -#: eval.c:1852 +#: eval.c:1869 msgid "attempt to reference from null string" msgstr "tentativo to referenziare da stringa nulla" -#: eval.c:1858 +#: eval.c:1875 #, 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 +#: eval.c:1896 eval.c:1903 profile.c:900 msgid "assignment is not allowed to result of builtin function" msgstr "assegnamento non permesso al risultato di una funzione interna" -#: eval.c:1941 +#: eval.c:1951 msgid "`IGNORECASE' is a gawk extension" msgstr "`IGNORECASE' è un'estensione gawk" -#: eval.c:1970 +#: eval.c:1980 msgid "`BINMODE' is a gawk extension" msgstr "`BINMODE' è un'estensione gawk" -#: eval.c:2082 +#: eval.c:2092 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "specificazione invalida `%sFMT' `%s'" -#: eval.c:2160 +#: eval.c:2170 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "disabilito `--lint' a causa di assegnamento a `LINT'" @@ -900,32 +911,32 @@ 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:181 +#: ext.c:183 msgid "Operation Not Supported" msgstr "Operazione Non Supportata" -#: field.c:321 +#: field.c:315 msgid "NF set to negative value" msgstr "NF impostato a un valore negativo" -#: field.c:819 +#: field.c:808 msgid "split: second argument is not an array" msgstr "split: il secondo argomento non è un vettore" -#: field.c:854 +#: field.c:842 msgid "split: null string for third arg is a gawk extension" msgstr "split: la stringa nulla come terzo arg. è un'estensione gawk" -#: field.c:906 +#: field.c:894 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "`FIELDWIDTHS' è un'estensione gawk" -#: field.c:933 +#: field.c:921 #, c-format msgid "field %d in FIELDWIDTHS, must be > 0" msgstr "campo %d in FIELDWIDTHS, deve essere > 0" -#: field.c:1006 +#: field.c:994 msgid "null string for `FS' is a gawk extension" msgstr "la stringa nulla usata come `FS' è un'estensione gawk" @@ -969,7 +980,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:431 +#: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:434 #, c-format msgid "%s: option requires an argument -- %c\n" msgstr "%s: l'opzione richiede un argomento -- %c\n" @@ -984,471 +995,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" -#: io.c:257 +#: io.c:305 #, c-format msgid "cannot open file `%s' for reading (%s)" msgstr "non riesco ad aprire file `%s' in lettura (%s)" -#: io.c:344 +#: io.c:392 #, c-format msgid "close of fd %d (`%s') failed (%s)" msgstr "chiusura di fd %d (`%s') fallita (%s)" -#: io.c:482 +#: io.c:530 #, c-format msgid "invalid tree type %s in redirect()" msgstr "tipo di albero invalido %s in redirect()" -#: io.c:488 +#: io.c:536 #, c-format msgid "expression in `%s' redirection only has numeric value" msgstr "espressione nella re-direzione `%s' ha solo un valore numerico" -#: io.c:494 +#: io.c:542 #, c-format msgid "expression for `%s' redirection has null string value" msgstr "espressione nella re-direzione `%s' ha per valore la stringa nulla" -#: io.c:499 +#: io.c:547 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" msgstr "" "nome file `%s' per la re-direzione `%s' può essere il risultato di una " "espressione logica" -#: io.c:521 +#: io.c:569 #, c-format msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" msgstr "mistura non necessaria di `>' e `>>' per il file `%.*s'" -#: io.c:573 +#: io.c:621 #, c-format msgid "can't open pipe `%s' for output (%s)" msgstr "non posso aprire 'pipe' `%s' in scrittura (%s)" -#: io.c:582 +#: io.c:630 #, c-format msgid "can't open pipe `%s' for input (%s)" msgstr "non posso aprire 'pipe' `%s' in lettura (%s)" -#: io.c:595 +#: io.c:643 #, c-format msgid "can't open two way socket `%s' for input/output (%s)" msgstr "" "non posso aprire 'socket' bidirezionale `%s' per lettura/scrittura (%s)" -#: io.c:599 +#: io.c:647 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" msgstr "non posso aprire 'pipe' bidirezionale `%s' per lettura/scrittura (%s)" -#: io.c:675 +#: io.c:723 #, c-format msgid "can't redirect from `%s' (%s)" msgstr "non posso re-dirigere da `%s' (%s)" -#: io.c:678 +#: io.c:726 #, c-format msgid "can't redirect to `%s' (%s)" msgstr "non posso re-dirigere a `%s' (%s)" -#: io.c:717 +#: io.c:765 msgid "" "reached system limit for open files: starting to multiplex file descriptors" msgstr "" "numero massimo consentito di file aperti raggiunto: comincio a riutilizzare " "i descrittori di file" -#: io.c:729 +#: io.c:777 #, c-format msgid "close of `%s' failed (%s)." msgstr "chiusura di `%s' fallita (%s)." -#: io.c:736 +#: io.c:784 msgid "too many pipes or input files open" msgstr "troppe 'pipe' o file di input aperti" -#: io.c:759 +#: io.c:807 msgid "close: second argument must be `to' or `from'" msgstr "close: il secondo argomento deve essere `a' o `da'" -#: io.c:773 +#: io.c:821 #, c-format msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "close: `%.*s' non è un file aperto, una 'pipe' o un co-processo" -#: io.c:777 +#: io.c:825 msgid "close of redirection that was never opened" msgstr "chiusura di una re-direzione mai aperta" -#: io.c:804 +#: io.c:862 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" msgstr "close: re-direzione `%s' non aperta con `|&', ignoro secondo argomento" -#: io.c:866 +#: io.c:924 #, c-format msgid "failure status (%d) on pipe close of `%s' (%s)" msgstr "errore ritornato (%d) dalla chiusura della 'pipe' `%s' (%s)" -#: io.c:869 +#: io.c:927 #, c-format msgid "failure status (%d) on file close of `%s' (%s)" msgstr "errore ritornato (%d) dalla chiusura del file `%s' (%s)" -#: io.c:888 +#: io.c:946 #, c-format msgid "no explicit close of socket `%s' provided" msgstr "nessuna chiusura esplicita richiesta per 'socket' `%s'" -#: io.c:891 +#: io.c:949 #, c-format msgid "no explicit close of co-process `%s' provided" msgstr "nessuna chiusura esplicita richiesta per co-processo `%s'" -#: io.c:894 +#: io.c:952 #, c-format msgid "no explicit close of pipe `%s' provided" msgstr "nessuna chiusura esplicita richiesta per 'pipe' `%s'" -#: io.c:897 +#: io.c:955 #, c-format msgid "no explicit close of file `%s' provided" msgstr "nessuna chiusura esplicita richiesta per file `%s'" -#: io.c:926 io.c:980 +#: io.c:984 io.c:1038 #, c-format msgid "error writing standard output (%s)" msgstr "errore scrivendo 'standard output' (%s)" -#: io.c:930 io.c:984 +#: io.c:988 io.c:1042 #, c-format msgid "error writing standard error (%s)" msgstr "errore scrivendo 'standard error' (%s)" -#: io.c:938 +#: io.c:996 #, c-format msgid "pipe flush of `%s' failed (%s)." msgstr "scaricamento di 'pipe' `%s' fallita (%s)." -#: io.c:941 +#: io.c:999 #, c-format msgid "co-process flush of pipe to `%s' failed (%s)." msgstr "scaricamento da co-processo di 'pipe' a `%s' fallita (%s)." -#: io.c:944 +#: io.c:1002 #, c-format msgid "file flush of `%s' failed (%s)." msgstr "scaricamento di file `%s' fallita (%s)." -#: io.c:1103 +#: io.c:1161 msgid "/inet/raw client not ready yet, sorry" msgstr "spiacente, 'client' /inet/raw non ancora pronto" -#: io.c:1105 io.c:1142 +#: io.c:1163 io.c:1200 msgid "only root may use `/inet/raw'." msgstr "solo root può usare `/inet/raw'." -#: io.c:1140 +#: io.c:1198 msgid "/inet/raw server not ready yet, sorry" msgstr "spiacente, 'server' /inet/raw non ancora pronto" -#: io.c:1230 +#: io.c:1288 #, c-format msgid "no (known) protocol supplied in special filename `%s'" msgstr "nessuno protocollo (conosciuto) specificato nel filename speciale `%s'" -#: io.c:1248 +#: io.c:1306 #, c-format msgid "special file name `%s' is incomplete" msgstr "nome file speciale `%s' incompleto" -#: io.c:1260 +#: io.c:1318 #, c-format msgid "local port invalid in `%s'" msgstr "porta locale invalida in `%s'" -#: io.c:1272 +#: io.c:1330 msgid "must supply a remote hostname to `/inet'" msgstr "va fornito nome di 'host' remoto a `/inet'" -#: io.c:1287 +#: io.c:1345 msgid "must supply a remote port to `/inet'" msgstr "va fornita porta remota a `/inet'" -#: io.c:1293 +#: io.c:1351 #, c-format msgid "remote port invalid in `%s'" msgstr "porta remota invalida in `%s'" -#: io.c:1303 +#: io.c:1361 msgid "TCP/IP communications are not supported" msgstr "comunicazioni TCP/IP non supportate" -#: io.c:1312 io.c:1492 +#: io.c:1370 io.c:1551 #, c-format msgid "file `%s' is a directory" msgstr "file `%s' è una 'directory'" -#: io.c:1381 +#: io.c:1440 #, c-format msgid "use `PROCINFO[\"%s\"]' instead of `%s'" msgstr "usa `PROCINFO[\"%s\"]' invece che `%s'" -#: io.c:1413 +#: io.c:1472 msgid "use `PROCINFO[...]' instead of `/dev/user'" msgstr "usa `PROCINFO[...]' invece che `/dev/user'" -#: io.c:1478 io.c:1652 +#: io.c:1537 io.c:1711 #, c-format msgid "could not open `%s', mode `%s'" msgstr "non riesco ad aprire `%s', modo `%s'" -#: io.c:1703 +#: io.c:1762 #, 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 +#: io.c:1764 io.c:1916 io.c:2068 #, c-format msgid "close of stdout in child failed (%s)" msgstr "fallita chiusura di 'stdout' nel processo-figlio (%s)" -#: io.c:1708 +#: io.c:1767 #, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" msgstr "" "fallito trasferimento di 'pty' secondaria a 'stdout' nel processo-figlio " "(dup: %s)" -#: io.c:1710 io.c:1862 +#: io.c:1769 io.c:1921 #, c-format msgid "close of stdin in child failed (%s)" msgstr "fallita chiusura di 'stdin' nel processo-figlio (%s)" -#: io.c:1713 +#: io.c:1772 #, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" msgstr "" "fallito trasferimento di 'pty' secondaria a 'stdin' nel processo-figlio " "(dup: %s)" -#: io.c:1715 io.c:1734 +#: io.c:1774 io.c:1793 #, 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 +#: io.c:1867 io.c:1919 io.c:2049 io.c:2071 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "fallito passaggio di 'pipe' a 'stdout' nel processo-figlio (dup: %s)" -#: io.c:1812 io.c:1865 +#: io.c:1871 io.c:1924 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "fallito passaggio di pipe a 'stdin' nel processo-figlio (dup: %s)" -#: io.c:1829 io.c:2003 +#: io.c:1888 io.c:2062 msgid "restoring stdout in parent process failed\n" msgstr "fallito ripristino di 'stdout' nel processo-padre\n" -#: io.c:1834 +#: io.c:1893 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 +#: io.c:1927 io.c:2073 io.c:2084 #, c-format msgid "close of pipe failed (%s)" msgstr "fallita chiusura di 'pipe' (%s)" -#: io.c:1913 +#: io.c:1972 msgid "`|&' not supported" msgstr "`|&' non supportato" -#: io.c:1980 +#: io.c:2039 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "non riesco ad aprire 'pipe' `%s' (%s)" -#: io.c:2021 +#: io.c:2080 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "non riesco a creare processo-figlio per `%s' (fork: %s)" -#: io.c:2364 +#: io.c:2423 #, c-format msgid "data file `%s' is empty" msgstr "file dati `%s' vuoto" -#: io.c:2407 io.c:2415 +#: io.c:2466 io.c:2474 msgid "could not allocate more input memory" msgstr "non riesco ad allocare ulteriore memoria per l'input" -#: io.c:2540 io.c:2782 io.c:3046 +#: io.c:2832 io.c:2895 #, c-format msgid "error reading input file `%s': %s" msgstr "errore leggendo file di input `%s': %s" -#: io.c:3281 +#: io.c:3020 msgid "multicharacter value of `RS' is a gawk extension" msgstr "valore multicarattere per `RS' è un'estensione gawk" -#: main.c:322 +#: main.c:324 msgid "`-m[fr]' option irrelevant in gawk" msgstr "`-m[fr]' opzione irrilevante per gawk" -#: main.c:324 +#: main.c:326 msgid "-m option usage: `-m[fr] nnn'" msgstr "-m uso opzione: `-m[fr] nnn'" -#: main.c:341 +#: main.c:343 #, c-format msgid "%s: option `-W %s' unrecognized, ignored\n" msgstr "%s: opzione `-W %s' non riconosciuta, ignorata\n" -#: main.c:378 +#: main.c:380 msgid "empty argument to `--source' ignored" msgstr "argomento di `--source' mancante, comando ignorato" -#: main.c:448 +#: main.c:451 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "variable d'ambiente `POSIXLY_CORRECT' impostata: attivo `--posix'" -#: main.c:453 +#: main.c:456 msgid "`--posix' overrides `--traditional'" msgstr "`--posix' annulla `--traditional'" -#: main.c:464 +#: main.c:467 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "`--posix'/`--traditional' annulla `--non-decimal-data'" -#: main.c:468 +#: main.c:471 #, c-format msgid "running %s setuid root may be a security problem" msgstr "eseguire %s con 'setuid' root può essere un rischio per la sicurezza" -#: main.c:509 +#: main.c:512 #, c-format msgid "can't set binary mode on stdin (%s)" msgstr "non posso impostare modalità binaria su 'stdin'(%s)" -#: main.c:512 +#: main.c:515 #, c-format msgid "can't set binary mode on stdout (%s)" msgstr "non posso impostare modalità binaria su 'stdout'(%s)" -#: main.c:514 +#: main.c:517 #, c-format msgid "can't set binary mode on stderr (%s)" msgstr "non posso impostare modalità binaria su 'stderr'(%s)" -#: main.c:544 +#: main.c:547 msgid "no program text at all!" msgstr "manca del tutto il testo del programma!" -#: main.c:612 +#: main.c:620 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "Uso: %s [opzioni in stile POSIX o GNU] -f fileprog [--] file ...\n" -#: main.c:614 +#: main.c:622 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "Usage: %s [opzioni in stile POSIX o GNU] [--] %cprogramma%c file ...\n" -#: main.c:619 +#: main.c:627 msgid "POSIX options:\t\tGNU long options:\n" msgstr "Opzioni POSIX:\t\topzioni lunghe GNU:\n" -#: main.c:620 +#: main.c:628 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "\t-f fileprog\t\t--file=fileprog\n" -#: main.c:621 +#: main.c:629 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "\t-F fs\t\t\t--field-separator=fs\n" -#: main.c:622 +#: main.c:630 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "\t-v var=valore\t\t--assign=var=valore\n" -#: main.c:623 +#: main.c:631 msgid "\t-m[fr] val\n" msgstr "\t-m[fr] valore\n" -#: main.c:624 +#: main.c:632 msgid "\t-W compat\t\t--compat\n" msgstr "\t-W compat\t\t--compat\n" -#: main.c:625 +#: main.c:633 msgid "\t-W copyleft\t\t--copyleft\n" msgstr "\t-W copyleft\t\t--copyleft\n" -#: main.c:626 +#: main.c:634 msgid "\t-W copyright\t\t--copyright\n" msgstr "\t-W copyright\t\t--copyright\n" -#: main.c:627 +#: main.c:635 msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n" msgstr "\t-W dump-variables[=file]\t--dump-variables[=file]\n" -#: main.c:628 +#: main.c:636 msgid "\t-W gen-po\t\t--gen-po\n" msgstr "\t-W gen-po\t\t--gen-po\n" -#: main.c:629 +#: main.c:637 msgid "\t-W help\t\t\t--help\n" msgstr "\t-W help\t\t\t--help\n" -#: main.c:630 +#: main.c:638 msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n" msgstr "\t-W lint[=fatal]\t\t--lint[=fatal]\n" -#: main.c:631 +#: main.c:639 msgid "\t-W lint-old\t\t--lint-old\n" msgstr "\t-W lint-old\t\t--lint-old\n" -#: main.c:632 +#: main.c:640 msgid "\t-W non-decimal-data\t--non-decimal-data\n" msgstr "\t-W non-decimal-data\t--non-decimal-data\n" -#: main.c:634 +#: main.c:642 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "\t-W nostalgia\t\t--nostalgia\n" -#: main.c:637 +#: main.c:645 msgid "\t-W parsedebug\t\t--parsedebug\n" msgstr "\t-W parsedebug\t\t--parsedebug\n" -#: main.c:639 +#: main.c:647 msgid "\t-W profile[=file]\t--profile[=file]\n" msgstr "\t-W profile[=file]\t--profile[=file]\n" -#: main.c:640 +#: main.c:648 msgid "\t-W posix\t\t--posix\n" msgstr "\t-W posix\t\t--posix\n" -#: main.c:641 +#: main.c:649 msgid "\t-W re-interval\t\t--re-interval\n" msgstr "\t-W re-interval\t\t--re-interval\n" -#: main.c:642 +#: main.c:650 msgid "\t-W source=program-text\t--source=program-text\n" msgstr "\t-W source=testo-programma\t--source=testo-programma\n" -#: main.c:643 +#: main.c:651 msgid "\t-W traditional\t\t--traditional\n" msgstr "\t-W traditional\t\t--traditional\n" -#: main.c:644 +#: main.c:652 msgid "\t-W usage\t\t--usage\n" msgstr "\t-W usage\t\t--usage\n" -#: main.c:645 +#: main.c:653 msgid "\t-W version\t\t--version\n" msgstr "\t-W version\t\t--version\n" -#: main.c:649 +#: main.c:657 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" @@ -1460,7 +1471,7 @@ msgstr "" "sezione `Reporting Problems and Bugs' nella versione a stampa.\n" "\n" -#: main.c:653 +#: main.c:661 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" @@ -1470,7 +1481,7 @@ msgstr "" "Senza parametri, legge da 'standard input' e scrive su 'standard output'.\n" "\n" -#: main.c:657 +#: main.c:665 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" @@ -1480,7 +1491,7 @@ msgstr "" "\tgawk '{ sum += $1 }; END { print sum }' file\n" "\tgawk -F: '{ print $1 }' /etc/passwd\n" -#: main.c:669 +#: main.c:682 #, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -1499,7 +1510,7 @@ msgstr "" "Licenza, o (a tua scelta) a una qualsiasi versione successiva.\n" "\n" -#: main.c:677 +#: main.c:690 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -1513,7 +1524,7 @@ msgstr "" "Vedi la 'GNU General Public License' per ulteriori dettagli.\n" "\n" -#: main.c:683 +#: main.c:696 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program; if not, write to the Free Software\n" @@ -1523,11 +1534,11 @@ 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:713 +#: main.c:730 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "-Ft non imposta FS a 'tab' nell'awk POSIX" -#: main.c:944 +#: main.c:956 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" @@ -1536,35 +1547,35 @@ msgstr "" "%s: `%s' argomento di `-v' non in forma `var=valore'\n" "\n" -#: main.c:964 +#: main.c:976 #, c-format msgid "`%s' is not a legal variable name" msgstr "`%s' non è un nome di variabile ammesso" -#: main.c:967 +#: main.c:979 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "`%s' non è un nome di variabile, cerco il file `%s=%s'" -#: main.c:995 +#: main.c:1012 msgid "floating point exception" msgstr "eccezione floating point" -#: main.c:1002 +#: main.c:1019 msgid "fatal error: internal error" msgstr "errore fatale: errore interno" -#: main.c:1052 +#: main.c:1069 #, c-format msgid "no pre-opened fd %d" msgstr "manca 'fd' predefinita %d" -#: main.c:1057 +#: main.c:1074 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "non riesco a predefinire /dev/null per 'fd' %d" -#: main.c:1080 main.c:1089 +#: main.c:1097 main.c:1106 #, c-format msgid "could not find groups: %s" msgstr "non riesco a trovare gruppi: %s" @@ -1585,23 +1596,23 @@ msgstr "errore: " msgid "fatal: " msgstr "fatale: " -#: node.c:59 node.c:66 node.c:75 node.c:89 node.c:116 +#: node.c:58 node.c:65 node.c:74 node.c:88 node.c:115 msgid "can't convert string to float" msgstr "non riesco a convertire stringa a valore in virgola mobile" -#: node.c:357 +#: node.c:355 msgid "backslash at end of string" msgstr "'\\' a fine stringa" -#: node.c:544 +#: node.c:539 msgid "POSIX does not allow `\\x' escapes" msgstr "POSIX non permette formato `\\x'" -#: node.c:550 +#: node.c:545 msgid "no hex digits in `\\x' escape sequence" msgstr "niente cifre esadecimanli nel formato `\\x'" -#: node.c:584 +#: node.c:579 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr " sequenza in formato `\\%c' considerata come semplice `%c'" @@ -1616,24 +1627,21 @@ msgstr "%s %s `%s': non riesco a impostare 'close-on-exec': (fcntl: %s)" msgid "could not open `%s' for writing: %s" msgstr "non riesco ad aprire `%s' in scrittura: %s" -#: profile.c:409 -msgid "internal error: Node_var with null vname" -msgstr "errore interno: 'Node_var' con 'vname' nullo" +#: profile.c:449 +#, c-format +msgid "internal error: %s with null vname" +msgstr "errore interno: %s con 'vname' nullo" -#: profile.c:471 +#: profile.c:512 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:1127 +#: profile.c:1162 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "\t# profilo gawk, creato %s\n" -#: profile.c:1130 +#: profile.c:1165 msgid "" "\t# BEGIN block(s)\n" "\n" @@ -1641,7 +1649,7 @@ msgstr "" "\t# blocco(hi) BEGIN\n" "\n" -#: profile.c:1140 +#: profile.c:1175 msgid "" "\t# Rule(s)\n" "\n" @@ -1649,7 +1657,7 @@ msgstr "" "\t# Regola(e)\n" "\n" -#: profile.c:1146 +#: profile.c:1181 msgid "" "\t# END block(s)\n" "\n" @@ -1657,7 +1665,7 @@ msgstr "" "\t# blocco(hi) END\n" "\n" -#: profile.c:1166 +#: profile.c:1201 msgid "" "\n" "\t# Functions, listed alphabetically\n" @@ -1665,7 +1673,7 @@ msgstr "" "\n" "\t# Funzioni, listate in ordine alfabetico\n" -#: profile.c:1376 +#: profile.c:1413 #, c-format msgid "unexpected type %s in prec_level" msgstr "tipo non previsto %s in 'prec_level'" @@ -1748,3 +1756,6 @@ msgstr ") or \\) non aperta" #: regcomp.c:621 msgid "No previous regular expression" msgstr "Nessuna espressione regolare precedente" + +#~ msgid "substr: length %g is < 0" +#~ msgstr "substr: lunghezza %g < 0" diff --git a/po/pt_BR.gmo b/po/pt_BR.gmo Binary files differindex 04b22ecf..79e02ebb 100644 --- a/po/pt_BR.gmo +++ b/po/pt_BR.gmo diff --git a/po/pt_BR.po b/po/pt_BR.po index ef9999ca..49270383 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -5,73 +5,71 @@ # 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" +"Project-Id-Version: gawk 3.1.2g\n" +"Report-Msgid-Bugs-To: arnold@skeeve.com\n" +"POT-Creation-Date: 2003-07-07 11:20-0700\n" +"PO-Revision-Date: 2003-06-26 16:18+0300\n" "Last-Translator: Juan Carlos Castro y Castro <jcastro@vialink.com.br>\n" "Language-Team: Brazilian Portuguese <ldp-br@bazar.conectiva.com.br>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=iso-8859-1\n" "Content-Transfer-Encoding: 8bit\n" -#: array.c:274 array.c:309 array.c:314 eval.c:494 +#: array.c:112 +#, c-format +msgid "attempt to use scalar parameter `%s' as an array" +msgstr "tentativa de usar parâmetro escalar `%s' como vetor" + +#: array.c:113 #, c-format msgid "attempt to use scalar `%s' as array" msgstr "tentativa de usar escalar `%s' como vetor" -#: array.c:338 +#: array.c:151 +#, c-format +msgid "from %s" +msgstr "de %s" + +#: array.c:506 #, c-format msgid "reference to uninitialized element `%s[\"%s\"]'" msgstr "referência a elemento não inicializado `%s[\"%s\"]'" -#: array.c:344 +#: array.c:512 #, 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 +#: array.c:609 #, c-format msgid "delete: index `%s' not in array `%s'" msgstr "delete: índice `%s' não está no vetor `%s'" -#: array.c: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 +#: array.c:769 #, c-format msgid "%s: empty (null)\n" msgstr "%s: vazio (nulo)\n" -#: array.c:638 +#: array.c:774 #, c-format msgid "%s: empty (zero)\n" msgstr "%s: vazio (zero)\n" -#: array.c:642 +#: array.c:778 #, c-format msgid "%s: table_size = %d, array_size = %d\n" msgstr "%s: table_size = %d, array_size = %d\n" -#: array.c:671 +#: array.c:807 #, c-format msgid "%s: is parameter\n" msgstr "%s: é parâmetro\n" -#: array.c:676 +#: array.c:812 #, 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" @@ -91,263 +89,276 @@ msgstr "`%s' é uma função intrínseca, não pode ser redefinida" msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "constante de expr. reg. `/%s/' parece um comentário C, mas não é" -#: awkgram.y:340 +#: awkgram.y:340 awkgram.y:615 msgid "statement may have no effect" msgstr "declaração pode não ter efeito" -#: awkgram.y:431 awkgram.y:451 +#: awkgram.y:435 awkgram.y:455 #, c-format msgid "`%s' used in %s action" msgstr "`%s' usado em ação %s" -#: awkgram.y:444 awkgram.y:447 +#: awkgram.y:448 awkgram.y:451 msgid "`nextfile' is a gawk extension" msgstr "`nextfile' é uma extensão do gawk" -#: awkgram.y:461 +#: awkgram.y:465 msgid "`return' used outside function context" msgstr "`return' usado fora do contexto de função" -#: awkgram.y:500 +#: awkgram.y:504 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" msgstr "" "`print' sozinho em regra BEGIN ou END provavelmente deveria ser `print \"\"'" -#: awkgram.y:513 awkgram.y:520 +#: awkgram.y:517 awkgram.y:524 msgid "`delete array' is a gawk extension" msgstr "`delete array' é uma extensão do gawk" -#: awkgram.y:528 awkgram.y:535 +#: awkgram.y:532 awkgram.y:539 msgid "`delete(array)' is a non-portable tawk extension" msgstr "`delete(array)' é uma extensão não-portável do tawk" -#: awkgram.y:578 +#: awkgram.y:583 +#, c-format +msgid "duplicate case values in switch body: %s" +msgstr "valores de case duplicados no corpo do switch: %s" + +#: awkgram.y:593 +msgid "Duplicate `default' detected in switch body" +msgstr "Detectado `default' duplicado no corpo do switch" + +#: awkgram.y:681 msgid "multistage two-way pipelines don't work" msgstr "pipelines bidirecionais de múltiplos estágios não funcionam" -#: awkgram.y:669 +#: awkgram.y:772 msgid "regular expression on right of assignment" msgstr "expressão regular à direita de atribuição" -#: awkgram.y:679 +#: awkgram.y:782 msgid "regular expression on left of `~' or `!~' operator" msgstr "expressão regular à esquerda de operador `~' ou `!~'" -#: awkgram.y:687 +#: awkgram.y:790 msgid "regular expression on right of comparison" msgstr "expressão regular à direita de comparação" -#: awkgram.y:754 +#: awkgram.y:857 msgid "non-redirected `getline' undefined inside END action" msgstr "`getline' não-redirecionado não é definido dentro da ação END" -#: awkgram.y:781 +#: awkgram.y:884 msgid "call of `length' without parentheses is not portable" msgstr "chamada a `length' sem parênteses não é portável" -#: awkgram.y:784 +#: awkgram.y:887 msgid "call of `length' without parentheses is deprecated by POSIX" msgstr "chamada a `length' sem parênteses é obsoleta de acordo com POSIX" -#: awkgram.y:835 +#: awkgram.y:940 +msgid "use of non-array as array" +msgstr "uso de não-vetor como vetor" + +#: awkgram.y:942 msgid "invalid subscript expression" msgstr "expressão de índice inválida" -#: awkgram.y:1020 +#: awkgram.y:1140 msgid "unexpected newline or end of string" msgstr "fim de linha ou de string inesperado" -#: awkgram.y:1115 +#: awkgram.y:1235 msgid "empty program text on command line" msgstr "texto de programa vazio na linha de comando" -#: awkgram.y:1172 +#: awkgram.y:1292 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "impossível abrir arquivo-fonte `%s' para leitura (%s)" -#: awkgram.y:1207 +#: awkgram.y:1327 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "impossível ler arquivo-fonte `%s' (%s)" -#: awkgram.y:1215 +#: awkgram.y:1335 #, 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 +#: awkgram.y:1537 awkgram.y:1647 awkgram.y:1665 awkgram.y:2015 awkgram.y:2100 msgid "source file does not end in newline" msgstr "arquivo-fonte não termina em fim-de-linha" -#: awkgram.y:1481 +#: awkgram.y:1601 msgid "unterminated regexp ends with `\\' at end of file" msgstr "expressão regular inacabada termina com `\\' ao fim do arquivo" -#: awkgram.y:1501 +#: awkgram.y:1621 msgid "unterminated regexp" msgstr "expressão regular inacabada" -#: awkgram.y:1504 +#: awkgram.y:1624 msgid "unterminated regexp at end of file" msgstr "expressão regular inacabada no fim do arquivo" -#: awkgram.y:1571 +#: awkgram.y:1691 msgid "use of `\\ #...' line continuation is not portable" msgstr "uso da continuação de linha `\\ #...' não é portável" -#: awkgram.y:1583 +#: awkgram.y:1703 msgid "backslash not last character on line" msgstr "`\\' não é o último caracter da linha" -#: awkgram.y:1628 +#: awkgram.y:1748 msgid "POSIX does not allow operator `**='" msgstr "POSIX não permite o operador `**='" -#: awkgram.y:1630 +#: awkgram.y:1750 msgid "old awk does not support operator `**='" msgstr "o velho awk não suporta o operador `**='" -#: awkgram.y:1639 +#: awkgram.y:1759 msgid "POSIX does not allow operator `**'" msgstr "POSIX não permite o operador `**'" -#: awkgram.y:1641 +#: awkgram.y:1761 msgid "old awk does not support operator `**'" msgstr "o velho awk não suporta o operador `**'" -#: awkgram.y:1672 +#: awkgram.y:1792 msgid "operator `^=' is not supported in old awk" msgstr "o velho awk não suporta o operador `^='" -#: awkgram.y:1680 +#: awkgram.y:1800 msgid "operator `^' is not supported in old awk" msgstr "o velho awk não suporta o operador `^'" -#: awkgram.y:1764 awkgram.y:1781 +#: awkgram.y:1884 awkgram.y:1901 msgid "unterminated string" msgstr "string inacabada" -#: awkgram.y:1941 +#: awkgram.y:2061 #, c-format msgid "invalid char '%c' in expression" msgstr "caracter inválido '%c' em expressão" -#: awkgram.y:2001 +#: awkgram.y:2121 #, c-format msgid "`%s' is a gawk extension" msgstr "`%s' é uma extensão do gawk" -#: awkgram.y:2004 +#: awkgram.y:2124 #, c-format msgid "`%s' is a Bell Labs extension" msgstr "`%s' é uma extensão da Bell Labs" -#: awkgram.y:2007 +#: awkgram.y:2127 #, c-format msgid "POSIX does not allow `%s'" msgstr "POSIX não permite `%s'" -#: awkgram.y:2011 +#: awkgram.y:2131 #, c-format msgid "`%s' is not supported in old awk" msgstr "`%s' não é suportado no velho awk" -#: awkgram.y:2038 +#: awkgram.y:2158 msgid "`goto' considered harmful!\n" msgstr "`goto' é considerado danoso!\n" -#: awkgram.y:2102 +#: awkgram.y:2220 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "%d é inválido como número de argumentos para %s" -#: awkgram.y:2121 awkgram.y:2124 +#: awkgram.y:2239 awkgram.y:2242 msgid "match: third argument is a gawk extension" msgstr "match: terceiro argumento é uma extensão do gawk" -#: awkgram.y:2137 +#: awkgram.y:2255 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "" "%s: string literal como último argumento de substituição não tem efeito" -#: awkgram.y:2140 +#: awkgram.y:2258 #, c-format msgid "%s third parameter is not a changeable object" msgstr "terceiro parâmetro %s não é um objeto modificável" -#: awkgram.y:2167 awkgram.y:2170 +#: awkgram.y:2285 awkgram.y:2288 msgid "close: second argument is a gawk extension" msgstr "close: segundo argumento é uma extensão do gawk" -#: awkgram.y:2180 +#: awkgram.y:2298 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "uso de dcgettext(_\"...\") é incorreto: remova o `_' precedente" -#: awkgram.y:2195 +#: awkgram.y:2313 msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "uso de dcngettext(_\"...\") é incorreto: remova o `_' precedente" -#: awkgram.y:2266 +#: awkgram.y:2384 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "função `%s': parâmetro #%d, `%s', duplica parâmetro #%d" -#: awkgram.y:2299 +#: awkgram.y:2417 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "função `%s': parâmetro `%s' encobre variável global" -#: awkgram.y:2411 +#: awkgram.y:2529 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "impossível abrir `%s' para escrita (%s)" -#: awkgram.y:2412 profile.c:93 +#: awkgram.y:2530 profile.c:93 msgid "sending profile to standard error" msgstr "enviando perfil para saída de erros" -#: awkgram.y:2442 +#: awkgram.y:2562 #, c-format msgid "%s: close failed (%s)" msgstr "%s: `close' falhou (%s)" -#: awkgram.y:2566 +#: awkgram.y:2684 msgid "shadow_funcs() called twice!" msgstr "shadow_funcs() chamada duas vezes!" -#: awkgram.y:2593 +#: awkgram.y:2711 msgid "there were shadowed variables." msgstr "houve variáveis encobertas." -#: awkgram.y:2666 +#: awkgram.y:2784 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "função `%s': não se pode usar o nome da função como nome de parâmetro" -#: awkgram.y:2676 +#: awkgram.y:2794 #, c-format msgid "function name `%s' previously defined" msgstr "nome de função `%s' definido anteriormente" -#: awkgram.y:2827 awkgram.y:2833 +#: awkgram.y:2945 awkgram.y:2951 #, c-format msgid "function `%s' called but never defined" msgstr "função `%s' chamada mas nunca definida" -#: awkgram.y:2836 +#: awkgram.y:2954 #, c-format msgid "function `%s' defined but never called" msgstr "função `%s' definida mas nunca chamada" -#: awkgram.y:2863 +#: awkgram.y:2981 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "" "constante com expr. regular para parâmetro nº %d retorna valor booleano" -#: awkgram.y:2876 +#: awkgram.y:2994 #, c-format msgid "" "function `%s' called with space between name and `(',\n" @@ -356,192 +367,197 @@ msgstr "" "função `%s' chamada com espaço entre o nome e o `(',\n" "%s" -#: awkgram.y:2878 +#: awkgram.y:2996 msgid "or used as a variable or an array" msgstr "ou usado como uma variável ou vetor" -#: builtin.c:111 +#: builtin.c:137 #, c-format msgid "%s to \"%s\" failed (%s)" msgstr "%s para \"%s\" falhou (%s)" -#: builtin.c:112 +#: builtin.c:138 msgid "standard output" msgstr "saída padrão" -#: builtin.c:113 +#: builtin.c:139 msgid "reason unknown" msgstr "motivo desconhecido" -#: builtin.c:126 +#: builtin.c:152 msgid "exp: received non-numeric argument" msgstr "exp: recebeu argumento não-numérico" -#: builtin.c:132 +#: builtin.c:158 #, c-format msgid "exp: argument %g is out of range" msgstr "exp: argumento %g está fora da faixa" -#: builtin.c:190 +#: builtin.c:216 #, c-format msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing" msgstr "" "fflush: erro ao descarregar: pipe `%s' aberto para leitura, não gravação" -#: builtin.c:193 +#: builtin.c:219 #, c-format msgid "fflush: cannot flush: file `%s' opened for reading, not writing" msgstr "" "fflush: erro ao descarregar: arquivo `%s' aberto para leitura, não gravação" -#: builtin.c:205 +#: builtin.c:231 #, c-format msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "fflush: `%s' não é um arquivo aberto, pipe ou co-processo" -#: builtin.c:299 +#: builtin.c:325 msgid "index: received non-string first argument" msgstr "index: recebeu primeiro argumento não-string" -#: builtin.c:301 +#: builtin.c:327 msgid "index: received non-string second argument" msgstr "index: recebeu segundo argumento não-string" -#: builtin.c:411 +#: builtin.c:437 msgid "int: received non-numeric argument" msgstr "int: recebeu argumento não-numérico" -#: builtin.c:428 +#: builtin.c:454 msgid "length: received non-string argument" msgstr "length: recebeu argumento não-string" -#: builtin.c:444 +#: builtin.c:470 msgid "log: received non-numeric argument" msgstr "log: recebeu argumento não-numérico" -#: builtin.c:447 +#: builtin.c:473 #, c-format msgid "log: received negative argument %g" msgstr "log: recebeu argumento negativo %g" -#: builtin.c:609 builtin.c:612 +#: builtin.c:635 builtin.c:638 msgid "must use `count$' on all formats or none" msgstr "deve usar `count$' em todos os formatos ou nenhum" -#: builtin.c:714 +#: builtin.c:740 msgid "`$' is not permitted in awk formats" msgstr "`$' não é permitido em formatos awk" -#: builtin.c:720 +#: builtin.c:746 msgid "arg count with `$' must be > 0" msgstr "nº de argumentos com `$' deve ser > 0" -#: builtin.c:722 +#: builtin.c:748 #, c-format msgid "arg count %ld greater than total number of supplied arguments" msgstr "nº de argumentos %ld maior que nº total de argumentos fornecidos" -#: builtin.c:724 +#: builtin.c:750 msgid "`$' not permitted after period in format" msgstr "`$' não é permitido depois de ponto no formato" -#: builtin.c:737 +#: builtin.c:763 msgid "no `$' supplied for positional field width or precision" msgstr "nenhum `$' fornecido para tamanho ou precisão de campo posicional" -#: builtin.c:795 +#: builtin.c:821 msgid "`l' is meaningless in awk formats; ignored" msgstr "`l' não faz sentido em formatos awk; ignorado" -#: builtin.c:799 +#: builtin.c:825 msgid "`l' is not permitted in POSIX awk formats" msgstr "`l' não é permitido em formatos POSIX awk" -#: builtin.c:810 +#: builtin.c:836 msgid "`L' is meaningless in awk formats; ignored" msgstr "`L' não faz sentido em formatos awk; ignorado" -#: builtin.c:814 +#: builtin.c:840 msgid "`L' is not permitted in POSIX awk formats" msgstr "`L' não é permitido em formatos POSIX awk" -#: builtin.c:825 +#: builtin.c:851 msgid "`h' is meaningless in awk formats; ignored" msgstr "`h' não faz sentido em formatos awk; ignorado" -#: builtin.c:829 +#: builtin.c:855 msgid "`h' is not permitted in POSIX awk formats" msgstr "`h' não é permitido em formatos POSIX awk" -#: builtin.c:1078 +#: builtin.c:1055 +#, c-format +msgid "[s]printf: value %g is out of range for `%%%c' format" +msgstr "[s]printf: valor %g fora da faixa para formato `%%%c'" + +#: builtin.c:1108 msgid "not enough arguments to satisfy format string" msgstr "argumentos insuficientes para a string de formato" -#: builtin.c:1080 +#: builtin.c:1110 msgid "^ ran out for this one" msgstr "^ acabou para este aqui" -#: builtin.c:1085 +#: builtin.c:1115 msgid "[s]printf: format specifier does not have control letter" msgstr "[s]printf: declaração de formato não tem letra de controle" -#: builtin.c:1088 +#: builtin.c:1118 msgid "too many arguments supplied for format string" msgstr "excesso de argumentos para a string de formato" -#: builtin.c:1154 builtin.c:1157 +#: builtin.c:1184 builtin.c:1187 msgid "printf: no arguments" msgstr "printf: nenhum argumento" -#: builtin.c:1181 +#: builtin.c:1211 msgid "sqrt: received non-numeric argument" msgstr "sqrt: recebeu argumento não-numérico" -#: builtin.c:1185 +#: builtin.c:1215 #, c-format msgid "sqrt: called with negative argument %g" msgstr "sqrt: chamada com argumento negativo %g" -#: builtin.c:1207 +#: builtin.c:1238 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "substr: posição inicial %g é inválida, usando 1" -#: builtin.c:1212 +#: builtin.c:1243 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "substr: posição inicial %g não-inteira será truncada" -#: builtin.c:1231 -#, c-format -msgid "substr: length %g is <= 0" +#: builtin.c:1262 +#, fuzzy, c-format +msgid "substr: length %g is not >= 1" msgstr "substr: comprimento %g é <= 0" -#: builtin.c:1233 -#, c-format -msgid "substr: length %g is < 0" -msgstr "substr: comprimento %g é < 0" +#: builtin.c:1264 +#, fuzzy, c-format +msgid "substr: length %g is not >= 0" +msgstr "substr: comprimento %g é <= 0" -#: builtin.c:1240 +#: builtin.c:1271 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "substr: comprimento %g não-inteiro será truncado" -#: builtin.c:1245 +#: builtin.c:1276 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" msgstr "substr: comprimento %g excessivo para indexação, truncando para %g" -#: builtin.c:1257 +#: builtin.c:1288 msgid "substr: source string is zero length" msgstr "substr: string origem tem comprimento zero" -#: builtin.c:1263 +#: builtin.c:1294 #, c-format msgid "substr: start index %g is past end of string" msgstr "substr: posição inicial %g além do fim da string" -#: builtin.c:1271 +#: builtin.c:1302 #, c-format msgid "" "substr: length %g at start index %g exceeds length of first argument (%lu)" @@ -549,232 +565,238 @@ msgstr "" "substr: comprimento %g a partir da posição %g excede tamanho do 1º argumento " "(%lu)" -#: builtin.c:1306 +#: builtin.c:1337 msgid "strftime: received non-string first argument" msgstr "strftime: recebeu primeiro argumento não-string" -#: builtin.c:1312 +#: builtin.c:1343 msgid "strftime: received empty format string" msgstr "strftime: recebeu string de formato vazia" -#: builtin.c:1321 +#: builtin.c:1352 msgid "strftime: received non-numeric second argument" msgstr "strftime: recebeu segundo argumento não-numérico" -#: builtin.c:1384 +#: builtin.c:1415 msgid "mktime: received non-string argument" msgstr "mktime: recebeu argumento não-string" -#: builtin.c:1429 +#: builtin.c:1460 msgid "system: received non-string argument" msgstr "system: recebeu argumento não-string" -#: builtin.c:1573 +#: builtin.c:1581 eval.c:1883 +#, c-format +msgid "reference to uninitialized field `$%d'" +msgstr "referência a campo não inicializado `$%d'" + +#: builtin.c:1608 msgid "tolower: received non-string argument" msgstr "tolower: recebeu argumento não-string" -#: builtin.c:1622 +#: builtin.c:1657 msgid "toupper: received non-string argument" msgstr "toupper: recebeu argumento não-string" -#: builtin.c:1667 +#: builtin.c:1702 msgid "atan2: received non-numeric first argument" msgstr "atan2: recebeu primeiro argumento não-numérico" -#: builtin.c:1669 +#: builtin.c:1704 msgid "atan2: received non-numeric second argument" msgstr "atan2: recebeu segundo argumento não-numérico" -#: builtin.c:1688 +#: builtin.c:1723 msgid "sin: received non-numeric argument" msgstr "sin: recebeu argumento não-numérico" -#: builtin.c:1704 +#: builtin.c:1739 msgid "cos: received non-numeric argument" msgstr "cos: recebeu argumento não-numérico" -#: builtin.c:1748 +#: builtin.c:1788 msgid "srand: received non-numeric argument" msgstr "srand: recebeu argumento não-numérico" -#: builtin.c:1787 +#: builtin.c:1823 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" +#: builtin.c:2307 +msgid "gensub: third argument of 0 treated as 1" msgstr "gensub: 3º argumento 0 tratado como 1" -#: builtin.c:2375 builtin.c:2377 +#: builtin.c:2416 builtin.c:2418 msgid "lshift: received non-numeric first argument" msgstr "lshift: recebeu primeiro argumento não-numérico" -#: builtin.c:2379 +#: builtin.c:2420 #, c-format msgid "lshift(%lf, %lf): negative values will give strange results" msgstr "lshift(%lf, %lf): valores negativos darão resultados estranhos" -#: builtin.c:2381 +#: builtin.c:2422 #, c-format msgid "lshift(%lf, %lf): fractional values will be truncated" msgstr "lshift(%lf, %lf): valores fracionários serão truncados" -#: builtin.c:2383 +#: builtin.c:2424 #, c-format msgid "lshift(%lf, %lf): too large shift value will give strange results" msgstr "lshift(%lf, %lf): deslocamento excessivo dará resultados estranhos" -#: builtin.c:2412 builtin.c:2414 +#: builtin.c:2453 builtin.c:2455 msgid "rshift: received non-numeric first argument" msgstr "rshift: recebeu primeiro argumento não-numérico" -#: builtin.c:2416 +#: builtin.c:2457 #, c-format msgid "rshift(%lf, %lf): negative values will give strange results" msgstr "rshift(%lf, %lf): valores negativos darão resultados estranhos" -#: builtin.c:2418 +#: builtin.c:2459 #, c-format msgid "rshift(%lf, %lf): fractional values will be truncated" msgstr "rshift(%lf, %lf): valores fracionários serão truncados" -#: builtin.c:2420 +#: builtin.c:2461 #, c-format msgid "rshift(%lf, %lf): too large shift value will give strange results" msgstr "rshift(%lf, %lf): deslocamento excessivo dará resultados estranhos" -#: builtin.c:2449 builtin.c:2451 +#: builtin.c:2490 builtin.c:2492 msgid "and: received non-numeric first argument" msgstr "and: recebeu primeiro argumento não-numérico" -#: builtin.c:2453 +#: builtin.c:2494 #, c-format msgid "and(%lf, %lf): negative values will give strange results" msgstr "and(%lf, %lf): valores negativos darão resultados estranhos" -#: builtin.c:2455 +#: builtin.c:2496 #, c-format msgid "and(%lf, %lf): fractional values will be truncated" msgstr "and(%lf, %lf): valores fracionários serão truncados" -#: builtin.c:2484 builtin.c:2486 +#: builtin.c:2525 builtin.c:2527 msgid "or: received non-numeric first argument" msgstr "or: recebeu primeiro argumento não-numérico" -#: builtin.c:2488 +#: builtin.c:2529 #, c-format msgid "or(%lf, %lf): negative values will give strange results" msgstr "or(%lf, %lf): valores negativos darão resultados estranhos" -#: builtin.c:2490 +#: builtin.c:2531 #, c-format msgid "or(%lf, %lf): fractional values will be truncated" msgstr "or(%lf, %lf): valores fracionários serão truncados" -#: builtin.c:2519 builtin.c:2521 +#: builtin.c:2560 builtin.c:2562 msgid "xor: received non-numeric first argument" msgstr "xor: recebeu primeiro argumento não-numérico" -#: builtin.c:2523 +#: builtin.c:2564 #, c-format msgid "xor(%lf, %lf): negative values will give strange results" msgstr "xor(%lf, %lf): valores negativos darão resultados estranhos" -#: builtin.c:2525 +#: builtin.c:2566 #, c-format msgid "xor(%lf, %lf): fractional values will be truncated" msgstr "xor(%lf, %lf): valores fracionários serão truncados" -#: builtin.c:2553 +#: builtin.c:2594 msgid "compl: received non-numeric argument" msgstr "compl: recebeu primeiro argumento não-numérico" -#: builtin.c:2555 +#: builtin.c:2596 #, c-format msgid "compl(%lf): negative value will give strange results" msgstr "compl(%lf): valores negativos darão resultados estranhos" -#: builtin.c:2557 +#: builtin.c:2598 #, c-format msgid "compl(%lf): fractional value will be truncated" msgstr "compl(%lf): valores fracionários serão truncados" -#: builtin.c:2728 +#: builtin.c:2771 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "dcgettext: `%s' não é uma categoria de \"locale\" válida" -#: eval.c:262 +#: eval.c:266 #, c-format msgid "unknown nodetype %d" msgstr "tipo de nodo desconhecido %d" -#: eval.c:310 +#: eval.c:312 msgid "buffer overflow in genflags2str" msgstr "estouro de buffer em genflags2str" -#: eval.c:555 +#: eval.c:647 #, c-format msgid "for loop: array `%s' changed size from %ld to %ld during loop execution" msgstr "" +"loop for: vetor `%s' mudou de tamanho de %ld para %ld durante a execução" -#: eval.c:576 +#: eval.c:668 msgid "`break' outside a loop is not portable" msgstr "`break' fora de um loop não é portável" -#: eval.c:580 +#: eval.c:672 msgid "`break' outside a loop is not allowed" msgstr "`break' fora de um loop não é permitido" -#: eval.c:597 +#: eval.c:689 msgid "`continue' outside a loop is not portable" msgstr "`continue' fora de um loop não é portável" -#: eval.c:601 +#: eval.c:693 msgid "`continue' outside a loop is not allowed" msgstr "`continue' fora de um loop não é permitido" -#: eval.c:635 +#: eval.c:727 msgid "`next' cannot be called from a BEGIN rule" msgstr "`next' não pode ser chamado de uma regra BEGIN" -#: eval.c:637 +#: eval.c:729 msgid "`next' cannot be called from an END rule" msgstr "`next' não pode ser chamado de uma regra END" -#: eval.c:646 +#: eval.c:738 msgid "`nextfile' cannot be called from a BEGIN rule" msgstr "`nextfile' não pode ser chamado de uma regra BEGIN" -#: eval.c:648 +#: eval.c:740 msgid "`nextfile' cannot be called from an END rule" msgstr "`nextfile' não pode ser chamado de uma regra END" -#: eval.c:696 +#: eval.c:785 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 +#: eval.c:828 eval.c:1726 #, c-format msgid "can't use function name `%s' as variable or array" msgstr "não se pode usar o nome de função `%s' como variável ou vetor" -#: eval.c:746 eval.c:752 +#: eval.c:835 eval.c:841 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "referência a argumento não inicializado `%s'" -#: eval.c:810 eval.c:1728 profile.c:773 +#: eval.c:848 eval.c:907 eval.c:1732 eval.c:1742 profile.c:807 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "tentativa de usar vetor `%s' em um contexto escalar" -#: eval.c:910 +#: eval.c:858 eval.c:1752 +#, c-format +msgid "reference to uninitialized variable `%s'" +msgstr "referência a variável não inicializada `%s'" + +#: eval.c:1007 msgid "" "concatenation: side effects in one expression have changed the length of " "another!" @@ -782,54 +804,49 @@ msgstr "" "concatenação: efeitos colaterais em um contexto mudaram o comprimento de " "outro!" -#: eval.c:935 +#: eval.c:1032 msgid "assignment used in conditional context" msgstr "atribuição usada em contexto condicional" -#: eval.c:1026 +#: eval.c:1122 msgid "division by zero attempted" msgstr "tentativa de divisão por zero" -#: eval.c:1041 +#: eval.c:1137 #, c-format msgid "division by zero attempted in `%%'" msgstr "tentativa de divisão por zero em `%%'" -#: eval.c:1056 profile.c:649 +#: eval.c:1152 profile.c:683 #, c-format msgid "illegal type (%s) in tree_eval" msgstr "tipo ilegal (%s) em tree_eval" -#: eval.c:1232 +#: eval.c:1328 msgid "division by zero attempted in `/='" msgstr "tentativa de divisão por zero em `/='" -#: eval.c:1250 +#: eval.c:1346 #, 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 +#: eval.c:1586 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "função `%s' chamada com mais argumentos que os declarados" -#: eval.c:1628 +#: eval.c:1633 #, c-format msgid "function `%s' not defined" msgstr "função `%s' não definida" -#: eval.c:1634 +#: eval.c:1639 #, c-format msgid "function %s called\n" msgstr "função %s chamada\n" -#: eval.c:1693 +#: eval.c:1698 msgid "" "\n" "\t# Function Call Stack:\n" @@ -839,46 +856,41 @@ msgstr "" "\t# Pilha de Chamadas de Função:\n" "\n" -#: eval.c:1696 +#: eval.c:1701 msgid "\t# -- main --\n" msgstr "\t# -- main --\n" -#: eval.c:1850 +#: eval.c:1867 msgid "attempt to field reference from non-numeric value" msgstr "tentativa de referência a campo a partir de valor não-numérico" -#: eval.c:1852 +#: eval.c:1869 msgid "attempt to reference from null string" msgstr "tentativa de referência a partir de string nula" -#: eval.c:1858 +#: eval.c:1875 #, 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 +#: eval.c:1896 eval.c:1903 profile.c:900 msgid "assignment is not allowed to result of builtin function" msgstr "atribuição não pode resultar de funções intrínsecas" -#: eval.c:1941 +#: eval.c:1951 msgid "`IGNORECASE' is a gawk extension" msgstr "`IGNORECASE' é uma extensão do gawk" -#: eval.c:1970 +#: eval.c:1980 msgid "`BINMODE' is a gawk extension" msgstr "`BINMODE' é uma extensão do gawk" -#: eval.c:2082 +#: eval.c:2092 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "especificação `%sFMT' inválida `%s'" -#: eval.c:2160 +#: eval.c:2170 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "desativando `--lint' devido a atribuição a `LINT'" @@ -896,32 +908,32 @@ msgstr "extension: impossível abrir `%s' (%s)\n" 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 +#: ext.c:183 msgid "Operation Not Supported" msgstr "Operação Não Suportada" -#: field.c:321 +#: field.c:315 msgid "NF set to negative value" msgstr "valor negativo atribuído a NF" -#: field.c:819 +#: field.c:808 msgid "split: second argument is not an array" msgstr "split: segundo argumento não é um vetor" -#: field.c:854 +#: field.c:842 msgid "split: null string for third arg is a gawk extension" msgstr "split: string nula para segundo argumento é uma extensão do gawk" -#: field.c:906 +#: field.c:894 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "`FIELDWIDTHS' é uma extensão do gawk" -#: field.c:933 +#: field.c:921 #, c-format msgid "field %d in FIELDWIDTHS, must be > 0" msgstr "campo %d em FIELDWIDTHS deve ser > 0" -#: field.c:1006 +#: field.c:994 msgid "null string for `FS' is a gawk extension" msgstr "string nula para `FS' é uma extensão do gawk" @@ -965,7 +977,7 @@ msgstr "%s: opção ilegal -- %c\n" 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 +#: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:434 #, c-format msgid "%s: option requires an argument -- %c\n" msgstr "%s: opção requer argumento -- %c\n" @@ -980,469 +992,469 @@ msgstr "%s: opção `-W %s' é ambígua\n" 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 +#: io.c:305 #, c-format msgid "cannot open file `%s' for reading (%s)" msgstr "impossível abrir arquivo `%s' para leitura (%s)" -#: io.c:344 +#: io.c:392 #, c-format msgid "close of fd %d (`%s') failed (%s)" msgstr "fechamento do descritor %d (`%s') falhou (%s)" -#: io.c:482 +#: io.c:530 #, c-format msgid "invalid tree type %s in redirect()" msgstr "tipo de árvore %s inválido em redirect()" -#: io.c:488 +#: io.c:536 #, c-format msgid "expression in `%s' redirection only has numeric value" msgstr "expressão no redirecionamento `%s' só tem valor numérico" -#: io.c:494 +#: io.c:542 #, c-format msgid "expression for `%s' redirection has null string value" msgstr "expressão para o redirecionamento `%s' tem valor string nulo" -#: io.c:499 +#: io.c:547 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" msgstr "" "nome de arquivo `%s' para redirecionamento `%s' pode ser resultado de " "expressão lógica" -#: io.c:521 +#: io.c:569 #, c-format msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" msgstr "mistura desnecessária de `>' e `>>' para arquivo `%.*s'" -#: io.c:573 +#: io.c:621 #, c-format msgid "can't open pipe `%s' for output (%s)" msgstr "impossível abrir pipe `%s' para saída (%s)" -#: io.c:582 +#: io.c:630 #, c-format msgid "can't open pipe `%s' for input (%s)" msgstr "impossível abrir pipe `%s' para entrada (%s)" -#: io.c:595 +#: io.c:643 #, c-format msgid "can't open two way socket `%s' for input/output (%s)" msgstr "impossível abrir socket bidirecional `%s' para entrada/saída (%s)" -#: io.c:599 +#: io.c:647 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" msgstr "impossível abrir pipe bidirecional `%s' para entrada/saída (%s)" -#: io.c:675 +#: io.c:723 #, c-format msgid "can't redirect from `%s' (%s)" msgstr "impossível redirecionar de `%s' (%s)" -#: io.c:678 +#: io.c:726 #, c-format msgid "can't redirect to `%s' (%s)" msgstr "impossível redirecionar para `%s' (%s)" -#: io.c:717 +#: io.c:765 msgid "" "reached system limit for open files: starting to multiplex file descriptors" msgstr "" "alcançado limite do sistema para arquivos abertos; começando a multiplexar " "descritores de arquivos" -#: io.c:729 +#: io.c:777 #, c-format msgid "close of `%s' failed (%s)." msgstr "fechamento de `%s' falhou (%s)" -#: io.c:736 +#: io.c:784 msgid "too many pipes or input files open" msgstr "excesso de pipes ou arquivos de entrada abertos" -#: io.c:759 +#: io.c:807 msgid "close: second argument must be `to' or `from'" msgstr "close: segundo argumento deve ser `to' ou `from'" -#: io.c:773 +#: io.c:821 #, c-format msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "close: `%.*s' não é um arquivo aberto, pipe ou co-processo" -#: io.c:777 +#: io.c:825 msgid "close of redirection that was never opened" msgstr "fechamento de redirecionamento que nunca foi aberto" -#: io.c:804 +#: io.c:862 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" msgstr "" "close: redirecionamento `%s' não foi aberto com `|&', segundo argumento " "ignorado" -#: io.c:866 +#: io.c:924 #, c-format msgid "failure status (%d) on pipe close of `%s' (%s)" msgstr "status de falha (%d) ao fechar pipe de `%s' (%s)" -#: io.c:869 +#: io.c:927 #, c-format msgid "failure status (%d) on file close of `%s' (%s)" msgstr "status de falha (%d) ao fechar arquivo de `%s' (%s)" -#: io.c:888 +#: io.c:946 #, c-format msgid "no explicit close of socket `%s' provided" msgstr "fechamento explícito do socket `%s' não fornecido" -#: io.c:891 +#: io.c:949 #, c-format msgid "no explicit close of co-process `%s' provided" msgstr "fechamento explícito do co-processo `%s' não fornecido" -#: io.c:894 +#: io.c:952 #, c-format msgid "no explicit close of pipe `%s' provided" msgstr "fechamento explícito do pipe `%s' não fornecido" -#: io.c:897 +#: io.c:955 #, c-format msgid "no explicit close of file `%s' provided" msgstr "fechamento explícito do arquivo `%s' não fornecido" -#: io.c:926 io.c:980 +#: io.c:984 io.c:1038 #, c-format msgid "error writing standard output (%s)" msgstr "erro ao escrever na saída padrão (%s)" -#: io.c:930 io.c:984 +#: io.c:988 io.c:1042 #, c-format msgid "error writing standard error (%s)" msgstr "erro ao escrever na saída padrão de erros (%s)" -#: io.c:938 +#: io.c:996 #, c-format msgid "pipe flush of `%s' failed (%s)." -msgstr "" +msgstr "descarga de pipe de `%s' falhou (%s)." -#: io.c:941 +#: io.c:999 #, c-format msgid "co-process flush of pipe to `%s' failed (%s)." -msgstr "" +msgstr "descarga de co-processo de pipe para `%s' falhou (%s)." -#: io.c:944 +#: io.c:1002 #, c-format msgid "file flush of `%s' failed (%s)." -msgstr "" +msgstr "descarga de arquivo de `%s' falhou (%s)." -#: io.c:1103 +#: io.c:1161 msgid "/inet/raw client not ready yet, sorry" msgstr "infelizmente, o cliente de /inet/raw não está concluído" -#: io.c:1105 io.c:1142 +#: io.c:1163 io.c:1200 msgid "only root may use `/inet/raw'." msgstr "apenas root pode usar `/inet/raw'." -#: io.c:1140 +#: io.c:1198 msgid "/inet/raw server not ready yet, sorry" msgstr "infelizmente, o servidor de /inet/raw não está concluído" -#: io.c:1230 +#: io.c:1288 #, c-format msgid "no (known) protocol supplied in special filename `%s'" msgstr "" "nenhum protocolo (conhecido) fornecido em nome de arquivo especial `%s'" -#: io.c:1248 +#: io.c:1306 #, c-format msgid "special file name `%s' is incomplete" msgstr "nome de arquivo especial `%s' está incompleto" -#: io.c:1260 +#: io.c:1318 #, c-format msgid "local port invalid in `%s'" msgstr "porta local inválida em `%s'" -#: io.c:1272 +#: io.c:1330 msgid "must supply a remote hostname to `/inet'" msgstr "deve ser fornecido um nome de host remoto para `/inet'" -#: io.c:1287 +#: io.c:1345 msgid "must supply a remote port to `/inet'" msgstr "deve ser fornecida uma porta remota para `/inet'" -#: io.c:1293 +#: io.c:1351 #, c-format msgid "remote port invalid in `%s'" msgstr "porta remota inválida em `%s'" -#: io.c:1303 +#: io.c:1361 msgid "TCP/IP communications are not supported" msgstr "comunicação TCP/IP não é suportada" -#: io.c:1312 io.c:1492 +#: io.c:1370 io.c:1551 #, c-format msgid "file `%s' is a directory" msgstr "arquivo `%s' é um diretório" -#: io.c:1381 +#: io.c:1440 #, c-format msgid "use `PROCINFO[\"%s\"]' instead of `%s'" msgstr "use `PROCINFO[\"%s\"]' em vez de `%s'" -#: io.c:1413 +#: io.c:1472 msgid "use `PROCINFO[...]' instead of `/dev/user'" msgstr "use `PROCINFO[...]' em vez de `/dev/user'" -#: io.c:1478 io.c:1652 +#: io.c:1537 io.c:1711 #, c-format msgid "could not open `%s', mode `%s'" msgstr "impossível abrir `%s', modo `%s'" -#: io.c:1703 +#: io.c:1762 #, 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 +#: io.c:1764 io.c:1916 io.c:2068 #, c-format msgid "close of stdout in child failed (%s)" msgstr "falha ao fechar stdout em filho (%s)" -#: io.c:1708 +#: io.c:1767 #, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" msgstr "falha ao mover pty escrava para stdout em filho (dup: %s)" -#: io.c:1710 io.c:1862 +#: io.c:1769 io.c:1921 #, c-format msgid "close of stdin in child failed (%s)" msgstr "falha ao fechar stdin em filho (%s)" -#: io.c:1713 +#: io.c:1772 #, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" msgstr "falha ao mover pty escrava para stdin em filho (dup: %s)" -#: io.c:1715 io.c:1734 +#: io.c:1774 io.c:1793 #, 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 +#: io.c:1867 io.c:1919 io.c:2049 io.c:2071 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "falha ao mover pipe para stdout em processo pai (dup: %s)" -#: io.c:1812 io.c:1865 +#: io.c:1871 io.c:1924 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "falha ao mover pipe para stdin em processo pai (dup: %s)" -#: io.c:1829 io.c:2003 +#: io.c:1888 io.c:2062 msgid "restoring stdout in parent process failed\n" msgstr "falha ao restaurar stdout em processo pai\n" -#: io.c:1834 +#: io.c:1893 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 +#: io.c:1927 io.c:2073 io.c:2084 #, c-format msgid "close of pipe failed (%s)" msgstr "falha ao fechar pipe (%s)" -#: io.c:1913 +#: io.c:1972 msgid "`|&' not supported" msgstr "`|&' não suportado" -#: io.c:1980 +#: io.c:2039 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "impossível abrir pipe `%s' (%s)" -#: io.c:2021 +#: io.c:2080 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "impossível criar processo filho para `%s' (fork: %s)" -#: io.c:2364 +#: io.c:2423 #, c-format msgid "data file `%s' is empty" msgstr "arquivo de dados `%s' vazio" -#: io.c:2407 io.c:2415 +#: io.c:2466 io.c:2474 msgid "could not allocate more input memory" -msgstr "" +msgstr "impossível alocar mais memória de entrada" -#: io.c:2540 io.c:2782 io.c:3046 +#: io.c:2832 io.c:2895 #, c-format msgid "error reading input file `%s': %s" msgstr "erro ao ler arquivo de entrada `%s': %s" -#: io.c:3281 +#: io.c:3020 msgid "multicharacter value of `RS' is a gawk extension" msgstr "valor de múltiplos caracteres para `RS' é uma extensão do gawk" -#: main.c:322 +#: main.c:324 msgid "`-m[fr]' option irrelevant in gawk" msgstr "opção `-m[fr] é irrelevante no gawk" -#: main.c:324 +#: main.c:326 msgid "-m option usage: `-m[fr] nnn'" msgstr "uso da opção -m: `-m[fr] nnn'" -#: main.c:341 +#: main.c:343 #, c-format msgid "%s: option `-W %s' unrecognized, ignored\n" msgstr "%s: opção `-W %s' não reconhecida, ignorada\n" -#: main.c:378 +#: main.c:380 msgid "empty argument to `--source' ignored" msgstr "argumento vazio para --source ignorado" -#: main.c:448 +#: main.c:451 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "variável de ambiente `POSIXLY_CORRECT' ativada: ligando `--posix'" -#: main.c:453 +#: main.c:456 msgid "`--posix' overrides `--traditional'" msgstr "`--posix' sobrepõe `--traditional'" -#: main.c:464 +#: main.c:467 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "`--posix'/`--traditional' sobrepõe `--non-decimal-data'" -#: main.c:468 +#: main.c:471 #, c-format msgid "running %s setuid root may be a security problem" msgstr "rodar %s com setuid root pode ser um problema de segurança" -#: main.c:509 +#: main.c:512 #, c-format msgid "can't set binary mode on stdin (%s)" msgstr "impossível ativar modo binário em stdin (%s)" -#: main.c:512 +#: main.c:515 #, c-format msgid "can't set binary mode on stdout (%s)" msgstr "impossível ativar modo binário em stdout (%s)" -#: main.c:514 +#: main.c:517 #, c-format msgid "can't set binary mode on stderr (%s)" msgstr "impossível ativar modo binário em stderr (%s)" -#: main.c:544 +#: main.c:547 msgid "no program text at all!" msgstr "nenhum texto de programa" -#: main.c:612 +#: main.c:620 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "Uso: %s [opções estilo POSIX ou GNU] -f arqprog [--] arquivo ...\n" -#: main.c:614 +#: main.c:622 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "Uso: %s [opções estilo POSIX ou GNU] [--] %cprograma%c arquivo ...\n" -#: main.c:619 +#: main.c:627 msgid "POSIX options:\t\tGNU long options:\n" msgstr "Opções POSIX: \t\tOpções longas GNU:\n" -#: main.c:620 +#: main.c:628 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "\t-f arqprog \t\t--file=arqprog\n" -#: main.c:621 +#: main.c:629 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "\t-F fs\t\t\t--field-separator=fs\n" -#: main.c:622 +#: main.c:630 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "\t-v var=val\t\t--assign=var=val\n" -#: main.c:623 +#: main.c:631 msgid "\t-m[fr] val\n" msgstr "\t-m[fr] val\n" -#: main.c:624 +#: main.c:632 msgid "\t-W compat\t\t--compat\n" msgstr "\t-W compat\t\t--compat\n" -#: main.c:625 +#: main.c:633 msgid "\t-W copyleft\t\t--copyleft\n" msgstr "\t-W copyleft\t\t--copyleft\n" -#: main.c:626 +#: main.c:634 msgid "\t-W copyright\t\t--copyright\n" msgstr "\t-W copyright\t\t--copyright\n" -#: main.c:627 +#: main.c:635 msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n" msgstr "\t-W dump-variables[=arq] \t--dump-variables[=arq]\n" -#: main.c:628 +#: main.c:636 msgid "\t-W gen-po\t\t--gen-po\n" msgstr "\t-W gen-po\t\t--gen-po\n" -#: main.c:629 +#: main.c:637 msgid "\t-W help\t\t\t--help\n" msgstr "\t-W help\t\t\t--help\n" -#: main.c:630 +#: main.c:638 msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n" msgstr "\t-W lint[=fatal]\t\t--lint[=fatal]\n" -#: main.c:631 +#: main.c:639 msgid "\t-W lint-old\t\t--lint-old\n" msgstr "\t-W lint-old\t\t--lint-old\n" -#: main.c:632 +#: main.c:640 msgid "\t-W non-decimal-data\t--non-decimal-data\n" msgstr "\t-W non-decimal-data\t--non-decimal-data\n" -#: main.c:634 +#: main.c:642 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "\t-W nostalgia\t\t--nostalgia\n" -#: main.c:637 +#: main.c:645 msgid "\t-W parsedebug\t\t--parsedebug\n" msgstr "\t-W parsedebug\t\t--parsedebug\n" -#: main.c:639 +#: main.c:647 msgid "\t-W profile[=file]\t--profile[=file]\n" msgstr "\t-W profile[=arq] \t--profile[=arq]\n" -#: main.c:640 +#: main.c:648 msgid "\t-W posix\t\t--posix\n" msgstr "\t-W posix\t\t--posix\n" -#: main.c:641 +#: main.c:649 msgid "\t-W re-interval\t\t--re-interval\n" msgstr "\t-W re-interval\t\t--re-interval\n" -#: main.c:642 +#: main.c:650 msgid "\t-W source=program-text\t--source=program-text\n" msgstr "\t-W source=program-text\t--source=program-text\n" -#: main.c:643 +#: main.c:651 msgid "\t-W traditional\t\t--traditional\n" msgstr "\t-W traditional\t\t--traditional\n" -#: main.c:644 +#: main.c:652 msgid "\t-W usage\t\t--usage\n" msgstr "\t-W usage\t\t--usage\n" -#: main.c:645 +#: main.c:653 msgid "\t-W version\t\t--version\n" msgstr "\t-W version\t\t--version\n" -#: main.c:649 +#: main.c:657 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" @@ -1454,7 +1466,7 @@ msgstr "" "seção `Reportando Problemas e Bugs' na versão impressa.\n" "\n" -#: main.c:653 +#: main.c:661 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" @@ -1464,7 +1476,7 @@ msgstr "" "Por padrão, o gawk lê a entrada padrão e escreve na saída padrão.\n" "\n" -#: main.c:657 +#: main.c:665 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" @@ -1474,7 +1486,7 @@ msgstr "" "\tgawk '{ soma += $1 }; END { print soma }' arquivo\n" "\tgawk -F: '{ print $1 }' /etc/passwd\n" -#: main.c:669 +#: main.c:682 #, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -1493,7 +1505,7 @@ msgstr "" "(aoseu critério) qualquer versão posterior.\n" "\n" -#: main.c:677 +#: main.c:690 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -1505,7 +1517,7 @@ msgstr "" "QUALQUER GARANTIA. Veja a Licença Pública Geral GNU (GNU GPL)\n" "para mais detalhes.\n" -#: main.c:683 +#: main.c:696 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program; if not, write to the Free Software\n" @@ -1515,11 +1527,11 @@ msgstr "" "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 +#: main.c:730 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "-Ft não faz FS ser tab no awk POSIX" -#: main.c:944 +#: main.c:956 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" @@ -1528,35 +1540,35 @@ msgstr "" "%s: argumento `%s' para `-v' não está na forma `var=valor'\n" "\n" -#: main.c:964 +#: main.c:976 #, c-format msgid "`%s' is not a legal variable name" msgstr "`%s' não é um nome legal de variável" -#: main.c:967 +#: main.c:979 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "`%s' não é um nome de variável, procurando arquivo `%s=%s'" -#: main.c:995 +#: main.c:1012 msgid "floating point exception" msgstr "exceção de ponto flutuante" -#: main.c:1002 +#: main.c:1019 msgid "fatal error: internal error" msgstr "erro fatal: erro interno" -#: main.c:1052 +#: main.c:1069 #, c-format msgid "no pre-opened fd %d" msgstr "nenhum descritor pré-aberto %d" -#: main.c:1057 +#: main.c:1074 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "impossível pré-abrir /dev/null para descritor %d" -#: main.c:1080 main.c:1089 +#: main.c:1097 main.c:1106 #, c-format msgid "could not find groups: %s" msgstr "impossível achar grupos: %s" @@ -1577,23 +1589,23 @@ msgstr "erro: " msgid "fatal: " msgstr "fatal: " -#: node.c:59 node.c:66 node.c:75 node.c:89 node.c:116 +#: node.c:58 node.c:65 node.c:74 node.c:88 node.c:115 msgid "can't convert string to float" msgstr "impossível converter string para float" -#: node.c:357 +#: node.c:355 msgid "backslash at end of string" msgstr "barra invertida (\\) no fim da string" -#: node.c:544 +#: node.c:539 msgid "POSIX does not allow `\\x' escapes" msgstr "POSIX não permite escapes do tipo `\\x'" -#: node.c:550 +#: node.c:545 msgid "no hex digits in `\\x' escape sequence" msgstr "nenhum dígito hexa em seqüência de escape `\\x'" -#: node.c:584 +#: node.c:579 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "seqüência de escape `\\%c' tratada como `%c' normal" @@ -1601,111 +1613,118 @@ 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 "" +msgstr "%s %s `%s': impossível ativar fechar-ao-executar: (fcntl: %s)" #: profile.c:91 #, c-format msgid "could not open `%s' for writing: %s" -msgstr "" +msgstr "impossível abrir `%s' para escrita: %s" -#: profile.c:409 -msgid "internal error: Node_var with null vname" -msgstr "" +#: profile.c:449 +#, c-format +msgid "internal error: %s with null vname" +msgstr "erro interno: %s com vname nulo" -#: profile.c:471 +#: profile.c:512 msgid "# treated internally as `delete'" -msgstr "" +msgstr "# tratado internamente como `delete'" -#: profile.c:545 -msgid "internal error: Node_var_array with null vname" -msgstr "" - -#: profile.c:1127 +#: profile.c:1162 #, c-format msgid "\t# gawk profile, created %s\n" -msgstr "" +msgstr "\t# perfil gawk, criado %s\n" -#: profile.c:1130 +#: profile.c:1165 msgid "" "\t# BEGIN block(s)\n" "\n" msgstr "" +"\t# bloco(s) BEGIN\n" +"\n" -#: profile.c:1140 +#: profile.c:1175 msgid "" "\t# Rule(s)\n" "\n" msgstr "" +"\t# Regra(s)\n" +"\n" -#: profile.c:1146 +#: profile.c:1181 msgid "" "\t# END block(s)\n" "\n" msgstr "" +"\t# bloco(s) END\n" +"\n" -#: profile.c:1166 +#: profile.c:1201 msgid "" "\n" "\t# Functions, listed alphabetically\n" msgstr "" +"\n" +"\t# Funções, listadas alfabeticamente\n" -#: profile.c:1376 +#: profile.c:1413 #, c-format msgid "unexpected type %s in prec_level" -msgstr "" +msgstr "tipo inesperado %s em prec_level" #: re.c:193 #, c-format msgid "regex match failed, not enough memory to match string \"%.*s%s\"" msgstr "" +"busca por exp. reg. falhou, memória insuficiente para testar string \"%.*s%s" +"\"" #: regcomp.c:136 msgid "Success" -msgstr "" +msgstr "Sucesso" #: regcomp.c:139 msgid "No match" -msgstr "" +msgstr "Sem combinação" #: regcomp.c:142 msgid "Invalid regular expression" -msgstr "" +msgstr "Expressão regular inválida" #: regcomp.c:145 msgid "Invalid collation character" -msgstr "" +msgstr "Caracter de combinação inválido" #: regcomp.c:148 msgid "Invalid character class name" -msgstr "" +msgstr "Nome de classe de caracter inválido" #: regcomp.c:151 msgid "Trailing backslash" -msgstr "" +msgstr "contra-barra (\\) finalizando" #: regcomp.c:154 msgid "Invalid back reference" -msgstr "" +msgstr "Referência anterior inválida" #: regcomp.c:157 msgid "Unmatched [ or [^" -msgstr "" +msgstr "[ ou [^ não emparelhado" #: regcomp.c:160 msgid "Unmatched ( or \\(" -msgstr "" +msgstr "( ou \\( não emparelhado" #: regcomp.c:163 msgid "Unmatched \\{" -msgstr "" +msgstr "\\{ não emparelhado" #: regcomp.c:166 msgid "Invalid content of \\{\\}" -msgstr "" +msgstr "Conteúdo inválido de \\{\\}" #: regcomp.c:169 msgid "Invalid range end" -msgstr "" +msgstr "Fim de faixa inválido" #: regcomp.c:172 msgid "Memory exhausted" @@ -1730,3 +1749,18 @@ msgstr ") ou \\) desemparelhado" #: regcomp.c:621 msgid "No previous regular expression" msgstr "Nenhuma expressão regular anterior" + +#~ msgid "substr: length %g is < 0" +#~ msgstr "substr: comprimento %g é < 0" + +#~ msgid "delete: illegal use of variable `%s' as array" +#~ msgstr "delete: uso ilegal da variável `%s' como vetor" + +#~ msgid "asort: first argument is not an array" +#~ msgstr "asort: primeiro argumento não é um vetor" + +#~ msgid "asort: second argument is not an array" +#~ msgstr "asort: segundo argumento não é um vetor" + +#~ msgid "internal error: Node_var_array with null vname" +#~ msgstr "erro interno: Node_var_array com vname nulo" diff --git a/po/quot.sed b/po/quot.sed new file mode 100644 index 00000000..0122c463 --- /dev/null +++ b/po/quot.sed @@ -0,0 +1,6 @@ +s/"\([^"]*\)"/“\1â€/g +s/`\([^`']*\)'/‘\1’/g +s/ '\([^`']*\)' / ‘\1’ /g +s/ '\([^`']*\)'$/ ‘\1’/g +s/^'\([^`']*\)' /‘\1’ /g +s/“â€/""/g diff --git a/po/stamp-po b/po/stamp-po new file mode 100644 index 00000000..9788f702 --- /dev/null +++ b/po/stamp-po @@ -0,0 +1 @@ +timestamp Binary files differ@@ -7,7 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: gawk 3.1.1m\n" -"POT-Creation-Date: 2003-03-19 14:25+0200\n" +"Report-Msgid-Bugs-To: arnold@skeeve.com\n" +"POT-Creation-Date: 2003-07-07 11:20-0700\n" "PO-Revision-Date: 2003-02-27 19:54+0100\n" "Last-Translator: Martin Sjögren <md9ms@mdstud.chalmers.se>\n" "Language-Team: Swedish <sv@li.org>\n" @@ -15,64 +16,61 @@ msgstr "" "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 +#: array.c:112 +#, c-format +msgid "attempt to use scalar parameter `%s' as an array" +msgstr "försök att använda skalärparametern \"%s\" som en vektor" + +#: array.c:113 #, c-format msgid "attempt to use scalar `%s' as array" msgstr "försök att använda skalären \"%s\" som vektor" -#: array.c:338 +#: array.c:151 +#, fuzzy, c-format +msgid "from %s" +msgstr "%s (från %s)" + +#: array.c:506 #, c-format msgid "reference to uninitialized element `%s[\"%s\"]'" msgstr "referens till ickeinitierat element \"%s[\"%s\"]\"" -#: array.c:344 +#: array.c:512 #, c-format msgid "subscript of array `%s' is null string" msgstr "index i vektorn \"%s\" är en tom sträng" -#: array.c:412 array.c:425 array.c:466 +#: array.c:609 #, c-format msgid "delete: index `%s' not in array `%s'" msgstr "delete: index \"%s\" finns inte i vektorn \"%s\"" -#: 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 +#: array.c:769 #, c-format msgid "%s: empty (null)\n" msgstr "%s: tom (null)\n" -#: array.c:638 +#: array.c:774 #, c-format msgid "%s: empty (zero)\n" msgstr "%s: tom (noll)\n" -#: array.c:642 +#: array.c:778 #, c-format msgid "%s: table_size = %d, array_size = %d\n" msgstr "%s: tabellstorlek = %d, vektorstorlek = %d\n" -#: array.c:671 +#: array.c:807 #, c-format msgid "%s: is parameter\n" msgstr "%s: är en parameter\n" -#: array.c:676 +#: array.c:812 #, c-format msgid "%s: array_ref to %s\n" msgstr "%s: vektorreferens till %s\n" -#: array.c:975 -msgid "asort: first argument is not an array" -msgstr "asort: första argumentet är inte en vektor" - -#: array.c:984 -msgid "asort: second argument is not an array" -msgstr "asort: andra argumentet är inte en vektor" - #: awkgram.y:208 #, c-format msgid "%s blocks must have an action part" @@ -92,266 +90,279 @@ msgstr "\"%s\" är en inbyggd funktion, den kan inte definieras om" msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "regexp-konstanten \"/%s/\" ser ut som en C-kommentar men är inte det" -#: awkgram.y:340 +#: awkgram.y:340 awkgram.y:615 msgid "statement may have no effect" msgstr "kommandot kanske inte har någon effekt" -#: awkgram.y:431 awkgram.y:451 +#: awkgram.y:435 awkgram.y:455 #, c-format msgid "`%s' used in %s action" msgstr "\"%s\" använd i %s-åtgärden" -#: awkgram.y:444 awkgram.y:447 +#: awkgram.y:448 awkgram.y:451 msgid "`nextfile' is a gawk extension" msgstr "\"nextfile\" är en gawk-utökning" -#: awkgram.y:461 +#: awkgram.y:465 msgid "`return' used outside function context" msgstr "\"return\" använd utanför funktion" -#: awkgram.y:500 +#: awkgram.y:504 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" msgstr "" "ensamt \"print\" i BEGIN eller END-regel bör troligen vara 'print \"\"'" -#: awkgram.y:513 awkgram.y:520 +#: awkgram.y:517 awkgram.y:524 msgid "`delete array' is a gawk extension" msgstr "\"delete array\" är en gawk-utökning" -#: awkgram.y:528 awkgram.y:535 +#: awkgram.y:532 awkgram.y:539 msgid "`delete(array)' is a non-portable tawk extension" msgstr "\"delete(array)\" är en icke portabel tawk-utökning" -#: awkgram.y:578 +#: awkgram.y:583 +#, c-format +msgid "duplicate case values in switch body: %s" +msgstr "" + +#: awkgram.y:593 +msgid "Duplicate `default' detected in switch body" +msgstr "" + +#: awkgram.y:681 msgid "multistage two-way pipelines don't work" msgstr "flerstegs dubbelriktade rör fungerar inte" -#: awkgram.y:669 +#: awkgram.y:772 msgid "regular expression on right of assignment" msgstr "reguljärt uttryck i högerledet av en tilldelning" -#: awkgram.y:679 +#: awkgram.y:782 msgid "regular expression on left of `~' or `!~' operator" msgstr "reguljärt uttryck på vänster sida om en \"~\"- eller \"!~\"-operator" -#: awkgram.y:687 +#: awkgram.y:790 msgid "regular expression on right of comparison" msgstr "reguljärt uttryck i högerledet av en jämförelse" -#: awkgram.y:754 +#: awkgram.y:857 msgid "non-redirected `getline' undefined inside END action" msgstr "icke omdirigerad \"getline\" odefinierad inuti END-åtgärd" -#: awkgram.y:781 +#: awkgram.y:884 msgid "call of `length' without parentheses is not portable" msgstr "anrop av \"length\" utan parenteser är inte portabelt" -#: awkgram.y:784 +#: awkgram.y:887 msgid "call of `length' without parentheses is deprecated by POSIX" msgstr "anrop av \"length\" utan parenteser är föråldrat enligt POSIX" -#: awkgram.y:835 +#: awkgram.y:940 +msgid "use of non-array as array" +msgstr "" + +#: awkgram.y:942 msgid "invalid subscript expression" msgstr "ogiltig indexuttryck" -#: awkgram.y:1020 +#: awkgram.y:1140 msgid "unexpected newline or end of string" msgstr "oväntat nyradstecken eller slut på strängen" -#: awkgram.y:1115 +#: awkgram.y:1235 msgid "empty program text on command line" msgstr "tom programtext på kommandoraden" -#: awkgram.y:1172 +#: awkgram.y:1292 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "kan inte öppna källfilen \"%s\" för läsning (%s)" -#: awkgram.y:1207 +#: awkgram.y:1327 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "kan inte läsa källfilen \"%s\" (%s)" -#: awkgram.y:1215 +#: awkgram.y:1335 #, 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 +#: awkgram.y:1537 awkgram.y:1647 awkgram.y:1665 awkgram.y:2015 awkgram.y:2100 msgid "source file does not end in newline" msgstr "källfilen slutar inte med en ny rad" -#: awkgram.y:1481 +#: awkgram.y:1601 msgid "unterminated regexp ends with `\\' at end of file" msgstr "oavslutat reguljärt uttryck slutar med \"\\\" i slutet av filen" -#: awkgram.y:1501 +#: awkgram.y:1621 msgid "unterminated regexp" msgstr "oavslutat reguljärt uttryck" -#: awkgram.y:1504 +#: awkgram.y:1624 msgid "unterminated regexp at end of file" msgstr "oavslutat reguljärt uttryck i slutet av filen" -#: awkgram.y:1571 +#: awkgram.y:1691 msgid "use of `\\ #...' line continuation is not portable" msgstr "Användning av \"\\ #...\" för radfortsättning är inte portabelt" -#: awkgram.y:1583 +#: awkgram.y:1703 msgid "backslash not last character on line" msgstr "sista tecknet på raden är inte ett omvänt snedstreck" -#: awkgram.y:1628 +#: awkgram.y:1748 msgid "POSIX does not allow operator `**='" msgstr "POSIX tillåter inte operatorn \"**=\"" -#: awkgram.y:1630 +#: awkgram.y:1750 msgid "old awk does not support operator `**='" msgstr "gamla awk stöder inte operatorn \"**=\"" -#: awkgram.y:1639 +#: awkgram.y:1759 msgid "POSIX does not allow operator `**'" msgstr "POSIX tillåter inte operatorn \"**\"" -#: awkgram.y:1641 +#: awkgram.y:1761 msgid "old awk does not support operator `**'" msgstr "gamla awk stöder inte operatorn \"**\"" -#: awkgram.y:1672 +#: awkgram.y:1792 msgid "operator `^=' is not supported in old awk" msgstr "operatorn \"^=\" stöds inte i gamla awk" -#: awkgram.y:1680 +#: awkgram.y:1800 msgid "operator `^' is not supported in old awk" msgstr "operatorn \"^\" stöds inte i gamla awk" -#: awkgram.y:1764 awkgram.y:1781 +#: awkgram.y:1884 awkgram.y:1901 msgid "unterminated string" msgstr "oavslutad sträng" -#: awkgram.y:1941 +#: awkgram.y:2061 #, c-format msgid "invalid char '%c' in expression" msgstr "ogiltigt tecken \"%c\" i uttryck" -#: awkgram.y:2001 +#: awkgram.y:2121 #, c-format msgid "`%s' is a gawk extension" msgstr "\"%s\" är en gawk-utökning" -#: awkgram.y:2004 +#: awkgram.y:2124 #, c-format msgid "`%s' is a Bell Labs extension" msgstr "\"%s\" är en Bell Labs-utökning" -#: awkgram.y:2007 +#: awkgram.y:2127 #, c-format msgid "POSIX does not allow `%s'" msgstr "POSIX tillåter inte \"%s\"" -#: awkgram.y:2011 +#: awkgram.y:2131 #, c-format msgid "`%s' is not supported in old awk" msgstr "\"%s\" stöds inte i gamla awk" -#: awkgram.y:2038 +#: awkgram.y:2158 msgid "`goto' considered harmful!\n" msgstr "\"goto\" anses skadlig!\n" -#: awkgram.y:2102 +#: awkgram.y:2220 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "%d är ett ogiltigt antal argument för %s" -#: awkgram.y:2121 awkgram.y:2124 +#: awkgram.y:2239 awkgram.y:2242 msgid "match: third argument is a gawk extension" msgstr "match: tredje argumentet är en gawk-utökning" -#: awkgram.y:2137 +#: awkgram.y:2255 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "" "%s: bokstavlig sträng som sista argument till ersättning har ingen effekt" -#: awkgram.y:2140 +#: awkgram.y:2258 #, c-format msgid "%s third parameter is not a changeable object" msgstr "%s: tredje argumentet är inte ett ändringsbart objekt" -#: awkgram.y:2167 awkgram.y:2170 +#: awkgram.y:2285 awkgram.y:2288 msgid "close: second argument is a gawk extension" msgstr "close: andra argumentet är en gawk-utökning" -#: awkgram.y:2180 +#: awkgram.y:2298 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "användandet av dcgettext(_\"...\") är felaktigt: ta bort det inledande " "understrykningstecknet" -#: awkgram.y:2195 +#: awkgram.y:2313 msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "" "användandet av dcngettext(_\"...\") är felaktigt: ta bort det inledande " "understrykningstecknet" -#: awkgram.y:2266 +#: awkgram.y:2384 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "funktionen \"%s\": parameter %d, \"%s\", är samma som parameter %d" -#: awkgram.y:2299 +#: awkgram.y:2417 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "funktionen \"%s\": parametern \"%s\" överskuggar en global variabel" -#: awkgram.y:2411 +#: awkgram.y:2529 #, 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 +#: awkgram.y:2530 profile.c:93 msgid "sending profile to standard error" msgstr "skickar profilen till standard fel" -#: awkgram.y:2442 +#: awkgram.y:2562 #, c-format msgid "%s: close failed (%s)" msgstr "%s: misslyckades att stänga (%s)" -#: awkgram.y:2566 +#: awkgram.y:2684 msgid "shadow_funcs() called twice!" msgstr "shadow_funcs() anropad två gånger!" -#: awkgram.y:2593 +#: awkgram.y:2711 msgid "there were shadowed variables." msgstr "det fanns överskuggade variabler." -#: awkgram.y:2666 +#: awkgram.y:2784 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "funktionen \"%s\": kan inte använda funktionsnamn som parameternamn" -#: awkgram.y:2676 +#: awkgram.y:2794 #, c-format msgid "function name `%s' previously defined" msgstr "funktionsnamnet \"%s\" är definierat sedan tidigare" -#: awkgram.y:2827 awkgram.y:2833 +#: awkgram.y:2945 awkgram.y:2951 #, c-format msgid "function `%s' called but never defined" msgstr "funktionen \"%s\" anropad men aldrig definierad" -#: awkgram.y:2836 +#: awkgram.y:2954 #, c-format msgid "function `%s' defined but never called" msgstr "funktionen \"%s\" definierad men aldrig anropad" -#: awkgram.y:2863 +#: awkgram.y:2981 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "konstant reguljärt uttryck för parameter %d ger ett booleskt värde" -#: awkgram.y:2876 +#: awkgram.y:2994 #, c-format msgid "" "function `%s' called with space between name and `(',\n" @@ -360,192 +371,197 @@ msgstr "" "funktionen \"%s\" anropad med blanktecken mellan namnet och \"(\",\n" "%s" -#: awkgram.y:2878 +#: awkgram.y:2996 msgid "or used as a variable or an array" msgstr "eller använd som variabel eller vektor" -#: builtin.c:111 +#: builtin.c:137 #, c-format msgid "%s to \"%s\" failed (%s)" msgstr "%s till \"%s\" misslyckades (%s)" -#: builtin.c:112 +#: builtin.c:138 msgid "standard output" msgstr "standard ut" -#: builtin.c:113 +#: builtin.c:139 msgid "reason unknown" msgstr "okänd anledning" -#: builtin.c:126 +#: builtin.c:152 msgid "exp: received non-numeric argument" msgstr "exp: fick ett ickenumeriskt argument" -#: builtin.c:132 +#: builtin.c:158 #, c-format msgid "exp: argument %g is out of range" msgstr "exp: argumentet %g är inte inom tillåten gräns" -#: builtin.c:190 +#: builtin.c:216 #, c-format msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing" msgstr "" "fflush: kan inte spola: röret \"%s\" öppnat för läsning, inte skrivning" -#: builtin.c:193 +#: builtin.c:219 #, c-format msgid "fflush: cannot flush: file `%s' opened for reading, not writing" msgstr "" "fflush: kan inte spola: filen \"%s\" öppnad för läsning, inte skrivning" -#: builtin.c:205 +#: builtin.c:231 #, c-format msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "fflush: \"%s\" är inte en öppen fil, rör eller koprocess" -#: builtin.c:299 +#: builtin.c:325 msgid "index: received non-string first argument" msgstr "index: första argumentet är inte en sträng" -#: builtin.c:301 +#: builtin.c:327 msgid "index: received non-string second argument" msgstr "index: andra argumentet är inte en sträng" -#: builtin.c:411 +#: builtin.c:437 msgid "int: received non-numeric argument" msgstr "int: fick ett ickenumeriskt argument" -#: builtin.c:428 +#: builtin.c:454 msgid "length: received non-string argument" msgstr "length: fick ett argument som inte är en sträng" -#: builtin.c:444 +#: builtin.c:470 msgid "log: received non-numeric argument" msgstr "log: fick ett ickenumeriskt argument" -#: builtin.c:447 +#: builtin.c:473 #, c-format msgid "log: received negative argument %g" msgstr "log: fick ett negativt argumentet %g" -#: builtin.c:609 builtin.c:612 +#: builtin.c:635 builtin.c:638 msgid "must use `count$' on all formats or none" msgstr "måste använda \"count$\" på alla eller inga format" -#: builtin.c:714 +#: builtin.c:740 msgid "`$' is not permitted in awk formats" msgstr "\"$\" tillåts inte i awkformat" -#: builtin.c:720 +#: builtin.c:746 msgid "arg count with `$' must be > 0" msgstr "argumentantalet med \"$\" måste vara > 0" -#: builtin.c:722 +#: builtin.c:748 #, c-format msgid "arg count %ld greater than total number of supplied arguments" msgstr "argumentantalet %ld är större än antalet givna argument" -#: builtin.c:724 +#: builtin.c:750 msgid "`$' not permitted after period in format" msgstr "\"$\" tillåts inte efter en punkt i formatet" -#: builtin.c:737 +#: builtin.c:763 msgid "no `$' supplied for positional field width or precision" msgstr "inget \"$\" bifogat för positionsangiven fältbredd eller precision" -#: builtin.c:795 +#: builtin.c:821 msgid "`l' is meaningless in awk formats; ignored" msgstr "\"l\" är meningslös i awk-format, ignorerad" -#: builtin.c:799 +#: builtin.c:825 msgid "`l' is not permitted in POSIX awk formats" msgstr "\"l\" tillåts inte i POSIX awk-format" -#: builtin.c:810 +#: builtin.c:836 msgid "`L' is meaningless in awk formats; ignored" msgstr "\"L\" är meningslös i awk-format, ignorerad" -#: builtin.c:814 +#: builtin.c:840 msgid "`L' is not permitted in POSIX awk formats" msgstr "\"L\" tillåts inte i POSIX awk-format" -#: builtin.c:825 +#: builtin.c:851 msgid "`h' is meaningless in awk formats; ignored" msgstr "\"h\" är meningslös i awk-format, ignorerad" -#: builtin.c:829 +#: builtin.c:855 msgid "`h' is not permitted in POSIX awk formats" msgstr "\"h\" tillåts inte i POSIX awk-format" -#: builtin.c:1078 +#: builtin.c:1055 +#, c-format +msgid "[s]printf: value %g is out of range for `%%%c' format" +msgstr "" + +#: builtin.c:1108 msgid "not enough arguments to satisfy format string" msgstr "för få argument för formatsträngen" -#: builtin.c:1080 +#: builtin.c:1110 msgid "^ ran out for this one" msgstr "^ tog slut här" -#: builtin.c:1085 +#: builtin.c:1115 msgid "[s]printf: format specifier does not have control letter" msgstr "[s]printf: formatspecifieraren har ingen kommandobokstav" -#: builtin.c:1088 +#: builtin.c:1118 msgid "too many arguments supplied for format string" msgstr "för många argument för formatsträngen" -#: builtin.c:1154 builtin.c:1157 +#: builtin.c:1184 builtin.c:1187 msgid "printf: no arguments" msgstr "printf: inga argument" -#: builtin.c:1181 +#: builtin.c:1211 msgid "sqrt: received non-numeric argument" msgstr "sqrt: fick ickenumeriskt argument" -#: builtin.c:1185 +#: builtin.c:1215 #, c-format msgid "sqrt: called with negative argument %g" msgstr "sqrt: anropad med negativt argument %g" -#: builtin.c:1207 +#: builtin.c:1238 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "substr: startindex %g är ogiltigt, använder 1" -#: builtin.c:1212 +#: builtin.c:1243 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "substr: startindex %g som inte är ett heltal kommer trunkeras" -#: builtin.c:1231 -#, c-format -msgid "substr: length %g is <= 0" +#: builtin.c:1262 +#, fuzzy, c-format +msgid "substr: length %g is not >= 1" msgstr "substr: längden %g är <= 0" -#: builtin.c:1233 -#, c-format -msgid "substr: length %g is < 0" -msgstr "substr: längden %g är < 0" +#: builtin.c:1264 +#, fuzzy, c-format +msgid "substr: length %g is not >= 0" +msgstr "substr: längden %g är <= 0" -#: builtin.c:1240 +#: builtin.c:1271 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "substr: längden %g som inte är ett heltal kommer trunkeras" -#: builtin.c:1245 +#: builtin.c:1276 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" msgstr "substr: längden %g är för stor för strängindexering, trunkeras till %g" -#: builtin.c:1257 +#: builtin.c:1288 msgid "substr: source string is zero length" msgstr "substr: källsträngen är tom" -#: builtin.c:1263 +#: builtin.c:1294 #, c-format msgid "substr: start index %g is past end of string" msgstr "substr: startindex %g är bortom strängens slut" -#: builtin.c:1271 +#: builtin.c:1302 #, c-format msgid "" "substr: length %g at start index %g exceeds length of first argument (%lu)" @@ -553,288 +569,288 @@ msgstr "" "substr: längden %g vid startindex %g överskrider det första argumentets " "längd (%lu)" -#: builtin.c:1306 +#: builtin.c:1337 msgid "strftime: received non-string first argument" msgstr "strftime: fick ett första argument som inte är en sträng" -#: builtin.c:1312 +#: builtin.c:1343 msgid "strftime: received empty format string" msgstr "strftime: fick en tom formatsträng" -#: builtin.c:1321 +#: builtin.c:1352 msgid "strftime: received non-numeric second argument" msgstr "strftime: fick ett ickenumeriskt andra argument" -#: builtin.c:1384 +#: builtin.c:1415 msgid "mktime: received non-string argument" msgstr "mktime: fick ett argument som inte är en sträng" -#: builtin.c:1429 +#: builtin.c:1460 msgid "system: received non-string argument" msgstr "system: fick ett argument som inte är en sträng" -#: builtin.c:1573 +#: builtin.c:1581 eval.c:1883 +#, fuzzy, c-format +msgid "reference to uninitialized field `$%d'" +msgstr "referens till icke initierad variabel \"%s\"" + +#: builtin.c:1608 msgid "tolower: received non-string argument" msgstr "tolower: fick ett argument som inte är en sträng" -#: builtin.c:1622 +#: builtin.c:1657 msgid "toupper: received non-string argument" msgstr "toupper: fick ett argument som inte är en sträng" -#: builtin.c:1667 +#: builtin.c:1702 msgid "atan2: received non-numeric first argument" msgstr "atan2: fick ett ickenumeriskt första argument" -#: builtin.c:1669 +#: builtin.c:1704 msgid "atan2: received non-numeric second argument" msgstr "atan2: fick ett ickenumeriskt andra argument" -#: builtin.c:1688 +#: builtin.c:1723 msgid "sin: received non-numeric argument" msgstr "sin: fick ett ickenumeriskt argument" -#: builtin.c:1704 +#: builtin.c:1739 msgid "cos: received non-numeric argument" msgstr "cos: fick ett ickenumeriskt argument" -#: builtin.c:1748 +#: builtin.c:1788 msgid "srand: received non-numeric argument" msgstr "srand: fick ett ickenumeriskt argument" -#: builtin.c:1787 +#: builtin.c:1823 msgid "match: third argument is not an array" msgstr "match: tredje argumentet är inte en vektor" -#: builtin.c:2264 -msgid "gensub: 3rd argument of 0 treated as 1" +#: builtin.c:2307 +msgid "gensub: third argument of 0 treated as 1" msgstr "gensub: Nollan i tredje argumentet behandlad som en etta" -#: builtin.c:2375 builtin.c:2377 +#: builtin.c:2416 builtin.c:2418 msgid "lshift: received non-numeric first argument" msgstr "lshift: fick ett ickenumeriskt första argument" -#: builtin.c:2379 +#: builtin.c:2420 #, c-format msgid "lshift(%lf, %lf): negative values will give strange results" msgstr "lshift(%lf, %lf): negativa värden kommer ge konstiga resultat" -#: builtin.c:2381 +#: builtin.c:2422 #, c-format msgid "lshift(%lf, %lf): fractional values will be truncated" msgstr "lshift(%lf, %lf): flyttalsvärden kommer trunkeras" -#: builtin.c:2383 +#: builtin.c:2424 #, c-format msgid "lshift(%lf, %lf): too large shift value will give strange results" msgstr "lshift(%lf, %lf): för stora skiftvärden kommer ge konstiga resultat" -#: builtin.c:2412 builtin.c:2414 +#: builtin.c:2453 builtin.c:2455 msgid "rshift: received non-numeric first argument" msgstr "rshift: fick ett ickenumeriskt första argument" -#: builtin.c:2416 +#: builtin.c:2457 #, c-format msgid "rshift(%lf, %lf): negative values will give strange results" msgstr "rshift(%lf, %lf): negativa värden kommer ge konstiga resultat" -#: builtin.c:2418 +#: builtin.c:2459 #, c-format msgid "rshift(%lf, %lf): fractional values will be truncated" msgstr "rshift(%lf, %lf): flyttalsvärden kommer trunkeras" -#: builtin.c:2420 +#: builtin.c:2461 #, c-format msgid "rshift(%lf, %lf): too large shift value will give strange results" msgstr "rshift(%lf, %lf): för stora skiftvärden kommer ge konstiga resultat" -#: builtin.c:2449 builtin.c:2451 +#: builtin.c:2490 builtin.c:2492 msgid "and: received non-numeric first argument" msgstr "and: fick ett ickenumeriskt första argument" -#: builtin.c:2453 +#: builtin.c:2494 #, c-format msgid "and(%lf, %lf): negative values will give strange results" msgstr "and(%lf, %lf): negativa värden kommer ge konstiga resultat" -#: builtin.c:2455 +#: builtin.c:2496 #, c-format msgid "and(%lf, %lf): fractional values will be truncated" msgstr "and(%lf, %lf): flyttalsvärden kommer trunkeras" -#: builtin.c:2484 builtin.c:2486 +#: builtin.c:2525 builtin.c:2527 msgid "or: received non-numeric first argument" msgstr "or: fick ett ickenumeriskt första argument" -#: builtin.c:2488 +#: builtin.c:2529 #, c-format msgid "or(%lf, %lf): negative values will give strange results" msgstr "or(%lf, %lf): negativa värden kommer ge konstiga resultat" -#: builtin.c:2490 +#: builtin.c:2531 #, c-format msgid "or(%lf, %lf): fractional values will be truncated" msgstr "or(%lf, %lf): flyttalsvärden kommer trunkeras" -#: builtin.c:2519 builtin.c:2521 +#: builtin.c:2560 builtin.c:2562 msgid "xor: received non-numeric first argument" msgstr "xor: fick ett ickenumeriskt första argument" -#: builtin.c:2523 +#: builtin.c:2564 #, c-format msgid "xor(%lf, %lf): negative values will give strange results" msgstr "xor(%lf, %lf): negativa värden kommer ge konstiga resultat" -#: builtin.c:2525 +#: builtin.c:2566 #, c-format msgid "xor(%lf, %lf): fractional values will be truncated" msgstr "xor(%lf, %lf): flyttalsvärden kommer trunkeras" -#: builtin.c:2553 +#: builtin.c:2594 msgid "compl: received non-numeric argument" msgstr "compl: fick ett ickenumeriskt argument" -#: builtin.c:2555 +#: builtin.c:2596 #, c-format msgid "compl(%lf): negative value will give strange results" msgstr "compl(%lf): negativa värden kommer ge konstiga resultat" -#: builtin.c:2557 +#: builtin.c:2598 #, c-format msgid "compl(%lf): fractional value will be truncated" msgstr "compl(%lf): flyttalsvärden kommer trunkeras" -#: builtin.c:2728 +#: builtin.c:2771 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "dcgettext: \"%s\" är inte en giltig lokalkategori" -#: eval.c:262 +#: eval.c:266 #, c-format msgid "unknown nodetype %d" msgstr "okänd nodtyp %d" -#: eval.c:310 +#: eval.c:312 msgid "buffer overflow in genflags2str" msgstr "buffertöverflöd i genflags2str" -#: eval.c:555 +#: eval.c:647 #, c-format msgid "for loop: array `%s' changed size from %ld to %ld during loop execution" msgstr "" "forslinga: vektorn \"%s\" ändrade storlek från %ld till %ld under " "slingexekvering" -#: eval.c:576 +#: eval.c:668 msgid "`break' outside a loop is not portable" msgstr "\"break\" utanför en slinga är inte portabelt" -#: eval.c:580 +#: eval.c:672 msgid "`break' outside a loop is not allowed" msgstr "\"break\" utanför en slinga är inte tillåtet" -#: eval.c:597 +#: eval.c:689 msgid "`continue' outside a loop is not portable" msgstr "\"continue\" utanför en slinga är inte portabelt" -#: eval.c:601 +#: eval.c:693 msgid "`continue' outside a loop is not allowed" msgstr "\"continue\" utanför en slinga är inte tillåtet" -#: eval.c:635 +#: eval.c:727 msgid "`next' cannot be called from a BEGIN rule" msgstr "\"next\" kan inte anropas från en BEGIN-regel" -#: eval.c:637 +#: eval.c:729 msgid "`next' cannot be called from an END rule" msgstr "\"next\" kan inte anropas från en END-regel" -#: eval.c:646 +#: eval.c:738 msgid "`nextfile' cannot be called from a BEGIN rule" msgstr "\"nextfile\" kan inte anropas från en BEGIN-regel" -#: eval.c:648 +#: eval.c:740 msgid "`nextfile' cannot be called from an END rule" msgstr "\"nextfile\" kan inte anropas från en END-regel" -#: eval.c:696 +#: eval.c:785 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 +#: eval.c:828 eval.c:1726 #, c-format msgid "can't use function name `%s' as variable or array" msgstr "kan inte använda funktionsnamnet \"%s\" som variabel eller vektor" -#: eval.c:746 eval.c:752 +#: eval.c:835 eval.c:841 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "referens till icke initierat argument \"%s\"" -#: eval.c:810 eval.c:1728 profile.c:773 +#: eval.c:848 eval.c:907 eval.c:1732 eval.c:1742 profile.c:807 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "försök att använda vektorn \"%s\" i skalärsammanhang" -#: eval.c:910 +#: eval.c:858 eval.c:1752 +#, c-format +msgid "reference to uninitialized variable `%s'" +msgstr "referens till icke initierad variabel \"%s\"" + +#: eval.c:1007 msgid "" "concatenation: side effects in one expression have changed the length of " "another!" msgstr "" "concatenation: sidoeffekter i ett uttryck har ändrat längden av ett annat!" -#: eval.c:935 +#: eval.c:1032 msgid "assignment used in conditional context" msgstr "tilldelning använt i jämförelsesammanhang" -#: eval.c:1026 +#: eval.c:1122 msgid "division by zero attempted" msgstr "försökte dividera med noll" -#: eval.c:1041 +#: eval.c:1137 #, c-format msgid "division by zero attempted in `%%'" msgstr "försökte dividera med noll i \"%%\"" -#: eval.c:1056 profile.c:649 +#: eval.c:1152 profile.c:683 #, c-format msgid "illegal type (%s) in tree_eval" msgstr "otillåten typ (%s) i tree_eval" -#: eval.c:1232 +#: eval.c:1328 msgid "division by zero attempted in `/='" msgstr "försökte dividera med noll i \"/=\"" -#: eval.c:1250 +#: eval.c:1346 #, 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 +#: eval.c:1586 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "funktionen \"%s\" anropad med fler argument än vad som deklarerats" -#: eval.c:1628 +#: eval.c:1633 #, c-format msgid "function `%s' not defined" msgstr "funktionen \"%s\" är inte definierad" -#: eval.c:1634 +#: eval.c:1639 #, c-format msgid "function %s called\n" msgstr "funktionen %s anropad\n" -#: eval.c:1693 +#: eval.c:1698 msgid "" "\n" "\t# Function Call Stack:\n" @@ -844,46 +860,41 @@ msgstr "" "\t# Funktionsanropsstack:\n" "\n" -#: eval.c:1696 +#: eval.c:1701 msgid "\t# -- main --\n" msgstr "\t# -- main --\n" -#: eval.c:1850 +#: eval.c:1867 msgid "attempt to field reference from non-numeric value" msgstr "försök att fältreferera från ickenumeriskt värde" -#: eval.c:1852 +#: eval.c:1869 msgid "attempt to reference from null string" msgstr "försök att referera från tom sträng" -#: eval.c:1858 +#: eval.c:1875 #, 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 +#: eval.c:1896 eval.c:1903 profile.c:900 msgid "assignment is not allowed to result of builtin function" msgstr "det är inte tillåtet att tilldela resultatet från en inbyggd funktion" -#: eval.c:1941 +#: eval.c:1951 msgid "`IGNORECASE' is a gawk extension" msgstr "\"IGNORECASE\" är en gawk-utökning" -#: eval.c:1970 +#: eval.c:1980 msgid "`BINMODE' is a gawk extension" msgstr "\"BINMODE\" är en gawk-utökning" -#: eval.c:2082 +#: eval.c:2092 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "felaktig \"%sFMT\"-specifikation \"%s\"" -#: eval.c:2160 +#: eval.c:2170 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "slår av \"--lint\" på grund av en tilldelning till \"LINT\"" @@ -901,32 +912,32 @@ 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:181 +#: ext.c:183 msgid "Operation Not Supported" msgstr "Operationen stöds inte" -#: field.c:321 +#: field.c:315 msgid "NF set to negative value" msgstr "NF satt till ett negativt värde" -#: field.c:819 +#: field.c:808 msgid "split: second argument is not an array" msgstr "split: andra argumentet är inte en vektor" -#: field.c:854 +#: field.c:842 msgid "split: null string for third arg is a gawk extension" msgstr "split: tom sträng som tredje argument är en gawk-utökning" -#: field.c:906 +#: field.c:894 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "\"FIELDWIDTHS\" är en gawk-utökning" -#: field.c:933 +#: field.c:921 #, c-format msgid "field %d in FIELDWIDTHS, must be > 0" msgstr "fält %d i FIELDWIDTHS måste vara > 0" -#: field.c:1006 +#: field.c:994 msgid "null string for `FS' is a gawk extension" msgstr "tom sträng som \"FS\" är en gawk-utökning" @@ -970,7 +981,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:431 +#: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:434 #, c-format msgid "%s: option requires an argument -- %c\n" msgstr "%s: flaggan kräver ett argument -- %c\n" @@ -985,469 +996,469 @@ 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" -#: io.c:257 +#: io.c:305 #, c-format msgid "cannot open file `%s' for reading (%s)" msgstr "kan inte öppna filen \"%s\" för läsning (%s)" -#: io.c:344 +#: io.c:392 #, c-format msgid "close of fd %d (`%s') failed (%s)" msgstr "stängning av fd %d (\"%s\") misslyckades (%s)" -#: io.c:482 +#: io.c:530 #, c-format msgid "invalid tree type %s in redirect()" msgstr "ogiltig trädtyp %s i redirect()" -#: io.c:488 +#: io.c:536 #, c-format msgid "expression in `%s' redirection only has numeric value" msgstr "uttrycket i \"%s\"-omdirigering har bara numeriskt värde" -#: io.c:494 +#: io.c:542 #, c-format msgid "expression for `%s' redirection has null string value" msgstr "uttrycket för \"%s\"-omdirigering har en tom sträng som värde" -#: io.c:499 +#: io.c:547 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" msgstr "" "filnamnet \"%s\" för \"%s\"-omdirigering kan vara resultatet av ett logiskt " "uttryck" -#: io.c:521 +#: io.c:569 #, c-format msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" msgstr "onödig blandning av \">\" och \">>\" för filen \"%.*s\"" -#: io.c:573 +#: io.c:621 #, c-format msgid "can't open pipe `%s' for output (%s)" msgstr "kan inte öppna röret \"%s\" för utmatning (%s)" -#: io.c:582 +#: io.c:630 #, c-format msgid "can't open pipe `%s' for input (%s)" msgstr "kan inte öppna röret \"%s\" för inmatning (%s)" -#: io.c:595 +#: io.c:643 #, c-format msgid "can't open two way socket `%s' for input/output (%s)" msgstr "kan inte öppna tvåvägsuttaget \"%s\" för in-/utmatning (%s)" -#: io.c:599 +#: io.c:647 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" msgstr "kan inte öppna tvåvägsröret \"%s\" för in-/utmatning (%s)" -#: io.c:675 +#: io.c:723 #, c-format msgid "can't redirect from `%s' (%s)" msgstr "kan inte dirigera om från \"%s\" (%s)" -#: io.c:678 +#: io.c:726 #, c-format msgid "can't redirect to `%s' (%s)" msgstr "kan inte dirigera om till \"%s\" (%s)" -#: io.c:717 +#: io.c:765 msgid "" "reached system limit for open files: starting to multiplex file descriptors" msgstr "" "nådde systembegränsningen för öppna filer: börjar multiplexa fildeskriptorer" -#: io.c:729 +#: io.c:777 #, c-format msgid "close of `%s' failed (%s)." msgstr "stängning av \"%s\" misslyckades (%s)" -#: io.c:736 +#: io.c:784 msgid "too many pipes or input files open" msgstr "för många rör eller indatafiler öppna" -#: io.c:759 +#: io.c:807 msgid "close: second argument must be `to' or `from'" msgstr "close: andra argumentet måste vara \"to\" eller \"from\"" -#: io.c:773 +#: io.c:821 #, c-format msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "close: \"%.*s\" är inte en öppen fil, rör eller koprocess" -#: io.c:777 +#: io.c:825 msgid "close of redirection that was never opened" msgstr "stängning av omdirigering som aldrig öppnades" -#: io.c:804 +#: io.c:862 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" msgstr "" "close: omdirigeringen \"%s\" öppnades inte med \"|&\", andra argumentet " "ignorerat" -#: io.c:866 +#: io.c:924 #, c-format msgid "failure status (%d) on pipe close of `%s' (%s)" msgstr "felstatus (%d) från rörstängning av \"%s\" (%s)" -#: io.c:869 +#: io.c:927 #, c-format msgid "failure status (%d) on file close of `%s' (%s)" msgstr "felstatus (%d) från filstängning av \"%s\" (%s)" -#: io.c:888 +#: io.c:946 #, c-format msgid "no explicit close of socket `%s' provided" msgstr "ingen explicit stängning av uttaget \"%s\" tillhandahållen" -#: io.c:891 +#: io.c:949 #, c-format msgid "no explicit close of co-process `%s' provided" msgstr "ingen explicit stängning av koprocessen \"%s\" tillhandahållen" -#: io.c:894 +#: io.c:952 #, c-format msgid "no explicit close of pipe `%s' provided" msgstr "ingen explicit stängning av röret \"%s\" tillhandahållen" -#: io.c:897 +#: io.c:955 #, c-format msgid "no explicit close of file `%s' provided" msgstr "ingen explicit stängning av filen \"%s\" tillhandahållen" -#: io.c:926 io.c:980 +#: io.c:984 io.c:1038 #, c-format msgid "error writing standard output (%s)" msgstr "fel vid skrivning till standard ut (%s)" -#: io.c:930 io.c:984 +#: io.c:988 io.c:1042 #, c-format msgid "error writing standard error (%s)" msgstr "fel vid skrivning till standard fel (%s)" -#: io.c:938 +#: io.c:996 #, c-format msgid "pipe flush of `%s' failed (%s)." msgstr "rörspolning av \"%s\" misslyckades (%s)" -#: io.c:941 +#: io.c:999 #, c-format msgid "co-process flush of pipe to `%s' failed (%s)." msgstr "koprocesspolning av röret till \"%s\" misslyckades (%s)" -#: io.c:944 +#: io.c:1002 #, c-format msgid "file flush of `%s' failed (%s)." msgstr "filspolning av \"%s\" misslyckades (%s)" -#: io.c:1103 +#: io.c:1161 msgid "/inet/raw client not ready yet, sorry" msgstr "/inet/raw-klient är tyvärr inte klar än" -#: io.c:1105 io.c:1142 +#: io.c:1163 io.c:1200 msgid "only root may use `/inet/raw'." msgstr "bara root kan använda \"/inet/raw\"." -#: io.c:1140 +#: io.c:1198 msgid "/inet/raw server not ready yet, sorry" msgstr "/inet/raw-server inte redo än, ledsen" -#: io.c:1230 +#: io.c:1288 #, c-format msgid "no (known) protocol supplied in special filename `%s'" msgstr "" "inget (känt) protokoll tillhandahållet i det speciella filnamnet \"%s\"" -#: io.c:1248 +#: io.c:1306 #, c-format msgid "special file name `%s' is incomplete" msgstr "speciellt filnamn \"%s\" är ofullständigt" -#: io.c:1260 +#: io.c:1318 #, c-format msgid "local port invalid in `%s'" msgstr "lokal port ogiltig i \"%s\"" -#: io.c:1272 +#: io.c:1330 msgid "must supply a remote hostname to `/inet'" msgstr "måste tillhandahålla ett fjärrdatornamn till \"/inet\"" -#: io.c:1287 +#: io.c:1345 msgid "must supply a remote port to `/inet'" msgstr "måste tillhandahålla en fjärrport till \"/inet\"" -#: io.c:1293 +#: io.c:1351 #, c-format msgid "remote port invalid in `%s'" msgstr "fjärrporten ogiltig i \"%s\"" -#: io.c:1303 +#: io.c:1361 msgid "TCP/IP communications are not supported" msgstr "TCP/IP-kommunikation stöds inte" -#: io.c:1312 io.c:1492 +#: io.c:1370 io.c:1551 #, c-format msgid "file `%s' is a directory" msgstr "filen \"%s\" är en katalog" -#: io.c:1381 +#: io.c:1440 #, c-format msgid "use `PROCINFO[\"%s\"]' instead of `%s'" msgstr "använd \"PROCINFO[\"%s\"]\" istället för \"%s\"" -#: io.c:1413 +#: io.c:1472 msgid "use `PROCINFO[...]' instead of `/dev/user'" msgstr "använd \"PROCINFO[...]\" istället för \"dev/user\"" -#: io.c:1478 io.c:1652 +#: io.c:1537 io.c:1711 #, c-format msgid "could not open `%s', mode `%s'" msgstr "kunde inte öppna \"%s\", läge \"%s\"" -#: io.c:1703 +#: io.c:1762 #, 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 +#: io.c:1764 io.c:1916 io.c:2068 #, c-format msgid "close of stdout in child failed (%s)" msgstr "stängning av standard ut i barnet misslyckades (%s)" -#: io.c:1708 +#: io.c:1767 #, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" msgstr "flyttandet av slavpty till standard ut i barnet misslyckades (dup: %s)" -#: io.c:1710 io.c:1862 +#: io.c:1769 io.c:1921 #, c-format msgid "close of stdin in child failed (%s)" msgstr "stängning av standard in i barnet misslyckades (%s)" -#: io.c:1713 +#: io.c:1772 #, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" msgstr "flyttandet av slavpty till standard in i barnet misslyckades (dup: %s)" -#: io.c:1715 io.c:1734 +#: io.c:1774 io.c:1793 #, 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 +#: io.c:1867 io.c:1919 io.c:2049 io.c:2071 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "flyttande av rör till standard ut i barnet misslyckades (dup: %s)" -#: io.c:1812 io.c:1865 +#: io.c:1871 io.c:1924 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "flyttande av rör till standard in i barnet misslyckades (dup: %s)" -#: io.c:1829 io.c:2003 +#: io.c:1888 io.c:2062 msgid "restoring stdout in parent process failed\n" msgstr "återställande av standard ut i förälderprocessen misslyckades\n" -#: io.c:1834 +#: io.c:1893 msgid "restoring stdin in parent process failed\n" msgstr "återställande av standard in i förälderprocessen misslyckades\n" -#: io.c:1868 io.c:2014 io.c:2025 +#: io.c:1927 io.c:2073 io.c:2084 #, c-format msgid "close of pipe failed (%s)" msgstr "stängning av röret misslyckades (%s)" -#: io.c:1913 +#: io.c:1972 msgid "`|&' not supported" msgstr "\"|&\" stöds inte" -#: io.c:1980 +#: io.c:2039 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "kan inte öppna röret \"%s\" (%s)" -#: io.c:2021 +#: io.c:2080 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "kan inte skapa barnprocess för \"%s\" (fork: %s)" -#: io.c:2364 +#: io.c:2423 #, c-format msgid "data file `%s' is empty" msgstr "datafilen \"%s\" är tom" -#: io.c:2407 io.c:2415 +#: io.c:2466 io.c:2474 msgid "could not allocate more input memory" msgstr "kunde inte allokera mer indataminne" -#: io.c:2540 io.c:2782 io.c:3046 +#: io.c:2832 io.c:2895 #, c-format msgid "error reading input file `%s': %s" msgstr "fel vid läsning av indatafilen \"%s\": %s" -#: io.c:3281 +#: io.c:3020 msgid "multicharacter value of `RS' is a gawk extension" msgstr "flerteckensvärdet av \"RS\" är en gawk-utökning" -#: main.c:322 +#: main.c:324 msgid "`-m[fr]' option irrelevant in gawk" msgstr "\"-m[fr]\"-flaggan är irrelevant i gawk" -#: main.c:324 +#: main.c:326 msgid "-m option usage: `-m[fr] nnn'" msgstr "-m-flaggans användning: \"-m[fr] nnn\"" -#: main.c:341 +#: main.c:343 #, c-format msgid "%s: option `-W %s' unrecognized, ignored\n" msgstr "%s: flaggan \"-W %s\" okänd, ignorerad\n" -#: main.c:378 +#: main.c:380 msgid "empty argument to `--source' ignored" msgstr "tomt argument till \"--source\" ignorerat" -#: main.c:448 +#: main.c:451 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "miljövariabeln \"POSIXLY_CORRECT\" satt: slår på \"--posix\"" -#: main.c:453 +#: main.c:456 msgid "`--posix' overrides `--traditional'" msgstr "\"--posix\" åsidosätter \"--traditional\"" -#: main.c:464 +#: main.c:467 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "\"--posix\"/\"--traditional\" åsidosätter \"--non-decimal-data\"" -#: main.c:468 +#: main.c:471 #, c-format msgid "running %s setuid root may be a security problem" msgstr "att köra %s setuid root kan vara ett säkerhetsproblem" -#: main.c:509 +#: main.c:512 #, c-format msgid "can't set binary mode on stdin (%s)" msgstr "kan inte sätta binärläge på standard in (%s)" -#: main.c:512 +#: main.c:515 #, c-format msgid "can't set binary mode on stdout (%s)" msgstr "kan inte sätta binärläge på standard ut (%s)" -#: main.c:514 +#: main.c:517 #, c-format msgid "can't set binary mode on stderr (%s)" msgstr "kan inte sätta binärläge på standard fel (%s)" -#: main.c:544 +#: main.c:547 msgid "no program text at all!" msgstr "ingen programtext alls!" -#: main.c:612 +#: main.c:620 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "" "Användning: %s [POSIX- eller GNU-stilsflaggor] -f progfil [--] fil ...\n" -#: main.c:614 +#: main.c:622 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "Användning: %s [POSIX- eller GNU-stilsflaggor] %cprogram%c fil ...\n" -#: main.c:619 +#: main.c:627 msgid "POSIX options:\t\tGNU long options:\n" msgstr "POSIX-flaggor:\t\tGNU långa flaggor:\n" -#: main.c:620 +#: main.c:628 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "\t-f progfil\t\t--file=progfil\n" -#: main.c:621 +#: main.c:629 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "\t-F fs\t\t\t--field-separator=fs\n" -#: main.c:622 +#: main.c:630 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "\t-v var=värde\t\t--assign=var=värde\n" -#: main.c:623 +#: main.c:631 msgid "\t-m[fr] val\n" msgstr "\t-m[fr] värde\n" -#: main.c:624 +#: main.c:632 msgid "\t-W compat\t\t--compat\n" msgstr "\t-W compat\t\t--compat\n" -#: main.c:625 +#: main.c:633 msgid "\t-W copyleft\t\t--copyleft\n" msgstr "\t-W copyleft\t\t--copyleft\n" -#: main.c:626 +#: main.c:634 msgid "\t-W copyright\t\t--copyright\n" msgstr "\t-W copyright\t\t--copyright\n" -#: main.c:627 +#: main.c:635 msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n" msgstr "\t-W dump-variables[=fil]\t--dump-variables[=fil]\n" -#: main.c:628 +#: main.c:636 msgid "\t-W gen-po\t\t--gen-po\n" msgstr "\t-W gen-po\t\t--gen-po\n" -#: main.c:629 +#: main.c:637 msgid "\t-W help\t\t\t--help\n" msgstr "\t-W help\t\t\t--help\n" -#: main.c:630 +#: main.c:638 msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n" msgstr "\t-W lint[=fatal]\t\t--lint[=fatal]\n" -#: main.c:631 +#: main.c:639 msgid "\t-W lint-old\t\t--lint-old\n" msgstr "\t-W lint-old\t\t--lint-old\n" -#: main.c:632 +#: main.c:640 msgid "\t-W non-decimal-data\t--non-decimal-data\n" msgstr "\t-W non-decimal-data\t--non-decimal-data\n" -#: main.c:634 +#: main.c:642 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "\t-W nostalgia\t\t--nostalgia\n" -#: main.c:637 +#: main.c:645 msgid "\t-W parsedebug\t\t--parsedebug\n" msgstr "\t-W parsedebug\t\t--parsedebug\n" -#: main.c:639 +#: main.c:647 msgid "\t-W profile[=file]\t--profile[=file]\n" msgstr "\t-W profile[=fil]\t--profile[=fil]\n" -#: main.c:640 +#: main.c:648 msgid "\t-W posix\t\t--posix\n" msgstr "\t-W posix\t\t--posix\n" -#: main.c:641 +#: main.c:649 msgid "\t-W re-interval\t\t--re-interval\n" msgstr "\t-W re-interval\t\t--re-interval\n" -#: main.c:642 +#: main.c:650 msgid "\t-W source=program-text\t--source=program-text\n" msgstr "\t-W source=programtext\t--source=programtext\n" -#: main.c:643 +#: main.c:651 msgid "\t-W traditional\t\t--traditional\n" msgstr "\t-W traditional\t\t--traditional\n" -#: main.c:644 +#: main.c:652 msgid "\t-W usage\t\t--usage\n" msgstr "\t-W usage\t\t--usage\n" -#: main.c:645 +#: main.c:653 msgid "\t-W version\t\t--version\n" msgstr "\t-W version\t\t--version\n" -#: main.c:649 +#: main.c:657 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" @@ -1461,7 +1472,7 @@ msgstr "" "Rapportera synpunkter på översättningen till <sv@li.org>.\n" "\n" -#: main.c:653 +#: main.c:661 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" @@ -1471,7 +1482,7 @@ msgstr "" "Normalt läser det från standard in och skriver till standard ut.\n" "\n" -#: main.c:657 +#: main.c:665 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" @@ -1481,7 +1492,7 @@ msgstr "" "\tgawk '{ sum += $1 }; END { print sum }' fil\n" "\tgawk -F: '{print $1 }' /etc/passwd\n" -#: main.c:669 +#: main.c:682 #, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -1500,7 +1511,7 @@ msgstr "" "någon senare version.\n" "\n" -#: main.c:677 +#: main.c:690 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -1514,7 +1525,7 @@ msgstr "" "General Public License för ytterligare information.\n" "\n" -#: main.c:683 +#: main.c:696 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program; if not, write to the Free Software\n" @@ -1524,46 +1535,46 @@ 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:713 +#: main.c:730 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "-Ft sätter inte FS till tab i POSIX-awk" -#: main.c:944 +#: main.c:956 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" "\n" msgstr "%s: Argumentet \"%s\" till \"-v\" är inte på formatet \"var=värde\"\n" -#: main.c:964 +#: main.c:976 #, c-format msgid "`%s' is not a legal variable name" msgstr "\"%s\" är inte ett giltigt variabelnamn" -#: main.c:967 +#: main.c:979 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "\"%s\" är inte ett variabelnamn, letar efter filen \"%s=%s\"" -#: main.c:995 +#: main.c:1012 msgid "floating point exception" msgstr "flyttalsundantag" -#: main.c:1002 +#: main.c:1019 msgid "fatal error: internal error" msgstr "ödesdigert fel: internt fel" -#: main.c:1052 +#: main.c:1069 #, c-format msgid "no pre-opened fd %d" msgstr "ingen föröppnad fd %d" -#: main.c:1057 +#: main.c:1074 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "kunde inte föröppna /dev/null för fd %d" -#: main.c:1080 main.c:1089 +#: main.c:1097 main.c:1106 #, c-format msgid "could not find groups: %s" msgstr "kunde inte hitta grupper: %s" @@ -1584,23 +1595,23 @@ msgstr "fel: " msgid "fatal: " msgstr "ödesdigert: " -#: node.c:59 node.c:66 node.c:75 node.c:89 node.c:116 +#: node.c:58 node.c:65 node.c:74 node.c:88 node.c:115 msgid "can't convert string to float" msgstr "kan inte konvertera en sträng till flyttal" -#: node.c:357 +#: node.c:355 msgid "backslash at end of string" msgstr "omvänt snedstreck i slutet av strängen" -#: node.c:544 +#: node.c:539 msgid "POSIX does not allow `\\x' escapes" msgstr "POSIX tillåter inte \"\\x\"-kontrollsekvenser" -#: node.c:550 +#: node.c:545 msgid "no hex digits in `\\x' escape sequence" msgstr "inga hexadecimala siffror i \"\\x\"-kontrollsekvenser" -#: node.c:584 +#: node.c:579 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "kontrollsekvensen \"\\%c\" behandlad som bara \"%c\"" @@ -1615,24 +1626,21 @@ msgstr "%s %s \"%s\": kunde inte sätta stäng-vid-exec (fcntl: %s)" msgid "could not open `%s' for writing: %s" msgstr "kunde inte öppna \"%s\" för skrivning: %s" -#: profile.c:409 -msgid "internal error: Node_var with null vname" +#: profile.c:449 +#, fuzzy, c-format +msgid "internal error: %s with null vname" msgstr "internt fel: Node_var med null vname" -#: profile.c:471 +#: profile.c:512 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 +#: profile.c:1162 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "\t# gawkprofil, skapad %s\n" -#: profile.c:1130 +#: profile.c:1165 msgid "" "\t# BEGIN block(s)\n" "\n" @@ -1640,7 +1648,7 @@ msgstr "" "\t# BEGIN-block\n" "\n" -#: profile.c:1140 +#: profile.c:1175 msgid "" "\t# Rule(s)\n" "\n" @@ -1648,7 +1656,7 @@ msgstr "" "\t# Regel/regler\n" "\n" -#: profile.c:1146 +#: profile.c:1181 msgid "" "\t# END block(s)\n" "\n" @@ -1656,7 +1664,7 @@ msgstr "" "\t# END-block\n" "\n" -#: profile.c:1166 +#: profile.c:1201 msgid "" "\n" "\t# Functions, listed alphabetically\n" @@ -1664,7 +1672,7 @@ msgstr "" "\n" "\t# Funktioner, listade alfabetiskt\n" -#: profile.c:1376 +#: profile.c:1413 #, c-format msgid "unexpected type %s in prec_level" msgstr "oväntad typ %s i prec_level" @@ -1748,6 +1756,31 @@ msgstr "Obalanserad ) eller \\)" msgid "No previous regular expression" msgstr "Inget föregående reguljärt uttryck" +#~ msgid "substr: length %g is < 0" +#~ msgstr "substr: längden %g är < 0" + +#~ msgid "delete: illegal use of variable `%s' as array" +#~ msgstr "delete: otillåten användning av variabeln \"%s\" som vektor" + +#, fuzzy +#~ msgid "%s: gvar_ref to %s\n" +#~ msgstr "%s: vektorreferens till %s\n" + +#~ msgid "asort: first argument is not an array" +#~ msgstr "asort: första argumentet är inte en vektor" + +#~ msgid "asort: second argument is not an array" +#~ msgstr "asort: andra argumentet är inte en vektor" + +#, fuzzy +#~ msgid "" +#~ "attempt to use array parameter `%s' that was passed from global scalar `%" +#~ "s'" +#~ msgstr "försök att använda skalärparametern \"%s\" som en vektor" + +#~ msgid "internal error: Node_var_array with null vname" +#~ msgstr "internt fel: Node_var_vektor med null vname" + #~ msgid "" #~ "\n" #~ "To report bugs, see node `Bugs' in `gawk.info', which is\n" Binary files differ@@ -4,74 +4,72 @@ # msgid "" msgstr "" -"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" +"Project-Id-Version: gawk 3.1.2g\n" +"Report-Msgid-Bugs-To: arnold@skeeve.com\n" +"POT-Creation-Date: 2003-07-07 11:20-0700\n" +"PO-Revision-Date: 2003-06-25 07:43+0300\n" "Last-Translator: Nilgün Belma Bugüner <nilgun@superonline.com>\n" "Language-Team: Turkish <gnu-tr-u12a@lists.sourceforge.net>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: KBabel 0.9.6\n" +"X-Generator: KBabel 1.0\n" -#: array.c:274 array.c:309 array.c:314 eval.c:494 +#: array.c:112 +#, c-format +msgid "attempt to use scalar parameter `%s' as an array" +msgstr "sayısal paramaetre `%s' bir dizi olarak kullanılmaya çalışılıyor" + +#: array.c:113 #, c-format msgid "attempt to use scalar `%s' as array" msgstr "sayısal `%s' dizi olarak kullanılmaya çalışılıyor" -#: array.c:338 +#: array.c:151 +#, c-format +msgid "from %s" +msgstr "%s'den" + +#: array.c:506 #, c-format msgid "reference to uninitialized element `%s[\"%s\"]'" -msgstr "ön deÄŸer atanmamış öğeye ( %s[\"%s\"] ) baÅŸvuru yapılıyor" +msgstr "ilklendirilmemiÅŸ öğeye ( %s[\"%s\"] ) baÅŸvuru yapılıyor" -#: array.c:344 +#: array.c:512 #, c-format msgid "subscript of array `%s' is null string" msgstr "dizinin indisi `%s' bir null dizge" -#: array.c:412 array.c:425 array.c:466 +#: array.c:609 #, c-format msgid "delete: index `%s' not in array `%s'" msgstr "delete: `%s' indeksi `%s' dizisinde deÄŸil" -#: 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 +#: array.c:769 #, c-format msgid "%s: empty (null)\n" msgstr "%s: boÅŸ (null)\n" -#: array.c:638 +#: array.c:774 #, c-format msgid "%s: empty (zero)\n" msgstr "%s: boÅŸ (sıfır)\n" -#: array.c:642 +#: array.c:778 #, c-format msgid "%s: table_size = %d, array_size = %d\n" msgstr "%s: tablo_uzunluÄŸu = %d, dizi_indisi = %d\n" -#: array.c:671 +#: array.c:807 #, c-format msgid "%s: is parameter\n" msgstr "%s: parametredir\n" -#: array.c:676 +#: array.c:812 #, c-format msgid "%s: array_ref to %s\n" msgstr "%s: %s için dizi baÅŸvurusu\n" -#: array.c:975 -msgid "asort: first argument is not an array" -msgstr "asort: ilk argüman bir dizi deÄŸil" - -#: array.c:984 -msgid "asort: second argument is not an array" -msgstr "asort: ikinci argüman bir dizi deÄŸil" - #: awkgram.y:208 #, c-format msgid "%s blocks must have an action part" @@ -91,260 +89,273 @@ msgstr "`%s' bir yerleÅŸik iÅŸlevdir, yeniden atanamaz" msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "düzenli ifade sabiti `/%s/' bir C açıklaması gibi görünüyor ama deÄŸil" -#: awkgram.y:340 +#: awkgram.y:340 awkgram.y:615 msgid "statement may have no effect" msgstr "deyim bir etkiye sahip olmayabilir" -#: awkgram.y:431 awkgram.y:451 +#: awkgram.y:435 awkgram.y:455 #, c-format msgid "`%s' used in %s action" msgstr "`%s' %s eyleminde kullanılmış" -#: awkgram.y:444 awkgram.y:447 +#: awkgram.y:448 awkgram.y:451 msgid "`nextfile' is a gawk extension" msgstr "`nextfile' bir gawk uzantısıdır" -#: awkgram.y:461 +#: awkgram.y:465 msgid "`return' used outside function context" msgstr "`return' iÅŸlev baÄŸlamının dışında kullanılmış" -#: awkgram.y:500 +#: awkgram.y:504 msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" msgstr "BEGIN veya END kuralındaki `print' aslında `print \"\"' olmalıydı" -#: awkgram.y:513 awkgram.y:520 +#: awkgram.y:517 awkgram.y:524 msgid "`delete array' is a gawk extension" msgstr "`delete array' bir gawk uzantısıdır" -#: awkgram.y:528 awkgram.y:535 +#: awkgram.y:532 awkgram.y:539 msgid "`delete(array)' is a non-portable tawk extension" msgstr "`delete array' uyarlanabilir olmayan bir gawk uzantısıdır" -#: awkgram.y:578 +#: awkgram.y:583 +#, c-format +msgid "duplicate case values in switch body: %s" +msgstr "switch içinde yinelenmiÅŸ case deÄŸerleri var: %s" + +#: awkgram.y:593 +msgid "Duplicate `default' detected in switch body" +msgstr "switch içinde yinelenmiÅŸ `default' saptandı" + +#: awkgram.y:681 msgid "multistage two-way pipelines don't work" msgstr "çok katlı iki yönlü veriyolları çalışmaz" -#: awkgram.y:669 +#: awkgram.y:772 msgid "regular expression on right of assignment" msgstr "düzenli ifade atamanın sağında" -#: awkgram.y:679 +#: awkgram.y:782 msgid "regular expression on left of `~' or `!~' operator" msgstr "düzenli ifade `~' ya da `!~' iÅŸlemiminin solunda" -#: awkgram.y:687 +#: awkgram.y:790 msgid "regular expression on right of comparison" msgstr "düzenli ifade karşılaÅŸtırmanın sağında" -#: awkgram.y:754 +#: awkgram.y:857 msgid "non-redirected `getline' undefined inside END action" msgstr "END eyleminin içinde yönlendirme yapmayan `getline' tanımsız" -#: awkgram.y:781 +#: awkgram.y:884 msgid "call of `length' without parentheses is not portable" msgstr "parantezsiz `length' çaÄŸrısı taşınabilir deÄŸil" -#: awkgram.y:784 +#: awkgram.y:887 msgid "call of `length' without parentheses is deprecated by POSIX" msgstr "parantezsiz `length' çaÄŸrısı POSIX'e uygun deÄŸil" -#: awkgram.y:835 +#: awkgram.y:940 +msgid "use of non-array as array" +msgstr "dizi olmayan deÄŸiÅŸken dizi olarak kullanılmış" + +#: awkgram.y:942 msgid "invalid subscript expression" msgstr "indis ifadesi geçersiz" -#: awkgram.y:1020 +#: awkgram.y:1140 msgid "unexpected newline or end of string" msgstr "beklenmeyen satırsonu ya da dizge sonu" -#: awkgram.y:1115 +#: awkgram.y:1235 msgid "empty program text on command line" msgstr "komut satırında boÅŸ program metni" -#: awkgram.y:1172 +#: awkgram.y:1292 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "kaynak dosyası `%s' okumak için açılamıyor (%s)" -#: awkgram.y:1207 +#: awkgram.y:1327 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "kaynak dosyası `%s' okunamıyor (%s)" -#: awkgram.y:1215 +#: awkgram.y:1335 #, 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 +#: awkgram.y:1537 awkgram.y:1647 awkgram.y:1665 awkgram.y:2015 awkgram.y:2100 msgid "source file does not end in newline" msgstr "kaynak dosyasının sonunda satırsonu eksik" -#: awkgram.y:1481 +#: awkgram.y:1601 msgid "unterminated regexp ends with `\\' at end of file" msgstr "sonlandırılmamış düzenli ifade dosya sonunda `\\' ile bitiyor" -#: awkgram.y:1501 +#: awkgram.y:1621 msgid "unterminated regexp" msgstr "sonlandırılmamış düzenli ifade" -#: awkgram.y:1504 +#: awkgram.y:1624 msgid "unterminated regexp at end of file" msgstr "dosya sonunda sonlandırılmamış düzenli ifade" -#: awkgram.y:1571 +#: awkgram.y:1691 msgid "use of `\\ #...' line continuation is not portable" msgstr "`\\ #...' satır uzatma kullanımı taşınabilir deÄŸil" -#: awkgram.y:1583 +#: awkgram.y:1703 msgid "backslash not last character on line" msgstr "tersbölü satırdaki son karakter deÄŸil" -#: awkgram.y:1628 +#: awkgram.y:1748 msgid "POSIX does not allow operator `**='" msgstr "`**=' iÅŸlemimi POSIX uyumlu deÄŸil" -#: awkgram.y:1630 +#: awkgram.y:1750 msgid "old awk does not support operator `**='" msgstr "`**=' iÅŸlemimini eski awk desteklemiyor" -#: awkgram.y:1639 +#: awkgram.y:1759 msgid "POSIX does not allow operator `**'" msgstr "`**' iÅŸlemimi POSIX uyumlu deÄŸil" -#: awkgram.y:1641 +#: awkgram.y:1761 msgid "old awk does not support operator `**'" msgstr "`**' iÅŸlemimini eski awk desteklemiyor" -#: awkgram.y:1672 +#: awkgram.y:1792 msgid "operator `^=' is not supported in old awk" msgstr "`^=' iÅŸlemimini eski awk desteklemiyor" -#: awkgram.y:1680 +#: awkgram.y:1800 msgid "operator `^' is not supported in old awk" msgstr "`^' iÅŸlemimini eski awk desteklemiyor" -#: awkgram.y:1764 awkgram.y:1781 +#: awkgram.y:1884 awkgram.y:1901 msgid "unterminated string" msgstr "sonlandırılmamış dizge" -#: awkgram.y:1941 +#: awkgram.y:2061 #, c-format msgid "invalid char '%c' in expression" msgstr "ifade içinde '%c' karakteri geçersiz" -#: awkgram.y:2001 +#: awkgram.y:2121 #, c-format msgid "`%s' is a gawk extension" msgstr "`%s' bir gawk uzantısıdır" -#: awkgram.y:2004 +#: awkgram.y:2124 #, c-format msgid "`%s' is a Bell Labs extension" msgstr "`%s' bir Bell Laboratuarları uzantısıdır" -#: awkgram.y:2007 +#: awkgram.y:2127 #, c-format msgid "POSIX does not allow `%s'" msgstr "`%s' POSIX uyumlu deÄŸil" -#: awkgram.y:2011 +#: awkgram.y:2131 #, c-format msgid "`%s' is not supported in old awk" msgstr "`%s' eski awk tarafından desteklemiyor" -#: awkgram.y:2038 +#: awkgram.y:2158 msgid "`goto' considered harmful!\n" msgstr "`goto' zararlı sayılır!\n" -#: awkgram.y:2102 +#: awkgram.y:2220 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "%d argüman sayısı olarak %s için geçersiz" -#: awkgram.y:2121 awkgram.y:2124 +#: awkgram.y:2239 awkgram.y:2242 msgid "match: third argument is a gawk extension" msgstr "match: üçüncü argüman bir gawk uzantısı" -#: awkgram.y:2137 +#: awkgram.y:2255 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "%s: yerine kullanılan son argüman olarak dizge sabiti etkisiz" -#: awkgram.y:2140 +#: awkgram.y:2258 #, c-format msgid "%s third parameter is not a changeable object" msgstr "üçüncü %s parametresi deÄŸiÅŸtirilebilir bir nesne deÄŸil" -#: awkgram.y:2167 awkgram.y:2170 +#: awkgram.y:2285 awkgram.y:2288 msgid "close: second argument is a gawk extension" msgstr "close: ikinci argüman bir gawk uzantısı" -#: awkgram.y:2180 +#: awkgram.y:2298 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "dcgettext(_\"...\") kullanımı yanlış: altçizgiyi kaldırın" -#: awkgram.y:2195 +#: awkgram.y:2313 msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" msgstr "dcngettext(_\"...\") kullanımı yanlış: altçizgiyi kaldırın" -#: awkgram.y:2266 +#: awkgram.y:2384 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "`%s' iÅŸlevi: %d. parametre, `%s', %d. parametrenin tekrarı" -#: awkgram.y:2299 +#: awkgram.y:2417 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "`%s' iÅŸlevi: parametre, `%s'global deÄŸiÅŸkeni gölgeliyor" -#: awkgram.y:2411 +#: awkgram.y:2529 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "`%s' yazmak için açılamadı (%s)" -#: awkgram.y:2412 profile.c:93 +#: awkgram.y:2530 profile.c:93 msgid "sending profile to standard error" msgstr "profil standart hataya gönderiliyor" -#: awkgram.y:2442 +#: awkgram.y:2562 #, c-format msgid "%s: close failed (%s)" msgstr "%s: kapatma baÅŸarısız (%s)" -#: awkgram.y:2566 +#: awkgram.y:2684 msgid "shadow_funcs() called twice!" msgstr "shadow_funcs() iki kere çaÄŸrıldı!" -#: awkgram.y:2593 +#: awkgram.y:2711 msgid "there were shadowed variables." msgstr "gölgeli deÄŸiÅŸkenler vardı." -#: awkgram.y:2666 +#: awkgram.y:2784 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "iÅŸlev `%s': iÅŸlev ismi parametre ismi olarak kullanılamaz" -#: awkgram.y:2676 +#: awkgram.y:2794 #, c-format msgid "function name `%s' previously defined" msgstr "iÅŸlev ismi `%s' önceden atanmış" -#: awkgram.y:2827 awkgram.y:2833 +#: awkgram.y:2945 awkgram.y:2951 #, c-format msgid "function `%s' called but never defined" msgstr "`%s' iÅŸlevi çaÄŸrıldı ama hiç atanmamış" -#: awkgram.y:2836 +#: awkgram.y:2954 #, c-format msgid "function `%s' defined but never called" msgstr "`%s' iÅŸlevi atanmış ama hiç çaÄŸrılmadı" -#: awkgram.y:2863 +#: awkgram.y:2981 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "%d numaralı argüman bir düzenli ifade sabiti" -#: awkgram.y:2876 +#: awkgram.y:2994 #, c-format msgid "" "function `%s' called with space between name and `(',\n" @@ -353,196 +364,201 @@ msgstr "" "`%s' iÅŸlevi `(' ile isim arasında boÅŸlukla çaÄŸrılmış,\n" "%s" -#: awkgram.y:2878 +#: awkgram.y:2996 msgid "or used as a variable or an array" msgstr "ya da bir deÄŸiÅŸken ya da dizi olarak kullanılmış" -#: builtin.c:111 +#: builtin.c:137 #, c-format msgid "%s to \"%s\" failed (%s)" msgstr "%s \"%s\"ya yazılamadı (%s)" -#: builtin.c:112 +#: builtin.c:138 msgid "standard output" msgstr "standart çıktı" -#: builtin.c:113 +#: builtin.c:139 msgid "reason unknown" msgstr "sebebi bilinmiyor" -#: builtin.c:126 +#: builtin.c:152 msgid "exp: received non-numeric argument" msgstr "exp: sayısal olmayan argüman alındı" -#: builtin.c:132 +#: builtin.c:158 #, c-format msgid "exp: argument %g is out of range" msgstr "exp: %g kapsamdışı" -#: builtin.c:190 +#: builtin.c:216 #, c-format msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing" msgstr "" "fflush: kanala yazılamadı: veriyolu `%s' okumak için açıldı, yazmak için " "deÄŸil" -#: builtin.c:193 +#: builtin.c:219 #, c-format msgid "fflush: cannot flush: file `%s' opened for reading, not writing" msgstr "" "fflush: kanala yazılamadı: dosya `%s' okumak için açıldı, yazmak için deÄŸil" -#: builtin.c:205 +#: builtin.c:231 #, c-format msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "fflush: `%s' bir açık dosya, veriyolu ya da bir yan iÅŸlem deÄŸil" -#: builtin.c:299 +#: builtin.c:325 msgid "index: received non-string first argument" msgstr "index: ilk argüman dizge olmayan türde alındı" -#: builtin.c:301 +#: builtin.c:327 msgid "index: received non-string second argument" msgstr "index: ikinci argüman dizge olmayan türde alındı" -#: builtin.c:411 +#: builtin.c:437 msgid "int: received non-numeric argument" msgstr "int: sayısal olmayan argüman alındı" -#: builtin.c:428 +#: builtin.c:454 msgid "length: received non-string argument" msgstr "length: dizge olmayan argüman alındı" -#: builtin.c:444 +#: builtin.c:470 msgid "log: received non-numeric argument" msgstr "log: sayısal olmayan argüman alındı" -#: builtin.c:447 +#: builtin.c:473 #, c-format msgid "log: received negative argument %g" msgstr "log: negatif argüman %g alındı" -#: builtin.c:609 builtin.c:612 +#: builtin.c:635 builtin.c:638 msgid "must use `count$' on all formats or none" msgstr "tüm biçemlerde ya `count$' kullanmalısınız ya da hiçbir ÅŸey" -#: builtin.c:714 +#: builtin.c:740 msgid "`$' is not permitted in awk formats" msgstr "`$' awk biçemlerde kullanılmaz" -#: builtin.c:720 +#: builtin.c:746 msgid "arg count with `$' must be > 0" msgstr "`$' ile birlikte verilen argüman sayısı > 0 olmalıdır" -#: builtin.c:722 +#: builtin.c:748 #, c-format msgid "arg count %ld greater than total number of supplied arguments" msgstr "argüman sayısı %ld saÄŸlanmış toplam argüman sayısından büyük" -#: builtin.c:724 +#: builtin.c:750 msgid "`$' not permitted after period in format" msgstr "`$' biçem içinde noktadan sonra kullanılmaz" -#: builtin.c:737 +#: builtin.c:763 msgid "no `$' supplied for positional field width or precision" msgstr "konumsal alan geniÅŸliÄŸi ya da duyarlığı için `$' kullanılmamış" -#: builtin.c:795 +#: builtin.c:821 msgid "`l' is meaningless in awk formats; ignored" msgstr "`l' awk biçemlerde anlamsız; yoksayıldı" -#: builtin.c:799 +#: builtin.c:825 msgid "`l' is not permitted in POSIX awk formats" msgstr "`l' POSIX awk biçemlerde kullanılmaz" -#: builtin.c:810 +#: builtin.c:836 msgid "`L' is meaningless in awk formats; ignored" msgstr "`L' awk biçemlerde anlamsız; yoksayıldı" -#: builtin.c:814 +#: builtin.c:840 msgid "`L' is not permitted in POSIX awk formats" msgstr "`L' POSIX awk biçemlerde kullanılmaz" -#: builtin.c:825 +#: builtin.c:851 msgid "`h' is meaningless in awk formats; ignored" msgstr "`h' awk biçemlerde anlamsız; yoksayıldı" -#: builtin.c:829 +#: builtin.c:855 msgid "`h' is not permitted in POSIX awk formats" msgstr "`h' POSIX awk biçemlerde kullanılmaz" -#: builtin.c:1078 +#: builtin.c:1055 +#, c-format +msgid "[s]printf: value %g is out of range for `%%%c' format" +msgstr "[s]printf: %g deÄŸeri `%%%c' biçimi için kapsamdışı" + +#: builtin.c:1108 msgid "not enough arguments to satisfy format string" msgstr "biçem dizgesini oluÅŸturacak yeterli argüman yok" -#: builtin.c:1080 +#: builtin.c:1110 msgid "^ ran out for this one" msgstr "bir bunun için ^ tükendi" -#: builtin.c:1085 +#: builtin.c:1115 msgid "[s]printf: format specifier does not have control letter" msgstr "[s]printf: biçem belirteci denetim karakteri içermiyor" -#: builtin.c:1088 +#: builtin.c:1118 msgid "too many arguments supplied for format string" msgstr "biçem dizgesi için çok fazla argüman saÄŸlanmış" -#: builtin.c:1154 builtin.c:1157 +#: builtin.c:1184 builtin.c:1187 msgid "printf: no arguments" msgstr "printf: argüman yok" -#: builtin.c:1181 +#: builtin.c:1211 msgid "sqrt: received non-numeric argument" msgstr "sqrt: sayısal olmayan argüman alındı" -#: builtin.c:1185 +#: builtin.c:1215 #, c-format msgid "sqrt: called with negative argument %g" msgstr "sqrt: negatif argüman %g ile çaÄŸrıldı" -#: builtin.c:1207 +#: builtin.c:1238 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "substr: baÅŸlangıç indeksi olarak %g geçersiz, 1 kullanılıyor" -#: builtin.c:1212 +#: builtin.c:1243 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "" "substr: tamsayı olmayan baÅŸlangıç indeksi %g den ondalık kısım çıkarılacak" -#: builtin.c:1231 -#, c-format -msgid "substr: length %g is <= 0" +#: builtin.c:1262 +#, fuzzy, c-format +msgid "substr: length %g is not >= 1" msgstr "substr: uzunluk %g <= 0 dır" -#: builtin.c:1233 -#, c-format -msgid "substr: length %g is < 0" -msgstr "substr: uzunluk %g < 0" +#: builtin.c:1264 +#, fuzzy, c-format +msgid "substr: length %g is not >= 0" +msgstr "substr: uzunluk %g <= 0 dır" -#: builtin.c:1240 +#: builtin.c:1271 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "substr: tamsayı olmayan uzunluk %g den ondalık kısım çıkarılacak" -#: builtin.c:1245 +#: builtin.c:1276 #, c-format msgid "substr: length %g too big for string indexing, truncating to %g" msgstr "" "substr: dizge indislemesi için uzunluk olarak %g çok fazla, %g den sonrası " "gözardı ediliyor" -#: builtin.c:1257 +#: builtin.c:1288 msgid "substr: source string is zero length" msgstr "substr: kaynak dizge sıfır uzunlukta" -#: builtin.c:1263 +#: builtin.c:1294 #, c-format msgid "substr: start index %g is past end of string" msgstr "substr: baÅŸlangıç indisi %g dizgenin sonundan sonra" -#: builtin.c:1271 +#: builtin.c:1302 #, c-format msgid "" "substr: length %g at start index %g exceeds length of first argument (%lu)" @@ -550,288 +566,288 @@ msgstr "" "substr: uzunluk %g, %g baÅŸlangıç indisinde ilk argümanın uzunluÄŸunu (%lu) " "aÅŸar" -#: builtin.c:1306 +#: builtin.c:1337 msgid "strftime: received non-string first argument" msgstr "strftime: ilk argüman dizge olmayan türde alındı" -#: builtin.c:1312 +#: builtin.c:1343 msgid "strftime: received empty format string" msgstr "strftime: boÅŸ biçem dizgesi alındı" -#: builtin.c:1321 +#: builtin.c:1352 msgid "strftime: received non-numeric second argument" msgstr "strftime: ikinci argüman sayısal olmayan türde alındı" -#: builtin.c:1384 +#: builtin.c:1415 msgid "mktime: received non-string argument" msgstr "mktime: dizge olmayan argüman alındı" -#: builtin.c:1429 +#: builtin.c:1460 msgid "system: received non-string argument" msgstr "system: dizge olmayan argüman alındı" -#: builtin.c:1573 +#: builtin.c:1581 eval.c:1883 +#, c-format +msgid "reference to uninitialized field `$%d'" +msgstr "ilklendirilmemiÅŸ `$%d' alanına baÅŸvuru" + +#: builtin.c:1608 msgid "tolower: received non-string argument" msgstr "tolower: dizge olmayan argüman alındı" -#: builtin.c:1622 +#: builtin.c:1657 msgid "toupper: received non-string argument" msgstr "toupper: dizge olmayan argüman alındı" -#: builtin.c:1667 +#: builtin.c:1702 msgid "atan2: received non-numeric first argument" msgstr "atan2: ilk argüman sayısal olmayan türde alındı" -#: builtin.c:1669 +#: builtin.c:1704 msgid "atan2: received non-numeric second argument" msgstr "atan2: ikinci argüman sayısal olmayan türde alındı" -#: builtin.c:1688 +#: builtin.c:1723 msgid "sin: received non-numeric argument" msgstr "sin: sayısal olmayan argüman alındı" -#: builtin.c:1704 +#: builtin.c:1739 msgid "cos: received non-numeric argument" msgstr "cos: sayısal olmayan argüman alındı" -#: builtin.c:1748 +#: builtin.c:1788 msgid "srand: received non-numeric argument" msgstr "srand: sayısal olmayan argüman alındı" -#: builtin.c:1787 +#: builtin.c:1823 msgid "match: third argument is not an array" msgstr "match: üçüncü argüman bir dizi deÄŸil" -#: builtin.c:2264 -msgid "gensub: 3rd argument of 0 treated as 1" +#: builtin.c:2307 +msgid "gensub: third argument of 0 treated as 1" msgstr "gensub: 0 olan 3. argüman 1 kabul edildi" -#: builtin.c:2375 builtin.c:2377 +#: builtin.c:2416 builtin.c:2418 msgid "lshift: received non-numeric first argument" msgstr "lshift: ilk argüman sayısal olmayan türde alındı" -#: builtin.c:2379 +#: builtin.c:2420 #, c-format msgid "lshift(%lf, %lf): negative values will give strange results" msgstr "lshift(%lf, %lf): negatif deÄŸerler tuhaf sonuçlar verecek" -#: builtin.c:2381 +#: builtin.c:2422 #, c-format msgid "lshift(%lf, %lf): fractional values will be truncated" msgstr "lshift(%lf, %lf): tamsayı kısım kalacak ÅŸekilde kalanı atılacak" -#: builtin.c:2383 +#: builtin.c:2424 #, c-format msgid "lshift(%lf, %lf): too large shift value will give strange results" msgstr "lshift(%lf, %lf): çok büyük kaydırma deÄŸeri tuhaf sonuçlar verecek" -#: builtin.c:2412 builtin.c:2414 +#: builtin.c:2453 builtin.c:2455 msgid "rshift: received non-numeric first argument" msgstr "rshift: ilk argüman sayısal olmayan türde alındı" -#: builtin.c:2416 +#: builtin.c:2457 #, c-format msgid "rshift(%lf, %lf): negative values will give strange results" msgstr "rshift(%lf, %lf): negatif deÄŸerler tuhaf sonuçlar verecek" -#: builtin.c:2418 +#: builtin.c:2459 #, c-format msgid "rshift(%lf, %lf): fractional values will be truncated" msgstr "rshift(%lf, %lf): tamsayı kısım kalacak ÅŸekilde kalanı atılacak" -#: builtin.c:2420 +#: builtin.c:2461 #, c-format msgid "rshift(%lf, %lf): too large shift value will give strange results" msgstr "rshift(%lf, %lf): çok büyük kaydırma deÄŸeri tuhaf sonuçlar verecek" -#: builtin.c:2449 builtin.c:2451 +#: builtin.c:2490 builtin.c:2492 msgid "and: received non-numeric first argument" msgstr "and: ilk argüman sayısal olmayan türde alındı" -#: builtin.c:2453 +#: builtin.c:2494 #, c-format msgid "and(%lf, %lf): negative values will give strange results" msgstr "and(%lf, %lf): negatif deÄŸerler tuhaf sonuçlar verecek" -#: builtin.c:2455 +#: builtin.c:2496 #, c-format msgid "and(%lf, %lf): fractional values will be truncated" msgstr "and(%lf, %lf): tamsayı kısım kalacak ÅŸekilde kalanı atılacak" -#: builtin.c:2484 builtin.c:2486 +#: builtin.c:2525 builtin.c:2527 msgid "or: received non-numeric first argument" msgstr "or: ilk argüman sayısal olmayan türde alındı" -#: builtin.c:2488 +#: builtin.c:2529 #, c-format msgid "or(%lf, %lf): negative values will give strange results" msgstr "or(%lf, %lf): negatif deÄŸerler tuhaf sonuçlar verecek" -#: builtin.c:2490 +#: builtin.c:2531 #, c-format msgid "or(%lf, %lf): fractional values will be truncated" msgstr "or(%lf, %lf): tamsayı kısım kalacak ÅŸekilde kalanı atılacak" -#: builtin.c:2519 builtin.c:2521 +#: builtin.c:2560 builtin.c:2562 msgid "xor: received non-numeric first argument" msgstr "xor: ilk argüman sayısal olmayan türde alındı" -#: builtin.c:2523 +#: builtin.c:2564 #, c-format msgid "xor(%lf, %lf): negative values will give strange results" msgstr "xor(%lf, %lf): negatif deÄŸerler tuhaf sonuçlar verecek" -#: builtin.c:2525 +#: builtin.c:2566 #, c-format msgid "xor(%lf, %lf): fractional values will be truncated" msgstr "xor(%lf, %lf): tamsayı kısım kalacak ÅŸekilde kalanı atılacak" -#: builtin.c:2553 +#: builtin.c:2594 msgid "compl: received non-numeric argument" msgstr "compl: sayısal olmayan argüman alındı" -#: builtin.c:2555 +#: builtin.c:2596 #, c-format msgid "compl(%lf): negative value will give strange results" msgstr "compl(%lf): negatif deÄŸerler tuhaf sonuçlar verecek" -#: builtin.c:2557 +#: builtin.c:2598 #, c-format msgid "compl(%lf): fractional value will be truncated" msgstr "compl(%lf): tamsayı kısım kalacak ÅŸekilde kalanı atılacak" -#: builtin.c:2728 +#: builtin.c:2771 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "dcgettext: `%s' geçerli bir yerel kategori deÄŸil" -#: eval.c:262 +#: eval.c:266 #, c-format msgid "unknown nodetype %d" msgstr "%d. düğümtürü bilinmiyor" -#: eval.c:310 +#: eval.c:312 msgid "buffer overflow in genflags2str" msgstr "genflags2str içinde tampon taÅŸtı" -#: eval.c:555 +#: eval.c:647 #, c-format msgid "for loop: array `%s' changed size from %ld to %ld during loop execution" msgstr "" "for loop: `%s' dizisinin boyu döngünün yorumlanması sırasında %ld iken %ld " "oldu" -#: eval.c:576 +#: eval.c:668 msgid "`break' outside a loop is not portable" msgstr "döngü dışında `break' kullanımı taşınabilir deÄŸil" -#: eval.c:580 +#: eval.c:672 msgid "`break' outside a loop is not allowed" msgstr "döngü dışında `break' kullanımı yasak" -#: eval.c:597 +#: eval.c:689 msgid "`continue' outside a loop is not portable" msgstr "döngü dışında `continue' kullanımı taşınabilir deÄŸil" -#: eval.c:601 +#: eval.c:693 msgid "`continue' outside a loop is not allowed" msgstr "döngü dışında `continue' kullanımı yasak" -#: eval.c:635 +#: eval.c:727 msgid "`next' cannot be called from a BEGIN rule" msgstr "`next' bir BEGIN kuralından çaÄŸrılamaz" -#: eval.c:637 +#: eval.c:729 msgid "`next' cannot be called from an END rule" msgstr "`next' bir END kuralından çaÄŸrılamaz" -#: eval.c:646 +#: eval.c:738 msgid "`nextfile' cannot be called from a BEGIN rule" msgstr "`nextfile' bir BEGIN kuralından çaÄŸrılamaz" -#: eval.c:648 +#: eval.c:740 msgid "`nextfile' cannot be called from an END rule" msgstr "`nextfile' bir END kuralından çaÄŸrılamaz" -#: eval.c:696 +#: eval.c:785 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 +#: eval.c:828 eval.c:1726 #, c-format msgid "can't use function name `%s' as variable or array" msgstr "`%s' iÅŸlev ismi bir deÄŸiÅŸken ya da dizi olarak kullanılamaz" -#: eval.c:746 eval.c:752 +#: eval.c:835 eval.c:841 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "baÅŸlangıç deÄŸeri olmayan `%s' argümanına baÅŸvuru" -#: eval.c:810 eval.c:1728 profile.c:773 +#: eval.c:848 eval.c:907 eval.c:1732 eval.c:1742 profile.c:807 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "`%s' dizisi bir sayısal baÄŸlamda kullanılmaya çalışılıyor" -#: eval.c:910 +#: eval.c:858 eval.c:1752 +#, c-format +msgid "reference to uninitialized variable `%s'" +msgstr "öndeÄŸer ataması yapılmamış `%s' deÄŸiÅŸkenine baÅŸvuru" + +#: eval.c:1007 msgid "" "concatenation: side effects in one expression have changed the length of " "another!" msgstr "" "bitiÅŸtirme: bir ifadenin yan etkileri diÄŸerinin uzunluÄŸunu deÄŸiÅŸtirmiÅŸ!" -#: eval.c:935 +#: eval.c:1032 msgid "assignment used in conditional context" msgstr "koÅŸul baÄŸlamında atama yapılmış" -#: eval.c:1026 +#: eval.c:1122 msgid "division by zero attempted" msgstr "sıfırla bölme hatası" -#: eval.c:1041 +#: eval.c:1137 #, c-format msgid "division by zero attempted in `%%'" msgstr "`%%'de sıfırla bölme hatası" -#: eval.c:1056 profile.c:649 +#: eval.c:1152 profile.c:683 #, c-format msgid "illegal type (%s) in tree_eval" msgstr "tree_eval içinde kuraldışı tür (%s)" -#: eval.c:1232 +#: eval.c:1328 msgid "division by zero attempted in `/='" msgstr "`/='de sıfırla bölme hatası" -#: eval.c:1250 +#: eval.c:1346 #, 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 +#: eval.c:1586 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "`%s' iÅŸlevi bildirilenden daha fazla argümanla çaÄŸrıldı" -#: eval.c:1628 +#: eval.c:1633 #, c-format msgid "function `%s' not defined" msgstr "`%s' iÅŸlevi tanımsız" -#: eval.c:1634 +#: eval.c:1639 #, c-format msgid "function %s called\n" msgstr "%s iÅŸlevi çaÄŸrıldı\n" -#: eval.c:1693 +#: eval.c:1698 msgid "" "\n" "\t# Function Call Stack:\n" @@ -841,46 +857,41 @@ msgstr "" "\t# Ä°ÅŸlev ÇaÄŸrı Yığını:\n" "\n" -#: eval.c:1696 +#: eval.c:1701 msgid "\t# -- main --\n" msgstr "\t# -- main --\n" -#: eval.c:1850 +#: eval.c:1867 msgid "attempt to field reference from non-numeric value" msgstr "sayısal olmayan deÄŸerden alan baÅŸvurusu" -#: eval.c:1852 +#: eval.c:1869 msgid "attempt to reference from null string" msgstr "null dizgeden alan baÅŸvurusu" -#: eval.c:1858 +#: eval.c:1875 #, 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 +#: eval.c:1896 eval.c:1903 profile.c:900 msgid "assignment is not allowed to result of builtin function" msgstr "deÄŸiÅŸken ismine yerleÅŸik iÅŸlevin sonucu atanamaz" -#: eval.c:1941 +#: eval.c:1951 msgid "`IGNORECASE' is a gawk extension" msgstr "`IGNORECASE' bir gawk uzantısıdır" -#: eval.c:1970 +#: eval.c:1980 msgid "`BINMODE' is a gawk extension" msgstr "`BINMODE' bir gawk uzantısıdır" -#: eval.c:2082 +#: eval.c:2092 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "`%sFMT' özelliÄŸi `%s' hatalı" -#: eval.c:2160 +#: eval.c:2170 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "`LINT' atamasından dolayı `--lint' kapatılıyor" @@ -898,32 +909,32 @@ 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:181 +#: ext.c:183 msgid "Operation Not Supported" msgstr "Ä°ÅŸlem Desteklenmiyor" -#: field.c:321 +#: field.c:315 msgid "NF set to negative value" msgstr "NF negatif deÄŸere ayarlı" -#: field.c:819 +#: field.c:808 msgid "split: second argument is not an array" msgstr "split: ikinci argüman bir dizi deÄŸil" -#: field.c:854 +#: field.c:842 msgid "split: null string for third arg is a gawk extension" msgstr "split: üçüncü argüman olan null dizge bir gawk uzantısı" -#: field.c:906 +#: field.c:894 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "`FIELDWIDTHS' bir gawk uzantısıdır" -#: field.c:933 +#: field.c:921 #, c-format msgid "field %d in FIELDWIDTHS, must be > 0" msgstr "FIELDWIDTHS içindeki %d. alan > 0 olmalı" -#: field.c:1006 +#: field.c:994 msgid "null string for `FS' is a gawk extension" msgstr "`FS' için null dizge bir gawk uzantısıdır" @@ -967,7 +978,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:431 +#: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:434 #, c-format msgid "%s: option requires an argument -- %c\n" msgstr "%s: seçenek bir argümanla kullanılır -- %c\n" @@ -982,471 +993,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" -#: io.c:257 +#: io.c:305 #, c-format msgid "cannot open file `%s' for reading (%s)" msgstr "`%s' okumak için açılamıyor (%s)" -#: io.c:344 +#: io.c:392 #, c-format msgid "close of fd %d (`%s') failed (%s)" msgstr "dosya tanımlayıcı %d (`%s') baÅŸarısız (%s)" -#: io.c:482 +#: io.c:530 #, c-format msgid "invalid tree type %s in redirect()" msgstr "redirect() içindeki aÄŸaç türü %s geçersiz" -#: io.c:488 +#: io.c:536 #, c-format msgid "expression in `%s' redirection only has numeric value" msgstr "`%s' yönlendirmesi içindeki ifade sadece sayısal deÄŸer içeriyor" -#: io.c:494 +#: io.c:542 #, c-format msgid "expression for `%s' redirection has null string value" msgstr "`%s' yönlendirmesi içindeki ifade null dizge deÄŸeri içeriyor" -#: io.c:499 +#: io.c:547 #, c-format msgid "filename `%s' for `%s' redirection may be result of logical expression" msgstr "" "`%s' dosya ismi (`%s' yönlendirmesi için) mantıksal ifadenin sonucu olabilir" -#: io.c:521 +#: io.c:569 #, c-format msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" msgstr "`%.*s' dosyası için `>' ve `>>' karışımı gereksiz" -#: io.c:573 +#: io.c:621 #, c-format msgid "can't open pipe `%s' for output (%s)" msgstr "`%s' veriyolu çıktı için açılamadı (%s)" -#: io.c:582 +#: io.c:630 #, c-format msgid "can't open pipe `%s' for input (%s)" msgstr "`%s' veriyolu girdi için açılamadı (%s)" -#: io.c:595 +#: io.c:643 #, c-format msgid "can't open two way socket `%s' for input/output (%s)" msgstr "iki yönlü `%s' soketi G/Ç için açılamıyor (%s)" -#: io.c:599 +#: io.c:647 #, c-format msgid "can't open two way pipe `%s' for input/output (%s)" msgstr "iki yönlü `%s' veriyolu G/Ç için açılamıyor (%s)" -#: io.c:675 +#: io.c:723 #, c-format msgid "can't redirect from `%s' (%s)" msgstr "`%s'den yönlendirilemiyor (%s)" -#: io.c:678 +#: io.c:726 #, c-format msgid "can't redirect to `%s' (%s)" msgstr "`%s'e yönlendirilemiyor (%s)" -#: io.c:717 +#: io.c:765 msgid "" "reached system limit for open files: starting to multiplex file descriptors" msgstr "" "açık dosyalar için sistem sınırı aşıldı: çoÄŸul dosya tanımlayıcılara " "baÅŸlarken" -#: io.c:729 +#: io.c:777 #, c-format msgid "close of `%s' failed (%s)." msgstr "`%s' kapatılamadı (%s)." -#: io.c:736 +#: io.c:784 msgid "too many pipes or input files open" msgstr "çok fazla veriyolu ya da dosya açık" -#: io.c:759 +#: io.c:807 msgid "close: second argument must be `to' or `from'" msgstr "close: ikinci argüman `to' ya da `from' olmalı" -#: io.c:773 +#: io.c:821 #, c-format msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "close: `%.*s' bir açık dosya, veriyolu ya da alt-iÅŸlem deÄŸil" -#: io.c:777 +#: io.c:825 msgid "close of redirection that was never opened" msgstr "hiç açılmamış bir yönlendirmenin kapatılması" -#: io.c:804 +#: io.c:862 #, c-format msgid "close: redirection `%s' not opened with `|&', second argument ignored" msgstr "" "close: `%s' yönlendirmesi bir `|&' ile açılmamış, ikinci argüman yoksayıldı" -#: io.c:866 +#: io.c:924 #, c-format msgid "failure status (%d) on pipe close of `%s' (%s)" msgstr "baÅŸarısızlık durumu (%d): `%s' veriyolunun kapatılması (%s)" -#: io.c:869 +#: io.c:927 #, c-format msgid "failure status (%d) on file close of `%s' (%s)" msgstr "baÅŸarısızlık durumu (%d): `%s' dosyasının kapatılması (%s)" -#: io.c:888 +#: io.c:946 #, c-format msgid "no explicit close of socket `%s' provided" msgstr "`%s' soketinin açıkça kapatılması istenmedi" -#: io.c:891 +#: io.c:949 #, c-format msgid "no explicit close of co-process `%s' provided" msgstr "`%s' alt-iÅŸleminin açıkça kapatılması istenmedi" -#: io.c:894 +#: io.c:952 #, c-format msgid "no explicit close of pipe `%s' provided" msgstr "`%s' veriyolunun açıkça kapatılması istenmedi" -#: io.c:897 +#: io.c:955 #, c-format msgid "no explicit close of file `%s' provided" msgstr "`%s' dosyasının açıkça kapatılması istenmedi" -#: io.c:926 io.c:980 +#: io.c:984 io.c:1038 #, c-format msgid "error writing standard output (%s)" msgstr "standart çıktıya yazarken hata (%s)" -#: io.c:930 io.c:984 +#: io.c:988 io.c:1042 #, c-format msgid "error writing standard error (%s)" msgstr "standart hataya yazarken hata (%s)" -#: io.c:938 +#: io.c:996 #, c-format msgid "pipe flush of `%s' failed (%s)." msgstr "`%s'in veriyolu ile veri aktarımı baÅŸarısız (%s)." -#: io.c:941 +#: io.c:999 #, c-format msgid "co-process flush of pipe to `%s' failed (%s)." msgstr "`%s'e veriyolunun alt-iÅŸlemi ile veri aktarımı baÅŸarısız (%s)." -#: io.c:944 +#: io.c:1002 #, c-format msgid "file flush of `%s' failed (%s)." msgstr "`%s'in dosya ile veri aktarımı baÅŸarısız (%s)." -#: io.c:1103 +#: io.c:1161 msgid "/inet/raw client not ready yet, sorry" msgstr "/inet/raw istemci henüz hazır deÄŸil" -#: io.c:1105 io.c:1142 +#: io.c:1163 io.c:1200 msgid "only root may use `/inet/raw'." msgstr "`/inet/raw' sadece root tarafından kullanılabilir" -#: io.c:1140 +#: io.c:1198 msgid "/inet/raw server not ready yet, sorry" msgstr "/inet/raw sunucu henüz hazır deÄŸil" -#: io.c:1230 +#: io.c:1288 #, c-format msgid "no (known) protocol supplied in special filename `%s'" msgstr "özel dosya ismi `%s' içinde (bilinen) bir protokol saÄŸlanmamış" -#: io.c:1248 +#: io.c:1306 #, c-format msgid "special file name `%s' is incomplete" msgstr "özel dosya ismi `%s' tamamlanmamış" -#: io.c:1260 +#: io.c:1318 #, c-format msgid "local port invalid in `%s'" msgstr "`%s' deki yerel port geçersiz" -#: io.c:1272 +#: io.c:1330 msgid "must supply a remote hostname to `/inet'" msgstr "`/inet' e bir karşı makina ismi saÄŸlanmalı" -#: io.c:1287 +#: io.c:1345 msgid "must supply a remote port to `/inet'" msgstr "`/inet' e bir karşı port saÄŸlanmalı" -#: io.c:1293 +#: io.c:1351 #, c-format msgid "remote port invalid in `%s'" msgstr "`%s' de karşı port geçersiz" -#: io.c:1303 +#: io.c:1361 msgid "TCP/IP communications are not supported" msgstr "TCP/IP haberleÅŸmesi desteklenmiyor" -#: io.c:1312 io.c:1492 +#: io.c:1370 io.c:1551 #, c-format msgid "file `%s' is a directory" msgstr "`%s' dosya deÄŸil dizin" -#: io.c:1381 +#: io.c:1440 #, c-format msgid "use `PROCINFO[\"%s\"]' instead of `%s'" msgstr "`PROCINFO[\"%s\"]' kullanın (`%s' yerine)" -#: io.c:1413 +#: io.c:1472 msgid "use `PROCINFO[...]' instead of `/dev/user'" msgstr "`/dev/user' yerine `PROCINFO[...]' kullanın" -#: io.c:1478 io.c:1652 +#: io.c:1537 io.c:1711 #, c-format msgid "could not open `%s', mode `%s'" msgstr "`%s', `%s' kipinde açılamadı" -#: io.c:1703 +#: io.c:1762 #, c-format msgid "close of master pty failed (%s)" msgstr "ana pty kapatılamadı (%s)" -#: io.c:1705 io.c:1857 io.c:2009 +#: io.c:1764 io.c:1916 io.c:2068 #, c-format msgid "close of stdout in child failed (%s)" msgstr "ast süreçte stdÇ kapatılamadı (%s)" -#: io.c:1708 +#: io.c:1767 #, c-format msgid "moving slave pty to stdout in child failed (dup: %s)" msgstr "ast süreçte yardımcı pty standart çıktıya taşınamadı (dup: %s)" -#: io.c:1710 io.c:1862 +#: io.c:1769 io.c:1921 #, c-format msgid "close of stdin in child failed (%s)" msgstr "ast süreçte stdG kapatılamadı (%s)" -#: io.c:1713 +#: io.c:1772 #, c-format msgid "moving slave pty to stdin in child failed (dup: %s)" msgstr "ast süreçte yardımcı pty standart girdiye taşınamadı (dup: %s)" -#: io.c:1715 io.c:1734 +#: io.c:1774 io.c:1793 #, 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 +#: io.c:1867 io.c:1919 io.c:2049 io.c:2071 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "ast süreçte veriyolu standart çıktıya taşınamadı (dup: %s)" -#: io.c:1812 io.c:1865 +#: io.c:1871 io.c:1924 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "ast süreçte veriyolu standart girdiye taşınamadı (dup: %s)" -#: io.c:1829 io.c:2003 +#: io.c:1888 io.c:2062 msgid "restoring stdout in parent process failed\n" msgstr "üst süreçte stdÇ eski durumuna getirilemedi\n" -#: io.c:1834 +#: io.c:1893 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 +#: io.c:1927 io.c:2073 io.c:2084 #, c-format msgid "close of pipe failed (%s)" msgstr "veriyolu kapatılamadı (%s)" -#: io.c:1913 +#: io.c:1972 msgid "`|&' not supported" msgstr "`|&' desteklenmiyor" -#: io.c:1980 +#: io.c:2039 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "`%s' veriyolu açılamıyor (%s)" -#: io.c:2021 +#: io.c:2080 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "`%s' için ast süreç oluÅŸturulamıyor (fork: %s)" -#: io.c:2364 +#: io.c:2423 #, c-format msgid "data file `%s' is empty" msgstr "veri dosyası `%s' boÅŸ" -#: io.c:2407 io.c:2415 +#: io.c:2466 io.c:2474 msgid "could not allocate more input memory" -msgstr "" +msgstr "daha fazla girdi belleÄŸi ayrılamadı" -#: io.c:2540 io.c:2782 io.c:3046 +#: io.c:2832 io.c:2895 #, c-format msgid "error reading input file `%s': %s" msgstr "`%s' girdi dosyası okunurken hata: %s" -#: io.c:3281 +#: io.c:3020 msgid "multicharacter value of `RS' is a gawk extension" msgstr "`RS' çoklu karakter deÄŸeri bir gawk uzantısıdır" -#: main.c:322 +#: main.c:324 msgid "`-m[fr]' option irrelevant in gawk" msgstr "`-m[fr]' seçeneÄŸi gawk'da böyle kullanılmaz" -#: main.c:324 +#: main.c:326 msgid "-m option usage: `-m[fr] nnn'" msgstr "-m seçeneÄŸinin kullanımı: `-m[fr] nnn'" -#: main.c:341 +#: main.c:343 #, c-format msgid "%s: option `-W %s' unrecognized, ignored\n" msgstr "%s: `-W %s' seçeneÄŸi tanımlı deÄŸil, yok sayıldı\n" -#: main.c:378 +#: main.c:380 msgid "empty argument to `--source' ignored" msgstr "`--source' seçeneÄŸi için boÅŸ argüman yoksayıldı" -#: main.c:448 +#: main.c:451 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "ortam deÄŸiÅŸkeni `POSIXLY_CORRECT' var: `--posix' kullanılıyor" -#: main.c:453 +#: main.c:456 msgid "`--posix' overrides `--traditional'" msgstr "`--posix' seçeneÄŸi `--traditional' seçeneÄŸini etkisiz kılar" -#: main.c:464 +#: main.c:467 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "" "`--posix'/`--traditional' seçenekleri `--non-decimal-data' seçeneÄŸini " "etkisiz kılar" -#: main.c:468 +#: main.c:471 #, c-format msgid "running %s setuid root may be a security problem" msgstr "%s root yetkileriyle çalıştırıldığında güvenlik sorunları olabilir" -#: main.c:509 +#: main.c:512 #, c-format msgid "can't set binary mode on stdin (%s)" msgstr "standart girdi ikilik kipe ayarlanamaz (%s)" -#: main.c:512 +#: main.c:515 #, c-format msgid "can't set binary mode on stdout (%s)" msgstr "standart çıktı ikilik kipe ayarlanamaz (%s)" -#: main.c:514 +#: main.c:517 #, c-format msgid "can't set binary mode on stderr (%s)" msgstr "standart hata ikilik kipe ayarlanamaz (%s)" -#: main.c:544 +#: main.c:547 msgid "no program text at all!" msgstr "program metni hiç yok!" -#: main.c:612 +#: main.c:620 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "" "Kullanımı: %s [POSIX veya GNU tarzı seçenekler] -f progdosyası [--] " "dosya ...\n" -#: main.c:614 +#: main.c:622 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "" "Kullanımı: %s [POSIX veya GNU tarzı seçenekler] %cprogram%c dosya ...\n" -#: main.c:619 +#: main.c:627 msgid "POSIX options:\t\tGNU long options:\n" msgstr "POSIX seçenekleri: GNU uzun seçenekleri:\n" -#: main.c:620 +#: main.c:628 msgid "\t-f progfile\t\t--file=progfile\n" msgstr " -f progDosyası --file=progDosyası\n" -#: main.c:621 +#: main.c:629 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr " -F ayraç --field-separator=ayraç\n" -#: main.c:622 +#: main.c:630 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr " -v var=deÄŸer --assign=var=deÄŸer\n" -#: main.c:623 +#: main.c:631 msgid "\t-m[fr] val\n" msgstr " -m[fr] deÄŸer\n" -#: main.c:624 +#: main.c:632 msgid "\t-W compat\t\t--compat\n" msgstr " -W compat --compat\n" -#: main.c:625 +#: main.c:633 msgid "\t-W copyleft\t\t--copyleft\n" msgstr " -W copyleft --copyleft\n" -#: main.c:626 +#: main.c:634 msgid "\t-W copyright\t\t--copyright\n" msgstr " -W copyright --copyright\n" -#: main.c:627 +#: main.c:635 msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n" msgstr " -W dump-variables[=dosya] --dump-variables[=dosya]\n" -#: main.c:628 +#: main.c:636 msgid "\t-W gen-po\t\t--gen-po\n" msgstr " -W gen-po --gen-po\n" -#: main.c:629 +#: main.c:637 msgid "\t-W help\t\t\t--help\n" msgstr " -W help --help\n" -#: main.c:630 +#: main.c:638 msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n" msgstr " -W lint[=ölümcül] --lint[=ölümcül]\n" -#: main.c:631 +#: main.c:639 msgid "\t-W lint-old\t\t--lint-old\n" msgstr " -W lint-old --lint-old\n" -#: main.c:632 +#: main.c:640 msgid "\t-W non-decimal-data\t--non-decimal-data\n" msgstr " -W non-decimal-data --non-decimal-data\n" -#: main.c:634 +#: main.c:642 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr " -W nostalgia --nostalgia\n" -#: main.c:637 +#: main.c:645 msgid "\t-W parsedebug\t\t--parsedebug\n" msgstr " -W parsedebug --parsedebug\n" -#: main.c:639 +#: main.c:647 msgid "\t-W profile[=file]\t--profile[=file]\n" msgstr " -W profile[=dosya] --profile[=dosya]\n" -#: main.c:640 +#: main.c:648 msgid "\t-W posix\t\t--posix\n" msgstr " -W posix --posix\n" -#: main.c:641 +#: main.c:649 msgid "\t-W re-interval\t\t--re-interval\n" msgstr " -W re-interval --re-interval\n" -#: main.c:642 +#: main.c:650 msgid "\t-W source=program-text\t--source=program-text\n" msgstr " -W source=program-metni --source=program-metni\n" -#: main.c:643 +#: main.c:651 msgid "\t-W traditional\t\t--traditional\n" msgstr " -W traditional --traditional\n" -#: main.c:644 +#: main.c:652 msgid "\t-W usage\t\t--usage\n" msgstr " -W usage --usage\n" -#: main.c:645 +#: main.c:653 msgid "\t-W version\t\t--version\n" msgstr " -W version --version\n" -#: main.c:649 +#: main.c:657 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" @@ -1460,7 +1471,7 @@ msgstr "" "Çeviri hatalarını <gnu-tr-u12a@lists.sourceforge.net> adresine bildiriniz.\n" "\n" -#: main.c:653 +#: main.c:661 msgid "" "gawk is a pattern scanning and processing language.\n" "By default it reads standard input and writes standard output.\n" @@ -1470,7 +1481,7 @@ msgstr "" "Öntanımlı olarak standart girdiyi okur ve standart çıktıya yazar.\n" "\n" -#: main.c:657 +#: main.c:665 msgid "" "Examples:\n" "\tgawk '{ sum += $1 }; END { print sum }' file\n" @@ -1480,7 +1491,7 @@ msgstr "" "\tgawk '{ sum += $1 }; END { print sum }' dosya\n" "\tgawk -F: '{ print $1 }' /etc/passwd\n" -#: main.c:669 +#: main.c:682 #, c-format msgid "" "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" @@ -1499,7 +1510,7 @@ msgstr "" "üzerinde deÄŸiÅŸiklik yapabilirsiniz.\n" "\n" -#: main.c:677 +#: main.c:690 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -1513,7 +1524,7 @@ msgstr "" "edinmek için GNU Genel Kamu Lisansına bakınız.\n" "\n" -#: main.c:683 +#: main.c:696 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program; if not, write to the Free Software\n" @@ -1523,11 +1534,11 @@ 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:713 +#: main.c:730 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "POSIX awk -Ft ile dosya sistemini belirlemez" -#: main.c:944 +#: main.c:956 #, c-format msgid "" "%s: `%s' argument to `-v' not in `var=value' form\n" @@ -1536,35 +1547,35 @@ msgstr "" "%s: `-v' ile verilen `%s' argümanı `var=deÄŸer' biçiminde deÄŸil\n" "\n" -#: main.c:964 +#: main.c:976 #, c-format msgid "`%s' is not a legal variable name" msgstr "`%s' kurala uygun bir deÄŸiÅŸken ismi deÄŸil" -#: main.c:967 +#: main.c:979 #, c-format msgid "`%s' is not a variable name, looking for file `%s=%s'" msgstr "`%2$s=%3$s' için dosyaya bakınca, `%1$s' bir deÄŸiÅŸken ismi deÄŸil" -#: main.c:995 +#: main.c:1012 msgid "floating point exception" msgstr "Gerçel sayı istisnası" -#: main.c:1002 +#: main.c:1019 msgid "fatal error: internal error" msgstr "ölümcül iç hata" -#: main.c:1052 +#: main.c:1069 #, c-format msgid "no pre-opened fd %d" msgstr "ön açılışlı bir %d dosya tanımlayıcısı yok" -#: main.c:1057 +#: main.c:1074 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "%d dosya tanımlayıcısı için /dev/null ön açılışı yapılamadı" -#: main.c:1080 main.c:1089 +#: main.c:1097 main.c:1106 #, c-format msgid "could not find groups: %s" msgstr "gruplar bulunamadı: %s" @@ -1585,23 +1596,23 @@ msgstr "hata: " msgid "fatal: " msgstr "ölümcül: " -#: node.c:59 node.c:66 node.c:75 node.c:89 node.c:116 +#: node.c:58 node.c:65 node.c:74 node.c:88 node.c:115 msgid "can't convert string to float" msgstr "dizge gerçel sayıya dönüştürülemiyor" -#: node.c:357 +#: node.c:355 msgid "backslash at end of string" msgstr "dizge sonunda tersbölü" -#: node.c:544 +#: node.c:539 msgid "POSIX does not allow `\\x' escapes" msgstr "POSIX `\\x' öncelemelerine izin vermez" -#: node.c:550 +#: node.c:545 msgid "no hex digits in `\\x' escape sequence" msgstr "`\\x' önceleme dizgesinde onaltılık rakamlar yok" -#: node.c:584 +#: node.c:579 #, c-format msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "`\\%c' önceleme dizgesi `%c' olarak kullanıldı" @@ -1616,24 +1627,21 @@ msgstr "%s %s `%s': close-on-exec belirlenemedi: (fcntl: %s)" msgid "could not open `%s' for writing: %s" msgstr "`%s' yazmak için açılamadı: %s" -#: profile.c:409 -msgid "internal error: Node_var with null vname" -msgstr "iç hata: null vname'li node_var" +#: profile.c:449 +#, c-format +msgid "internal error: %s with null vname" +msgstr "iç hata: null vname'li %s" -#: profile.c:471 +#: profile.c:512 msgid "# treated internally as `delete'" msgstr "# dahili olarak `delete' varsayıldı" -#: profile.c:545 -msgid "internal error: Node_var_array with null vname" -msgstr "iç hata: null vname'li node_var_array" - -#: profile.c:1127 +#: profile.c:1162 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "\t# gawk profili, oluÅŸturuldu: %s\n" -#: profile.c:1130 +#: profile.c:1165 msgid "" "\t# BEGIN block(s)\n" "\n" @@ -1641,7 +1649,7 @@ msgstr "" "\t# BEGIN blokları\n" "\n" -#: profile.c:1140 +#: profile.c:1175 msgid "" "\t# Rule(s)\n" "\n" @@ -1649,7 +1657,7 @@ msgstr "" "\t# Kurallar\n" "\n" -#: profile.c:1146 +#: profile.c:1181 msgid "" "\t# END block(s)\n" "\n" @@ -1657,7 +1665,7 @@ msgstr "" "\t# END blokları\n" "\n" -#: profile.c:1166 +#: profile.c:1201 msgid "" "\n" "\t# Functions, listed alphabetically\n" @@ -1665,7 +1673,7 @@ msgstr "" "\n" "\t# Ä°ÅŸlevler, alfabetik sırayla\n" -#: profile.c:1376 +#: profile.c:1413 #, c-format msgid "unexpected type %s in prec_level" msgstr "prec_level'da anlaşılamayan tür %s" @@ -1749,6 +1757,21 @@ msgstr ") ya da \\) eÅŸleÅŸmiyor" msgid "No previous regular expression" msgstr "Daha önce düzenli ifade yok" +#~ msgid "substr: length %g is < 0" +#~ msgstr "substr: uzunluk %g < 0" + +#~ msgid "delete: illegal use of variable `%s' as array" +#~ msgstr "delete: `%s' deÄŸiÅŸkeninin dizi olarak kullanımı kuraldışı" + +#~ msgid "asort: first argument is not an array" +#~ msgstr "asort: ilk argüman bir dizi deÄŸil" + +#~ msgid "asort: second argument is not an array" +#~ msgstr "asort: ikinci argüman bir dizi deÄŸil" + +#~ msgid "internal error: Node_var_array with null vname" +#~ msgstr "iç hata: null vname'li node_var_array" + #~ msgid "invalid syntax in name `%s' for variable assignment" #~ msgstr "deÄŸiÅŸken ismi `%s' de sözdizimi hatası" diff --git a/posix/ChangeLog b/posix/ChangeLog index cba078f4..b2bcfb1b 100644 --- a/posix/ChangeLog +++ b/posix/ChangeLog @@ -1,3 +1,11 @@ +Mon Jul 7 11:01:43 2003 Arnold D. Robbins <arnold@skeeve.com> + + * Release 3.1.3: Release tar file made. + +Sun May 25 16:23:43 2003 Corinna Vinschen <vinschen@redhat.com> + + * gawkmisc.c (cygwin_premain0): New function. + Wed Mar 19 14:10:31 2003 Arnold D. Robbins <arnold@skeeve.com> This time for sure. diff --git a/posix/gawkmisc.c b/posix/gawkmisc.c index 6ca9ee3d..b421766a 100644 --- a/posix/gawkmisc.c +++ b/posix/gawkmisc.c @@ -219,3 +219,20 @@ int fd; /* no-op */ return; } + +#ifdef __CYGWIN__ +#include <sys/cygwin.h> + +extern int _fmode; +void +cygwin_premain0 (int argc, char **argv, struct per_process *myself) +{ + static struct __cygwin_perfile pf[] = + { + {"", O_RDONLY | O_TEXT}, + /*{"", O_WRONLY | O_BINARY},*/ + {NULL, 0} + }; + cygwin_internal (CW_PERFILE, pf); +} +#endif @@ -250,6 +250,44 @@ pprint(register NODE *volatile tree) fprintf(prof_fp, "}\n"); break; + case Node_K_switch: + indent(tree->exec_count); + fprintf(prof_fp, "switch ("); + in_expr++; + pprint(tree->lnode); + in_expr--; + fprintf(prof_fp, ") {\n"); + pprint(tree->rnode); + indent(SPACEOVER); + fprintf(prof_fp, "}\n"); + break; + + case Node_switch_body: + case Node_case_list: + pprint(tree->lnode); + pprint(tree->rnode); + break; + + case Node_K_case: + indent(tree->exec_count); + fprintf(prof_fp, "case "); + in_expr++; + pprint(tree->lnode); + in_expr--; + fprintf(prof_fp, ":\n"); + indent_in(); + pprint(tree->rnode); + indent_out(); + break; + + case Node_K_default: + indent(tree->exec_count); + fprintf(prof_fp, "default:\n"); + indent_in(); + pprint(tree->rnode); + indent_out(); + break; + case Node_K_while: indent(tree->exec_count); fprintf(prof_fp, "while ("); @@ -402,11 +440,14 @@ tree_eval(register NODE *tree) fprintf(prof_fp, "%s", fparms[tree->param_cnt]); return; + case Node_var_new: case Node_var: + case Node_var_array: if (tree->vname != NULL) fprintf(prof_fp, "%s", tree->vname); else - fatal(_("internal error: Node_var with null vname")); + fatal(_("internal error: %s with null vname"), + nodetype2str(tree->type)); return; case Node_val: @@ -538,13 +579,6 @@ tree_eval(register NODE *tree) pp_lhs(tree); return; - case Node_var_array: - if (tree->vname != NULL) - fprintf(prof_fp, "%s", tree->vname); - else - fatal(_("internal error: Node_var_array with null vname")); - return; - case Node_unary_minus: fprintf(prof_fp, " -"); if (is_scalar(tree->subnode->type)) @@ -773,6 +807,7 @@ pp_lhs(register NODE *ptr) fatal(_("attempt to use array `%s' in a scalar context"), ptr->vname); + case Node_var_new: case Node_var: fprintf(prof_fp, "%s", ptr->vname); break; @@ -1254,6 +1289,7 @@ static int is_scalar(NODETYPE type) { switch (type) { + case Node_var_new: case Node_var: case Node_var_array: case Node_val: @@ -1284,6 +1320,7 @@ static int prec_level(NODETYPE type) { switch (type) { + case Node_var_new: case Node_var: case Node_var_array: case Node_param_list: @@ -318,3 +318,38 @@ remaybelong(const char *text, size_t len) return FALSE; } + +/* reflags2str --- make a regex flags value readable */ + +const char * +reflags2str(int flagval) +{ + static const struct flagtab values[] = { + { RE_BACKSLASH_ESCAPE_IN_LISTS, "RE_BACKSLASH_ESCAPE_IN_LISTS" }, + { RE_BK_PLUS_QM, "RE_BK_PLUS_QM" }, + { RE_CHAR_CLASSES, "RE_CHAR_CLASSES" }, + { RE_CONTEXT_INDEP_ANCHORS, "RE_CONTEXT_INDEP_ANCHORS" }, + { RE_CONTEXT_INDEP_OPS, "RE_CONTEXT_INDEP_OPS" }, + { RE_CONTEXT_INVALID_OPS, "RE_CONTEXT_INVALID_OPS" }, + { RE_DOT_NEWLINE, "RE_DOT_NEWLINE" }, + { RE_DOT_NOT_NULL, "RE_DOT_NOT_NULL" }, + { RE_HAT_LISTS_NOT_NEWLINE, "RE_HAT_LISTS_NOT_NEWLINE" }, + { RE_INTERVALS, "RE_INTERVALS" }, + { RE_LIMITED_OPS, "RE_LIMITED_OPS" }, + { RE_NEWLINE_ALT, "RE_NEWLINE_ALT" }, + { RE_NO_BK_BRACES, "RE_NO_BK_BRACES" }, + { RE_NO_BK_PARENS, "RE_NO_BK_PARENS" }, + { RE_NO_BK_REFS, "RE_NO_BK_REFS" }, + { RE_NO_BK_VBAR, "RE_NO_BK_VBAR" }, + { RE_NO_EMPTY_RANGES, "RE_NO_EMPTY_RANGES" }, + { RE_UNMATCHED_RIGHT_PAREN_ORD, "RE_UNMATCHED_RIGHT_PAREN_ORD" }, + { RE_NO_POSIX_BACKTRACKING, "RE_NO_POSIX_BACKTRACKING" }, + { RE_NO_GNU_OPS, "RE_NO_GNU_OPS" }, + { RE_DEBUG, "RE_DEBUG" }, + { RE_INVALID_INTERVAL_ORD, "RE_INVALID_INTERVAL_ORD" }, + { RE_ICASE, "RE_ICASE" }, + { 0, NULL }, + }; + + return genflags2str(flagval, values); +} @@ -48,6 +48,11 @@ /* POSIX says that <sys/types.h> must be included (by the caller) before <regex.h>. */ #include <sys/types.h> + +#if defined (_MSC_VER) +#include <stdio.h> /* for size_t */ +#endif + #include <limits.h> #include <regex.h> #include "regex_internal.h" diff --git a/test/ChangeLog b/test/ChangeLog index 3da3d663..88bcbb79 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,97 @@ +Mon Jul 7 11:01:43 2003 Arnold D. Robbins <arnold@skeeve.com> + + * Release 3.1.3: Release tar file made. + +Fri Jul 4 11:12:07 2003 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (poundbang2): Removed. + (poundbang): Added env var settings. + +Thu Jun 26 15:44:33 2003 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (match2, whiny): new test. + * match2.awk, match2.ok: new files. + * whiny.awk, whiny.ok: new files. + +Thu Jun 26 14:51:40 2003 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am: Use double quotes for sed invocation to make + life easier (eventually) for DOS version of Makefile. + * pipeio2.awk, pipio2.ok: Ditto. + +Wed Jun 18 12:32:14 2003 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (AWK): Use LC_ALL=$${GAWKLOCALE:-C} and + same for LANG when running awk. Provides sane locale for + tests with ability to override it if need be. + (all tests): Removed explicit setting of LC_ALL and LANG. + * Gentests: Ditto. + +Wed May 28 08:02:33 CEST 2003 Stepan Kasal <kasal@math.cas.cz> + + * Makefile.am (uninit4): new test. + * uninit4.awk, uninit4.ok: new files. + +Wed May 28 06:30:23 2003 Stepan Kasal <kasal@math.cas.cz> + + * Makefile.am (aryprm4 aryprm5 aryprm6 aryprm7 aryprm8 scalar uninit3): + new tests. + * aryprm4.awk aryprm4.ok aryprm5.awk aryprm5.ok aryprm6.awk aryprm6.ok: + aryprm7.awk aryprm7.ok aryprm8.awk aryprm8.ok scalar.awk scalar.ok: + uninit3.awk uninit3.ok: new files. + +Tue May 27 14:27:50 2003 Stepan Kasal <kasal@math.cas.cz> + + * Makefile.am (aryprm1, aryprm2, aryprm3, sortempty): New tests. + * aryprm1.awk, aryprm1.ok, aryprm2.awk, aryprm2.ok: New files. + * aryprm3.awk, aryprm3.ok, sortempty.awk, sortempty.ok: dtto + * prmarscl.ok: The actual error message has changed. + +Tue May 27 08:23:51 2003 Stepan Kasal <kasal@math.cas.cz> + + * arrayref3.ok, arrayref4.ok, fnaryscl.ok: Error messages reformatted. + +Sun Jun 8 17:18:06 2003 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (fmttest, strtonum, nested, gsubtst5, delarpm2): New tests. + * fmttest.awk, fmttest.ok: New files. From Nelson Beebe, + <beebe@math.utah.edu>. + * strtonum.awk, strtonum.ok: New files. + * nested.awk, nested.in, nested.ok: New files. + * gsubtst5.awk, gsubtst5.in, gsubtst5.ok: New files. + * delarpm2.awk, delarpm2.ok: New files. (Also from Nelson Beebe.) + + * switch2.awk: Currently unused test for switch code. + +Wed May 14 16:49:53 2003 Arnold D. Robbins <arnold@skeeve.com> + + * Gentests: Add LC_ALL=C LANG=C to generated tests. + * Makefile.am: All other manual tests: ditto. + +Sun May 11 15:27:55 2003 Stepan Kasal <kasal@math.cas.cz> + + * Makefile.am (rsnulbig, rsnulbig2): New tests. + * rsnulbig.ok, rsnulbig2.ok: New files. + +Sun May 11 15:00:20 2003 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (arrayprm2, arrayprm3, arryref2, arryref3, arryref4, + arryref5, rstest3, rstest4, rstest5): New tests. + * arrayprm2.awk, arrayprm2.ok, arrayprm3.awk, arrayprm3.ok, arryref2.ok, + arryref3.ok, arryref4.ok, arryref5.ok, rstest3.awk, rstest3.ok, rstest4.awk, + rstest4.ok, rstest5.awk, rstest5.ok: New files. + +Sun May 11 12:20:59 2003 Arnold D. Robbins <arnold@skeeve.com> + + * strftime.awk: Remove seconds from input and strftime output, + to decrease chance of failing on second boundary. + * Makefile.am (strftime): Tweak message appropriately. + +Tue Mar 25 08:35:42 2003 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (fnarray2): New test. + * fnarray2.awk, fnarray2.ok: New files. + Wed Mar 19 14:10:31 2003 Arnold D. Robbins <arnold@skeeve.com> This time for sure. @@ -18,7 +112,7 @@ Tue Mar 4 10:32:23 2003 Arnold D. Robbins <arnold@skeeve.com> 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 + reports any failures. Otherwise, for `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'. diff --git a/test/Makefile.am b/test/Makefile.am index fb0917b4..0a4b68e3 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -42,17 +42,45 @@ EXTRA_DIST = \ argtest.ok \ arrayparm.awk \ arrayparm.ok \ + arrayprm2.awk \ + arrayprm2.ok \ + arrayprm3.awk \ + arrayprm3.ok \ arrayref.awk \ arrayref.ok \ + arrymem1.awk \ + arrymem1.ok \ + arryref2.awk \ + arryref2.ok \ + arryref3.awk \ + arryref3.ok \ + arryref4.awk \ + arryref4.ok \ + arryref5.awk \ + arryref5.ok \ arynasty.awk \ arynasty.ok \ arynocls.awk \ arynocls.in \ arynocls.ok \ + aryprm1.awk \ + aryprm1.ok \ + aryprm2.awk \ + aryprm2.ok \ + aryprm3.awk \ + aryprm3.ok \ + aryprm4.awk \ + aryprm4.ok \ + aryprm5.awk \ + aryprm5.ok \ + aryprm6.awk \ + aryprm6.ok \ + aryprm7.awk \ + aryprm7.ok \ + aryprm8.awk \ + aryprm8.ok \ arysubnm.awk \ arysubnm.ok \ - arrymem1.awk \ - arrymem1.ok \ asgext.awk \ asgext.in \ asgext.ok \ @@ -95,6 +123,8 @@ EXTRA_DIST = \ defref.ok \ delarprm.awk \ delarprm.ok \ + delarpm2.awk \ + delarpm2.ok \ dynlj.awk \ dynlj.ok \ eofsplit.awk \ @@ -110,11 +140,15 @@ EXTRA_DIST = \ fldchgnf.awk \ fldchgnf.in \ fldchgnf.ok \ + fmttest.awk \ + fmttest.ok \ fnamedat.awk \ fnamedat.in \ fnamedat.ok \ fnarray.awk \ fnarray.ok \ + fnarray2.awk \ + fnarray2.ok \ fnarydel.awk \ fnarydel.ok \ fnaryscl.awk \ @@ -183,6 +217,9 @@ EXTRA_DIST = \ gsubtst3.ok \ gsubtst4.awk \ gsubtst4.ok \ + gsubtst5.awk \ + gsubtst5.in \ + gsubtst5.ok \ gtlnbufv.awk \ hsprint.awk \ hsprint.ok \ @@ -227,6 +264,8 @@ EXTRA_DIST = \ manyfiles.ok \ match1.awk \ match1.ok \ + match2.awk \ + match2.ok \ math.awk \ math.ok \ membug1.awk \ @@ -242,6 +281,9 @@ EXTRA_DIST = \ nasty2.ok \ negexp.awk \ negexp.ok \ + nested.awk \ + nested.in \ + nested.ok \ nfldstr.awk \ nfldstr.in \ nfldstr.ok \ @@ -339,6 +381,7 @@ EXTRA_DIST = \ printf1.awk \ printf1.ok \ printfloat.awk \ + printlang.awk \ prmarscl.awk \ prmarscl.ok \ prmreuse.awk \ @@ -387,13 +430,23 @@ EXTRA_DIST = \ rsnul1nl.awk \ rsnul1nl.in \ rsnul1nl.ok \ + rsnulbig.ok \ + rsnulbig2.ok \ rstest1.awk \ rstest1.ok \ rstest2.awk \ rstest2.ok \ + rstest3.awk \ + rstest3.ok \ + rstest4.awk \ + rstest4.ok \ + rstest5.awk \ + rstest5.ok \ rswhite.awk \ rswhite.in \ rswhite.ok \ + scalar.awk \ + scalar.ok \ sclforin.awk \ sclforin.ok \ sclifin.awk \ @@ -402,6 +455,8 @@ EXTRA_DIST = \ shadow.ok \ sort1.awk \ sort1.ok \ + sortempty.awk \ + sortempty.ok \ space.ok \ splitargv.awk \ splitargv.in \ @@ -421,6 +476,8 @@ EXTRA_DIST = \ strtod.awk \ strtod.in \ strtod.ok \ + strtonum.awk \ + strtonum.ok \ strftime.awk \ strftlng.awk \ strftlng.ok \ @@ -431,6 +488,7 @@ EXTRA_DIST = \ swaplns.awk \ swaplns.in \ swaplns.ok \ + switch2.awk \ synerr1.awk \ synerr1.ok \ tradanch.awk \ @@ -439,59 +497,75 @@ EXTRA_DIST = \ tweakfld.awk \ tweakfld.in \ tweakfld.ok \ - uninitialized.awk \ - uninitialized.ok \ uninit2.awk \ uninit2.ok \ + uninit3.awk \ + uninit3.ok \ + uninit4.awk \ + uninit4.ok \ + uninitialized.awk \ + uninitialized.ok \ + whiny.awk \ + whiny.in \ + whiny.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 +BASIC_TESTS = addcomma anchgsub argarray arrayparm arrayref arrymem1 \ + arrayprm2 arrayprm3 arryref2 arryref3 arryref4 arryref5 arynasty \ + arynocls aryprm1 aryprm2 aryprm3 aryprm4 aryprm5 aryprm6 aryprm7 \ + aryprm8 arysubnm asgext awkpath back89 backgsub childin clobber \ + clsflnam compare compare2 concat1 convfmt datanonl defref \ + delarprm delarpm2 dynlj eofsplit fldchg fldchgnf fmttest fnamedat \ + fnarray fnarray2 fnarydel fnaryscl fnasgnm fnmisc fnparydl \ + forsimp fsbs fsrs fstabplus funsemnl funsmnam funstack getline \ + getline2 getline3 getlnbuf getnr2tb getnr2tm gsubasgn gsubtest \ + gsubtst2 gsubtst3 gsubtst4 gsubtst5 hsprint inputred intest \ + intprec leaddig leadnl litoct longsub longwrds math membug1 \ + messages minusstr mmap8k nasty nasty2 negexp nested 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 rsnulbig rsnulbig2 rstest1 \ + rstest2 rstest3 rstest4 rstest5 rswhite scalar sclforin sclifin \ + sortempty splitargv splitarr splitdef splitvar splitwht sprintfc \ + strtod subslash substr swaplns synerr1 tradanch tweakfld uninit2 \ + uninit3 uninit4 uninitialized 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 + match1 match2 manyfiles nondec posix procinfs regx8bit rebuf reint \ + shadow sort1 strtonum strftime whiny 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 +NEED_LINT = defref noeffect nofmtch shadow uninit2 uninit3 uninit4 uninitialized # List of the files that appear in manual tests or are for reserve testing: -GENTESTS_UNUSED = Makefile.in gtlnbufv.awk printfloat.awk +GENTESTS_UNUSED = Makefile.in gtlnbufv.awk printfloat.awk switch2.awk CMP = cmp AWKPROG = ../gawk$(EXEEXT) -AWK = LC_ALL=C $(AWKPROG) + +# This business forces the locale to be C for running the tests, +# unless we override it to something else for testing. +AWK = LC_ALL=$${GAWKLOCALE:-C} LANG=$${GAWKLOCALE:-C} $(AWKPROG) # 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 \ + printlang \ basic-msg-start basic basic-msg-end \ unix-msg-start unix-tests unix-msg-end \ extend-msg-start gawk-extensions extend-msg-end @@ -514,6 +588,9 @@ msg:: @echo 'some systems may omit a leading zero and the floating point' @echo 'precision may lead to slightly different output in a few cases.' +printlang:: + @$(AWK) -f $(srcdir)/printlang.awk + basic-msg-start: @echo "======== Starting basic tests ========" @@ -547,7 +624,7 @@ poundbang:: else \ sed "s;/tmp/gawk;../$(AWKPROG);" < $(srcdir)/poundbang.awk > ./_pbd.awk ; \ chmod +x ./_pbd.awk ; \ - ./_pbd.awk $(srcdir)/poundbang.awk > _`basename $@`; \ + LC_ALL=$${GAWKLOCALE:-C} LANG=$${GAWKLOCALE:-C} ./_pbd.awk $(srcdir)/poundbang.awk > _`basename $@`; \ fi @-$(CMP) $(srcdir)/poundbang.awk _`basename $@` && rm -f _`basename $@` _pbd.awk @@ -581,7 +658,7 @@ manyfiles:: @mkdir junk @$(AWK) 'BEGIN { for (i = 1; i <= 300; i++) print i, i}' >_$@ @$(AWK) -f $(srcdir)/manyfiles.awk _$@ _$@ - @wc -l junk/* | $(AWK) '$$1 != 2' | wc -l | sed 's/ *//g' > _$@ + @wc -l junk/* | $(AWK) '$$1 != 2' | wc -l | sed "s/ *//g" > _$@ @rm -rf junk ; $(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ compare:: @@ -592,7 +669,7 @@ compare:: inftest:: @echo $@ @echo This test is very machine specific... - @$(AWK) -f $(srcdir)/inftest.awk | sed 's/inf/Inf/g' >_$@ + @$(AWK) -f $(srcdir)/inftest.awk | sed "s/inf/Inf/g" >_$@ @-$(CMP) $(srcdir)/inftest.ok _$@ && rm -f _$@ getline2:: @@ -621,7 +698,7 @@ nonl:: @-$(CMP) $(srcdir)/nonl.ok _$@ && rm -f _$@ strftime:: - @echo This test could fail on slow machines or on a second boundary, + @echo This test could fail on slow machines or on a minute boundary, @echo so if it does, double check the actual results: @echo $@ @LC_ALL=C; export LC_ALL; LANG=C; export LANG; \ @@ -659,7 +736,7 @@ tradanch:: # 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 $@` ; : + @AWKPATH=$(srcdir) AWK=$(AWKPROG) $(SHELL) $(srcdir)/pid.sh $$$$ > _`basename $@` ; : @-$(CMP) $(srcdir)/pid.ok _`basename $@` && rm -f _`basename $@` _`basename $@`.in strftlng:: @@ -756,6 +833,27 @@ printf0:: @$(AWK) --posix -f $(srcdir)/$@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ +rsnulbig:: + @echo $@ + @ : Suppose that block size for pipe is at most 128kB: + @$(AWK) 'BEGIN { for (i = 1; i <= 128*64+1; i++) print "abcdefgh123456\n" }' 2>&1 | \ + $(AWK) 'BEGIN { RS = ""; ORS = "\n\n" }; { print }' 2>&1 | \ + $(AWK) '/^[^a]/; END{ print NR }' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +rsnulbig2:: + @echo $@ + @$(AWK) 'BEGIN { ORS = ""; n = "\n"; for (i = 1; i <= 10; i++) n = (n n); \ + for (i = 1; i <= 128; i++) print n; print "abc\n" }' 2>&1 | \ + $(AWK) 'BEGIN { RS = ""; ORS = "\n\n" };{ print }' 2>&1 | \ + $(AWK) '/^[^a]/; END { print NR }' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +whiny:: + @echo $@ + @WHINY_USERS=1 $(AWK) -f $(srcdir)/$@.awk $(srcdir)/$@.in >_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + # Targets generated for other tests: include Maketests diff --git a/test/Makefile.in b/test/Makefile.in index 135f689e..0c918524 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.7.3 from Makefile.am. +# Makefile.in generated by automake 1.7.5 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 @@ -67,7 +67,10 @@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ -AWK = LC_ALL=C $(AWKPROG) + +# This business forces the locale to be C for running the tests, +# unless we override it to something else for testing. +AWK = LC_ALL=$${GAWKLOCALE:-C} LANG=$${GAWKLOCALE:-C} $(AWKPROG) BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ @@ -184,17 +187,45 @@ EXTRA_DIST = \ argtest.ok \ arrayparm.awk \ arrayparm.ok \ + arrayprm2.awk \ + arrayprm2.ok \ + arrayprm3.awk \ + arrayprm3.ok \ arrayref.awk \ arrayref.ok \ + arrymem1.awk \ + arrymem1.ok \ + arryref2.awk \ + arryref2.ok \ + arryref3.awk \ + arryref3.ok \ + arryref4.awk \ + arryref4.ok \ + arryref5.awk \ + arryref5.ok \ arynasty.awk \ arynasty.ok \ arynocls.awk \ arynocls.in \ arynocls.ok \ + aryprm1.awk \ + aryprm1.ok \ + aryprm2.awk \ + aryprm2.ok \ + aryprm3.awk \ + aryprm3.ok \ + aryprm4.awk \ + aryprm4.ok \ + aryprm5.awk \ + aryprm5.ok \ + aryprm6.awk \ + aryprm6.ok \ + aryprm7.awk \ + aryprm7.ok \ + aryprm8.awk \ + aryprm8.ok \ arysubnm.awk \ arysubnm.ok \ - arrymem1.awk \ - arrymem1.ok \ asgext.awk \ asgext.in \ asgext.ok \ @@ -237,6 +268,8 @@ EXTRA_DIST = \ defref.ok \ delarprm.awk \ delarprm.ok \ + delarpm2.awk \ + delarpm2.ok \ dynlj.awk \ dynlj.ok \ eofsplit.awk \ @@ -252,11 +285,15 @@ EXTRA_DIST = \ fldchgnf.awk \ fldchgnf.in \ fldchgnf.ok \ + fmttest.awk \ + fmttest.ok \ fnamedat.awk \ fnamedat.in \ fnamedat.ok \ fnarray.awk \ fnarray.ok \ + fnarray2.awk \ + fnarray2.ok \ fnarydel.awk \ fnarydel.ok \ fnaryscl.awk \ @@ -325,6 +362,9 @@ EXTRA_DIST = \ gsubtst3.ok \ gsubtst4.awk \ gsubtst4.ok \ + gsubtst5.awk \ + gsubtst5.in \ + gsubtst5.ok \ gtlnbufv.awk \ hsprint.awk \ hsprint.ok \ @@ -369,6 +409,8 @@ EXTRA_DIST = \ manyfiles.ok \ match1.awk \ match1.ok \ + match2.awk \ + match2.ok \ math.awk \ math.ok \ membug1.awk \ @@ -384,6 +426,9 @@ EXTRA_DIST = \ nasty2.ok \ negexp.awk \ negexp.ok \ + nested.awk \ + nested.in \ + nested.ok \ nfldstr.awk \ nfldstr.in \ nfldstr.ok \ @@ -481,6 +526,7 @@ EXTRA_DIST = \ printf1.awk \ printf1.ok \ printfloat.awk \ + printlang.awk \ prmarscl.awk \ prmarscl.ok \ prmreuse.awk \ @@ -529,13 +575,23 @@ EXTRA_DIST = \ rsnul1nl.awk \ rsnul1nl.in \ rsnul1nl.ok \ + rsnulbig.ok \ + rsnulbig2.ok \ rstest1.awk \ rstest1.ok \ rstest2.awk \ rstest2.ok \ + rstest3.awk \ + rstest3.ok \ + rstest4.awk \ + rstest4.ok \ + rstest5.awk \ + rstest5.ok \ rswhite.awk \ rswhite.in \ rswhite.ok \ + scalar.awk \ + scalar.ok \ sclforin.awk \ sclforin.ok \ sclifin.awk \ @@ -544,6 +600,8 @@ EXTRA_DIST = \ shadow.ok \ sort1.awk \ sort1.ok \ + sortempty.awk \ + sortempty.ok \ space.ok \ splitargv.awk \ splitargv.in \ @@ -563,6 +621,8 @@ EXTRA_DIST = \ strtod.awk \ strtod.in \ strtod.ok \ + strtonum.awk \ + strtonum.ok \ strftime.awk \ strftlng.awk \ strftlng.ok \ @@ -573,6 +633,7 @@ EXTRA_DIST = \ swaplns.awk \ swaplns.in \ swaplns.ok \ + switch2.awk \ synerr1.awk \ synerr1.ok \ tradanch.awk \ @@ -581,10 +642,17 @@ EXTRA_DIST = \ tweakfld.awk \ tweakfld.in \ tweakfld.ok \ - uninitialized.awk \ - uninitialized.ok \ uninit2.awk \ uninit2.ok \ + uninit3.awk \ + uninit3.ok \ + uninit4.awk \ + uninit4.ok \ + uninitialized.awk \ + uninitialized.ok \ + whiny.awk \ + whiny.in \ + whiny.ok \ zeroe0.awk \ zeroe0.ok \ zeroflag.awk \ @@ -592,31 +660,36 @@ EXTRA_DIST = \ # 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 +BASIC_TESTS = addcomma anchgsub argarray arrayparm arrayref arrymem1 \ + arrayprm2 arrayprm3 arryref2 arryref3 arryref4 arryref5 arynasty \ + arynocls aryprm1 aryprm2 aryprm3 aryprm4 aryprm5 aryprm6 aryprm7 \ + aryprm8 arysubnm asgext awkpath back89 backgsub childin clobber \ + clsflnam compare compare2 concat1 convfmt datanonl defref \ + delarprm delarpm2 dynlj eofsplit fldchg fldchgnf fmttest fnamedat \ + fnarray fnarray2 fnarydel fnaryscl fnasgnm fnmisc fnparydl \ + forsimp fsbs fsrs fstabplus funsemnl funsmnam funstack getline \ + getline2 getline3 getlnbuf getnr2tb getnr2tm gsubasgn gsubtest \ + gsubtst2 gsubtst3 gsubtst4 gsubtst5 hsprint inputred intest \ + intprec leaddig leadnl litoct longsub longwrds math membug1 \ + messages minusstr mmap8k nasty nasty2 negexp nested 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 rsnulbig rsnulbig2 rstest1 \ + rstest2 rstest3 rstest4 rstest5 rswhite scalar sclforin sclifin \ + sortempty splitargv splitarr splitdef splitvar splitwht sprintfc \ + strtod subslash substr swaplns synerr1 tradanch tweakfld uninit2 \ + uninit3 uninit4 uninitialized 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 + match1 match2 manyfiles nondec posix procinfs regx8bit rebuf reint \ + shadow sort1 strtonum strftime whiny EXTRA_TESTS = regtest inftest @@ -624,14 +697,15 @@ 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 +NEED_LINT = defref noeffect nofmtch shadow uninit2 uninit3 uninit4 uninitialized # List of the files that appear in manual tests or are for reserve testing: -GENTESTS_UNUSED = Makefile.in gtlnbufv.awk printfloat.awk +GENTESTS_UNUSED = Makefile.in gtlnbufv.awk printfloat.awk switch2.awk CMP = cmp AWKPROG = ../gawk$(EXEEXT) subdir = test +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = @@ -641,7 +715,7 @@ DIST_COMMON = README $(srcdir)/Maketests ChangeLog Makefile.am \ all: all-am .SUFFIXES: -$(srcdir)/Makefile.in: Makefile.am $(srcdir)/Maketests $(top_srcdir)/configure.in $(ACLOCAL_M4) +$(srcdir)/Makefile.in: Makefile.am $(srcdir)/Maketests $(top_srcdir)/configure.ac $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --gnu test/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @@ -690,7 +764,6 @@ check: check-am all-am: Makefile installdirs: - install: install-am install-exec: install-exec-am install-data: install-data-am @@ -773,6 +846,7 @@ uninstall-am: uninstall-info-am # Make the pass-fail last and dependent on others to avoid # spurious errors if `make -j' in effect. check: msg \ + printlang \ basic-msg-start basic basic-msg-end \ unix-msg-start unix-tests unix-msg-end \ extend-msg-start gawk-extensions extend-msg-end @@ -795,6 +869,9 @@ msg:: @echo 'some systems may omit a leading zero and the floating point' @echo 'precision may lead to slightly different output in a few cases.' +printlang:: + @$(AWK) -f $(srcdir)/printlang.awk + basic-msg-start: @echo "======== Starting basic tests ========" @@ -827,7 +904,7 @@ poundbang:: else \ sed "s;/tmp/gawk;../$(AWKPROG);" < $(srcdir)/poundbang.awk > ./_pbd.awk ; \ chmod +x ./_pbd.awk ; \ - ./_pbd.awk $(srcdir)/poundbang.awk > _`basename $@`; \ + LC_ALL=$${GAWKLOCALE:-C} LANG=$${GAWKLOCALE:-C} ./_pbd.awk $(srcdir)/poundbang.awk > _`basename $@`; \ fi @-$(CMP) $(srcdir)/poundbang.awk _`basename $@` && rm -f _`basename $@` _pbd.awk @@ -861,7 +938,7 @@ manyfiles:: @mkdir junk @$(AWK) 'BEGIN { for (i = 1; i <= 300; i++) print i, i}' >_$@ @$(AWK) -f $(srcdir)/manyfiles.awk _$@ _$@ - @wc -l junk/* | $(AWK) '$$1 != 2' | wc -l | sed 's/ *//g' > _$@ + @wc -l junk/* | $(AWK) '$$1 != 2' | wc -l | sed "s/ *//g" > _$@ @rm -rf junk ; $(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ compare:: @@ -872,7 +949,7 @@ compare:: inftest:: @echo $@ @echo This test is very machine specific... - @$(AWK) -f $(srcdir)/inftest.awk | sed 's/inf/Inf/g' >_$@ + @$(AWK) -f $(srcdir)/inftest.awk | sed "s/inf/Inf/g" >_$@ @-$(CMP) $(srcdir)/inftest.ok _$@ && rm -f _$@ getline2:: @@ -901,7 +978,7 @@ nonl:: @-$(CMP) $(srcdir)/nonl.ok _$@ && rm -f _$@ strftime:: - @echo This test could fail on slow machines or on a second boundary, + @echo This test could fail on slow machines or on a minute boundary, @echo so if it does, double check the actual results: @echo $@ @LC_ALL=C; export LC_ALL; LANG=C; export LANG; \ @@ -939,7 +1016,7 @@ tradanch:: # 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 $@` ; : + @AWKPATH=$(srcdir) AWK=$(AWKPROG) $(SHELL) $(srcdir)/pid.sh $$$$ > _`basename $@` ; : @-$(CMP) $(srcdir)/pid.ok _`basename $@` && rm -f _`basename $@` _`basename $@`.in strftlng:: @@ -1035,6 +1112,27 @@ printf0:: @echo $@ @$(AWK) --posix -f $(srcdir)/$@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +rsnulbig:: + @echo $@ + @ : Suppose that block size for pipe is at most 128kB: + @$(AWK) 'BEGIN { for (i = 1; i <= 128*64+1; i++) print "abcdefgh123456\n" }' 2>&1 | \ + $(AWK) 'BEGIN { RS = ""; ORS = "\n\n" }; { print }' 2>&1 | \ + $(AWK) '/^[^a]/; END{ print NR }' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +rsnulbig2:: + @echo $@ + @$(AWK) 'BEGIN { ORS = ""; n = "\n"; for (i = 1; i <= 10; i++) n = (n n); \ + for (i = 1; i <= 128; i++) print n; print "abc\n" }' 2>&1 | \ + $(AWK) 'BEGIN { RS = ""; ORS = "\n\n" };{ print }' 2>&1 | \ + $(AWK) '/^[^a]/; END { print NR }' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +whiny:: + @echo $@ + @WHINY_USERS=1 $(AWK) -f $(srcdir)/$@.awk $(srcdir)/$@.in >_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ Gt-dummy: # file Maketests, generated from Makefile.am by the Gentests program addcomma: @@ -1062,11 +1160,81 @@ arrymem1: @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ +arrayprm2: + @echo arrayprm2 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +arrayprm3: + @echo arrayprm3 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +arryref2: + @echo arryref2 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +arryref3: + @echo arryref3 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +arryref4: + @echo arryref4 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +arryref5: + @echo arryref5 + @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 _$@ +aryprm1: + @echo aryprm1 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +aryprm2: + @echo aryprm2 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +aryprm3: + @echo aryprm3 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +aryprm4: + @echo aryprm4 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +aryprm5: + @echo aryprm5 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +aryprm6: + @echo aryprm6 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +aryprm7: + @echo aryprm7 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +aryprm8: + @echo aryprm8 + @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: $$? >>_$@ @@ -1127,6 +1295,11 @@ delarprm: @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ +delarpm2: + @echo delarpm2 + @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: $$? >>_$@ @@ -1147,6 +1320,11 @@ fldchgnf: @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ +fmttest: + @echo fmttest + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 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: $$? >>_$@ @@ -1157,6 +1335,11 @@ fnarray: @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ +fnarray2: + @echo fnarray2 + @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: $$? >>_$@ @@ -1257,6 +1440,11 @@ gsubtst4: @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ +gsubtst5: + @echo gsubtst5 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + hsprint: @echo hsprint @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -1322,6 +1510,11 @@ negexp: @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ +nested: + @echo nested + @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 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: $$? >>_$@ @@ -1547,11 +1740,31 @@ rstest2: @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ +rstest3: + @echo rstest3 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +rstest4: + @echo rstest4 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +rstest5: + @echo rstest5 + @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 _$@ +scalar: + @echo scalar + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + sclforin: @echo sclforin @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -1562,6 +1775,11 @@ sclifin: @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ +sortempty: + @echo sortempty + @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: $$? >>_$@ @@ -1617,13 +1835,23 @@ synerr1: @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ -uninitialized: - @echo uninitialized +uninit2: + @echo uninit2 @AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ -uninit2: - @echo uninit2 +uninit3: + @echo uninit3 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +uninit4: + @echo uninit4 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 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 _$@ @@ -1717,6 +1945,11 @@ match1: @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ +match2: + @echo match2 + @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: $$? >>_$@ @@ -1752,6 +1985,11 @@ sort1: @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ +strtonum: + @echo strtonum + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + # end of file Maketests # Targets generated for other tests: diff --git a/test/Maketests b/test/Maketests index 97179e7b..27108d6d 100644 --- a/test/Maketests +++ b/test/Maketests @@ -25,11 +25,81 @@ arrymem1: @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ +arrayprm2: + @echo arrayprm2 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +arrayprm3: + @echo arrayprm3 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +arryref2: + @echo arryref2 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +arryref3: + @echo arryref3 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +arryref4: + @echo arryref4 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +arryref5: + @echo arryref5 + @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 _$@ +aryprm1: + @echo aryprm1 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +aryprm2: + @echo aryprm2 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +aryprm3: + @echo aryprm3 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +aryprm4: + @echo aryprm4 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +aryprm5: + @echo aryprm5 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +aryprm6: + @echo aryprm6 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +aryprm7: + @echo aryprm7 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +aryprm8: + @echo aryprm8 + @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: $$? >>_$@ @@ -90,6 +160,11 @@ delarprm: @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ +delarpm2: + @echo delarpm2 + @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: $$? >>_$@ @@ -110,6 +185,11 @@ fldchgnf: @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ +fmttest: + @echo fmttest + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 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: $$? >>_$@ @@ -120,6 +200,11 @@ fnarray: @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ +fnarray2: + @echo fnarray2 + @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: $$? >>_$@ @@ -220,6 +305,11 @@ gsubtst4: @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ +gsubtst5: + @echo gsubtst5 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + hsprint: @echo hsprint @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -285,6 +375,11 @@ negexp: @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ +nested: + @echo nested + @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 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: $$? >>_$@ @@ -510,11 +605,31 @@ rstest2: @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ +rstest3: + @echo rstest3 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +rstest4: + @echo rstest4 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +rstest5: + @echo rstest5 + @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 _$@ +scalar: + @echo scalar + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + sclforin: @echo sclforin @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -525,6 +640,11 @@ sclifin: @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ +sortempty: + @echo sortempty + @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: $$? >>_$@ @@ -580,13 +700,23 @@ synerr1: @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ -uninitialized: - @echo uninitialized +uninit2: + @echo uninit2 @AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ -uninit2: - @echo uninit2 +uninit3: + @echo uninit3 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +uninit4: + @echo uninit4 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 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 _$@ @@ -680,6 +810,11 @@ match1: @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ +match2: + @echo match2 + @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: $$? >>_$@ @@ -715,4 +850,9 @@ sort1: @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ +strtonum: + @echo strtonum + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + # end of file Maketests diff --git a/test/arrayprm2.awk b/test/arrayprm2.awk new file mode 100644 index 00000000..35a92cc8 --- /dev/null +++ b/test/arrayprm2.awk @@ -0,0 +1,67 @@ +# From spcecdt@armory.com Wed Apr 30 11:08:48 2003 +# Return-Path: <spcecdt@armory.com> +# Received: from localhost (skeeve [127.0.0.1]) +# by skeeve.com (8.12.5/8.12.5) with ESMTP id h3U7uZWr015489 +# for <arnold@localhost>; Wed, 30 Apr 2003 11:08:48 +0300 +# Received: from actcom.co.il [192.114.47.1] +# by localhost with POP3 (fetchmail-5.9.0) +# for arnold@localhost (single-drop); Wed, 30 Apr 2003 11:08:48 +0300 (IDT) +# Received: by actcom.co.il (mbox arobbins) +# (with Cubic Circle's cucipop (v1.31 1998/05/13) Wed Apr 30 11:05:01 2003) +# X-From_: spcecdt@armory.com Wed Apr 30 04:06:46 2003 +# Received: from smtp1.actcom.net.il by actcom.co.il with ESMTP +# (8.11.6/actcom-0.2) id h3U16iv04111 for <arobbins@actcom.co.il>; +# Wed, 30 Apr 2003 04:06:45 +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 smtp1.actcom.net.il (8.12.8/8.12.8) with ESMTP id h3U16nEv009589 +# for <arobbins@actcom.co.il>; Wed, 30 Apr 2003 04:06:50 +0300 +# Received: from fencepost.gnu.org (fencepost.gnu.org [199.232.76.164]) +# by f7.net (8.11.7/8.11.6) with ESMTP id h3U16gj29182 +# for <arnold@skeeve.com>; Tue, 29 Apr 2003 21:06:42 -0400 +# Received: from monty-python.gnu.org ([199.232.76.173]) +# by fencepost.gnu.org with esmtp (Exim 4.10) +# id 19Ag3W-00029w-00 +# for bug-gawk@gnu.org; Tue, 29 Apr 2003 21:06:42 -0400 +# Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) +# id 19Ag1V-0001AN-00 +# for bug-gawk@gnu.org; Tue, 29 Apr 2003 21:04:39 -0400 +# Received: from deepthought.armory.com ([192.122.209.42] helo=armory.com) +# by monty-python.gnu.org with smtp (Exim 4.10.13) +# id 19Ag1V-0001A3-00 +# for bug-gawk@gnu.org; Tue, 29 Apr 2003 21:04:37 -0400 +# Date: Tue, 29 Apr 2003 18:04:35 -0700 +# From: "John H. DuBois III" <spcecdt@armory.com> +# To: bug-gawk@gnu.org +# Subject: gawk 3.1.2a bug +# Message-ID: <20030430010434.GA4278@armory.com> +# Mime-Version: 1.0 +# Content-Type: text/plain; charset=us-ascii +# Content-Disposition: inline +# User-Agent: Mutt/1.3.28i +# X-Www: http://www.armory.com./~spcecdt/ +# Sender: spcecdt@armory.com +# X-Spam-Status: No, hits=-7.2 required=5.0 +# tests=SIGNATURE_SHORT_DENSE,SPAM_PHRASE_00_01,USER_AGENT, +# USER_AGENT_MUTT +# version=2.41 +# X-Spam-Level: +# X-SpamBouncer: 1.4 (10/07/01) +# X-SBClass: OK +# Status: RO +# +# gawk-3.1.2a 'BEGIN {foo(bar)};function foo(baz){split("x",baz)}' +# gawk-3.1.2a: cmd. line:1: fatal: split: second argument is not an array +# +# John +# -- +# John DuBois spcecdt@armory.com KC6QKZ/AE http://www.armory.com/~spcecdt/ +# +BEGIN { + foo(bar) +} + +function foo(baz) +{ + split("x", baz) +} diff --git a/test/arrayprm2.ok b/test/arrayprm2.ok new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/test/arrayprm2.ok diff --git a/test/arrayprm3.awk b/test/arrayprm3.awk new file mode 100644 index 00000000..a41e587c --- /dev/null +++ b/test/arrayprm3.awk @@ -0,0 +1,56 @@ +# From spcecdt@armory.com Fri May 2 13:24:46 2003 +# Return-Path: <spcecdt@armory.com> +# Received: from localhost (skeeve [127.0.0.1]) +# by skeeve.com (8.12.5/8.12.5) with ESMTP id h42AChum021950 +# for <arnold@localhost>; Fri, 2 May 2003 13:24:46 +0300 +# Received: from actcom.co.il [192.114.47.1] +# by localhost with POP3 (fetchmail-5.9.0) +# for arnold@localhost (single-drop); Fri, 02 May 2003 13:24:46 +0300 (IDT) +# Received: by actcom.co.il (mbox arobbins) +# (with Cubic Circle's cucipop (v1.31 1998/05/13) Fri May 2 13:23:37 2003) +# X-From_: spcecdt@armory.com Fri May 2 00:43:51 2003 +# Received: from smtp1.actcom.net.il by actcom.co.il with ESMTP +# (8.11.6/actcom-0.2) id h41Lhm500217 for <arobbins@actcom.co.il>; +# Fri, 2 May 2003 00:43:49 +0300 (EET DST) +# (rfc931-sender: lmail.actcom.co.il [192.114.47.13]) +# Received: from f7.net (consort.superb.net [209.61.216.22]) +# by smtp1.actcom.net.il (8.12.8/8.12.8) with ESMTP id h41LiGcO022817 +# for <arobbins@actcom.co.il>; Fri, 2 May 2003 00:44:18 +0300 +# Received: from armory.com (deepthought.armory.com [192.122.209.42]) +# by f7.net (8.11.7/8.11.6) with SMTP id h41Lhj106516 +# for <arnold@skeeve.com>; Thu, 1 May 2003 17:43:46 -0400 +# Date: Thu, 1 May 2003 14:43:45 -0700 +# From: "John H. DuBois III" <spcecdt@armory.com> +# To: Aharon Robbins <arnold@skeeve.com> +# Subject: Re: gawk 3.1.2a bug +# Message-ID: <20030501214345.GA24615@armory.com> +# References: <200305011738.h41Hcg76017565@localhost.localdomain> +# Mime-Version: 1.0 +# Content-Type: text/plain; charset=us-ascii +# Content-Disposition: inline +# In-Reply-To: <200305011738.h41Hcg76017565@localhost.localdomain> +# User-Agent: Mutt/1.3.28i +# X-Www: http://www.armory.com./~spcecdt/ +# Sender: spcecdt@armory.com +# X-SpamBouncer: 1.4 (10/07/01) +# X-SBClass: OK +# Status: RO +# +# On Thu, May 01, 2003 at 08:38:42PM +0300, Aharon Robbins wrote: +# > > That worked, thanks. +# > +# > Great. Your report motivated me to find everywhere such additional +# > code ought to be needed. I think I did so. --Arnold +# +# Here's another one (perhaps fixed by your additional work): +# +BEGIN { foo(a) } +function foo(a) { bar(a); print "" in a } +function bar(a) { a[""]; } +# +# Prints 1 with gawk-3.1.1; 0 with 3.1.2a. +# +# John +# -- +# John DuBois spcecdt@armory.com KC6QKZ/AE http://www.armory.com/~spcecdt/ +# diff --git a/test/arrayprm3.ok b/test/arrayprm3.ok new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/test/arrayprm3.ok @@ -0,0 +1 @@ +1 diff --git a/test/arryref2.awk b/test/arryref2.awk new file mode 100644 index 00000000..202a0409 --- /dev/null +++ b/test/arryref2.awk @@ -0,0 +1,18 @@ +BEGIN { + foo(a) + + for (i in a) + print i, a[i] +} + +function foo(b) +{ + bar(b) + b[2] = "local" +} + +function bar(c) +{ + a[3] = "global" + c[1] = "local2" +} diff --git a/test/arryref2.ok b/test/arryref2.ok new file mode 100644 index 00000000..71aa9ed9 --- /dev/null +++ b/test/arryref2.ok @@ -0,0 +1,3 @@ +1 local2 +2 local +3 global diff --git a/test/arryref3.awk b/test/arryref3.awk new file mode 100644 index 00000000..e234ee52 --- /dev/null +++ b/test/arryref3.awk @@ -0,0 +1,18 @@ +BEGIN { + foo(a) + + for (i in a) + print i, a[i] +} + +function foo(b) +{ + a[1] = "global" + b[2] = "local" + bar(b) +} + +function bar(c) +{ + c = 12 +} diff --git a/test/arryref3.ok b/test/arryref3.ok new file mode 100644 index 00000000..eec04b63 --- /dev/null +++ b/test/arryref3.ok @@ -0,0 +1,2 @@ +gawk: arryref3.awk:17: fatal: attempt to use array `c (from b, from a)' in a scalar context +EXIT CODE: 2 diff --git a/test/arryref4.awk b/test/arryref4.awk new file mode 100644 index 00000000..072eade6 --- /dev/null +++ b/test/arryref4.awk @@ -0,0 +1,17 @@ +BEGIN { + foo(a) + + print a +} + +function foo(b) +{ + a = "global" + b[2] = "local" +# bar(b) +} + +function bar(c) +{ + c = 12 +} diff --git a/test/arryref4.ok b/test/arryref4.ok new file mode 100644 index 00000000..11cebfb4 --- /dev/null +++ b/test/arryref4.ok @@ -0,0 +1,2 @@ +gawk: arryref4.awk:10: fatal: attempt to use scalar parameter `b' as an array +EXIT CODE: 2 diff --git a/test/arryref5.awk b/test/arryref5.awk new file mode 100644 index 00000000..babff9c3 --- /dev/null +++ b/test/arryref5.awk @@ -0,0 +1,17 @@ +BEGIN { + foo(a) + + print a +} + +function foo(b) +{ + b[2] = "local" + a = "global" +# bar(b) +} + +function bar(c) +{ + c = 12 +} diff --git a/test/arryref5.ok b/test/arryref5.ok new file mode 100644 index 00000000..7b542fbf --- /dev/null +++ b/test/arryref5.ok @@ -0,0 +1,2 @@ +gawk: arryref5.awk:10: fatal: attempt to use array `a' in a scalar context +EXIT CODE: 2 diff --git a/test/aryprm1.awk b/test/aryprm1.awk new file mode 100644 index 00000000..e5bb9915 --- /dev/null +++ b/test/aryprm1.awk @@ -0,0 +1,9 @@ +function f(a) { + if (3 in a) + print 7 + a = 5 +} + +BEGIN { + f(arr) +} diff --git a/test/aryprm1.ok b/test/aryprm1.ok new file mode 100644 index 00000000..99ffd8f8 --- /dev/null +++ b/test/aryprm1.ok @@ -0,0 +1,2 @@ +gawk: aryprm1.awk:4: fatal: attempt to use array `a (from arr)' in a scalar context +EXIT CODE: 2 diff --git a/test/aryprm2.awk b/test/aryprm2.awk new file mode 100644 index 00000000..00dd7638 --- /dev/null +++ b/test/aryprm2.awk @@ -0,0 +1,8 @@ +function f(a) { + delete a + a *= 5 +} + +BEGIN { + f(arr) +} diff --git a/test/aryprm2.ok b/test/aryprm2.ok new file mode 100644 index 00000000..c8585c9a --- /dev/null +++ b/test/aryprm2.ok @@ -0,0 +1,2 @@ +gawk: aryprm2.awk:3: fatal: attempt to use array `a (from arr)' in a scalar context +EXIT CODE: 2 diff --git a/test/aryprm3.awk b/test/aryprm3.awk new file mode 100644 index 00000000..c38ab588 --- /dev/null +++ b/test/aryprm3.awk @@ -0,0 +1,10 @@ +function f(a, i) { + for (i in a) + delete a[i] + if (a == 0) + print 7 +} + +BEGIN { + f(arr) +} diff --git a/test/aryprm3.ok b/test/aryprm3.ok new file mode 100644 index 00000000..63c51312 --- /dev/null +++ b/test/aryprm3.ok @@ -0,0 +1,2 @@ +gawk: aryprm3.awk:6: fatal: attempt to use array `a (from arr)' in a scalar context +EXIT CODE: 2 diff --git a/test/aryprm4.awk b/test/aryprm4.awk new file mode 100644 index 00000000..09427f6b --- /dev/null +++ b/test/aryprm4.awk @@ -0,0 +1,7 @@ +function f(x){ + x = 1 +} +BEGIN { + f(a) + a[1] +} diff --git a/test/aryprm4.ok b/test/aryprm4.ok new file mode 100644 index 00000000..9307e4ab --- /dev/null +++ b/test/aryprm4.ok @@ -0,0 +1,2 @@ +gawk: aryprm4.awk:6: fatal: attempt to use scalar `a' as array +EXIT CODE: 2 diff --git a/test/aryprm5.awk b/test/aryprm5.awk new file mode 100644 index 00000000..a4aac367 --- /dev/null +++ b/test/aryprm5.awk @@ -0,0 +1,6 @@ +function f(x){ + x[1] = x +} +BEGIN { + f(a) +} diff --git a/test/aryprm5.ok b/test/aryprm5.ok new file mode 100644 index 00000000..1ce41199 --- /dev/null +++ b/test/aryprm5.ok @@ -0,0 +1,2 @@ +gawk: aryprm5.awk:2: fatal: attempt to use scalar parameter `x' as an array +EXIT CODE: 2 diff --git a/test/aryprm6.awk b/test/aryprm6.awk new file mode 100644 index 00000000..b12b2782 --- /dev/null +++ b/test/aryprm6.awk @@ -0,0 +1,7 @@ +function f(x){ + a + x[1] = 3 +} +BEGIN { + f(a) +} diff --git a/test/aryprm6.ok b/test/aryprm6.ok new file mode 100644 index 00000000..8561ddf2 --- /dev/null +++ b/test/aryprm6.ok @@ -0,0 +1,2 @@ +gawk: aryprm6.awk:3: fatal: attempt to use scalar parameter `x' as an array +EXIT CODE: 2 diff --git a/test/aryprm7.awk b/test/aryprm7.awk new file mode 100644 index 00000000..b442b4da --- /dev/null +++ b/test/aryprm7.awk @@ -0,0 +1,6 @@ +function f(x, y){ + y[1] = x +} +BEGIN { + f(a, a) +} diff --git a/test/aryprm7.ok b/test/aryprm7.ok new file mode 100644 index 00000000..00e28967 --- /dev/null +++ b/test/aryprm7.ok @@ -0,0 +1,2 @@ +gawk: aryprm7.awk:2: fatal: attempt to use scalar parameter `y' as an array +EXIT CODE: 2 diff --git a/test/aryprm8.awk b/test/aryprm8.awk new file mode 100644 index 00000000..b294abb6 --- /dev/null +++ b/test/aryprm8.awk @@ -0,0 +1,22 @@ +BEGIN { + f(0, a) # nothing + f(1, a) +} +function f(i, a) { + if (i == 0) return + g(a, a) + pr(a) +} +function g(x, y) { + h(y, x, y) +} +function h(b, c, d) { + b[1] = 1 + c[1] = 2 # rewrite + print b[1], d[1] + c[2] = 1 + b[2] = 2 # should rewrite +} +function pr(x) { + print x[1], x[2] +} diff --git a/test/aryprm8.ok b/test/aryprm8.ok new file mode 100644 index 00000000..fad54c24 --- /dev/null +++ b/test/aryprm8.ok @@ -0,0 +1,2 @@ +2 2 +2 2 diff --git a/test/delarpm2.awk b/test/delarpm2.awk new file mode 100644 index 00000000..ad0ed3df --- /dev/null +++ b/test/delarpm2.awk @@ -0,0 +1,95 @@ +# From beebe@math.utah.edu Sat May 17 21:31:27 2003 +# Return-Path: <beebe@math.utah.edu> +# Received: from localhost (aahz [127.0.0.1]) +# by skeeve.com (8.12.5/8.12.5) with ESMTP id h4HIQmCw001380 +# for <arnold@localhost>; Sat, 17 May 2003 21:31:27 +0300 +# Received: from actcom.co.il [192.114.47.1] +# by localhost with POP3 (fetchmail-5.9.0) +# for arnold@localhost (single-drop); Sat, 17 May 2003 21:31:27 +0300 (IDT) +# Received: by actcom.co.il (mbox arobbins) +# (with Cubic Circle's cucipop (v1.31 1998/05/13) Sat May 17 21:34:07 2003) +# X-From_: beebe@sunshine.math.utah.edu Fri May 16 20:38:45 2003 +# Received: from smtp1.actcom.net.il by actcom.co.il with ESMTP +# (8.11.6/actcom-0.2) id h4GHcd226764 for <arobbins@actcom.co.il>; +# Fri, 16 May 2003 20:38:40 +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 smtp1.actcom.net.il (8.12.8/8.12.8) with ESMTP id h4GHgBc2023067 +# for <arobbins@actcom.co.il>; Fri, 16 May 2003 20:42:13 +0300 +# Received: from sunshine.math.utah.edu (sunshine.math.utah.edu [128.110.198.2]) +# by f7.net (8.11.7/8.11.6) with ESMTP id h4GHcbf09202 +# for <arnold@skeeve.com>; Fri, 16 May 2003 13:38:37 -0400 +# Received: from suncore.math.utah.edu (IDENT:r8KQWmkF4jVMLBhxpojXGNCAnBZB38ET@suncore.math.utah.edu [128.110.198.5]) +# by sunshine.math.utah.edu (8.9.3p2/8.9.3) with ESMTP id LAA09111; +# Fri, 16 May 2003 11:38:34 -0600 (MDT) +# Received: (from beebe@localhost) +# by suncore.math.utah.edu (8.9.3p2/8.9.3) id LAA01743; +# Fri, 16 May 2003 11:38:34 -0600 (MDT) +# Date: Fri, 16 May 2003 11:38:34 -0600 (MDT) +# From: "Nelson H. F. Beebe" <beebe@math.utah.edu> +# To: "Arnold Robbins" <arnold@skeeve.com> +# Cc: beebe@math.utah.edu +# X-US-Mail: "Center for Scientific Computing, Department of Mathematics, 110 +# LCB, University of Utah, 155 S 1400 E RM 233, Salt Lake City, UT +# 84112-0090, USA" +# X-Telephone: +1 801 581 5254 +# X-FAX: +1 801 585 1640, +1 801 581 4148 +# X-URL: http://www.math.utah.edu/~beebe +# Subject: gawk-3.1.2[ab]: bug in delete +# Message-ID: <CMM.0.92.0.1053106714.beebe@suncore.math.utah.edu> +# +# I discovered yesterday that one of my tools got broken by the upgrade +# to gawk-3.1.2a and gawk-3.1.2b. For now, I've temporarily reset +# /usr/local/bin/gawk on the Sun Solaris and Intel GNU/Linux systems +# back to be gawk-3.1.2. +# +# This morning, I isolated the problem to the following small test case: +# +# % cat bug.awk + BEGIN { + clear_array(table) + foo(table) + for (key in table) + print key, table[k] + clear_array(table) + exit(0) + } + + function clear_array(array, key) + { + for (key in array) + delete array[key] + } + + function foo(a) + { + a[1] = "one" + a[2] = "two" + } +# +# With nawk, mawk, and also gawk-3.1.2 or earlier, I get this: +# +# % mawk -f bug.awk +# 1 +# 2 +# +# However, with the two most recent gawk releases, I get: +# +# % gawk-3.1.2b -f bug.awk +# gawk-3.1.2b: bug.awk:12: fatal: delete: illegal use of variable `table' as +# array +# +# If the first clear_array() statement is commented out, it runs. +# However, the problem is that in a large program, it may not be easy to +# identify places where it is safe to invoke delete, so I believe the +# old behavior is more desirable. +# +# ------------------------------------------------------------------------------- +# - Nelson H. F. Beebe Tel: +1 801 581 5254 - +# - Center for Scientific Computing FAX: +1 801 581 4148 - +# - University of Utah Internet e-mail: beebe@math.utah.edu - +# - Department of Mathematics, 110 LCB beebe@acm.org beebe@computer.org - +# - 155 S 1400 E RM 233 beebe@ieee.org - +# - Salt Lake City, UT 84112-0090, USA URL: http://www.math.utah.edu/~beebe - +# ------------------------------------------------------------------------------- +# diff --git a/test/delarpm2.ok b/test/delarpm2.ok new file mode 100644 index 00000000..bea5b8a4 --- /dev/null +++ b/test/delarpm2.ok @@ -0,0 +1,2 @@ +1 +2 diff --git a/test/fmttest.awk b/test/fmttest.awk new file mode 100644 index 00000000..e8db0fb7 --- /dev/null +++ b/test/fmttest.awk @@ -0,0 +1,164 @@ +### /u/sy/beebe/xml/shbook/fmttest.awk, Sat May 31 09:13:52 2003 +### Edit by Nelson H. F. Beebe <beebe@math.utah.edu> +### ==================================================================== +### Test the degree of support for printf format items in awk +### implementations. +### +### Usage: +### awk -f fmttest.awk +### [31-May-2003] +### ==================================================================== + +BEGIN { + ## ----------------------------------------------------------------- + print "\n\nFormat item: c\n" + + printf("ABC with %%c : %c\n", "ABC") + printf("123 with %%c : %c\n", 123) + + printf("ABC with %%.15c : %.15c\n", "ABC") + printf("123 with %%.15c : %.15c\n", 123) + + printf("ABC with %%15c : %15c\n", "ABC") + printf("123 with %%15c : %15c\n", 123) + + printf("ABC with %%-15c : %-15c\n", "ABC") + printf("123 with %%-15c : %-15c\n", 123) + + ## ----------------------------------------------------------------- + print "\n\nFormat item: d\n" + + printf("ABC with %%d : %d\n", "ABC") + printf("123 with %%d : %d\n", 123) + + printf("ABC with %%.15d : %.15d\n", "ABC") + printf("123 with %%.15d : %.15d\n", 123) + + printf("ABC with %%15d : %15d\n", "ABC") + printf("123 with %%15d : %15d\n", 123) + + printf("ABC with %%-15d : %-15d\n", "ABC") + printf("123 with %%-15d : %-15d\n", 123) + + ## ----------------------------------------------------------------- + print "\n\nFormat item: e\n" + + printf("ABC with %%e : %e\n", "ABC") + printf("123 with %%e : %e\n", 123) + + printf("ABC with %%.25e : %.25e\n", "ABC") + printf("123 with %%.25e : %.25e\n", 123) + + printf("ABC with %%25e : %25e\n", "ABC") + printf("123 with %%25e : %25e\n", 123) + + printf("ABC with %%-25e : %-25e\n", "ABC") + printf("123 with %%-25e : %-25e\n", 123) + + ## ----------------------------------------------------------------- + print "\n\nFormat item: f\n" + + printf("ABC with %%f : %f\n", "ABC") + printf("123 with %%f : %f\n", 123) + + printf("ABC with %%.25f : %.25f\n", "ABC") + printf("123 with %%.25f : %.25f\n", 123) + + printf("ABC with %%25f : %25f\n", "ABC") + printf("123 with %%25f : %25f\n", 123) + + printf("ABC with %%-25f : %-25f\n", "ABC") + printf("123 with %%-25f : %-25f\n", 123) + + ## ----------------------------------------------------------------- + print "\n\nFormat item: g\n" + + printf("ABC with %%g : %g\n", "ABC") + printf("123 with %%g : %g\n", 123) + + printf("ABC with %%.25g : %.25g\n", "ABC") + printf("123 with %%.25g : %.25g\n", 123) + + printf("ABC with %%25g : %25g\n", "ABC") + printf("123 with %%25g : %25g\n", 123) + + printf("ABC with %%-25g : %-25g\n", "ABC") + printf("123 with %%-25g : %-25g\n", 123) + + ## ----------------------------------------------------------------- + print "\n\nFormat item: o\n" + + printf("ABC with %%o : %o\n", "ABC") + printf("123 with %%o : %o\n", 123) + + printf("ABC with %%.15o : %.15o\n", "ABC") + printf("123 with %%.15o : %.15o\n", 123) + + printf("ABC with %%15o : %15o\n", "ABC") + printf("123 with %%15o : %15o\n", 123) + + printf("ABC with %%-15o : %-15o\n", "ABC") + printf("123 with %%-15o : %-15o\n", 123) + + ## ----------------------------------------------------------------- + print "\n\nFormat item: s\n" + + printf("ABC with %%s : %s\n", "ABC") + printf("123 with %%s : %s\n", 123) + + printf("ABC with %%.15s : %.15s\n", "ABC") + printf("123 with %%.15s : %.15s\n", 123) + + printf("ABC with %%15s : %15s\n", "ABC") + printf("123 with %%15s : %15s\n", 123) + + printf("ABC with %%-15s : %-15s\n", "ABC") + printf("123 with %%-15s : %-15s\n", 123) + + ## ----------------------------------------------------------------- + print "\n\nFormat item: u\n" + + printf("ABC with %%u : %u\n", "ABC") + printf("123 with %%u : %u\n", 123) + + printf("ABC with %%.15u : %.15u\n", "ABC") + printf("123 with %%.15u : %.15u\n", 123) + + printf("ABC with %%15u : %15u\n", "ABC") + printf("123 with %%15u : %15u\n", 123) + + printf("ABC with %%-15u : %-15u\n", "ABC") + printf("123 with %%-15u : %-15u\n", 123) + + ## ----------------------------------------------------------------- + print "\n\nFormat item: x\n" + + printf("ABC with %%x : %x\n", "ABC") + printf("123 with %%x : %x\n", 123) + + printf("ABC with %%.15x : %.15x\n", "ABC") + printf("123 with %%.15x : %.15x\n", 123) + + printf("ABC with %%15x : %15x\n", "ABC") + printf("123 with %%15x : %15x\n", 123) + + printf("ABC with %%-15x : %-15x\n", "ABC") + printf("123 with %%-15x : %-15x\n", 123) + + ## ----------------------------------------------------------------- + print "\n\nFormat item: X\n" + + printf("ABC with %%X : %X\n", "ABC") + printf("123 with %%X : %X\n", 123) + + printf("ABC with %%.15X : %.15X\n", "ABC") + printf("123 with %%.15X : %.15X\n", 123) + + printf("ABC with %%15X : %15X\n", "ABC") + printf("123 with %%15X : %15X\n", 123) + + printf("ABC with %%-15X : %-15X\n", "ABC") + printf("123 with %%-15X : %-15X\n", 123) + + exit(0) +} diff --git a/test/fmttest.ok b/test/fmttest.ok new file mode 100644 index 00000000..753567ac --- /dev/null +++ b/test/fmttest.ok @@ -0,0 +1,120 @@ + + +Format item: c + +ABC with %c : A +123 with %c : { +ABC with %.15c : A +123 with %.15c : { +ABC with %15c : A +123 with %15c : { +ABC with %-15c : A +123 with %-15c : { + + +Format item: d + +ABC with %d : 0 +123 with %d : 123 +ABC with %.15d : 000000000000000 +123 with %.15d : 000000000000123 +ABC with %15d : 0 +123 with %15d : 123 +ABC with %-15d : 0 +123 with %-15d : 123 + + +Format item: e + +ABC with %e : 0.000000e+00 +123 with %e : 1.230000e+02 +ABC with %.25e : 0.0000000000000000000000000e+00 +123 with %.25e : 1.2300000000000000000000000e+02 +ABC with %25e : 0.000000e+00 +123 with %25e : 1.230000e+02 +ABC with %-25e : 0.000000e+00 +123 with %-25e : 1.230000e+02 + + +Format item: f + +ABC with %f : 0.000000 +123 with %f : 123.000000 +ABC with %.25f : 0.0000000000000000000000000 +123 with %.25f : 123.0000000000000000000000000 +ABC with %25f : 0.000000 +123 with %25f : 123.000000 +ABC with %-25f : 0.000000 +123 with %-25f : 123.000000 + + +Format item: g + +ABC with %g : 0 +123 with %g : 123 +ABC with %.25g : 0 +123 with %.25g : 123 +ABC with %25g : 0 +123 with %25g : 123 +ABC with %-25g : 0 +123 with %-25g : 123 + + +Format item: o + +ABC with %o : 0 +123 with %o : 173 +ABC with %.15o : 000000000000000 +123 with %.15o : 000000000000173 +ABC with %15o : 0 +123 with %15o : 173 +ABC with %-15o : 0 +123 with %-15o : 173 + + +Format item: s + +ABC with %s : ABC +123 with %s : 123 +ABC with %.15s : ABC +123 with %.15s : 123 +ABC with %15s : ABC +123 with %15s : 123 +ABC with %-15s : ABC +123 with %-15s : 123 + + +Format item: u + +ABC with %u : 0 +123 with %u : 123 +ABC with %.15u : 000000000000000 +123 with %.15u : 000000000000123 +ABC with %15u : 0 +123 with %15u : 123 +ABC with %-15u : 0 +123 with %-15u : 123 + + +Format item: x + +ABC with %x : 0 +123 with %x : 7b +ABC with %.15x : 000000000000000 +123 with %.15x : 00000000000007b +ABC with %15x : 0 +123 with %15x : 7b +ABC with %-15x : 0 +123 with %-15x : 7b + + +Format item: X + +ABC with %X : 0 +123 with %X : 7B +ABC with %.15X : 000000000000000 +123 with %.15X : 00000000000007B +ABC with %15X : 0 +123 with %15X : 7B +ABC with %-15X : 0 +123 with %-15X : 7B diff --git a/test/fnarray.ok b/test/fnarray.ok index 2ef124b7..3ee41814 100644 --- a/test/fnarray.ok +++ b/test/fnarray.ok @@ -1,3 +1,3 @@ -gawk: fnarray.awk:5: fatal: function `foo' called with space between name and `(', -or used as a variable or an array -EXIT CODE: 2 +gawk: fnarray.awk:5: Num = foo[c] +gawk: fnarray.awk:5: ^ use of non-array as array +EXIT CODE: 1 diff --git a/test/fnarray2.awk b/test/fnarray2.awk new file mode 100644 index 00000000..1723fbf6 --- /dev/null +++ b/test/fnarray2.awk @@ -0,0 +1,5 @@ +function pile(c, r) +{ + r = ++pile[c] +} +{ pile($1) } diff --git a/test/fnarray2.ok b/test/fnarray2.ok new file mode 100644 index 00000000..243e4cc3 --- /dev/null +++ b/test/fnarray2.ok @@ -0,0 +1,3 @@ +gawk: fnarray2.awk:3: r = ++pile[c] +gawk: fnarray2.awk:3: ^ use of non-array as array +EXIT CODE: 1 diff --git a/test/fnaryscl.ok b/test/fnaryscl.ok index 2fecd582..ac840772 100644 --- a/test/fnaryscl.ok +++ b/test/fnaryscl.ok @@ -1,2 +1,2 @@ -gawk: fnaryscl.awk:10: fatal: attempt to use array `c (from b (from a (from foo)))' in a scalar context +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/gsubtst5.awk b/test/gsubtst5.awk new file mode 100644 index 00000000..4bef854f --- /dev/null +++ b/test/gsubtst5.awk @@ -0,0 +1,97 @@ +# From jose@monkey.org Thu Jun 5 11:48:35 2003 +# Return-Path: <jose@monkey.org> +# Received: from localhost (skeeve [127.0.0.1]) +# by skeeve.com (8.12.5/8.12.5) with ESMTP id h558eVvA012655 +# for <arnold@localhost>; Thu, 5 Jun 2003 11:48:35 +0300 +# Received: from actcom.co.il [192.114.47.1] +# by localhost with POP3 (fetchmail-5.9.0) +# for arnold@localhost (single-drop); Thu, 05 Jun 2003 11:48:35 +0300 (IDT) +# Received: by actcom.co.il (mbox arobbins) +# (with Cubic Circle's cucipop (v1.31 1998/05/13) Thu Jun 5 11:47:59 2003) +# X-From_: jose@monkey.org Thu Jun 5 07:14:45 2003 +# Received: from smtp1.actcom.net.il by actcom.co.il with ESMTP +# (8.11.6/actcom-0.2) id h554EdY08108 for <arobbins@actcom.co.il>; +# Thu, 5 Jun 2003 07:14:41 +0300 (EET DST) +# (rfc931-sender: smtp.actcom.co.il [192.114.47.13]) +# Received: from f7.net (consort.superb.net [209.61.216.22]) +# by smtp1.actcom.net.il (8.12.8/8.12.8) with ESMTP id h554G3To008304 +# for <arobbins@actcom.co.il>; Thu, 5 Jun 2003 07:16:05 +0300 +# Received: from fencepost.gnu.org (fencepost.gnu.org [199.232.76.164]) +# by f7.net (8.11.7/8.11.6) with ESMTP id h554Ean08172 +# for <arnold@skeeve.com>; Thu, 5 Jun 2003 00:14:36 -0400 +# Received: from monty-python.gnu.org ([199.232.76.173]) +# by fencepost.gnu.org with esmtp (Exim 4.20) +# id 19Nm96-0001xE-1i +# for arnold@gnu.ai.mit.edu; Thu, 05 Jun 2003 00:14:36 -0400 +# Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) +# id 19Nm8x-0005ge-Dz +# for arnold@gnu.ai.mit.edu; Thu, 05 Jun 2003 00:14:28 -0400 +# Received: from naughty.monkey.org ([66.93.9.164]) +# by monty-python.gnu.org with esmtp (Exim 4.20) +# id 19Nm8w-0005VM-Ko +# for arnold@gnu.ai.mit.edu; Thu, 05 Jun 2003 00:14:26 -0400 +# Received: by naughty.monkey.org (Postfix, from userid 1203) +# id C15511BA97B; Thu, 5 Jun 2003 00:14:19 -0400 (EDT) +# Received: from localhost (localhost [127.0.0.1]) +# by naughty.monkey.org (Postfix) with ESMTP +# id BF9821BA969; Thu, 5 Jun 2003 00:14:19 -0400 (EDT) +# Date: Thu, 5 Jun 2003 00:14:19 -0400 (EDT) +# From: Jose Nazario <jose@monkey.org> +# To: bug-gnu-utils@prep.ai.mit.edu, arnold@gnu.ai.mit.edu, +# netbsd-bugs@netbsd.org +# Subject: bug in gawk/gsub() (not present in nawk) +# Message-ID: <Pine.BSO.4.51.0306050007160.31577@naughty.monkey.org> +# MIME-Version: 1.0 +# Content-Type: TEXT/PLAIN; charset=US-ASCII +# X-Spam-Status: No, hits=-1.2 required=5.0 +# tests=SPAM_PHRASE_00_01,USER_AGENT_PINE +# version=2.41 +# X-Spam-Level: +# X-SpamBouncer: 1.4 (10/07/01) +# X-SBClass: OK +# Status: R +# +# while playing with some tools in data massaging, i had to migrate from an +# openbsd/nawk system to a netbsd/gawk system. i found the folllowing +# behavior, which seems to be a bug. +# +# the following gsub() pattern has a strange effect under gawk which is not +# visible in nawk (at least as compiled on openbsd). the intention is to +# take a string like "This Is a Title: My Title?" and turn it into a +# normalized string: "ThisIsaTitleMyTitle". to do this, i wrote the +# following gross gsub line in an awk script: +# +# gsub(/[\ \"-\/\\:;\[\]\@\?\.\,\$]/, "", $2) +# print $2 +# +# in gawk, as found in netbsd-macppc/1.5.2, this will drop the first letter +# of every word. the resulting string will be "hissitleyitle", while in nawk +# as built on openbsd-3.3 this will get it correct. +# +# any insights? the inconsistency with this relatively naive pattern seems a +# bit odd. (i would up installing nawk built from openbsd sources.) +# +# thanks. sorry i didn't send a better bug report, netbsd folks, i'm not +# much of a netbsd user, and i dont have send-pr set up. yes, this is a +# slightly older version of netbsd and gawk: +# +# $ uname -a +# NetBSD entropy 1.5.2 NetBSD 1.5.2 (GENERIC) #0: Sun Feb 10 02:00:04 EST +# 2002 jose@entropy:/usr/src/sys/arch/macppc/compile/GENERIC macppc +# $ awk --version +# GNU Awk 3.0.3 +# Copyright (C) 1989, 1991-1997 Free Software Foundation. +# +# +# +# thanks. +# +# ___________________________ +# jose nazario, ph.d. jose@monkey.org +# http://monkey.org/~jose/ +# +# +{ + gsub(/[\ \"-\/\\:;\[\]\@\?\.\,\$]/, "") + print +} diff --git a/test/gsubtst5.in b/test/gsubtst5.in new file mode 100644 index 00000000..5d1f1a97 --- /dev/null +++ b/test/gsubtst5.in @@ -0,0 +1 @@ +This Is a Title: My Title? diff --git a/test/gsubtst5.ok b/test/gsubtst5.ok new file mode 100644 index 00000000..b038c8af --- /dev/null +++ b/test/gsubtst5.ok @@ -0,0 +1 @@ +ThisIsaTitleMyTitle diff --git a/test/match2.awk b/test/match2.awk new file mode 100644 index 00000000..b4d9544c --- /dev/null +++ b/test/match2.awk @@ -0,0 +1,6 @@ +function f(a, b, c) +{ + print match("foo", "bar", f) +} + +BEGIN { f(1, 2, 3) } diff --git a/test/match2.ok b/test/match2.ok new file mode 100644 index 00000000..a4a91e85 --- /dev/null +++ b/test/match2.ok @@ -0,0 +1,2 @@ +gawk: match2.awk:3: fatal: match: third argument is not an array +EXIT CODE: 2 diff --git a/test/nested.awk b/test/nested.awk new file mode 100644 index 00000000..5284b550 --- /dev/null +++ b/test/nested.awk @@ -0,0 +1,123 @@ +# From james@ruari-quinn.demon.co.uk Thu Jun 5 11:43:58 2003 +# Return-Path: <james@ruari-quinn.demon.co.uk> +# Received: from localhost (skeeve [127.0.0.1]) +# by skeeve.com (8.12.5/8.12.5) with ESMTP id h558eVui012655 +# for <arnold@localhost>; Thu, 5 Jun 2003 11:43:58 +0300 +# Received: from actcom.co.il [192.114.47.1] +# by localhost with POP3 (fetchmail-5.9.0) +# for arnold@localhost (single-drop); Thu, 05 Jun 2003 11:43:58 +0300 (IDT) +# Received: by actcom.co.il (mbox arobbins) +# (with Cubic Circle's cucipop (v1.31 1998/05/13) Thu Jun 5 11:43:29 2003) +# X-From_: james@ruari-quinn.demon.co.uk Wed Jun 4 20:09:54 2003 +# Received: from smtp1.actcom.net.il by actcom.co.il with ESMTP +# (8.11.6/actcom-0.2) id h54H9oY05088 for <arobbins@actcom.co.il>; +# Wed, 4 Jun 2003 20:09:52 +0300 (EET DST) +# (rfc931-sender: smtp.actcom.co.il [192.114.47.13]) +# Received: from f7.net (consort.superb.net [209.61.216.22]) +# by smtp1.actcom.net.il (8.12.8/8.12.8) with ESMTP id h54HB8To002721 +# for <arobbins@actcom.co.il>; Wed, 4 Jun 2003 20:11:09 +0300 +# Received: from fencepost.gnu.org (fencepost.gnu.org [199.232.76.164]) +# by f7.net (8.11.7/8.11.6) with ESMTP id h54H9li15411 +# for <arnold@skeeve.com>; Wed, 4 Jun 2003 13:09:47 -0400 +# Received: from monty-python.gnu.org ([199.232.76.173]) +# by fencepost.gnu.org with esmtp (Exim 4.20) +# id 19Nbli-0001kD-BL +# for bug-gawk@gnu.org; Wed, 04 Jun 2003 13:09:46 -0400 +# Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) +# id 19NbZ5-0004V2-71 +# for bug-gawk@gnu.org; Wed, 04 Jun 2003 12:56:43 -0400 +# Received: from cicero.e-mis.co.uk ([212.240.194.162]) +# by monty-python.gnu.org with esmtp (Exim 4.20) +# id 19NbYK-0003c7-AP +# for bug-gawk@gnu.org; Wed, 04 Jun 2003 12:55:56 -0400 +# Received: from [10.139.58.254] (helo=tacitus) +# by cicero.e-mis.co.uk with esmtp (Exim 3.35 #1 (Debian)) +# id 19NbWO-0007Qv-00 +# for <bug-gawk@gnu.org>; Wed, 04 Jun 2003 17:53:56 +0100 +# Received: from james by tacitus with local (Exim 3.36 #1 (Debian)) +# id 19NbWO-0000cK-00 +# for <bug-gawk@gnu.org>; Wed, 04 Jun 2003 17:53:56 +0100 +# To: bug-gawk@gnu.org +# Subject: 3.1.0 regression +# Mail-Copies-To: never +# From: James Troup <james@nocrew.org> +# User-Agent: Gnus/5.090017 (Oort Gnus v0.17) Emacs/20.7 (gnu/linux) +# Date: Wed, 04 Jun 2003 17:53:56 +0100 +# Message-ID: <874r35wzq3.fsf@nocrew.org> +# MIME-Version: 1.0 +# Content-Type: text/plain; charset=us-ascii +# Sender: James Troup <james@ruari-quinn.demon.co.uk> +# X-Spam-Status: No, hits=-3.9 required=5.0 +# tests=EMAIL_ATTRIBUTION,SIGNATURE_SHORT_DENSE,SPAM_PHRASE_00_01, +# USER_AGENT +# version=2.41 +# X-Spam-Level: +# X-SpamBouncer: 1.4 (10/07/01) +# X-SBClass: OK +# Status: R +# +# Hi Aharon, +# +# This bug report comes from the Debian bug tracking system. You can +# view the full log at: +# +# http://bugs.debian.org/188345 +# +# Like my other bug, this is a regression from 3.1.0 and I've reproduced +# this problem with 3.1.2d. +# +# "Nikita V. Youshchenko" <yoush@cs.msu.su> writes: +# +# | Package: gawk +# | Version: 1:3.1.2-2 +# | Severity: normal +# | Tags: sid +# | +# | After upgrading gawk from woody to sid, I found one of my scripts not +# | working. I explored this a little and found minimal script to reproduce +# | the problem. +# | +# | File bug.awk is the following: +# | +BEGIN { + WI_total = 0 +} +{ + WI_total++ + { + split ( $1, sws, "_" ) + a = sws[1] + } + print(sws[1]) + print(a) +} +# | +# | The second print should output the same what first print poutputs, but +# | with gawk 3.1.2-2 it outputs nothing: +# | > echo a_b | gawk -f bug.awk +# | a +# | +# | > +# | +# | With gawk from stable I get what expexted: +# | > echo a_b | gawk -f bug.awk +# | a +# | a +# | > +# | +# | If I remove "WI_total++" line, bug disapperas +# | +# | -- System Information: +# | Debian Release: 3.0 +# | Architecture: i386 +# | Kernel: Linux zigzag 2.4.19 16:49:13 MSK 2003 i686 +# | Locale: LANG=ru_RU.KOI8-R, LC_CTYPE=ru_RU.KOI8-R +# | +# | Versions of packages gawk depends on: +# | ii libc6 2.3.1-16 GNU C Library: Shared libraries an +# | +# | -- no debconf information +# +# -- +# James +# diff --git a/test/nested.in b/test/nested.in new file mode 100644 index 00000000..31b658b1 --- /dev/null +++ b/test/nested.in @@ -0,0 +1 @@ +a_b diff --git a/test/nested.ok b/test/nested.ok new file mode 100644 index 00000000..7e8a1653 --- /dev/null +++ b/test/nested.ok @@ -0,0 +1,2 @@ +a +a diff --git a/test/pipeio2.awk b/test/pipeio2.awk index 32d09eee..dbf354bf 100644 --- a/test/pipeio2.awk +++ b/test/pipeio2.awk @@ -28,7 +28,8 @@ BEGIN { while ((com | getline fnam) > 0) { # com_tr = "echo " fnam " | tr [0-9]. ..........." - com_tr = "echo " fnam " | sed 's/[0-9]/./g'" +# com_tr = "echo " fnam " | sed 's/[0-9]/./g'" + com_tr = "echo " fnam " | sed \"s/[0-9]/./g\"" # print "\'" com_tr "\'" print "'" com_tr "'" diff --git a/test/pipeio2.ok b/test/pipeio2.ok index 0bb33245..13b0b9b0 100644 --- a/test/pipeio2.ok +++ b/test/pipeio2.ok @@ -1,16 +1,16 @@ -'echo January 1997 | sed 's/[0-9]/./g'' +'echo January 1997 | sed "s/[0-9]/./g"' January .... -'echo S M Tu W Th F S | sed 's/[0-9]/./g'' +'echo S M Tu W Th F S | sed "s/[0-9]/./g"' S M Tu W Th F S -'echo 1 2 3 4 | sed 's/[0-9]/./g'' +'echo 1 2 3 4 | sed "s/[0-9]/./g"' . . . . -'echo 5 6 7 8 9 10 11 | sed 's/[0-9]/./g'' +'echo 5 6 7 8 9 10 11 | sed "s/[0-9]/./g"' . . . . . .. .. -'echo 12 13 14 15 16 17 18 | sed 's/[0-9]/./g'' +'echo 12 13 14 15 16 17 18 | sed "s/[0-9]/./g"' .. .. .. .. .. .. .. -'echo 19 20 21 22 23 24 25 | sed 's/[0-9]/./g'' +'echo 19 20 21 22 23 24 25 | sed "s/[0-9]/./g"' .. .. .. .. .. .. .. -'echo 26 27 28 29 30 31 | sed 's/[0-9]/./g'' +'echo 26 27 28 29 30 31 | sed "s/[0-9]/./g"' .. .. .. .. .. .. -'echo | sed 's/[0-9]/./g'' +'echo | sed "s/[0-9]/./g"' diff --git a/test/printlang.awk b/test/printlang.awk new file mode 100644 index 00000000..03e06c0e --- /dev/null +++ b/test/printlang.awk @@ -0,0 +1,4 @@ +BEGIN { + printf "\nLocale environment:\n\tLC_ALL=\"%s\" LANG=\"%s\"\n\n", + ENVIRON["LC_ALL"], ENVIRON["LANG"] +} diff --git a/test/rsnulbig.ok b/test/rsnulbig.ok new file mode 100644 index 00000000..10a52093 --- /dev/null +++ b/test/rsnulbig.ok @@ -0,0 +1 @@ +16386 diff --git a/test/rsnulbig2.ok b/test/rsnulbig2.ok new file mode 100644 index 00000000..0cfbf088 --- /dev/null +++ b/test/rsnulbig2.ok @@ -0,0 +1 @@ +2 diff --git a/test/rstest3.awk b/test/rstest3.awk new file mode 100644 index 00000000..3238ffa2 --- /dev/null +++ b/test/rstest3.awk @@ -0,0 +1,73 @@ +# From spcecdt@armory.com Tue Apr 15 17:35:01 2003 +# Return-Path: <spcecdt@armory.com> +# Received: from localhost (aahz [127.0.0.1]) +# by skeeve.com (8.12.5/8.12.5) with ESMTP id h3FEYA6o001541 +# for <arnold@localhost>; Tue, 15 Apr 2003 17:35:01 +0300 +# Received: from actcom.co.il [192.114.47.1] +# by localhost with POP3 (fetchmail-5.9.0) +# for arnold@localhost (single-drop); Tue, 15 Apr 2003 17:35:01 +0300 (IDT) +# Received: by actcom.co.il (mbox arobbins) +# (with Cubic Circle's cucipop (v1.31 1998/05/13) Tue Apr 15 17:38:46 2003) +# X-From_: spcecdt@armory.com Tue Apr 15 11:09:12 2003 +# Received: from smtp1.actcom.net.il by actcom.co.il with ESMTP +# (8.11.6/actcom-0.2) id h3F88uC19825 for <arobbins@actcom.co.il>; +# Tue, 15 Apr 2003 11:09:04 +0300 (EET DST) +# (rfc931-sender: smtp.actcom.co.il [192.114.47.13]) +# Received: from f7.net (consort.superb.net [209.61.216.22]) +# by smtp1.actcom.net.il (8.12.8/8.12.8) with ESMTP id h3F8CgQ7019081 +# for <arobbins@actcom.co.il>; Tue, 15 Apr 2003 11:12:47 +0300 +# Received: from fencepost.gnu.org (fencepost.gnu.org [199.232.76.164]) +# by f7.net (8.11.7/8.11.6) with ESMTP id h3F88oW23381 +# for <arnold@skeeve.com>; Tue, 15 Apr 2003 04:08:50 -0400 +# Received: from monty-python.gnu.org ([199.232.76.173]) +# by fencepost.gnu.org with esmtp (Exim 4.10) +# id 195LUo-0001cv-00 +# for bug-gawk@gnu.org; Tue, 15 Apr 2003 04:08:50 -0400 +# Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) +# id 195LUh-0006n0-00 +# for bug-gawk@gnu.org; Tue, 15 Apr 2003 04:08:44 -0400 +# Received: from deepthought.armory.com ([192.122.209.42] helo=armory.com) +# by monty-python.gnu.org with smtp (Exim 4.10.13) +# id 195LUC-0006JM-00 +# for bug-gawk@gnu.org; Tue, 15 Apr 2003 04:08:13 -0400 +# Date: Tue, 15 Apr 2003 01:08:11 -0700 +# From: "John H. DuBois III" <spcecdt@armory.com> +# To: bug-gawk@gnu.org +# Subject: gawk 3.1.2 fatal bug +# Message-ID: <20030415080811.GA14963@armory.com> +# Mime-Version: 1.0 +# Content-Type: text/plain; charset=us-ascii +# Content-Disposition: inline +# User-Agent: Mutt/1.3.28i +# X-Www: http://www.armory.com./~spcecdt/ +# Sender: spcecdt@armory.com +# X-Spam-Status: No, hits=-7.9 required=5.0 +# tests=SIGNATURE_SHORT_DENSE,SPAM_PHRASE_01_02,USER_AGENT, +# USER_AGENT_MUTT +# version=2.41 +# X-Spam-Level: +# X-SpamBouncer: 1.4 (10/07/01) +# X-SBClass: OK +# Status: RO +# +# This program: +# +# BEGIN { RS = ""; "/bin/echo -n x" | getline } +# +# fails in exactly the same way under SCO OpenServer 5.0.6a using gawk 3.1.2 +# built with gcc 2.95.3 and linux using gawk 3.1.2 built with gcc 3.2.2: +# +# gawk: gawktest:1: fatal error: internal error +# Abort +# +# The same program does not fail with gawk 3.1.1. +# +# John +# -- +# John DuBois spcecdt@armory.com KC6QKZ/AE http://www.armory.com/~spcecdt/ +# +# +BEGIN { + RS = "" + "echo x | tr -d '\\12'" | getline +} diff --git a/test/rstest3.ok b/test/rstest3.ok new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/test/rstest3.ok diff --git a/test/rstest4.awk b/test/rstest4.awk new file mode 100644 index 00000000..ddf06917 --- /dev/null +++ b/test/rstest4.awk @@ -0,0 +1,67 @@ +# From spcecdt@armory.com Mon May 5 14:37:09 2003 +# Return-Path: <spcecdt@armory.com> +# Received: from localhost (skeeve [127.0.0.1]) +# by skeeve.com (8.12.5/8.12.5) with ESMTP id h45B1GvT031993 +# for <arnold@localhost>; Mon, 5 May 2003 14:37:09 +0300 +# Received: from actcom.co.il [192.114.47.1] +# by localhost with POP3 (fetchmail-5.9.0) +# for arnold@localhost (single-drop); Mon, 05 May 2003 14:37:09 +0300 (IDT) +# Received: by actcom.co.il (mbox arobbins) +# (with Cubic Circle's cucipop (v1.31 1998/05/13) Mon May 5 14:35:11 2003) +# X-From_: spcecdt@armory.com Mon May 5 12:20:20 2003 +# Received: from smtp1.actcom.net.il by actcom.co.il with ESMTP +# (8.11.6/actcom-0.2) id h459KC529186 for <arobbins@actcom.co.il>; +# Mon, 5 May 2003 12:20:15 +0300 (EET DST) +# (rfc931-sender: smtp.actcom.co.il [192.114.47.13]) +# Received: from f7.net (consort.superb.net [209.61.216.22]) +# by smtp1.actcom.net.il (8.12.8/8.12.8) with ESMTP id h459LMfl025854 +# for <arobbins@actcom.co.il>; Mon, 5 May 2003 12:21:24 +0300 +# Received: from armory.com (deepthought.armory.com [192.122.209.42]) +# by f7.net (8.11.7/8.11.6) with SMTP id h459K9I26841 +# for <arnold@skeeve.com>; Mon, 5 May 2003 05:20:09 -0400 +# Date: Mon, 5 May 2003 02:20:08 -0700 +# From: "John H. DuBois III" <spcecdt@armory.com> +# To: Aharon Robbins <arnold@skeeve.com> +# Subject: Re: gawk 3.1.2b now available +# Message-ID: <20030505092008.GA15970@armory.com> +# References: <200305041149.h44BnLcm005484@localhost.localdomain> +# Mime-Version: 1.0 +# Content-Type: text/plain; charset=us-ascii +# Content-Disposition: inline +# In-Reply-To: <200305041149.h44BnLcm005484@localhost.localdomain> +# User-Agent: Mutt/1.3.28i +# X-Www: http://www.armory.com./~spcecdt/ +# Sender: spcecdt@armory.com +# X-SpamBouncer: 1.4 (10/07/01) +# X-SBClass: OK +# Status: RO +# +# This is a curious one: +# +# gawk-3.1.2b 'BEGIN { +# while (("echo" | getline) == 1) +# ; +# RS = "" +# "echo \"a\n\nb\"" | getline y +# print x +# }' | hd +# +# The output is: +# +# 0000 00 13 0a ... +# 0003 +# +# (the uninitialized variable 'x' is somehow getting the value <null><control-S>) +# +# John +# -- +# John DuBois spcecdt@armory.com KC6QKZ/AE http://www.armory.com/~spcecdt/ +# +BEGIN { + while (("echo" | getline) == 1) + ; + RS = "" + "echo \"a\n\nb\"" | getline y + printf "y = <%s>\n", y # ADR + printf "x = <%s>\n", x # ADR +} diff --git a/test/rstest4.ok b/test/rstest4.ok new file mode 100644 index 00000000..430442fb --- /dev/null +++ b/test/rstest4.ok @@ -0,0 +1,2 @@ +y = <a> +x = <> diff --git a/test/rstest5.awk b/test/rstest5.awk new file mode 100644 index 00000000..09abb4a0 --- /dev/null +++ b/test/rstest5.awk @@ -0,0 +1,60 @@ +# From spcecdt@armory.com Tue May 6 13:42:34 2003 +# Return-Path: <spcecdt@armory.com> +# Received: from localhost (aahz [127.0.0.1]) +# by skeeve.com (8.12.5/8.12.5) with ESMTP id h46AgG53003519 +# for <arnold@localhost>; Tue, 6 May 2003 13:42:34 +0300 +# Received: from actcom.co.il [192.114.47.1] +# by localhost with POP3 (fetchmail-5.9.0) +# for arnold@localhost (single-drop); Tue, 06 May 2003 13:42:34 +0300 (IDT) +# Received: by actcom.co.il (mbox arobbins) +# (with Cubic Circle's cucipop (v1.31 1998/05/13) Tue May 6 13:48:46 2003) +# X-From_: spcecdt@armory.com Tue May 6 13:26:09 2003 +# Received: from smtp1.actcom.net.il by actcom.co.il with ESMTP +# (8.11.6/actcom-0.2) id h46AQ6520133 for <arobbins@actcom.co.il>; +# Tue, 6 May 2003 13:26:07 +0300 (EET DST) +# (rfc931-sender: lmail.actcom.co.il [192.114.47.13]) +# Received: from f7.net (consort.superb.net [209.61.216.22]) +# by smtp1.actcom.net.il (8.12.8/8.12.8) with ESMTP id h46ARSfl010998 +# for <arobbins@actcom.co.il>; Tue, 6 May 2003 13:27:31 +0300 +# Received: from armory.com (deepthought.armory.com [192.122.209.42]) +# by f7.net (8.11.7/8.11.6) with SMTP id h46AQ1I18183 +# for <arnold@skeeve.com>; Tue, 6 May 2003 06:26:01 -0400 +# Date: Tue, 6 May 2003 03:25:59 -0700 +# From: "John H. DuBois III" <spcecdt@armory.com> +# To: Aharon Robbins <arnold@skeeve.com> +# Subject: Re: gawk 3.1.2b now available +# Message-ID: <20030506102559.GA16105@armory.com> +# References: <200305051157.h45Bv4XO003106@localhost.localdomain> +# Mime-Version: 1.0 +# Content-Type: text/plain; charset=us-ascii +# Content-Disposition: inline +# In-Reply-To: <200305051157.h45Bv4XO003106@localhost.localdomain> +# User-Agent: Mutt/1.3.28i +# X-Www: http://www.armory.com./~spcecdt/ +# Sender: spcecdt@armory.com +# X-SpamBouncer: 1.4 (10/07/01) +# X-SBClass: OK +# Status: RO +# +# The patch fixed the previous case, but here's another one - this prints +# <null><control-S>: +# +# BEGIN { +# RS = "" +# "echo 'foo\n\nbaz'" | getline +# "echo 'foo\n\nbaz'" | getline +# "echo 'bar\n\nbaz'" | getline +# print x +# } +# +# John +# -- +# John DuBois spcecdt@armory.com KC6QKZ/AE http://www.armory.com/~spcecdt/ +# +BEGIN { + RS = "" + "echo 'foo\n\nbaz'" | getline ; print + "echo 'foo\n\nbaz'" | getline ; print + "echo 'bar\n\nbaz'" | getline ; print + printf "x = <%s>\n", x +} diff --git a/test/rstest5.ok b/test/rstest5.ok new file mode 100644 index 00000000..bf451511 --- /dev/null +++ b/test/rstest5.ok @@ -0,0 +1,4 @@ +foo +baz +bar +x = <> diff --git a/test/scalar.awk b/test/scalar.awk new file mode 100644 index 00000000..9027389b --- /dev/null +++ b/test/scalar.awk @@ -0,0 +1,4 @@ +BEGIN{ + sub(/x/,"",a) + a[1] +} diff --git a/test/scalar.ok b/test/scalar.ok new file mode 100644 index 00000000..6aea31a7 --- /dev/null +++ b/test/scalar.ok @@ -0,0 +1,2 @@ +gawk: scalar.awk:3: fatal: attempt to use scalar `a' as array +EXIT CODE: 2 diff --git a/test/sortempty.awk b/test/sortempty.awk new file mode 100644 index 00000000..6848d953 --- /dev/null +++ b/test/sortempty.awk @@ -0,0 +1 @@ +BEGIN { print asort(a) } diff --git a/test/sortempty.ok b/test/sortempty.ok new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/test/sortempty.ok @@ -0,0 +1 @@ +0 diff --git a/test/strftime.awk b/test/strftime.awk index 8c1f401a..775cd4e5 100644 --- a/test/strftime.awk +++ b/test/strftime.awk @@ -6,10 +6,14 @@ # on cygwin, where the timezone field is empty and there # are two consecutive blanks. +# Additional mucking about to lop off the seconds field; +# helps decrease chance of difference due to a second boundary + { $3 = sprintf("%02d", $3 + 0) + $4 = substr($4, 1, 5) print > "strftime.ok" - $0 = strftime() + $0 = strftime("%a %b %d %H:%M %Z %Y") $NF = $NF print > OUTPUT } diff --git a/test/strtonum.awk b/test/strtonum.awk new file mode 100644 index 00000000..22ad41e2 --- /dev/null +++ b/test/strtonum.awk @@ -0,0 +1,6 @@ +BEGIN { + print strtonum("0x13") + print strtonum("013") + print strtonum("13") + print strtonum(13) +} diff --git a/test/strtonum.ok b/test/strtonum.ok new file mode 100644 index 00000000..9d1e557b --- /dev/null +++ b/test/strtonum.ok @@ -0,0 +1,4 @@ +19 +11 +13 +13 diff --git a/test/switch2.awk b/test/switch2.awk new file mode 100644 index 00000000..f788edbd --- /dev/null +++ b/test/switch2.awk @@ -0,0 +1,59 @@ +# From spcecdt@armory.com Tue Jun 3 11:41:49 2003 +# Return-Path: <spcecdt@armory.com> +# Received: from localhost (skeeve [127.0.0.1]) +# by skeeve.com (8.12.5/8.12.5) with ESMTP id h538fVuW018115 +# for <arnold@localhost>; Tue, 3 Jun 2003 11:41:49 +0300 +# Received: from actcom.co.il [192.114.47.1] +# by localhost with POP3 (fetchmail-5.9.0) +# for arnold@localhost (single-drop); Tue, 03 Jun 2003 11:41:49 +0300 (IDT) +# Received: by actcom.co.il (mbox arobbins) +# (with Cubic Circle's cucipop (v1.31 1998/05/13) Tue Jun 3 11:41:37 2003) +# X-From_: spcecdt@armory.com Mon Jun 2 20:17:30 2003 +# Received: from smtp1.actcom.net.il by actcom.co.il with ESMTP +# (8.11.6/actcom-0.2) id h52HHNY23516 for <arobbins@actcom.co.il>; +# Mon, 2 Jun 2003 20:17:24 +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 smtp1.actcom.net.il (8.12.8/8.12.8) with ESMTP id h52HIHqv028728 +# for <arobbins@actcom.co.il>; Mon, 2 Jun 2003 20:18:18 +0300 +# Received: from armory.com (deepthought.armory.com [192.122.209.42]) +# by f7.net (8.11.7/8.11.6) with SMTP id h52HHKl31637 +# for <arnold@skeeve.com>; Mon, 2 Jun 2003 13:17:20 -0400 +# Date: Mon, 2 Jun 2003 10:17:11 -0700 +# From: "John H. DuBois III" <spcecdt@armory.com> +# To: arnold@skeeve.com +# Subject: gawk 3.1.2c coredump +# Message-ID: <20030602171711.GA3958@armory.com> +# Mime-Version: 1.0 +# Content-Type: text/plain; charset=us-ascii +# Content-Disposition: inline +# User-Agent: Mutt/1.3.28i +# X-Www: http://www.armory.com./~spcecdt/ +# Sender: spcecdt@armory.com +# X-SpamBouncer: 1.4 (10/07/01) +# X-SBClass: OK +# Status: R +# +#!/usr/local/bin/gawk -f +BEGIN { + switch (substr("x",1,1)) { + case /ask.com/: + break + case "google": + break + } +} +# +# The stack says: +# +# #0 0x0806fac2 in r_tree_eval (tree=0x8092000, iscond=0) at eval.c:813 +# #1 0x08070413 in r_tree_eval (tree=0x0, iscond=0) at eval.c:1071 +# #2 0x08070413 in r_tree_eval (tree=0x8092000, iscond=0) at eval.c:1071 +# #3 0x08070413 in r_tree_eval (tree=0x8092000, iscond=0) at eval.c:1071 +# [ this continues on indefinitely - I suppose it ran out of stack eventually ] +# +# John +# -- +# John DuBois spcecdt@armory.com KC6QKZ/AE http://www.armory.com/~spcecdt/ +# +# diff --git a/test/uninit3.awk b/test/uninit3.awk new file mode 100644 index 00000000..d0140d54 --- /dev/null +++ b/test/uninit3.awk @@ -0,0 +1,7 @@ +function f(x){ + print x +} + +BEGIN { + f(x) +} diff --git a/test/uninit3.ok b/test/uninit3.ok new file mode 100644 index 00000000..a98ddb04 --- /dev/null +++ b/test/uninit3.ok @@ -0,0 +1,3 @@ +gawk: uninit3.awk:8: warning: function `f': parameter `x' shadows global variable +gawk: uninit3.awk:2: warning: reference to uninitialized variable `x' + diff --git a/test/uninit4.awk b/test/uninit4.awk new file mode 100644 index 00000000..89de7322 --- /dev/null +++ b/test/uninit4.awk @@ -0,0 +1,13 @@ +# test whether --lint catches uninitialized fields: +function pr() +{ + print +} + +BEGIN { + pr() + print $0 + print $(1-1) + print $1 + NF=3; print $2 +} diff --git a/test/uninit4.ok b/test/uninit4.ok new file mode 100644 index 00000000..3ea4da30 --- /dev/null +++ b/test/uninit4.ok @@ -0,0 +1,10 @@ +gawk: uninit4.awk:4: warning: reference to uninitialized field `$0' + +gawk: uninit4.awk:9: warning: reference to uninitialized field `$0' + +gawk: uninit4.awk:10: warning: reference to uninitialized field `$0' + +gawk: uninit4.awk:11: warning: reference to uninitialized field `$1' + +gawk: uninit4.awk:12: warning: reference to uninitialized field `$2' + diff --git a/test/whiny.awk b/test/whiny.awk new file mode 100644 index 00000000..dc86694b --- /dev/null +++ b/test/whiny.awk @@ -0,0 +1,5 @@ +{ word[$0]++ } +END { + for (i in word) + print i +} diff --git a/test/whiny.in b/test/whiny.in new file mode 100644 index 00000000..6c8a2e3a --- /dev/null +++ b/test/whiny.in @@ -0,0 +1,178 @@ +gawk +pattern +scanning +and +processing +language +or +style +options +file +or +style +options +file +or +style +options +file +or +style +options +file +is +the +Project's +implementation +of +the +programming +language. +It +conforms +to +the +definition +of +the +language +in +the +Command +Language +And +Utilities +Standard. +This +version +in +turn +is +based +on +the +description +in +by +Aho, +Kernighan, +and +Weinberger, +with +the +additional +features +found +in +the +System +V +Release +version +of +also +provides +more +recent +Bell +Laboratories +extensions, +and +a +number +of +extensions. +is +the +profiling +version +of +It +is +identical +in +every +way +to +except +that +programs +run +more +slowly, +and +it +automatically +produces +an +execution +profile +in +the +file +when +done. +See +the +option, +below. +The +command +line +consists +of +options +to +itself, +the +program +text +not +supplied +via +the +or +options), +and +values +to +be +made +available +in +the +and +pre-defined +variables. +options +may +be +either +traditional +one +letter +options, +or +style +long +options. +options +start +with +a +single +while +long +options +start +with +Long +options +are +provided +for +both +features +and +for +features. diff --git a/test/whiny.ok b/test/whiny.ok new file mode 100644 index 00000000..973aa5d3 --- /dev/null +++ b/test/whiny.ok @@ -0,0 +1,108 @@ +Aho, +And +Bell +Command +It +Kernighan, +Laboratories +Language +Long +Project's +Release +See +Standard. +System +The +This +Utilities +V +Weinberger, +a +additional +also +an +and +are +automatically +available +based +be +below. +both +by +command +conforms +consists +definition +description +done. +either +every +except +execution +extensions, +extensions. +features +features. +file +for +found +gawk +identical +implementation +in +is +it +itself, +language +language. +letter +line +long +made +may +more +not +number +of +on +one +option, +options +options), +options, +options. +or +pattern +pre-defined +processing +produces +profile +profiling +program +programming +programs +provided +provides +recent +run +scanning +single +slowly, +start +style +supplied +text +that +the +to +traditional +turn +values +variables. +version +via +way +when +while +with diff --git a/unsupported/atari/ChangeLog b/unsupported/atari/ChangeLog index 37c2ad76..7717bd3a 100644 --- a/unsupported/atari/ChangeLog +++ b/unsupported/atari/ChangeLog @@ -1,3 +1,7 @@ +Mon Jul 7 11:01:43 2003 Arnold D. Robbins <arnold@skeeve.com> + + * Release 3.1.3: Release tar file made. + Wed Mar 19 14:10:31 2003 Arnold D. Robbins <arnold@skeeve.com> This time for sure. diff --git a/unsupported/tandem/ChangeLog b/unsupported/tandem/ChangeLog index fd8ffd8d..6a9cdeb4 100644 --- a/unsupported/tandem/ChangeLog +++ b/unsupported/tandem/ChangeLog @@ -1,3 +1,7 @@ +Mon Jul 7 11:01:43 2003 Arnold D. Robbins <arnold@skeeve.com> + + * Release 3.1.3: Release tar file made. + Wed Mar 19 14:10:31 2003 Arnold D. Robbins <arnold@skeeve.com> This time for sure. diff --git a/vms/ChangeLog b/vms/ChangeLog index 210976ba..d16e219b 100644 --- a/vms/ChangeLog +++ b/vms/ChangeLog @@ -1,3 +1,12 @@ +Mon Jul 7 11:01:43 2003 Arnold D. Robbins <arnold@skeeve.com> + + * Release 3.1.3: Release tar file made. + +Mon Jun 9 22:15:40 2003 Pat Rankin <rankin@pactechdata.com> + + * vms-conf.h: Synchronize with current configh.in. + ALLOW_SWITCH: Define this to enable new `switch' feature. + Wed Mar 19 14:10:31 2003 Arnold D. Robbins <arnold@skeeve.com> This time for sure. diff --git a/vms/descrip.mms b/vms/descrip.mms index b1dc393e..30ad5074 100644 --- a/vms/descrip.mms +++ b/vms/descrip.mms @@ -122,7 +122,7 @@ DOCS= $(DOCDIR)gawk.1,$(DOCDIR)gawk.texi,$(DOCDIR)texinfo.tex # Release of gawk REL=3.1 -PATCHLVL=1 +PATCHLVL=3 # generic target all : gawk diff --git a/vms/vms-conf.h b/vms/vms-conf.h index 50c2790a..dd862b2e 100644 --- a/vms/vms-conf.h +++ b/vms/vms-conf.h @@ -27,320 +27,476 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ +/* switch statements are enabled in awk programs */ +#undef ALLOW_SWITCH + +/* 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 + #if 0 -/* Define if using alloca.c. */ -#define C_ALLOCA +/* Define to 1 if using alloca.c. */ +#define C_ALLOCA 1 #else #define NO_ALLOCA /* vms/vms_fwrite.c needs this */ #endif -/* Define if type char is unsigned and you are not using gcc. */ -#ifndef __CHAR_UNSIGNED__ -/* #undef __CHAR_UNSIGNED__ */ -#endif +/* dynamic loading is possible */ +#undef DYNAMIC -/* Define to empty if the keyword does not work. */ -/* #undef const */ - -/* 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'. */ #define GETGROUPS_T int -/* Define if the `getpgrp' function takes no argument. */ +/* Define to 1 if the `getpgrp' function requires zero arguments. */ #define GETPGRP_VOID 1 -/* Define to `int' if <sys/types.h> doesn't define. */ -/* #undef gid_t */ +/* Define to 1 if you have the `alarm' function. */ +#define HAVE_ALARM 1 -/* 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 to 1 if you have the <argz.h> header file. */ +#undef HAVE_ARGZ_H -/* Define if you have a working `mmap' system call. */ -#undef HAVE_MMAP +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +#undef HAVE_DCGETTEXT -/* Define if your struct stat has st_blksize. */ -#undef HAVE_ST_BLKSIZE +/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ +#undef HAVE_DOPRNT -/* Define if you have the ANSI # stringizing operator in cpp. */ -#ifdef VAXC -#undef HAVE_STRINGIZE -#else -#define HAVE_STRINGIZE 1 -#endif +/* Define to 1 if you have the <fcntl.h> header file. */ +#undef HAVE_FCNTL_H -/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */ -#undef HAVE_SYS_WAIT_H +/* Define to 1 if you have the `feof_unlocked' function. */ +#undef HAVE_FEOF_UNLOCKED -/* Define if your struct tm has tm_zone. */ -#undef HAVE_TM_ZONE +/* Define to 1 if you have the `fgets_unlocked' function. */ +#undef HAVE_FGETS_UNLOCKED -/* Define if you don't have tm_zone but do have the external array - tzname. */ -#define HAVE_TZNAME 1 /* (faked in vms/vms_misc.c) */ +/* Define to 1 if you have the `fmod' function. */ +#define HAVE_FMOD 1 -/* Define if you have the vprintf function. */ -#define HAVE_VPRINTF 1 +/* Define to 1 if you have the `getcwd' function. */ +#define HAVE_GETCWD 1 -/* Define as __inline if that's what the C compiler calls it. */ -/* #undef inline */ +/* Define to 1 if you have the `getc_unlocked' function. */ +#undef HAVE_GETC_UNLOCKED -/* Define if on MINIX. */ -/* #undef _MINIX */ +/* Define to 1 if you have the `getegid' function. */ +#undef HAVE_GETEGID -/* Define to `long' if <sys/types.h> doesn't define. */ -/* #undef off_t */ +/* Define to 1 if you have the `geteuid' function. */ +#define HAVE_GETEUID 1 -/* Define to `int' if <sys/types.h> doesn't define. */ -/* #undef pid_t */ +/* Define to 1 if you have the `getgid' function. */ +#define HAVE_GETGID 1 -/* 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 `getgrent' function. */ +#undef HAVE_GETGRENT -/* Define if you need to in order for stat and other things to work. */ -/* #undef _POSIX_SOURCE */ +/* Define to 1 if you have the `getgroups' function. */ +#undef HAVE_GETGROUPS -/* Define as the return type of signal handlers (int or void). */ -#define RETSIGTYPE void +/* Define if you have the getpagesize function. */ +#undef HAVE_GETPAGESIZE -/* Define to `unsigned' if <sys/types.h> doesn't define. */ -/* #undef size_t */ +/* Define if the GNU gettext() function is already present or preinstalled. */ +#undef HAVE_GETTEXT -/* 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 - */ -#define STACK_DIRECTION (-1) +/* Define to 1 if you have the `getuid' function. */ +#define HAVE_GETUID 1 -/* Define if you have the ANSI C header files. */ -#define STDC_HEADERS 1 +/* Define to 1 if you have the `grantpt' function. */ +#undef HAVE_GRANTPT -/* Define if you can safely include both <sys/time.h> and <time.h>. */ -#undef TIME_WITH_SYS_TIME +/* Define if you have the iconv() function. */ +#undef HAVE_ICONV -/* Define if your <sys/time.h> declares struct tm. */ -/* #undef TM_IN_SYS_TIME */ +/* Define if <inttypes.h> exists and doesn't clash with <sys/types.h>. */ +#undef HAVE_INTTYPES_H -/* Define to `int' if <sys/types.h> doesn't define. */ -/* #undef uid_t */ - -#define REGEX_MALLOC 1 /* use malloc instead of alloca in regex.c */ -#define SPRINTF_RET int /* return type of sprintf */ -#define HAVE_MKTIME 1 /* have the mktime function */ -#undef HAVE_SOCKETS /* don't have sockets on this system by default */ -#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 */ -#define ssize_t int /* signed version of size_t */ - -/* Define if you have the __argz_count function. */ -#undef HAVE___ARGZ_COUNT +/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */ +#undef HAVE_LANGINFO_CODESET -/* Define if you have the __argz_next function. */ -#undef HAVE___ARGZ_NEXT +/* Define if your <locale.h> file defines LC_MESSAGES. */ +#undef HAVE_LC_MESSAGES -/* Define if you have the __argz_stringify function. */ -#undef HAVE___ARGZ_STRINGIFY +/* Define to 1 if you have the `dl' library (-ldl). */ +#undef HAVE_LIBDL -/* Define if you have the alarm function. */ -#define HAVE_ALARM 1 +/* Define to 1 if you have the <libintl.h> header file. */ +#undef HAVE_LIBINTL_H -/* Define if you have the dcgettext function. */ -#undef HAVE_DCGETTEXT +/* Define to 1 if you have the `m' library (-lm). */ +#undef HAVE_LIBM -/* Define if you have the fmod function. */ -#define HAVE_FMOD 1 +/* Define to 1 if you have the <limits.h> header file. */ +#define HAVE_LIMITS_H 1 -/* Define if you have the getcwd function. */ -#define HAVE_GETCWD 1 +/* Define to 1 if you have the <locale.h> header file. */ +#undef HAVE_LOCALE_H -/* Define if you have the getpagesize function. */ -#undef HAVE_GETPAGESIZE +/* Define if you have the long long type. */ +#undef HAVE_LONG_LONG + +/* Define to 1 if you have the <malloc.h> header file. */ +#undef HAVE_MALLOC_H + +/* Define to 1 if you have the `mbrlen' function. */ +#undef HAVE_MBRLEN + +/* Define to 1 if you have the `mbrtowc' function. */ +#undef HAVE_MBRTOWC -/* Define 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. */ #define HAVE_MEMCMP 1 -/* Define if you have the memcpy function. */ +/* Define to 1 if you have the `memcpy' function. */ #define HAVE_MEMCPY 1 -/* Define if you have the memset function. */ +/* Define to 1 if you have the <memory.h> header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `mempcpy' function. */ +#undef HAVE_MEMPCPY + +/* Define to 1 if you have the `memset' function. */ #define HAVE_MEMSET 1 -/* Define if you have the munmap function. */ +/* we have the mktime function */ +#define HAVE_MKTIME 1 + +/* 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 + +/* Define to 1 if you have the `snprintf' function. */ +#undef HAVE_SNPRINTF + +/* we have sockets on this system */ +#undef HAVE_SOCKETS + +/* Define to 1 if you have the <stdarg.h> header file. */ +#define HAVE_STDARG_H 1 + +/* Define to 1 if you have the <stddef.h> header file. */ +#define HAVE_STDDEF_H 1 + +/* Define to 1 if you have the <stdint.h> header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the <stdlib.h> header file. */ +#define HAVE_STDLIB_H 1 + +/* 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. */ #define HAVE_STRCHR 1 -/* 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. */ #define HAVE_STRERROR 1 -/* Define if you have the strftime function. */ +/* Define to 1 if you have the `strftime' function. */ #undef HAVE_STRFTIME /* use the missing_d/strfime.c version */ -/* Define if you have the strncasecmp function. */ -#undef HAVE_STRNCASECMP +/* Define to 1 if cpp supports the ANSI # stringizing operator. */ +#ifdef VAXC +#undef HAVE_STRINGIZE +#else +#define HAVE_STRINGIZE 1 +#endif -/* Define if you have the strtod function. */ -#define HAVE_STRTOD 1 +/* Define to 1 if you have the <strings.h> header file. */ +#undef HAVE_STRINGS_H -/* Define if you have the system function. */ -#define HAVE_SYSTEM 1 +/* Define to 1 if you have the <string.h> header file. */ +#define HAVE_STRING_H 1 -/* Define if you have the tzset function. */ -#define HAVE_TZSET 1 /* (faked in vms/vms_misc.c) */ +/* Define to 1 if you have the `strncasecmp' function. */ +#undef HAVE_STRNCASECMP -/* Define if you have the <argz.h> header file. */ -#undef HAVE_ARGZ_H +/* Define to 1 if you have the <stropts.h> header file. */ +#undef HAVE_STROPTS_H -/* Define if you have the <fcntl.h> header file. */ -#undef HAVE_FCNTL_H - -/* Define if you have the <libintl.h> header file. */ -#undef HAVE_LIBINTL_H +/* Define to 1 if you have the `strtod' function. */ +#define HAVE_STRTOD 1 -/* Define if you have the <limits.h> header file. */ -#define HAVE_LIMITS_H 1 +/* Define to 1 if you have the `strtoul' function. */ +#define HAVE_STRTOUL 1 -/* Define if you have the <locale.h> header file. */ -#undef HAVE_LOCALE_H +/* Define to 1 if `st_blksize' is member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_BLKSIZE -/* Define if you have the <malloc.h> header file. */ -#undef HAVE_MALLOC_H +/* Define to 1 if `tm_zone' is member of `struct tm'. */ +#undef HAVE_STRUCT_TM_TM_ZONE -/* Define if you have the <mcheck.h> header file. */ -#undef HAVE_MCHECK_H +/* Define to 1 if your `struct stat' has `st_blksize'. Deprecated, use + `HAVE_STRUCT_STAT_ST_BLKSIZE' instead. */ +#undef HAVE_ST_BLKSIZE -/* Define if you have the <memory.h> header file. */ -#undef HAVE_MEMORY_H +/* Define to 1 if you have the `system' function. */ +#define HAVE_SYSTEM 1 -/* Define if you have the <netdb.h> header file. */ -#undef HAVE_NETDB_H +/* Define to 1 if you have the <sys/param.h> header file. */ +#undef HAVE_SYS_PARAM_H -/* Define if you have the <netinet/in.h> header file. */ -#undef HAVE_NETINET_IN_H +/* Define to 1 if you have the <sys/socket.h> header file. */ +#undef HAVE_SYS_SOCKET_H -/* Define if you have the <nl_types.h> header file. */ -#undef HAVE_NL_TYPES_H +/* Define to 1 if you have the <sys/stat.h> header file. */ +#undef HAVE_SYS_STAT_H -/* Define if you have the <signum.h> header file. */ -#undef HAVE_SIGNUM_H +/* Define to 1 if you have the <sys/time.h> header file. */ +#undef HAVE_SYS_TIME_H -/* Define if you have the <stdarg.h> header file. */ -#define HAVE_STDARG_H 1 +/* Define to 1 if you have the <sys/types.h> header file. */ +#undef HAVE_SYS_TYPES_H -/* Define if you have the <stdlib.h> header file. */ -#define HAVE_STDLIB_H 1 +/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */ +#undef HAVE_SYS_WAIT_H -/* Define if you have the <string.h> header file. */ -#define HAVE_STRING_H 1 +/* Define to 1 if you have the <termios.h> header file. */ +#undef HAVE_TERMIOS_H -/* Define if you have the <strings.h> header file. */ -#undef HAVE_STRINGS_H +/* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use + `HAVE_STRUCT_TM_TM_ZONE' instead. */ +#undef HAVE_TM_ZONE -/* Define if you have the <sys/param.h> header file. */ -#undef HAVE_SYS_PARAM_H +/* Define to 1 if you have the `tsearch' function. */ +#undef HAVE_TSEARCH -/* Define if you have the <sys/socket.h> header file. */ -#undef HAVE_SYS_SOCKET_H +/* Define to 1 if you don't have `tm_zone' but do have the external array + `tzname'. */ +#define HAVE_TZNAME 1 /* (faked in vms/vms_misc.c) */ -/* Define if you have the <sys/time.h> header file. */ -#undef HAVE_SYS_TIME_H +/* Define to 1 if you have the `tzset' function. */ +#define HAVE_TZSET 1 /* (faked in vms/vms_misc.c) */ -/* Define if you have the <unistd.h> header file. */ +/* Define to 1 if you have the <unistd.h> header file. */ #ifdef __DECC #define HAVE_UNISTD_H 1 #else #undef HAVE_UNISTD_H #endif -/* Define if you have the i library (-li). */ -#undef HAVE_LIBI +/* Define if you have the unsigned long long type. */ +#undef HAVE_UNSIGNED_LONG_LONG + +/* Define to 1 if you have the `vprintf' function. */ +#define HAVE_VPRINTF 1 -/* Define if you have the intl library (-lintl). */ -#undef HAVE_LIBINTL +/* Define to 1 if you have the <wchar.h> header file. */ +#undef HAVE_WCHAR_H -/* Define if you have the m library (-lm). */ -#undef HAVE_LIBM +/* Define to 1 if you have the `wcrtomb' function. */ +#undef HAVE_WCRTOMB + +/* Define to 1 if you have the `wcscoll' function. */ +#undef HAVE_WCSCOLL + +/* Define to 1 if you have the <wctype.h> header file. */ +#undef HAVE_WCTYPE_H + +/* Define to 1 if you have the `__argz_count' function. */ +#undef HAVE___ARGZ_COUNT + +/* Define to 1 if you have the `__argz_next' function. */ +#undef HAVE___ARGZ_NEXT + +/* Define to 1 if you have the `__argz_stringify' function. */ +#undef HAVE___ARGZ_STRINGIFY + +/* Define as const if the declaration of iconv() needs const. */ +#undef ICONV_CONST + +/* Define if integer division by zero raises signal SIGFPE. */ +#define INTDIV0_RAISES_SIGFPE 1 + +/* disable lint checks */ +#undef NO_LINT /* Name of package */ #define PACKAGE "gawk" +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "bug-gawk@gnu.org" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "GNU Awk" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "GNU Awk 3.1.2" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "gawk" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "3.1.2" + +/* Define if <inttypes.h> exists and defines unusable PRI* macros. */ +#undef PRI_MACROS_BROKEN + +/* Define if compiler has function prototypes */ +#define PROTOTYPES 1 + +/* use malloc instead of alloca in regex.c */ +#define REGEX_MALLOC 1 + +/* Define as the return type of signal handlers (`int' or `void'). */ +#define RETSIGTYPE void + +/* return type of sprintf */ +#define SPRINTF_RET int + +/* 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 */ +#define STACK_DIRECTION (-1) + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* strtod doesn't have C89 semantics */ +#define STRTOD_NOT_C89 1 + +/* some systems define this type here */ +#undef TIME_T_IN_SYS_TYPES_H + +/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ +#undef TIME_WITH_SYS_TIME + +/* Define to 1 if your <sys/time.h> declares `struct tm'. */ +#undef TM_IN_SYS_TIME + +/* force use of our version of strftime */ +#define USE_INCLUDED_STRFTIME 1 + /* Version number of package */ -#define VERSION "3.1.1" +#define VERSION "3.1.2" + +/* 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 to make ftello visible on some hosts (e.g. HP-UX 10.20). */ -#undef _LARGEFILE_SOURCE - /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES -/* Define to make ftello visible on some hosts (e.g. glibc 2.1.3). */ -#undef _XOPEN_SOURCE +/* Define to 1 if on MINIX. */ +#undef _MINIX -/* Define if compiler has function prototypes */ -#define PROTOTYPES 1 +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +#undef _POSIX_1_SOURCE -/* Define to 1 if you have the stpcpy function. */ -#undef HAVE_STPCPY +/* Define to 1 if you need to in order for `stat' and other things to work. */ +#undef _POSIX_SOURCE -/* Define if your locale.h file contains LC_MESSAGES. */ -#undef HAVE_LC_MESSAGES +/* Define to 1 if type `char' is unsigned and you are not using gcc. */ +#ifndef __CHAR_UNSIGNED__ +# undef __CHAR_UNSIGNED__ +#endif -/* Define to 1 if NLS is requested. */ -#undef ENABLE_NLS +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const -/* Define to 1 if you have gettext and don't want to use GNU gettext. */ -#undef HAVE_GETTEXT +/* Define to `int' if <sys/types.h> doesn't define. */ +#undef gid_t -/* Define as 1 if you have catgets and don't want to use GNU gettext. */ -#undef HAVE_CATGETS +/* Define as `__inline' if that's what the C compiler calls it, or to nothing + if it is not supported. */ +#undef inline -/* Whether `time_t' is an unsigned type. */ -#define TIME_T_UNSIGNED 1 +/* Define to widest signed type if <inttypes.h> doesn't define. */ +#define intmax_t long int + +/* Define to `long' if <sys/types.h> doesn't define. */ +#undef off_t + +/* Define to `int' if <sys/types.h> doesn't define. */ +#undef pid_t + +/* Define to `unsigned' if <sys/types.h> doesn't define. */ +#undef size_t + +/* Define to `int' if <sys/types.h> does not define. */ +#define ssize_t int + +/* Define to `int' if <sys/types.h> doesn't define. */ +#undef uid_t + +/* Define to widest unsigned type if <inttypes.h> doesn't define. */ +#define uintmax_t unsigned long #if 0 #include <custom.h> /* overrides for stuff autoconf can't deal with */ #else +/* Whether `time_t' is an unsigned type. */ +#define TIME_T_UNSIGNED 1 + /*******************************/ /* Gawk configuration options. */ /*******************************/ +#define ALLOW_SWITCH 1 + /* * DEFPATH * VMS: "/AWK_LIBRARY" => "AWK_LIBRARY:" diff --git a/vms/vmsbuild.com b/vms/vmsbuild.com index 206ec37a..0da62445 100644 --- a/vms/vmsbuild.com +++ b/vms/vmsbuild.com @@ -9,7 +9,7 @@ $! gawk 3.1.0 revised, Mar'01 $! gawk 3.1.1 revised, Apr'02 $! $ REL = "3.1" !release version number -$ PATCHLVL = "1" +$ PATCHLVL = "3" $! $! $ CCFLAGS = "/noList" ! "/noOpt/Debug" |