aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuergen Kahrs <Juergen.Kahrs@vr-web.de>2012-03-20 17:21:22 +0100
committerJuergen Kahrs <Juergen.Kahrs@vr-web.de>2012-03-20 17:21:22 +0100
commit2dcf0c1084fafc7bb4d8ff5435a228ce90c408f8 (patch)
tree858812d9d74191f0462a3667df05073b71bc5147
parent8dffe780526d2bd419d17917eacd91bbacbab9ec (diff)
parentcd44d957787e162df4348028c22e8b9621000790 (diff)
downloadegawk-2dcf0c1084fafc7bb4d8ff5435a228ce90c408f8.tar.gz
egawk-2dcf0c1084fafc7bb4d8ff5435a228ce90c408f8.tar.bz2
egawk-2dcf0c1084fafc7bb4d8ff5435a228ce90c408f8.zip
Merge remote-tracking branch 'origin/master' into xgawk
-rw-r--r--ChangeLog138
-rw-r--r--FUTURES7
-rw-r--r--Makefile.am24
-rw-r--r--Makefile.in62
-rw-r--r--NEWS22
-rw-r--r--README_d/README.bootstrap32
-rw-r--r--array.c113
-rw-r--r--awk.h77
-rw-r--r--awkgram.c786
-rw-r--r--awkgram.y82
-rw-r--r--builtin.c4
-rw-r--r--cint_array.c9
-rw-r--r--command.c150
-rw-r--r--command.y2
-rw-r--r--debug.c69
-rw-r--r--dfa.c128
-rw-r--r--dfa.h7
-rw-r--r--doc/ChangeLog38
-rw-r--r--doc/awkcard.in37
-rw-r--r--doc/gawk.1160
-rw-r--r--doc/gawk.info3636
-rw-r--r--doc/gawk.texi1699
-rw-r--r--eval.c1289
-rw-r--r--eval_d.c27
-rw-r--r--eval_p.c27
-rw-r--r--ext.c94
-rw-r--r--int_array.c10
-rw-r--r--interpret.h1187
-rw-r--r--io.c301
-rw-r--r--main.c88
-rw-r--r--mbsupport.h22
-rw-r--r--missing_d/ChangeLog8
-rw-r--r--missing_d/wcmisc.c100
-rw-r--r--msg.c2
-rw-r--r--pc/ChangeLog25
-rw-r--r--pc/Makefile.tst56
-rw-r--r--pc/config.h21
-rw-r--r--pc/config.sed120
-rw-r--r--pc/testoutcmp.awk38
-rw-r--r--po/ast.gmobin37068 -> 0 bytes
-rw-r--r--po/ca.gmobin25787 -> 0 bytes
-rw-r--r--po/da.gmobin48739 -> 48739 bytes
-rw-r--r--po/da.po96
-rw-r--r--po/de.gmobin52166 -> 52166 bytes
-rw-r--r--po/de.po96
-rw-r--r--po/es.gmobin51471 -> 51471 bytes
-rw-r--r--po/es.po96
-rw-r--r--po/fi.gmobin51684 -> 51684 bytes
-rw-r--r--po/fi.po96
-rw-r--r--po/fr.gmobin53311 -> 53311 bytes
-rw-r--r--po/fr.po96
-rw-r--r--po/ga.gmobin33929 -> 0 bytes
-rw-r--r--po/gawk.pot98
-rw-r--r--po/he.gmobin24651 -> 0 bytes
-rw-r--r--po/id.gmobin35809 -> 0 bytes
-rw-r--r--po/it.gmobin44316 -> 44316 bytes
-rw-r--r--po/it.po96
-rw-r--r--po/ja.gmobin55596 -> 55596 bytes
-rw-r--r--po/ja.po96
-rw-r--r--po/nl.gmobin49267 -> 49267 bytes
-rw-r--r--po/nl.po96
-rw-r--r--po/pl.gmobin50946 -> 50946 bytes
-rw-r--r--po/pl.po96
-rw-r--r--po/pt_BR.gmobin29120 -> 0 bytes
-rw-r--r--po/ro.gmobin25383 -> 0 bytes
-rw-r--r--po/rw.gmobin487 -> 0 bytes
-rw-r--r--po/sv.gmobin48752 -> 48752 bytes
-rw-r--r--po/sv.po96
-rw-r--r--po/tr.gmobin33826 -> 0 bytes
-rw-r--r--po/vi.gmobin40445 -> 0 bytes
-rw-r--r--po/zh_CN.gmobin33717 -> 0 bytes
-rw-r--r--profile.c35
-rw-r--r--profile_p.c27
-rw-r--r--regex_internal.h8
-rw-r--r--regexec.c12
-rw-r--r--replace.c4
-rw-r--r--str_array.c15
-rw-r--r--test/ChangeLog13
-rw-r--r--test/Makefile.am59
-rw-r--r--test/Makefile.in59
-rw-r--r--test/badargs.ok3
-rw-r--r--test/rri1.awk1
-rw-r--r--test/rri1.in1
-rw-r--r--test/rri1.ok0
-rw-r--r--vms/ChangeLog22
-rw-r--r--vms/descrip.mms8
-rw-r--r--vms/vms-conf.h32
-rw-r--r--vms/vms_misc.c6
-rw-r--r--vms/vmstest.com87
89 files changed, 6321 insertions, 5826 deletions
diff --git a/ChangeLog b/ChangeLog
index dbead39b..f5d1a8ae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,141 @@
+2012-01-02 Arnold D. Robbins <arnold@skeeve.com>
+
+ * io.c (Read_can_timeout, Read_timeout, Read_default_timeout):
+ Renamed to use lower case.
+ Other minor stylistic edits.
+
+2012-01-01 John Haque <j.eh@mchsi.com>
+
+ * awk.h (struct iobuf): New entry read_func.
+ * io.c (Read_can_timeout, Read_timeout, Read_default_timeout):
+ New variables.
+ (init_io): New routine to initialize the variables.
+ (in_PROCINFO): New "clever" routine to parse elements with indices
+ seperated by a SUPSEP.
+ (get_read_timeout): New routine to read timeout value for an IOBUF.
+ (read_with_timeout): New routine to read from a fd with a timeout.
+ (pty_vs_pipe): Use in_PROCINFO().
+ (get_a_record): Set the timeout value and the read routine as necessary.
+ * main.c (main): Call init_io().
+
+2011-12-31 Arnold D. Robbins <arnold@skeeve.com>
+
+ * profile_p.c: Remove the file.
+ * msg.c (err): Remove check for name being dgawk.
+
+2011-12-31 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h [STREQ, STREQN]: Remove macros.
+ * awkgram.y, builtin.c, command.y, debug.c, eval.c,
+ io.c, msg.c: Change all uses to call strcmp, strncmp.
+
+2011-12-28 Arnold D. Robbins <arnold@skeeve.com>
+
+ * int_array.c, str_array.c: Fix some compiler warnings 32/64
+ bit system differences.
+
+2011-12-26 John Haque <j.eh@mchsi.com>
+
+ Merge gawk, pgawk and dgawk into a single executable gawk.
+
+ * awk.h (DO_PRETTY_PRINT, DO_PROFILE, DO_DEBUG,
+ do_pretty_print, do_debug): New defines.
+ (interpret): New variable, a pointer to an interpreter routine.
+ (enum exe_mode): Nuked.
+ * main.c (opttab): New options --pretty-print and --debug;
+ Remove option --command.
+ (usage): Update usage messages.
+ * interpret.h: New file.
+ * eval.c (r_interpret): Move to the new file.
+ (debug_interpret): New interpreter routine when debugging.
+ (init_interpret): New routine to initialize interpreter related
+ variables.
+ * eval_d.c, eval_p.c: Delete files.
+ * debug.c (interpret): Renamed to debug_prog.
+ (DEFAULT_PROMPT, DEFAULT_HISTFILE, DEFAULT_OPTFILE): Remove prefix 'd'.
+ * profile.c (init_profiling): Nuked.
+ * Makefile.am: Adjusted.
+
+ Add command line option --load for loading extensions.
+
+ * awk.h (srctype): Add new source type SRC_EXTLIB.
+ * ext.c(load_ext): New routine to load extension.
+ (do_ext): Adjust to use load_ext().
+ * main.c (opttab): Add new option --load.
+ (main): Call load_ext() to load extensions.
+ (usage): Add usage message for the new option.
+ * io.c (get_cwd): New routine.
+ (do_find_source): Use the new routine.
+ (find_source): Handle new type SRC_EXTLIB.
+ * awkgram.y (parse_program, next_sourcefile): Skip type SRC_EXTLIB.
+ (add_srcfile): Adjust call to find_source.
+ * debug.c (source_find): Same.
+
+ Unrelated:
+
+ * ext.c (get_argument): Fixed argument parsing.
+ * array.c (null_array_func): Reworked array routines for an empty array.
+ * str_array.c, int_array.c: Make GCC happy, use %u instead of %lu
+ printf formats.
+ * eval.c (node_Boolean): New array for TRUE and FALSE nodes.
+ (init_interpret): Create the new nodes.
+ (eval_condition): Add test for the new nodes.
+ (setup_frame): Disable tail-recursion optimization when profiling.
+ * interpret.h (r_interpret): Use the boolean nodes instead of making
+ new ones when needed.
+
+2011-12-26 Arnold D. Robbins <arnold@skeeve.com>
+
+ Finish Rational Range Interpretation (!)
+
+ * dfa.c (match_mb_charset): Compare wide characters directly
+ instead of using wcscoll().
+ * regexec.c (check_node_accept_byte): Ditto.
+
+ Thanks to Paolo Bonzini for pointing these out.
+
+2011-12-06 John Haque <j.eh@mchsi.com>
+
+ * debug.c (source_find): Fix misplaced call to efree.
+ * profile.c (redir2str): Add a missing comma in the redirtab array.
+ * eval.c (r_interpret): Disallow call to exit if currule is undefined.
+ This avoids the possiblity of running END blocks more than once when
+ used in a user-defined sorted-in comparision function.
+ * array.c (sort_user_func): Adjust appropriately.
+
+2011-12-06 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h, mbsupport.h: Changes for MBS support on DJGPP
+ and z/OS.
+ * io.c: Disable pty support on z/OS.
+
+2011-11-27 Arnold D. Robbins <arnold@skeeve.com>
+
+ * dfa.c: Sync with GNU grep.
+ * dfa.h: Add _GL_ATTRIBUTE_PURE macro. Bleah.
+
+2011-11-14 John Haque <j.eh@mchsi.com>
+
+ * debug.c (set_breakpoint_at): Fix problem with setting
+ breakpoints in a switch statement. Thanks to Giorgio Palandri
+ <giorgio.palandri@gmail.com> for the bug report.
+
+2011-11-14 Arnold D. Robbins <arnold@skeeve.com>
+
+ * mbsupport.h: Add check for HAVE_BTOWC, per Pat Rankin.
+
+2011-11-12 Eli Zaretskii <eliz@gnu.org>
+
+ * mbsupport.h: Additional glop for dfa.c in Windows environment.
+
+2011-11-01 Arnold D. Robbins <arnold@skeeve.com>
+
+ * dfa.c: Move glop for ! MBS_SUPPORT to ...
+ * mbsupport.h: ... here.
+ * replace.c: Include missing_d/wcmisc.c if ! MBS_SUPPORT.
+ * regex_internal.h: Move include of mbsupport.h up and add
+ additional checks to avoid inclusion of wctype.h and wchar.h.
+
2011-10-27 Arnold D. Robbins <arnold@skeeve.com>
* builtin.c (do_strftime): Per Pat Rankin, instead of casting
diff --git a/FUTURES b/FUTURES
index 02574107..03fe71dc 100644
--- a/FUTURES
+++ b/FUTURES
@@ -11,14 +11,14 @@ don't bug us too much about schedules or what all this really means.
For 4.1
=======
- Merge gawk/pgawk/dgawk into one executable
+ DONE: Merge gawk/pgawk/dgawk into one executable
Consider removing use of and/or need for the protos.h file.
Consider moving var_value info into Node_var itself
to reduce memory usage.
- Merge xmlgawk -l feature
+ DONE: Merge xmlgawk -l feature
Merge xmlgawk XML extensions
@@ -26,6 +26,9 @@ For 4.1
Continue code reviews / code cleanup
+ Consider making gawk output +nan for NaN values so that it
+ will accept its own output as input.
+
For 4.2
=======
Implement designed API for loadable modules
diff --git a/Makefile.am b/Makefile.am
index e9248506..b9470617 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -79,18 +79,22 @@ SUBDIRS = \
test
# what to make and install
-bin_PROGRAMS = gawk pgawk dgawk
+bin_PROGRAMS = gawk
-# sources for both gawk and pgawk
+# sources for both gawk and dgawk
base_sources = \
array.c \
awk.h \
awkgram.y \
builtin.c \
cint_array.c \
+ cmd.h \
+ command.y \
custom.h \
+ debug.c \
dfa.c \
dfa.h \
+ eval.c \
ext.c \
field.c \
floatcomp.c \
@@ -102,11 +106,13 @@ base_sources = \
getopt_int.h \
gettext.h \
int_array.c \
+ interpret.h \
io.c \
mbsupport.h \
main.c \
msg.c \
node.c \
+ profile.c \
protos.h \
random.c \
random.h \
@@ -119,13 +125,10 @@ base_sources = \
version.c \
xalloc.h
-gawk_SOURCES = $(base_sources) eval.c profile.c
-pgawk_SOURCES = $(base_sources) eval_p.c profile_p.c
-dgawk_SOURCES = $(base_sources) eval_d.c profile.c cmd.h command.y debug.c
+gawk_SOURCES = $(base_sources)
# Get extra libs as needed, Automake will supply LIBINTL and SOCKET_LIBS.
-LDADD = $(LIBSIGSEGV) $(LIBINTL) $(SOCKET_LIBS)
-dgawk_LDADD = $(LDADD) @LIBREADLINE@
+LDADD = $(LIBSIGSEGV) $(LIBINTL) $(SOCKET_LIBS) @LIBREADLINE@
# Directory for gawk's data files. Automake supplies datadir.
pkgdatadir = $(datadir)/awk
@@ -144,7 +147,6 @@ MAINTAINERCLEANFILES = version.c
LN= ln
# First, add a link from gawk to gawk-X.Y.Z.
-# Same for pgawk.
#
# For GNU systems where gawk is awk, add a link to awk.
# (This is done universally, which may not always be right, but
@@ -152,7 +154,6 @@ LN= ln
install-exec-hook:
(cd $(DESTDIR)$(bindir); \
$(LN) gawk$(EXEEXT) gawk-$(VERSION)$(EXEEXT) 2>/dev/null ; \
- $(LN) pgawk$(EXEEXT) pgawk-$(VERSION)$(EXEEXT) 2>/dev/null ; \
if [ ! -f awk ]; \
then $(LN_S) gawk$(EXEEXT) awk; \
fi; exit 0)
@@ -161,12 +162,12 @@ install-exec-hook:
uninstall-links:
(cd $(DESTDIR)$(bindir); \
if [ -f awk ] && cmp awk gawk$(EXEEXT) > /dev/null; then rm -f awk; fi ; \
- rm -f gawk-$(VERSION)$(EXEEXT) pgawk-$(VERSION)$(EXEEXT); exit 0)
+ rm -f gawk-$(VERSION)$(EXEEXT); exit 0)
uninstall-recursive: uninstall-links
# force there to be a gawk executable before running tests
-check-local: gawk$(EXEEXT) pgawk$(EXEEXT)
+check-local: gawk$(EXEEXT)
# A little extra clean up when making distributions.
# And additional set up for the pc directory.
@@ -181,6 +182,7 @@ dist-hook:
# Special rules for individual files
# Use of awk instead of $(AWK) is deliberate, in case gawk doesn't build
# or work correctly.
+
awkgram.c: awkgram.y
$(YACC) $(AM_YFLAGS) $(YFLAGS) $<
sed 's/parse error/syntax error/g' < y.tab.c | awk -f $(srcdir)/bisonfix.awk awkgram > $*.c && rm y.tab.c
diff --git a/Makefile.in b/Makefile.in
index 26d6017b..3083c4c3 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -56,7 +56,7 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-bin_PROGRAMS = gawk$(EXEEXT) pgawk$(EXEEXT) dgawk$(EXEEXT)
+bin_PROGRAMS = gawk$(EXEEXT)
subdir = .
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/configh.in \
@@ -88,31 +88,20 @@ CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)"
PROGRAMS = $(bin_PROGRAMS)
am__objects_1 = array.$(OBJEXT) awkgram.$(OBJEXT) builtin.$(OBJEXT) \
- cint_array.$(OBJEXT) dfa.$(OBJEXT) ext.$(OBJEXT) \
- field.$(OBJEXT) floatcomp.$(OBJEXT) gawkmisc.$(OBJEXT) \
- getopt.$(OBJEXT) getopt1.$(OBJEXT) int_array.$(OBJEXT) \
- io.$(OBJEXT) main.$(OBJEXT) msg.$(OBJEXT) node.$(OBJEXT) \
+ cint_array.$(OBJEXT) command.$(OBJEXT) debug.$(OBJEXT) \
+ dfa.$(OBJEXT) eval.$(OBJEXT) ext.$(OBJEXT) field.$(OBJEXT) \
+ floatcomp.$(OBJEXT) gawkmisc.$(OBJEXT) getopt.$(OBJEXT) \
+ getopt1.$(OBJEXT) int_array.$(OBJEXT) io.$(OBJEXT) \
+ main.$(OBJEXT) msg.$(OBJEXT) node.$(OBJEXT) profile.$(OBJEXT) \
random.$(OBJEXT) re.$(OBJEXT) regex.$(OBJEXT) \
replace.$(OBJEXT) str_array.$(OBJEXT) symbol.$(OBJEXT) \
version.$(OBJEXT)
-am_dgawk_OBJECTS = $(am__objects_1) eval_d.$(OBJEXT) profile.$(OBJEXT) \
- command.$(OBJEXT) debug.$(OBJEXT)
-dgawk_OBJECTS = $(am_dgawk_OBJECTS)
-am__DEPENDENCIES_1 =
-am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1)
-dgawk_DEPENDENCIES = $(am__DEPENDENCIES_2)
-am_gawk_OBJECTS = $(am__objects_1) eval.$(OBJEXT) profile.$(OBJEXT)
+am_gawk_OBJECTS = $(am__objects_1)
gawk_OBJECTS = $(am_gawk_OBJECTS)
gawk_LDADD = $(LDADD)
+am__DEPENDENCIES_1 =
gawk_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
-am_pgawk_OBJECTS = $(am__objects_1) eval_p.$(OBJEXT) \
- profile_p.$(OBJEXT)
-pgawk_OBJECTS = $(am_pgawk_OBJECTS)
-pgawk_LDADD = $(LDADD)
-pgawk_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1)
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@@ -123,8 +112,8 @@ CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS)
YLWRAP = $(top_srcdir)/ylwrap
-SOURCES = $(dgawk_SOURCES) $(gawk_SOURCES) $(pgawk_SOURCES)
-DIST_SOURCES = $(dgawk_SOURCES) $(gawk_SOURCES) $(pgawk_SOURCES)
+SOURCES = $(gawk_SOURCES)
+DIST_SOURCES = $(gawk_SOURCES)
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
@@ -357,16 +346,20 @@ SUBDIRS = \
test
-# sources for both gawk and pgawk
+# sources for both gawk and dgawk
base_sources = \
array.c \
awk.h \
awkgram.y \
builtin.c \
cint_array.c \
+ cmd.h \
+ command.y \
custom.h \
+ debug.c \
dfa.c \
dfa.h \
+ eval.c \
ext.c \
field.c \
floatcomp.c \
@@ -378,11 +371,13 @@ base_sources = \
getopt_int.h \
gettext.h \
int_array.c \
+ interpret.h \
io.c \
mbsupport.h \
main.c \
msg.c \
node.c \
+ profile.c \
protos.h \
random.c \
random.h \
@@ -395,13 +390,10 @@ base_sources = \
version.c \
xalloc.h
-gawk_SOURCES = $(base_sources) eval.c profile.c
-pgawk_SOURCES = $(base_sources) eval_p.c profile_p.c
-dgawk_SOURCES = $(base_sources) eval_d.c profile.c cmd.h command.y debug.c
+gawk_SOURCES = $(base_sources)
# Get extra libs as needed, Automake will supply LIBINTL and SOCKET_LIBS.
-LDADD = $(LIBSIGSEGV) $(LIBINTL) $(SOCKET_LIBS)
-dgawk_LDADD = $(LDADD) @LIBREADLINE@
+LDADD = $(LIBSIGSEGV) $(LIBINTL) $(SOCKET_LIBS) @LIBREADLINE@
# stuff for compiling gawk/pgawk
DEFPATH = '".$(PATH_SEPARATOR)$(pkgdatadir)"'
@@ -505,15 +497,9 @@ uninstall-binPROGRAMS:
clean-binPROGRAMS:
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
-dgawk$(EXEEXT): $(dgawk_OBJECTS) $(dgawk_DEPENDENCIES)
- @rm -f dgawk$(EXEEXT)
- $(LINK) $(dgawk_OBJECTS) $(dgawk_LDADD) $(LIBS)
gawk$(EXEEXT): $(gawk_OBJECTS) $(gawk_DEPENDENCIES)
@rm -f gawk$(EXEEXT)
$(LINK) $(gawk_OBJECTS) $(gawk_LDADD) $(LIBS)
-pgawk$(EXEEXT): $(pgawk_OBJECTS) $(pgawk_DEPENDENCIES)
- @rm -f pgawk$(EXEEXT)
- $(LINK) $(pgawk_OBJECTS) $(pgawk_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -529,8 +515,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dfa.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eval.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eval_d.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eval_p.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/field.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/floatcomp.Po@am__quote@
@@ -543,7 +527,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/node.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/profile.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/profile_p.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/random.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/re.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regex.Po@am__quote@
@@ -1017,7 +1000,6 @@ uninstall-am: uninstall-binPROGRAMS
# First, add a link from gawk to gawk-X.Y.Z.
-# Same for pgawk.
#
# For GNU systems where gawk is awk, add a link to awk.
# (This is done universally, which may not always be right, but
@@ -1025,7 +1007,6 @@ uninstall-am: uninstall-binPROGRAMS
install-exec-hook:
(cd $(DESTDIR)$(bindir); \
$(LN) gawk$(EXEEXT) gawk-$(VERSION)$(EXEEXT) 2>/dev/null ; \
- $(LN) pgawk$(EXEEXT) pgawk-$(VERSION)$(EXEEXT) 2>/dev/null ; \
if [ ! -f awk ]; \
then $(LN_S) gawk$(EXEEXT) awk; \
fi; exit 0)
@@ -1034,12 +1015,12 @@ install-exec-hook:
uninstall-links:
(cd $(DESTDIR)$(bindir); \
if [ -f awk ] && cmp awk gawk$(EXEEXT) > /dev/null; then rm -f awk; fi ; \
- rm -f gawk-$(VERSION)$(EXEEXT) pgawk-$(VERSION)$(EXEEXT); exit 0)
+ rm -f gawk-$(VERSION)$(EXEEXT); exit 0)
uninstall-recursive: uninstall-links
# force there to be a gawk executable before running tests
-check-local: gawk$(EXEEXT) pgawk$(EXEEXT)
+check-local: gawk$(EXEEXT)
# A little extra clean up when making distributions.
# And additional set up for the pc directory.
@@ -1054,6 +1035,7 @@ dist-hook:
# Special rules for individual files
# Use of awk instead of $(AWK) is deliberate, in case gawk doesn't build
# or work correctly.
+
awkgram.c: awkgram.y
$(YACC) $(AM_YFLAGS) $(YFLAGS) $<
sed 's/parse error/syntax error/g' < y.tab.c | awk -f $(srcdir)/bisonfix.awk awkgram > $*.c && rm y.tab.c
diff --git a/NEWS b/NEWS
index 0106f7ce..803c1d52 100644
--- a/NEWS
+++ b/NEWS
@@ -3,7 +3,29 @@
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.
+
+Changes from 4.0.1 to 4.1
+-------------------------
+1. The three executables gawk, pgawk, and dgawk, have been merged into
+ one, named just gawk. As a result:
+ * The -R option is gone
+ * Use -D to run the debugger. An optional file argument is a
+ list of commands to run first.
+ * Use -o to do pretty-printing only.
+ * Use -p to do profiling.
+
+2. The new -l option is used for loading dynamic extensions.
+Changes from 4.0.0 to 4.0.1
+---------------------------
+
+1. The default handling of backslash in sub() and gsub() has been reverted to
+ the behavior of 3.1. It was silly to think I could break compatibility that
+ way, even for standards compliance.
+
+XXX. Lots of minor bugs fixed and portability clean-ups along the way. See
+ the ChangeLog for details.
+
Changes from 3.1.8 to 4.0.0
---------------------------
diff --git a/README_d/README.bootstrap b/README_d/README.bootstrap
new file mode 100644
index 00000000..152bbefa
--- /dev/null
+++ b/README_d/README.bootstrap
@@ -0,0 +1,32 @@
+Tue Dec 6 21:33:19 IST 2011
+============================
+
+As documented in the mail below, if you are using a system without any
+version of awk installed, you will have bootstrapping problems (i.e., running
+configure). The solution is to install mawk or Brian Kernighan's awk
+first.
+
+Arnold Robbins
+------------------------------------
+From: Simon Josefsson <simon@josefsson.org>
+To: bug-gawk@gnu.org
+Date: Sat, 19 Nov 2011 15:24:22 +0100
+Message-ID: <87r514faw9.fsf@latte.josefsson.org>
+Subject: [bug-gawk] building gawk requires an awk?
+
+Hello,
+
+I was not able to build gawk 4.0.0 on a GNU/Hurd machine that didn't
+have any awk, the ./configure script failed at the end:
+
+config.status: creating Makefile
+./config.status: line 1169: awk: command not found
+config.status: error: could not create Makefile
+
+Is this a known bootstrapping issue? Same happened for 3.1.8. I looked
+in README but didn't find anything obvious.
+
+Btw, building 'mawk' first and then gawk 4.0.0 works. Running self
+checks didn't work because there is no 'cmp' on the system either...
+
+/Simon
diff --git a/array.c b/array.c
index 2a89a606..e3bdbf54 100644
--- a/array.c
+++ b/array.c
@@ -35,11 +35,22 @@ static size_t SUBSEPlen;
static char *SUBSEP;
static char indent_char[] = " ";
-static NODE **e_lookup(NODE *symbol, NODE *subs);
-static array_ptr empty_array_func[NUM_AFUNCS] = {
+static NODE **null_lookup(NODE *symbol, NODE *subs);
+static NODE **null_afunc(NODE *symbol, NODE *subs);
+static NODE **null_dump(NODE *symbol, NODE *subs);
+static array_ptr null_array_func[] = {
(array_ptr) 0,
(array_ptr) 0,
- e_lookup,
+ null_lookup,
+ null_afunc,
+ null_afunc,
+ null_afunc,
+ null_afunc,
+ null_afunc,
+ null_dump,
+#ifdef ARRAYDEBUG
+ null_afunc
+#endif
};
#define MAX_ATYPE 10
@@ -91,20 +102,20 @@ make_array()
getnode(array);
memset(array, '\0', sizeof(NODE));
array->type = Node_var_array;
- array->array_funcs = empty_array_func;
+ array->array_funcs = null_array_func;
/* vname, flags, and parent_array not set here */
return array;
}
-/* init_array --- initialize an array node */
+/* init_array --- (re)initialize an array node */
void
init_array(NODE *symbol)
{
symbol->type = Node_var_array;
- symbol->array_funcs = empty_array_func;
+ symbol->array_funcs = null_array_func;
symbol->buckets = NULL;
symbol->table_size = symbol->array_size = 0;
symbol->array_capacity = 0;
@@ -116,15 +127,15 @@ init_array(NODE *symbol)
}
-/* e_lookup: assign type to an empty array. */
+/* null_lookup: assign type to an empty array. */
static NODE **
-e_lookup(NODE *symbol, NODE *subs)
+null_lookup(NODE *symbol, NODE *subs)
{
int i;
array_ptr *afunc = NULL;
- assert(array_empty(symbol) == TRUE);
+ assert(symbol->table_size == 0);
/* Check which array type wants to accept this sub; traverse
* array type list in reverse order.
@@ -143,13 +154,21 @@ e_lookup(NODE *symbol, NODE *subs)
}
-/* assoc_clear --- flush all the values in symbol[] */
+/* null_afunc --- dummy function for an empty array */
-void
-assoc_clear(NODE *symbol)
+static NODE **
+null_afunc(NODE *symbol ATTRIBUTE_UNUSED, NODE *subs ATTRIBUTE_UNUSED)
{
- if (! array_empty(symbol))
- (void) symbol->aclear(symbol, NULL);
+ return NULL;
+}
+
+/* null_dump --- dump function for an empty array */
+
+static NODE **
+null_dump(NODE *symbol, NODE *subs ATTRIBUTE_UNUSED)
+{
+ fprintf(output_fp, "array `%s' is empty\n", array_vname(symbol));
+ return NULL;
}
@@ -162,24 +181,11 @@ r_in_array(NODE *symbol, NODE *subs)
{
NODE **ret;
- if (array_empty(symbol))
- return NULL;
ret = symbol->aexists(symbol, subs);
return (ret ? *ret : NULL);
}
-/* assoc_remove --- remove an index from symbol[] */
-
-int
-assoc_remove(NODE *symbol, NODE *subs)
-{
- if (array_empty(symbol))
- return FALSE;
- return (symbol->aremove(symbol, subs) != NULL);
-}
-
-
/* assoc_copy --- duplicate input array "symbol" */
NODE *
@@ -188,11 +194,9 @@ assoc_copy(NODE *symbol, NODE *newsymb)
assert(newsymb->vname != NULL);
assoc_clear(newsymb);
- if (! array_empty(symbol)) {
- (void) symbol->acopy(symbol, newsymb);
- newsymb->array_funcs = symbol->array_funcs;
- newsymb->flags = symbol->flags;
- }
+ (void) symbol->acopy(symbol, newsymb);
+ newsymb->array_funcs = symbol->array_funcs;
+ newsymb->flags = symbol->flags;
return newsymb;
}
@@ -202,9 +206,7 @@ assoc_copy(NODE *symbol, NODE *newsymb)
void
assoc_dump(NODE *symbol, NODE *ndump)
{
- if (array_empty(symbol))
- fprintf(output_fp, "array `%s' is empty\n", array_vname(symbol));
- else if (symbol->adump)
+ if (symbol->adump)
(void) symbol->adump(symbol, ndump);
}
@@ -806,7 +808,7 @@ asort_actual(int nargs, SORT_CTXT ctxt)
{
NODE *array, *dest = NULL, *result;
NODE *r, *subs, *s;
- NODE **list, **ptr;
+ NODE **list = NULL, **ptr;
unsigned long num_elems, i;
const char *sort_str;
@@ -855,18 +857,18 @@ asort_actual(int nargs, SORT_CTXT ctxt)
}
}
- if (array_empty(array)) {
- /* source array is empty */
- if (dest != NULL && dest != array)
- assoc_clear(dest);
- return make_number((AWKNUM) 0);
- }
num_elems = array->table_size;
-
- /* sorting happens inside assoc_list */
- list = assoc_list(array, sort_str, ctxt);
+ if (num_elems > 0) /* sorting happens inside assoc_list */
+ list = assoc_list(array, sort_str, ctxt);
DEREF(s);
+ if (num_elems == 0 || list == NULL) {
+ /* source array is empty */
+ if (dest != NULL && dest != array)
+ assoc_clear(dest);
+ return make_number((AWKNUM) 0);
+ }
+
/*
* Must not assoc_clear() the source array before constructing
* the output array. assoc_list() does not duplicate array values
@@ -1219,7 +1221,6 @@ sort_user_func(const void *p1, const void *p2)
NODE *idx1, *idx2, *val1, *val2;
AWKNUM ret;
INSTRUCTION *code;
- extern int exiting;
idx1 = *((NODE *const *) p1);
idx2 = *((NODE *const *) p2);
@@ -1242,10 +1243,7 @@ sort_user_func(const void *p1, const void *p2)
PUSH(val2);
/* execute the comparison function */
- (void) interpret(code);
-
- if (exiting) /* do not assume anything about the user-defined function! */
- gawk_exit(exit_val);
+ (void) (*interpret)(code);
/* return value of the comparison function */
POP_NUMBER(ret);
@@ -1293,7 +1291,8 @@ assoc_list(NODE *symbol, const char *sort_str, SORT_CTXT sort_ctxt)
int save_rule = 0;
num_elems = symbol->table_size;
- assert(num_elems > 0);
+ if (num_elems == 0)
+ return NULL;
elem_size = 1;
fl.flags = 0;
@@ -1346,9 +1345,9 @@ assoc_list(NODE *symbol, const char *sort_str, SORT_CTXT sort_ctxt)
(code + 1)->expr_count = 4; /* function takes 4 arguments */
code->nexti = bcalloc(Op_stop, 1, 0);
- /* make non-local jumps `next' and `nextfile' fatal in
+ /* make non-redirected getline, exit, `next' and `nextfile' fatal in
* callback function by setting currule in interpret()
- * to undefined (0). `exit' is handled in sort_user_func.
+ * to undefined (0).
*/
save_rule = currule; /* save current rule */
@@ -1359,8 +1358,8 @@ assoc_list(NODE *symbol, const char *sort_str, SORT_CTXT sort_ctxt)
list = symbol->alist(symbol, & fl);
- if (! cmp_func || (fl.flags & (AASC|ADESC)) != 0)
- return list; /* unsorted or list already sorted */
+ if (list == NULL || ! cmp_func || (fl.flags & (AASC|ADESC)) != 0)
+ return list; /* empty list or unsorted, or list already sorted */
qsort(list, num_elems, elem_size * sizeof(NODE *), cmp_func); /* shazzam! */
@@ -1371,9 +1370,7 @@ assoc_list(NODE *symbol, const char *sort_str, SORT_CTXT sort_ctxt)
bcfree(code); /* Op_func_call */
}
- if (sort_ctxt == SORTED_IN
- && (fl.flags & (AINDEX|AVALUE)) == (AINDEX|AVALUE)
- ) {
+ if (sort_ctxt == SORTED_IN && (fl.flags & (AINDEX|AVALUE)) == (AINDEX|AVALUE)) {
/* relocate all index nodes to the first half of the list. */
for (j = 1; j < num_elems; j++)
list[j] = list[2 * j];
diff --git a/awk.h b/awk.h
index 2bb325b6..72593902 100644
--- a/awk.h
+++ b/awk.h
@@ -76,6 +76,10 @@
extern int errno;
#endif
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#endif /* not STDC_HEADERS */
+
#include "mbsupport.h" /* defines MBS_SUPPORT */
#if MBS_SUPPORT
@@ -131,10 +135,6 @@ typedef int off_t;
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
#endif
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-#endif /* not STDC_HEADERS */
-
#include "protos.h"
#ifdef HAVE_STRING_H
@@ -407,7 +407,7 @@ typedef struct exp_node {
# define ARRAYMAXED 0x0800 /* array is at max size */
# define HALFHAT 0x1000 /* half-capacity Hashed Array Tree;
* See cint_array.c */
-# define XARRAY 0x2000 /* FIXME: Nuke */
+# define XARRAY 0x2000
} NODE;
#define vname sub.nodep.name
@@ -850,6 +850,11 @@ typedef struct iobuf {
ssize_t count; /* amount read last time */
size_t scanoff; /* where we were in the buffer when we had
to regrow/refill */
+ /*
+ * No argument prototype on read_func. See get_src_buf()
+ * in awkgram.y.
+ */
+ ssize_t (*read_func)();
void *opaque; /* private data for open hooks */
int (*get_record)(char **out, struct iobuf *, int *errcode);
@@ -862,7 +867,7 @@ typedef struct iobuf {
# define IOP_NOFREE_OBJ 2
# define IOP_AT_EOF 4
# define IOP_CLOSED 8
-# define IOP_AT_START 16
+# define IOP_AT_START 16
} IOBUF;
typedef void (*Func_ptr)(void);
@@ -901,8 +906,8 @@ typedef struct srcfile {
struct srcfile *next;
struct srcfile *prev;
- enum srctype { SRC_CMDLINE = 1, SRC_STDIN, SRC_FILE, SRC_INC } stype;
- char *src; /* name on command line or inclde statement */
+ enum srctype { SRC_CMDLINE = 1, SRC_STDIN, SRC_FILE, SRC_INC, SRC_EXTLIB } stype;
+ char *src; /* name on command line or include statement */
char *fullpath; /* full path after AWKPATH search */
time_t mtime;
struct stat sbuf;
@@ -990,6 +995,8 @@ extern NODE *Null_field;
extern NODE **fields_arr;
extern int sourceline;
extern char *source;
+extern int (*interpret)(INSTRUCTION *); /* interpreter routine */
+
#if __GNUC__ < 2
extern NODE *_t; /* used as temporary in macros */
@@ -1017,25 +1024,31 @@ extern int do_flags;
#define DO_NON_DEC_DATA 0x0040
/* allow {...,...} in regexps, see resetup() */
#define DO_INTERVALS 0x0080
-/* profile and pretty print the program */
-#define DO_PROFILING 0x0100
+/* pretty print the program */
+#define DO_PRETTY_PRINT 0x0100
/* dump all global variables at end */
#define DO_DUMP_VARS 0x0200
/* release vars when done */
#define DO_TIDY_MEM 0x0400
/* sandbox mode - disable 'system' function & redirections */
#define DO_SANDBOX 0x0800
+/* profile the program */
+#define DO_PROFILE 0x1000
+/* debug the program */
+#define DO_DEBUG 0x2000
#define do_traditional (do_flags & DO_TRADITIONAL)
-#define do_posix (do_flags & DO_POSIX)
-#define do_intl (do_flags & DO_INTL)
+#define do_posix (do_flags & DO_POSIX)
+#define do_intl (do_flags & DO_INTL)
#define do_non_decimal_data (do_flags & DO_NON_DEC_DATA)
#define do_intervals (do_flags & DO_INTERVALS)
-#define do_profiling (do_flags & DO_PROFILING)
+#define do_pretty_print (do_flags & DO_PRETTY_PRINT)
+#define do_profile (do_flags & DO_PROFILE)
#define do_dump_vars (do_flags & DO_DUMP_VARS)
#define do_tidy_mem (do_flags & DO_TIDY_MEM)
#define do_sandbox (do_flags & DO_SANDBOX)
+#define do_debug (do_flags & DO_DEBUG)
extern int do_optimize;
@@ -1073,17 +1086,10 @@ extern char envsep;
extern char casetable[]; /* for case-independent regexp matching */
-/*
- * Provide a way for code to know which program is executing:
- * gawk vs dgawk vs pgawk.
- */
-enum exe_mode { exe_normal = 1, exe_debugging, exe_profiling };
-extern enum exe_mode which_gawk; /* (defined in eval.c) */
-
/* ------------------------- Runtime stack -------------------------------- */
typedef union stack_item {
- NODE *rptr; /* variable etc. */
+ NODE *rptr; /* variable etc. */
NODE **lptr; /* address of a variable etc. */
} STACK_ITEM;
@@ -1232,13 +1238,8 @@ extern NODE *r_force_string(NODE *s);
#endif /* __GNUC__ */
#endif /* GAWKDEBUG */
-#define STREQ(a,b) (*(a) == *(b) && strcmp((a), (b)) == 0)
-#define STREQN(a,b,n) ((n) && *(a)== *(b) && \
- strncmp((a), (b), (size_t) (n)) == 0)
-
#define fatal set_loc(__FILE__, __LINE__), r_fatal
-
extern jmp_buf fatal_tag;
extern int fatal_tag_valid;
@@ -1246,15 +1247,21 @@ extern int fatal_tag_valid;
if (val++) \
memcpy((char *) (stack), (const char *) tag, sizeof(jmp_buf))
#define POP_BINDING(stack, tag, val) \
-if (--val) \
+if (--val) \
memcpy((char *) tag, (const char *) (stack), sizeof(jmp_buf))
#define array_empty(a) ((a)->table_size == 0)
#define assoc_lookup(a, s) (a)->alookup(a, s)
+/* assoc_clear --- flush all the values in symbol[] */
+#define assoc_clear(a) (void) ((a)->aclear(a, NULL))
+
+/* assoc_remove --- remove an index from symbol[] */
+#define assoc_remove(a, s) ((a)->aremove(a, s) != NULL)
+
+
#if __GNUC__ >= 2
-#define in_array(a, s) ({ NODE **_l; array_empty(a) ? NULL \
- : (_l = (a)->aexists(a, s), _l ? *_l : NULL); })
+#define in_array(a, s) ({ NODE **_l; _l = (a)->aexists(a, s); _l ? *_l : NULL; })
#else /* not __GNUC__ */
#define in_array(a, s) r_in_array(a, s)
#endif /* __GNUC__ */
@@ -1284,9 +1291,7 @@ extern void array_init(void);
extern int register_array_func(array_ptr *afunc);
extern void set_SUBSEP(void);
extern NODE *concat_exp(int nargs, int do_subsep);
-extern void assoc_clear(NODE *symbol);
extern NODE *r_in_array(NODE *symbol, NODE *subs);
-extern int assoc_remove(NODE *symbol, NODE *subs);
extern NODE *assoc_copy(NODE *symbol, NODE *newsymb);
extern void assoc_dump(NODE *symbol, NODE *p);
extern NODE **assoc_list(NODE *symbol, const char *sort_str, SORT_CTXT sort_ctxt);
@@ -1358,7 +1363,9 @@ extern int strncasecmpmbs(const unsigned char *,
/* eval.c */
extern void PUSH_CODE(INSTRUCTION *cp);
extern INSTRUCTION *POP_CODE(void);
-extern int interpret(INSTRUCTION *);
+extern void init_interpret(void);
+extern int r_interpret(INSTRUCTION *);
+extern int debug_interpret(INSTRUCTION *);
extern int cmp_nodes(NODE *p1, NODE *p2);
extern void set_IGNORECASE(void);
extern void set_OFS(void);
@@ -1384,11 +1391,10 @@ extern const char *opcode2str(OPCODE type);
extern const char *op2str(OPCODE type);
extern NODE **r_get_lhs(NODE *n, int reference);
extern STACK_ITEM *grow_stack(void);
-#ifdef PROFILING
extern void dump_fcall_stack(FILE *fp);
-#endif
/* ext.c */
NODE *do_ext(int nargs);
+NODE *load_ext(const char *lib_name, const char *init_func, NODE *obj);
#ifdef DYNAMIC
void make_builtin(const char *, NODE *(*)(int), int);
NODE *get_argument(int);
@@ -1433,6 +1439,7 @@ extern int ispath(const char *file);
extern int isdirpunct(int c);
/* io.c */
+extern void init_io(void);
extern void register_open_hook(void *(*open_func)(IOBUF *));
extern void set_FNR(void);
extern void set_NR(void);
@@ -1443,7 +1450,7 @@ extern int flush_io(void);
extern int close_io(int *stdio_problem);
extern int devopen(const char *name, const char *mode);
extern int srcopen(SRCFILE *s);
-extern char *find_source(const char *src, struct stat *stb, int *errcode);
+extern char *find_source(const char *src, struct stat *stb, int *errcode, int is_extlib);
extern NODE *do_getline_redir(int intovar, int redirtype);
extern NODE *do_getline(int intovar, IOBUF *iop);
extern struct redirect *getredirect(const char *str, int len);
diff --git a/awkgram.c b/awkgram.c
index 298e3a0b..24c102d4 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -173,6 +173,7 @@ extern int sourceline;
extern SRCFILE *srcfiles;
extern INSTRUCTION *rule_list;
extern int max_args;
+extern NODE **args_array;
static INSTRUCTION *rule_block[sizeof(ruletab)];
@@ -194,7 +195,7 @@ extern double fmod(double x, double y);
/* Line 268 of yacc.c */
-#line 198 "awkgram.c"
+#line 199 "awkgram.c"
/* Enabling traces. */
#ifndef YYDEBUG
@@ -340,7 +341,7 @@ typedef int YYSTYPE;
/* Line 343 of yacc.c */
-#line 344 "awkgram.c"
+#line 345 "awkgram.c"
#ifdef short
# undef short
@@ -702,25 +703,25 @@ static const yytype_int16 yyrhs[] =
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 191, 191, 193, 198, 199, 203, 215, 219, 230,
- 236, 244, 252, 254, 260, 261, 263, 289, 300, 311,
- 317, 326, 336, 338, 340, 346, 351, 352, 356, 375,
- 374, 408, 410, 415, 416, 429, 434, 435, 439, 441,
- 443, 450, 540, 582, 624, 737, 744, 751, 761, 770,
- 779, 788, 803, 819, 818, 842, 854, 854, 948, 948,
- 973, 996, 1002, 1003, 1009, 1010, 1017, 1022, 1034, 1048,
- 1050, 1056, 1061, 1063, 1071, 1073, 1082, 1083, 1091, 1096,
- 1096, 1107, 1111, 1119, 1120, 1123, 1125, 1130, 1131, 1140,
- 1141, 1146, 1151, 1157, 1159, 1161, 1168, 1169, 1175, 1176,
- 1181, 1183, 1188, 1190, 1192, 1194, 1200, 1207, 1209, 1211,
- 1227, 1237, 1244, 1246, 1251, 1253, 1255, 1263, 1265, 1270,
- 1272, 1277, 1279, 1281, 1331, 1333, 1335, 1337, 1339, 1341,
- 1343, 1345, 1368, 1373, 1378, 1403, 1409, 1411, 1413, 1415,
- 1417, 1419, 1424, 1428, 1459, 1461, 1467, 1473, 1486, 1487,
- 1488, 1493, 1498, 1502, 1506, 1519, 1532, 1537, 1573, 1591,
- 1592, 1598, 1599, 1604, 1606, 1613, 1630, 1647, 1649, 1656,
- 1661, 1669, 1679, 1691, 1700, 1704, 1708, 1712, 1716, 1720,
- 1723, 1725, 1729, 1733, 1737
+ 0, 192, 192, 194, 199, 200, 204, 216, 220, 231,
+ 237, 245, 253, 255, 261, 262, 264, 290, 301, 312,
+ 318, 327, 337, 339, 341, 347, 352, 353, 357, 376,
+ 375, 409, 411, 416, 417, 430, 435, 436, 440, 442,
+ 444, 451, 541, 583, 625, 738, 745, 752, 762, 771,
+ 780, 789, 804, 820, 819, 843, 855, 855, 949, 949,
+ 974, 997, 1003, 1004, 1010, 1011, 1018, 1023, 1035, 1049,
+ 1051, 1057, 1062, 1064, 1072, 1074, 1083, 1084, 1092, 1097,
+ 1097, 1108, 1112, 1120, 1121, 1124, 1126, 1131, 1132, 1141,
+ 1142, 1147, 1152, 1158, 1160, 1162, 1169, 1170, 1176, 1177,
+ 1182, 1184, 1189, 1191, 1193, 1195, 1201, 1208, 1210, 1212,
+ 1228, 1238, 1245, 1247, 1252, 1254, 1256, 1264, 1266, 1271,
+ 1273, 1278, 1280, 1282, 1332, 1334, 1336, 1338, 1340, 1342,
+ 1344, 1346, 1369, 1374, 1379, 1404, 1410, 1412, 1414, 1416,
+ 1418, 1420, 1425, 1429, 1460, 1462, 1468, 1474, 1487, 1488,
+ 1489, 1494, 1499, 1503, 1507, 1520, 1533, 1538, 1574, 1592,
+ 1593, 1599, 1600, 1605, 1607, 1614, 1631, 1648, 1650, 1657,
+ 1662, 1670, 1680, 1692, 1701, 1705, 1709, 1713, 1717, 1721,
+ 1724, 1726, 1730, 1734, 1738
};
#endif
@@ -2038,8 +2039,8 @@ yyreduce:
{
case 3:
-/* Line 1821 of yacc.c */
-#line 194 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 195 "awkgram.y"
{
rule = 0;
yyerrok;
@@ -2048,8 +2049,8 @@ yyreduce:
case 5:
-/* Line 1821 of yacc.c */
-#line 200 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 201 "awkgram.y"
{
next_sourcefile();
}
@@ -2057,8 +2058,8 @@ yyreduce:
case 6:
-/* Line 1821 of yacc.c */
-#line 204 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 205 "awkgram.y"
{
rule = 0;
/*
@@ -2071,8 +2072,8 @@ yyreduce:
case 7:
-/* Line 1821 of yacc.c */
-#line 216 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 217 "awkgram.y"
{
(void) append_rule((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]));
}
@@ -2080,8 +2081,8 @@ yyreduce:
case 8:
-/* Line 1821 of yacc.c */
-#line 220 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 221 "awkgram.y"
{
if (rule != Rule) {
msg(_("%s blocks must have an action part"), ruletab[rule]);
@@ -2096,8 +2097,8 @@ yyreduce:
case 9:
-/* Line 1821 of yacc.c */
-#line 231 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 232 "awkgram.y"
{
in_function = NULL;
(void) mk_function((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]));
@@ -2107,8 +2108,8 @@ yyreduce:
case 10:
-/* Line 1821 of yacc.c */
-#line 237 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 238 "awkgram.y"
{
want_source = FALSE;
yyerrok;
@@ -2117,8 +2118,8 @@ yyreduce:
case 11:
-/* Line 1821 of yacc.c */
-#line 245 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 246 "awkgram.y"
{
if (include_source((yyvsp[(1) - (1)])) < 0)
YYABORT;
@@ -2130,36 +2131,36 @@ yyreduce:
case 12:
-/* Line 1821 of yacc.c */
-#line 253 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 254 "awkgram.y"
{ (yyval) = NULL; }
break;
case 13:
-/* Line 1821 of yacc.c */
-#line 255 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 256 "awkgram.y"
{ (yyval) = NULL; }
break;
case 14:
-/* Line 1821 of yacc.c */
-#line 260 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 261 "awkgram.y"
{ (yyval) = NULL; rule = Rule; }
break;
case 15:
-/* Line 1821 of yacc.c */
-#line 262 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 263 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); rule = Rule; }
break;
case 16:
-/* Line 1821 of yacc.c */
-#line 264 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 265 "awkgram.y"
{
INSTRUCTION *tp;
@@ -2167,7 +2168,7 @@ yyreduce:
add_lint((yyvsp[(4) - (4)]), LINT_assign_in_cond);
tp = instruction(Op_no_op);
- list_prepend((yyvsp[(1) - (4)]), bcalloc(Op_line_range, !!do_profiling + 1, 0));
+ list_prepend((yyvsp[(1) - (4)]), bcalloc(Op_line_range, !!do_pretty_print + 1, 0));
(yyvsp[(1) - (4)])->nexti->triggered = FALSE;
(yyvsp[(1) - (4)])->nexti->target_jmp = (yyvsp[(4) - (4)])->nexti;
@@ -2178,7 +2179,7 @@ yyreduce:
list_append((yyvsp[(4) - (4)]), instruction(Op_cond_pair));
(yyvsp[(4) - (4)])->lasti->line_range = (yyvsp[(1) - (4)])->nexti;
(yyvsp[(4) - (4)])->lasti->target_jmp = tp;
- if (do_profiling) {
+ if (do_pretty_print) {
((yyvsp[(1) - (4)])->nexti + 1)->condpair_left = (yyvsp[(1) - (4)])->lasti;
((yyvsp[(1) - (4)])->nexti + 1)->condpair_right = (yyvsp[(4) - (4)])->lasti;
}
@@ -2189,8 +2190,8 @@ yyreduce:
case 17:
-/* Line 1821 of yacc.c */
-#line 290 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 291 "awkgram.y"
{
static int begin_seen = 0;
if (do_lint_old && ++begin_seen == 2)
@@ -2205,8 +2206,8 @@ yyreduce:
case 18:
-/* Line 1821 of yacc.c */
-#line 301 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 302 "awkgram.y"
{
static int end_seen = 0;
if (do_lint_old && ++end_seen == 2)
@@ -2221,8 +2222,8 @@ yyreduce:
case 19:
-/* Line 1821 of yacc.c */
-#line 312 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 313 "awkgram.y"
{
(yyvsp[(1) - (1)])->in_rule = rule = BEGINFILE;
(yyvsp[(1) - (1)])->source_file = source;
@@ -2232,8 +2233,8 @@ yyreduce:
case 20:
-/* Line 1821 of yacc.c */
-#line 318 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 319 "awkgram.y"
{
(yyvsp[(1) - (1)])->in_rule = rule = ENDFILE;
(yyvsp[(1) - (1)])->source_file = source;
@@ -2243,8 +2244,8 @@ yyreduce:
case 21:
-/* Line 1821 of yacc.c */
-#line 327 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 328 "awkgram.y"
{
if ((yyvsp[(2) - (5)]) == NULL)
(yyval) = list_create(instruction(Op_no_op));
@@ -2255,22 +2256,22 @@ yyreduce:
case 22:
-/* Line 1821 of yacc.c */
-#line 337 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 338 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 23:
-/* Line 1821 of yacc.c */
-#line 339 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 340 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 24:
-/* Line 1821 of yacc.c */
-#line 341 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 342 "awkgram.y"
{
yyerror(_("`%s' is a built-in function, it cannot be redefined"),
tokstart);
@@ -2280,15 +2281,15 @@ yyreduce:
case 25:
-/* Line 1821 of yacc.c */
-#line 347 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 348 "awkgram.y"
{ (yyval) = (yyvsp[(2) - (2)]); }
break;
case 28:
-/* Line 1821 of yacc.c */
-#line 357 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 358 "awkgram.y"
{
(yyvsp[(1) - (6)])->source_file = source;
if (install_function((yyvsp[(2) - (6)])->lextok, (yyvsp[(1) - (6)]), (yyvsp[(4) - (6)])) < 0)
@@ -2303,15 +2304,15 @@ yyreduce:
case 29:
-/* Line 1821 of yacc.c */
-#line 375 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 376 "awkgram.y"
{ ++want_regexp; }
break;
case 30:
-/* Line 1821 of yacc.c */
-#line 377 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 378 "awkgram.y"
{
NODE *n, *exp;
char *re;
@@ -2344,22 +2345,22 @@ yyreduce:
case 31:
-/* Line 1821 of yacc.c */
-#line 409 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 410 "awkgram.y"
{ bcfree((yyvsp[(1) - (1)])); }
break;
case 33:
-/* Line 1821 of yacc.c */
-#line 415 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 416 "awkgram.y"
{ (yyval) = NULL; }
break;
case 34:
-/* Line 1821 of yacc.c */
-#line 417 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 418 "awkgram.y"
{
if ((yyvsp[(2) - (2)]) == NULL)
(yyval) = (yyvsp[(1) - (2)]);
@@ -2376,31 +2377,31 @@ yyreduce:
case 35:
-/* Line 1821 of yacc.c */
-#line 430 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 431 "awkgram.y"
{ (yyval) = NULL; }
break;
case 38:
-/* Line 1821 of yacc.c */
-#line 440 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 441 "awkgram.y"
{ (yyval) = NULL; }
break;
case 39:
-/* Line 1821 of yacc.c */
-#line 442 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 443 "awkgram.y"
{ (yyval) = (yyvsp[(2) - (3)]); }
break;
case 40:
-/* Line 1821 of yacc.c */
-#line 444 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 445 "awkgram.y"
{
- if (do_profiling)
+ if (do_pretty_print)
(yyval) = list_prepend((yyvsp[(1) - (1)]), instruction(Op_exec_count));
else
(yyval) = (yyvsp[(1) - (1)]);
@@ -2409,8 +2410,8 @@ yyreduce:
case 41:
-/* Line 1821 of yacc.c */
-#line 451 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 452 "awkgram.y"
{
INSTRUCTION *dflt, *curr = NULL, *cexp, *cstmt;
INSTRUCTION *ip, *nextc, *tbreak;
@@ -2469,7 +2470,7 @@ yyreduce:
else
dflt->target_jmp = casestmt->nexti;
- if (do_profiling) {
+ if (do_pretty_print) {
curr->stmt_start = casestmt->nexti;
curr->stmt_end = casestmt->lasti;
(void) list_prepend(cexp, curr);
@@ -2484,7 +2485,7 @@ yyreduce:
efree(case_values);
ip = (yyvsp[(3) - (9)]);
- if (do_profiling) {
+ if (do_pretty_print) {
(void) list_prepend(ip, (yyvsp[(1) - (9)]));
(void) list_prepend(ip, instruction(Op_exec_count));
(yyvsp[(1) - (9)])->target_break = tbreak;
@@ -2504,8 +2505,8 @@ yyreduce:
case 42:
-/* Line 1821 of yacc.c */
-#line 541 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 542 "awkgram.y"
{
/*
* -----------------
@@ -2528,7 +2529,7 @@ yyreduce:
ip = list_append((yyvsp[(3) - (6)]), instruction(Op_jmp_false));
ip->lasti->target_jmp = tbreak;
- if (do_profiling) {
+ if (do_pretty_print) {
(void) list_append(ip, instruction(Op_exec_count));
(yyvsp[(1) - (6)])->target_break = tbreak;
(yyvsp[(1) - (6)])->target_continue = tcont;
@@ -2551,8 +2552,8 @@ yyreduce:
case 43:
-/* Line 1821 of yacc.c */
-#line 583 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 584 "awkgram.y"
{
/*
* -----------------
@@ -2575,7 +2576,7 @@ yyreduce:
ip = list_merge((yyvsp[(3) - (8)]), (yyvsp[(6) - (8)]));
else
ip = list_prepend((yyvsp[(6) - (8)]), instruction(Op_no_op));
- if (do_profiling)
+ if (do_pretty_print)
(void) list_prepend(ip, instruction(Op_exec_count));
(void) list_append(ip, instruction(Op_jmp_true));
ip->lasti->target_jmp = ip->nexti;
@@ -2585,7 +2586,7 @@ yyreduce:
continue_allowed--;
fix_break_continue(ip, tbreak, tcont);
- if (do_profiling) {
+ if (do_pretty_print) {
(yyvsp[(1) - (8)])->target_break = tbreak;
(yyvsp[(1) - (8)])->target_continue = tcont;
((yyvsp[(1) - (8)]) + 1)->doloop_cond = tcont;
@@ -2598,8 +2599,8 @@ yyreduce:
case 44:
-/* Line 1821 of yacc.c */
-#line 625 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 626 "awkgram.y"
{
INSTRUCTION *ip;
char *var_name = (yyvsp[(3) - (8)])->lextok;
@@ -2673,7 +2674,7 @@ regular_loop:
(yyvsp[(3) - (8)])->target_jmp = tbreak;
(void) list_append(ip, (yyvsp[(3) - (8)]));
- if (do_profiling) {
+ if (do_pretty_print) {
(yyvsp[(1) - (8)])->opcode = Op_K_arrayfor;
(yyvsp[(1) - (8)])->target_continue = tcont;
(yyvsp[(1) - (8)])->target_break = tbreak;
@@ -2694,7 +2695,7 @@ regular_loop:
ip->lasti->assign_var = (yyvsp[(4) - (8)])->array_var->var_assign;
}
- if (do_profiling) {
+ if (do_pretty_print) {
(void) list_append(ip, instruction(Op_exec_count));
((yyvsp[(1) - (8)]) + 1)->forloop_cond = (yyvsp[(4) - (8)]);
((yyvsp[(1) - (8)]) + 1)->forloop_body = ip->lasti;
@@ -2716,8 +2717,8 @@ regular_loop:
case 45:
-/* Line 1821 of yacc.c */
-#line 738 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 739 "awkgram.y"
{
(yyval) = mk_for_loop((yyvsp[(1) - (12)]), (yyvsp[(3) - (12)]), (yyvsp[(6) - (12)]), (yyvsp[(9) - (12)]), (yyvsp[(12) - (12)]));
@@ -2728,8 +2729,8 @@ regular_loop:
case 46:
-/* Line 1821 of yacc.c */
-#line 745 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 746 "awkgram.y"
{
(yyval) = mk_for_loop((yyvsp[(1) - (11)]), (yyvsp[(3) - (11)]), (INSTRUCTION *) NULL, (yyvsp[(8) - (11)]), (yyvsp[(11) - (11)]));
@@ -2740,10 +2741,10 @@ regular_loop:
case 47:
-/* Line 1821 of yacc.c */
-#line 752 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 753 "awkgram.y"
{
- if (do_profiling)
+ if (do_pretty_print)
(yyval) = list_prepend((yyvsp[(1) - (1)]), instruction(Op_exec_count));
else
(yyval) = (yyvsp[(1) - (1)]);
@@ -2752,8 +2753,8 @@ regular_loop:
case 48:
-/* Line 1821 of yacc.c */
-#line 762 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 763 "awkgram.y"
{
if (! break_allowed)
error_ln((yyvsp[(1) - (2)])->source_line,
@@ -2766,8 +2767,8 @@ regular_loop:
case 49:
-/* Line 1821 of yacc.c */
-#line 771 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 772 "awkgram.y"
{
if (! continue_allowed)
error_ln((yyvsp[(1) - (2)])->source_line,
@@ -2780,8 +2781,8 @@ regular_loop:
case 50:
-/* Line 1821 of yacc.c */
-#line 780 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 781 "awkgram.y"
{
/* if inside function (rule = 0), resolve context at run-time */
if (rule && rule != Rule)
@@ -2794,8 +2795,8 @@ regular_loop:
case 51:
-/* Line 1821 of yacc.c */
-#line 789 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 790 "awkgram.y"
{
if (do_traditional)
error_ln((yyvsp[(1) - (2)])->source_line,
@@ -2814,8 +2815,8 @@ regular_loop:
case 52:
-/* Line 1821 of yacc.c */
-#line 804 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 805 "awkgram.y"
{
/* Initialize the two possible jump targets, the actual target
* is resolved at run-time.
@@ -2834,8 +2835,8 @@ regular_loop:
case 53:
-/* Line 1821 of yacc.c */
-#line 819 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 820 "awkgram.y"
{
if (! in_function)
yyerror(_("`return' used outside function context"));
@@ -2844,8 +2845,8 @@ regular_loop:
case 54:
-/* Line 1821 of yacc.c */
-#line 822 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 823 "awkgram.y"
{
if ((yyvsp[(3) - (4)]) == NULL) {
(yyval) = list_create((yyvsp[(1) - (4)]));
@@ -2854,7 +2855,7 @@ regular_loop:
} else {
if (do_optimize > 1
&& (yyvsp[(3) - (4)])->lasti->opcode == Op_func_call
- && STREQ((yyvsp[(3) - (4)])->lasti->func_name, in_function)
+ && strcmp((yyvsp[(3) - (4)])->lasti->func_name, in_function) == 0
) {
/* Do tail recursion optimization. Tail
* call without a return value is recognized
@@ -2870,15 +2871,15 @@ regular_loop:
case 56:
-/* Line 1821 of yacc.c */
-#line 854 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 855 "awkgram.y"
{ in_print = TRUE; in_parens = 0; }
break;
case 57:
-/* Line 1821 of yacc.c */
-#line 855 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 856 "awkgram.y"
{
/*
* Optimization: plain `print' has no expression list, so $3 is null.
@@ -2975,15 +2976,15 @@ regular_loop:
case 58:
-/* Line 1821 of yacc.c */
-#line 948 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 949 "awkgram.y"
{ sub_counter = 0; }
break;
case 59:
-/* Line 1821 of yacc.c */
-#line 949 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 950 "awkgram.y"
{
char *arr = (yyvsp[(2) - (4)])->lextok;
@@ -3012,8 +3013,8 @@ regular_loop:
case 60:
-/* Line 1821 of yacc.c */
-#line 978 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 979 "awkgram.y"
{
static short warned = FALSE;
char *arr = (yyvsp[(3) - (4)])->lextok;
@@ -3036,36 +3037,36 @@ regular_loop:
case 61:
-/* Line 1821 of yacc.c */
-#line 997 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 998 "awkgram.y"
{ (yyval) = optimize_assignment((yyvsp[(1) - (1)])); }
break;
case 62:
-/* Line 1821 of yacc.c */
-#line 1002 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1003 "awkgram.y"
{ (yyval) = NULL; }
break;
case 63:
-/* Line 1821 of yacc.c */
-#line 1004 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1005 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 64:
-/* Line 1821 of yacc.c */
-#line 1009 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1010 "awkgram.y"
{ (yyval) = NULL; }
break;
case 65:
-/* Line 1821 of yacc.c */
-#line 1011 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1012 "awkgram.y"
{
if ((yyvsp[(1) - (2)]) == NULL)
(yyval) = list_create((yyvsp[(2) - (2)]));
@@ -3076,20 +3077,20 @@ regular_loop:
case 66:
-/* Line 1821 of yacc.c */
-#line 1018 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1019 "awkgram.y"
{ (yyval) = NULL; }
break;
case 67:
-/* Line 1821 of yacc.c */
-#line 1023 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1024 "awkgram.y"
{
INSTRUCTION *casestmt = (yyvsp[(5) - (5)]);
if ((yyvsp[(5) - (5)]) == NULL)
casestmt = list_create(instruction(Op_no_op));
- if (do_profiling)
+ if (do_pretty_print)
(void) list_prepend(casestmt, instruction(Op_exec_count));
(yyvsp[(1) - (5)])->case_exp = (yyvsp[(2) - (5)]);
(yyvsp[(1) - (5)])->case_stmt = casestmt;
@@ -3100,13 +3101,13 @@ regular_loop:
case 68:
-/* Line 1821 of yacc.c */
-#line 1035 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1036 "awkgram.y"
{
INSTRUCTION *casestmt = (yyvsp[(4) - (4)]);
if ((yyvsp[(4) - (4)]) == NULL)
casestmt = list_create(instruction(Op_no_op));
- if (do_profiling)
+ if (do_pretty_print)
(void) list_prepend(casestmt, instruction(Op_exec_count));
bcfree((yyvsp[(2) - (4)]));
(yyvsp[(1) - (4)])->case_stmt = casestmt;
@@ -3116,15 +3117,15 @@ regular_loop:
case 69:
-/* Line 1821 of yacc.c */
-#line 1049 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1050 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 70:
-/* Line 1821 of yacc.c */
-#line 1051 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1052 "awkgram.y"
{
(yyvsp[(2) - (2)])->memory->numbr = -(force_number((yyvsp[(2) - (2)])->memory));
bcfree((yyvsp[(1) - (2)]));
@@ -3134,8 +3135,8 @@ regular_loop:
case 71:
-/* Line 1821 of yacc.c */
-#line 1057 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1058 "awkgram.y"
{
bcfree((yyvsp[(1) - (2)]));
(yyval) = (yyvsp[(2) - (2)]);
@@ -3144,15 +3145,15 @@ regular_loop:
case 72:
-/* Line 1821 of yacc.c */
-#line 1062 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1063 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 73:
-/* Line 1821 of yacc.c */
-#line 1064 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1065 "awkgram.y"
{
(yyvsp[(1) - (1)])->opcode = Op_push_re;
(yyval) = (yyvsp[(1) - (1)]);
@@ -3161,22 +3162,22 @@ regular_loop:
case 74:
-/* Line 1821 of yacc.c */
-#line 1072 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1073 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 75:
-/* Line 1821 of yacc.c */
-#line 1074 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1075 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 77:
-/* Line 1821 of yacc.c */
-#line 1084 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1085 "awkgram.y"
{
(yyval) = (yyvsp[(2) - (3)]);
}
@@ -3184,8 +3185,8 @@ regular_loop:
case 78:
-/* Line 1821 of yacc.c */
-#line 1091 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1092 "awkgram.y"
{
in_print = FALSE;
in_parens = 0;
@@ -3195,15 +3196,15 @@ regular_loop:
case 79:
-/* Line 1821 of yacc.c */
-#line 1096 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1097 "awkgram.y"
{ in_print = FALSE; in_parens = 0; }
break;
case 80:
-/* Line 1821 of yacc.c */
-#line 1097 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1098 "awkgram.y"
{
if ((yyvsp[(1) - (3)])->redir_type == redirect_twoway
&& (yyvsp[(3) - (3)])->lasti->opcode == Op_K_getline_redir
@@ -3215,8 +3216,8 @@ regular_loop:
case 81:
-/* Line 1821 of yacc.c */
-#line 1108 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1109 "awkgram.y"
{
(yyval) = mk_condition((yyvsp[(3) - (6)]), (yyvsp[(1) - (6)]), (yyvsp[(6) - (6)]), NULL, NULL);
}
@@ -3224,8 +3225,8 @@ regular_loop:
case 82:
-/* Line 1821 of yacc.c */
-#line 1113 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1114 "awkgram.y"
{
(yyval) = mk_condition((yyvsp[(3) - (9)]), (yyvsp[(1) - (9)]), (yyvsp[(6) - (9)]), (yyvsp[(7) - (9)]), (yyvsp[(9) - (9)]));
}
@@ -3233,15 +3234,15 @@ regular_loop:
case 87:
-/* Line 1821 of yacc.c */
-#line 1130 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1131 "awkgram.y"
{ (yyval) = NULL; }
break;
case 88:
-/* Line 1821 of yacc.c */
-#line 1132 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1133 "awkgram.y"
{
bcfree((yyvsp[(1) - (2)]));
(yyval) = (yyvsp[(2) - (2)]);
@@ -3250,22 +3251,22 @@ regular_loop:
case 89:
-/* Line 1821 of yacc.c */
-#line 1140 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1141 "awkgram.y"
{ (yyval) = NULL; }
break;
case 90:
-/* Line 1821 of yacc.c */
-#line 1142 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1143 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]) ; }
break;
case 91:
-/* Line 1821 of yacc.c */
-#line 1147 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1148 "awkgram.y"
{
(yyvsp[(1) - (1)])->param_count = 0;
(yyval) = list_create((yyvsp[(1) - (1)]));
@@ -3274,8 +3275,8 @@ regular_loop:
case 92:
-/* Line 1821 of yacc.c */
-#line 1152 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1153 "awkgram.y"
{
(yyvsp[(3) - (3)])->param_count = (yyvsp[(1) - (3)])->lasti->param_count + 1;
(yyval) = list_append((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]));
@@ -3285,64 +3286,64 @@ regular_loop:
case 93:
-/* Line 1821 of yacc.c */
-#line 1158 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1159 "awkgram.y"
{ (yyval) = NULL; }
break;
case 94:
-/* Line 1821 of yacc.c */
-#line 1160 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1161 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (2)]); }
break;
case 95:
-/* Line 1821 of yacc.c */
-#line 1162 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1163 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (3)]); }
break;
case 96:
-/* Line 1821 of yacc.c */
-#line 1168 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1169 "awkgram.y"
{ (yyval) = NULL; }
break;
case 97:
-/* Line 1821 of yacc.c */
-#line 1170 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1171 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 98:
-/* Line 1821 of yacc.c */
-#line 1175 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1176 "awkgram.y"
{ (yyval) = NULL; }
break;
case 99:
-/* Line 1821 of yacc.c */
-#line 1177 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1178 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 100:
-/* Line 1821 of yacc.c */
-#line 1182 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1183 "awkgram.y"
{ (yyval) = mk_expression_list(NULL, (yyvsp[(1) - (1)])); }
break;
case 101:
-/* Line 1821 of yacc.c */
-#line 1184 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1185 "awkgram.y"
{
(yyval) = mk_expression_list((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]));
yyerrok;
@@ -3351,36 +3352,36 @@ regular_loop:
case 102:
-/* Line 1821 of yacc.c */
-#line 1189 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1190 "awkgram.y"
{ (yyval) = NULL; }
break;
case 103:
-/* Line 1821 of yacc.c */
-#line 1191 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1192 "awkgram.y"
{ (yyval) = NULL; }
break;
case 104:
-/* Line 1821 of yacc.c */
-#line 1193 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1194 "awkgram.y"
{ (yyval) = NULL; }
break;
case 105:
-/* Line 1821 of yacc.c */
-#line 1195 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1196 "awkgram.y"
{ (yyval) = NULL; }
break;
case 106:
-/* Line 1821 of yacc.c */
-#line 1201 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1202 "awkgram.y"
{
if (do_lint && (yyvsp[(3) - (3)])->lasti->opcode == Op_match_rec)
lintwarn_ln((yyvsp[(2) - (3)])->source_line,
@@ -3391,22 +3392,22 @@ regular_loop:
case 107:
-/* Line 1821 of yacc.c */
-#line 1208 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1209 "awkgram.y"
{ (yyval) = mk_boolean((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
case 108:
-/* Line 1821 of yacc.c */
-#line 1210 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1211 "awkgram.y"
{ (yyval) = mk_boolean((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
case 109:
-/* Line 1821 of yacc.c */
-#line 1212 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1213 "awkgram.y"
{
if ((yyvsp[(1) - (3)])->lasti->opcode == Op_match_rec)
warning_ln((yyvsp[(2) - (3)])->source_line,
@@ -3426,8 +3427,8 @@ regular_loop:
case 110:
-/* Line 1821 of yacc.c */
-#line 1228 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1229 "awkgram.y"
{
if (do_lint_old)
warning_ln((yyvsp[(2) - (3)])->source_line,
@@ -3441,8 +3442,8 @@ regular_loop:
case 111:
-/* Line 1821 of yacc.c */
-#line 1238 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1239 "awkgram.y"
{
if (do_lint && (yyvsp[(3) - (3)])->lasti->opcode == Op_match_rec)
lintwarn_ln((yyvsp[(2) - (3)])->source_line,
@@ -3453,36 +3454,36 @@ regular_loop:
case 112:
-/* Line 1821 of yacc.c */
-#line 1245 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1246 "awkgram.y"
{ (yyval) = mk_condition((yyvsp[(1) - (5)]), (yyvsp[(2) - (5)]), (yyvsp[(3) - (5)]), (yyvsp[(4) - (5)]), (yyvsp[(5) - (5)])); }
break;
case 113:
-/* Line 1821 of yacc.c */
-#line 1247 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1248 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 114:
-/* Line 1821 of yacc.c */
-#line 1252 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1253 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 115:
-/* Line 1821 of yacc.c */
-#line 1254 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1255 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 116:
-/* Line 1821 of yacc.c */
-#line 1256 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1257 "awkgram.y"
{
(yyvsp[(2) - (2)])->opcode = Op_assign_quotient;
(yyval) = (yyvsp[(2) - (2)]);
@@ -3491,50 +3492,50 @@ regular_loop:
case 117:
-/* Line 1821 of yacc.c */
-#line 1264 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1265 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 118:
-/* Line 1821 of yacc.c */
-#line 1266 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1267 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 119:
-/* Line 1821 of yacc.c */
-#line 1271 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1272 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 120:
-/* Line 1821 of yacc.c */
-#line 1273 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1274 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 121:
-/* Line 1821 of yacc.c */
-#line 1278 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1279 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 122:
-/* Line 1821 of yacc.c */
-#line 1280 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1281 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 123:
-/* Line 1821 of yacc.c */
-#line 1282 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1283 "awkgram.y"
{
int count = 2;
int is_simple_var = FALSE;
@@ -3585,50 +3586,50 @@ regular_loop:
case 125:
-/* Line 1821 of yacc.c */
-#line 1334 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1335 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
case 126:
-/* Line 1821 of yacc.c */
-#line 1336 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1337 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
case 127:
-/* Line 1821 of yacc.c */
-#line 1338 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1339 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
case 128:
-/* Line 1821 of yacc.c */
-#line 1340 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1341 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
case 129:
-/* Line 1821 of yacc.c */
-#line 1342 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1343 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
case 130:
-/* Line 1821 of yacc.c */
-#line 1344 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1345 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
case 131:
-/* Line 1821 of yacc.c */
-#line 1346 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1347 "awkgram.y"
{
/*
* In BEGINFILE/ENDFILE, allow `getline var < file'
@@ -3655,8 +3656,8 @@ regular_loop:
case 132:
-/* Line 1821 of yacc.c */
-#line 1369 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1370 "awkgram.y"
{
(yyvsp[(2) - (2)])->opcode = Op_postincrement;
(yyval) = mk_assignment((yyvsp[(1) - (2)]), NULL, (yyvsp[(2) - (2)]));
@@ -3665,8 +3666,8 @@ regular_loop:
case 133:
-/* Line 1821 of yacc.c */
-#line 1374 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1375 "awkgram.y"
{
(yyvsp[(2) - (2)])->opcode = Op_postdecrement;
(yyval) = mk_assignment((yyvsp[(1) - (2)]), NULL, (yyvsp[(2) - (2)]));
@@ -3675,8 +3676,8 @@ regular_loop:
case 134:
-/* Line 1821 of yacc.c */
-#line 1379 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1380 "awkgram.y"
{
if (do_lint_old) {
warning_ln((yyvsp[(4) - (5)])->source_line,
@@ -3700,8 +3701,8 @@ regular_loop:
case 135:
-/* Line 1821 of yacc.c */
-#line 1404 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1405 "awkgram.y"
{
(yyval) = mk_getline((yyvsp[(3) - (4)]), (yyvsp[(4) - (4)]), (yyvsp[(1) - (4)]), (yyvsp[(2) - (4)])->redir_type);
bcfree((yyvsp[(2) - (4)]));
@@ -3710,50 +3711,50 @@ regular_loop:
case 136:
-/* Line 1821 of yacc.c */
-#line 1410 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1411 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
case 137:
-/* Line 1821 of yacc.c */
-#line 1412 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1413 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
case 138:
-/* Line 1821 of yacc.c */
-#line 1414 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1415 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
case 139:
-/* Line 1821 of yacc.c */
-#line 1416 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1417 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
case 140:
-/* Line 1821 of yacc.c */
-#line 1418 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1419 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
case 141:
-/* Line 1821 of yacc.c */
-#line 1420 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1421 "awkgram.y"
{ (yyval) = mk_binary((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]), (yyvsp[(2) - (3)])); }
break;
case 142:
-/* Line 1821 of yacc.c */
-#line 1425 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1426 "awkgram.y"
{
(yyval) = list_create((yyvsp[(1) - (1)]));
}
@@ -3761,8 +3762,8 @@ regular_loop:
case 143:
-/* Line 1821 of yacc.c */
-#line 1429 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1430 "awkgram.y"
{
if ((yyvsp[(2) - (2)])->opcode == Op_match_rec) {
(yyvsp[(2) - (2)])->opcode = Op_nomatch;
@@ -3797,15 +3798,15 @@ regular_loop:
case 144:
-/* Line 1821 of yacc.c */
-#line 1460 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1461 "awkgram.y"
{ (yyval) = (yyvsp[(2) - (3)]); }
break;
case 145:
-/* Line 1821 of yacc.c */
-#line 1462 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1463 "awkgram.y"
{
(yyval) = snode((yyvsp[(3) - (4)]), (yyvsp[(1) - (4)]));
if ((yyval) == NULL)
@@ -3815,8 +3816,8 @@ regular_loop:
case 146:
-/* Line 1821 of yacc.c */
-#line 1468 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1469 "awkgram.y"
{
(yyval) = snode((yyvsp[(3) - (4)]), (yyvsp[(1) - (4)]));
if ((yyval) == NULL)
@@ -3826,8 +3827,8 @@ regular_loop:
case 147:
-/* Line 1821 of yacc.c */
-#line 1474 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1475 "awkgram.y"
{
static short warned1 = FALSE;
@@ -3844,8 +3845,8 @@ regular_loop:
case 150:
-/* Line 1821 of yacc.c */
-#line 1489 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1490 "awkgram.y"
{
(yyvsp[(1) - (2)])->opcode = Op_preincrement;
(yyval) = mk_assignment((yyvsp[(2) - (2)]), NULL, (yyvsp[(1) - (2)]));
@@ -3854,8 +3855,8 @@ regular_loop:
case 151:
-/* Line 1821 of yacc.c */
-#line 1494 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1495 "awkgram.y"
{
(yyvsp[(1) - (2)])->opcode = Op_predecrement;
(yyval) = mk_assignment((yyvsp[(2) - (2)]), NULL, (yyvsp[(1) - (2)]));
@@ -3864,8 +3865,8 @@ regular_loop:
case 152:
-/* Line 1821 of yacc.c */
-#line 1499 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1500 "awkgram.y"
{
(yyval) = list_create((yyvsp[(1) - (1)]));
}
@@ -3873,8 +3874,8 @@ regular_loop:
case 153:
-/* Line 1821 of yacc.c */
-#line 1503 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1504 "awkgram.y"
{
(yyval) = list_create((yyvsp[(1) - (1)]));
}
@@ -3882,8 +3883,8 @@ regular_loop:
case 154:
-/* Line 1821 of yacc.c */
-#line 1507 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1508 "awkgram.y"
{
if ((yyvsp[(2) - (2)])->lasti->opcode == Op_push_i
&& ((yyvsp[(2) - (2)])->lasti->memory->flags & (STRCUR|STRING)) == 0
@@ -3900,8 +3901,8 @@ regular_loop:
case 155:
-/* Line 1821 of yacc.c */
-#line 1520 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1521 "awkgram.y"
{
/*
* was: $$ = $2
@@ -3915,8 +3916,8 @@ regular_loop:
case 156:
-/* Line 1821 of yacc.c */
-#line 1533 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1534 "awkgram.y"
{
func_use((yyvsp[(1) - (1)])->lasti->func_name, FUNC_USE);
(yyval) = (yyvsp[(1) - (1)]);
@@ -3925,8 +3926,8 @@ regular_loop:
case 157:
-/* Line 1821 of yacc.c */
-#line 1538 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1539 "awkgram.y"
{
/* indirect function call */
INSTRUCTION *f, *t;
@@ -3963,8 +3964,8 @@ regular_loop:
case 158:
-/* Line 1821 of yacc.c */
-#line 1574 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1575 "awkgram.y"
{
param_sanity((yyvsp[(3) - (4)]));
(yyvsp[(1) - (4)])->opcode = Op_func_call;
@@ -3982,43 +3983,43 @@ regular_loop:
case 159:
-/* Line 1821 of yacc.c */
-#line 1591 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1592 "awkgram.y"
{ (yyval) = NULL; }
break;
case 160:
-/* Line 1821 of yacc.c */
-#line 1593 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1594 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 161:
-/* Line 1821 of yacc.c */
-#line 1598 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1599 "awkgram.y"
{ (yyval) = NULL; }
break;
case 162:
-/* Line 1821 of yacc.c */
-#line 1600 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1601 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (2)]); }
break;
case 163:
-/* Line 1821 of yacc.c */
-#line 1605 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1606 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 164:
-/* Line 1821 of yacc.c */
-#line 1607 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1608 "awkgram.y"
{
(yyval) = list_merge((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]));
}
@@ -4026,8 +4027,8 @@ regular_loop:
case 165:
-/* Line 1821 of yacc.c */
-#line 1614 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1615 "awkgram.y"
{
INSTRUCTION *ip = (yyvsp[(1) - (1)])->lasti;
int count = ip->sub_count; /* # of SUBSEP-seperated expressions */
@@ -4045,8 +4046,8 @@ regular_loop:
case 166:
-/* Line 1821 of yacc.c */
-#line 1631 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1632 "awkgram.y"
{
INSTRUCTION *t = (yyvsp[(2) - (3)]);
if ((yyvsp[(2) - (3)]) == NULL) {
@@ -4064,15 +4065,15 @@ regular_loop:
case 167:
-/* Line 1821 of yacc.c */
-#line 1648 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1649 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 168:
-/* Line 1821 of yacc.c */
-#line 1650 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1651 "awkgram.y"
{
(yyval) = list_merge((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]));
}
@@ -4080,15 +4081,15 @@ regular_loop:
case 169:
-/* Line 1821 of yacc.c */
-#line 1657 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1658 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (2)]); }
break;
case 170:
-/* Line 1821 of yacc.c */
-#line 1662 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1663 "awkgram.y"
{
char *var_name = (yyvsp[(1) - (1)])->lextok;
@@ -4100,8 +4101,8 @@ regular_loop:
case 171:
-/* Line 1821 of yacc.c */
-#line 1670 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1671 "awkgram.y"
{
char *arr = (yyvsp[(1) - (2)])->lextok;
(yyvsp[(1) - (2)])->memory = variable((yyvsp[(1) - (2)])->source_line, arr, Node_var_new);
@@ -4112,8 +4113,8 @@ regular_loop:
case 172:
-/* Line 1821 of yacc.c */
-#line 1680 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1681 "awkgram.y"
{
INSTRUCTION *ip = (yyvsp[(1) - (1)])->nexti;
if (ip->opcode == Op_push
@@ -4129,8 +4130,8 @@ regular_loop:
case 173:
-/* Line 1821 of yacc.c */
-#line 1692 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1693 "awkgram.y"
{
(yyval) = list_append((yyvsp[(2) - (3)]), (yyvsp[(1) - (3)]));
if ((yyvsp[(3) - (3)]) != NULL)
@@ -4140,8 +4141,8 @@ regular_loop:
case 174:
-/* Line 1821 of yacc.c */
-#line 1701 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1702 "awkgram.y"
{
(yyvsp[(1) - (1)])->opcode = Op_postincrement;
}
@@ -4149,8 +4150,8 @@ regular_loop:
case 175:
-/* Line 1821 of yacc.c */
-#line 1705 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1706 "awkgram.y"
{
(yyvsp[(1) - (1)])->opcode = Op_postdecrement;
}
@@ -4158,50 +4159,50 @@ regular_loop:
case 176:
-/* Line 1821 of yacc.c */
-#line 1708 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1709 "awkgram.y"
{ (yyval) = NULL; }
break;
case 178:
-/* Line 1821 of yacc.c */
-#line 1716 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1717 "awkgram.y"
{ yyerrok; }
break;
case 179:
-/* Line 1821 of yacc.c */
-#line 1720 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1721 "awkgram.y"
{ yyerrok; }
break;
case 182:
-/* Line 1821 of yacc.c */
-#line 1729 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1730 "awkgram.y"
{ yyerrok; }
break;
case 183:
-/* Line 1821 of yacc.c */
-#line 1733 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1734 "awkgram.y"
{ (yyval) = (yyvsp[(1) - (1)]); yyerrok; }
break;
case 184:
-/* Line 1821 of yacc.c */
-#line 1737 "awkgram.y"
+/* Line 1806 of yacc.c */
+#line 1738 "awkgram.y"
{ yyerrok; }
break;
-/* Line 1821 of yacc.c */
-#line 4217 "awkgram.c"
+/* Line 1806 of yacc.c */
+#line 4218 "awkgram.c"
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
@@ -4432,7 +4433,7 @@ yyreturn:
/* Line 2067 of yacc.c */
-#line 1739 "awkgram.y"
+#line 1740 "awkgram.y"
struct token {
@@ -4607,7 +4608,7 @@ print_included_from()
line--;
msg("%s %s:%d%c",
s->prev == sourcefile ? "In file included from"
- : " from",
+ : " from",
(s->stype == SRC_INC ||
s->stype == SRC_FILE) ? s->src : "cmd. line",
line,
@@ -4889,7 +4890,10 @@ parse_program(INSTRUCTION **pcode)
ip_atexit = instruction(Op_atexit); /* target for `exit' in END block */
}
- sourcefile = srcfiles->next;
+ for (sourcefile = srcfiles->next; sourcefile->stype == SRC_EXTLIB;
+ sourcefile = sourcefile->next)
+ ;
+
lexeof = FALSE;
lexptr = NULL;
lasttok = 0;
@@ -4906,6 +4910,11 @@ parse_program(INSTRUCTION **pcode)
if (ret == 0) /* avoid spurious warning if parser aborted with YYABORT */
check_funcs();
+ if (args_array == NULL)
+ emalloc(args_array, NODE **, (max_args + 2) * sizeof(NODE *), "parse_program");
+ else
+ erealloc(args_array, NODE **, (max_args + 2) * sizeof(NODE *), "parse_program");
+
return (ret || errcount);
}
@@ -4948,7 +4957,7 @@ add_srcfile(int stype, char *src, SRCFILE *thisfile, int *already_included, int
if (stype == SRC_CMDLINE || stype == SRC_STDIN)
return do_add_srcfile(stype, src, NULL, thisfile);
- path = find_source(src, &sbuf, &errno_val);
+ path = find_source(src, & sbuf, &errno_val, stype == SRC_EXTLIB);
if (path == NULL) {
if (errcode) {
*errcode = errno_val;
@@ -4959,7 +4968,7 @@ add_srcfile(int stype, char *src, SRCFILE *thisfile, int *already_included, int
}
for (s = srcfiles->next; s != srcfiles; s = s->next) {
- if ((s->stype == SRC_FILE || s->stype == SRC_INC)
+ if ((s->stype == SRC_FILE || s->stype == SRC_INC || s->stype == SRC_EXTLIB)
&& files_are_same(path, s)
) {
if (do_lint) {
@@ -5076,9 +5085,12 @@ next_sourcefile()
sourcefile->lexptr_begin = NULL;
}
- sourcefile = sourcefile->next;
- if (sourcefile == srcfiles)
- return;
+ while ((sourcefile = sourcefile->next) != NULL) {
+ if (sourcefile == srcfiles)
+ return;
+ if (sourcefile->stype != SRC_EXTLIB)
+ break;
+ }
if (sourcefile->lexptr_begin != NULL) {
/* resume reading from already opened file (postponed to process '@include') */
@@ -6175,7 +6187,7 @@ retry:
case LEX_WHILE:
case LEX_DO:
case LEX_SWITCH:
- if (! do_profiling)
+ if (! do_pretty_print)
return lasttok = class;
/* fall through */
case LEX_CASE:
@@ -6516,7 +6528,6 @@ parms_shadow(INSTRUCTION *pc, int *shadow)
return 0;
}
-
/* valinfo --- dump var info */
void
@@ -6616,8 +6627,7 @@ mk_function(INSTRUCTION *fi, INSTRUCTION *def)
for (t = def->nexti; t->nexti != def->lasti; t = t->nexti)
;
if (t->opcode == Op_func_call
- && STREQ(t->func_name, thisfunc->vname)
- )
+ && strcmp(t->func_name, thisfunc->vname) == 0)
(t + 1)->tail_call = TRUE;
}
@@ -6629,7 +6639,7 @@ mk_function(INSTRUCTION *fi, INSTRUCTION *def)
def->lasti->memory = dupnode(Nnull_string);
(void) list_append(def, instruction(Op_K_return));
- if (do_profiling)
+ if (do_pretty_print)
(void) list_prepend(def, instruction(Op_exec_count));
/* fi->opcode = Op_func */
@@ -6900,7 +6910,7 @@ variable(int location, char *name, NODETYPE type)
*/
return install_symbol(name, type);
}
- if (STREQ(name, dv->name)) {
+ if (strcmp(name, dv->name) == 0) {
r = (*dv->load_func)();
break;
}
@@ -7254,7 +7264,7 @@ mk_condition(INSTRUCTION *cond, INSTRUCTION *ifp, INSTRUCTION *true_branch,
if (false_branch == NULL) {
false_branch = list_create(instruction(Op_no_op));
if (elsep != NULL) { /* else { } */
- if (do_profiling)
+ if (do_pretty_print)
(void) list_prepend(false_branch, elsep);
else
bcfree(elsep);
@@ -7265,7 +7275,7 @@ mk_condition(INSTRUCTION *cond, INSTRUCTION *ifp, INSTRUCTION *true_branch,
/* avoid a series of no_op's: if .. else if .. else if .. */
if (false_branch->lasti->opcode != Op_no_op)
(void) list_append(false_branch, instruction(Op_no_op));
- if (do_profiling) {
+ if (do_pretty_print) {
(void) list_prepend(false_branch, elsep);
false_branch->nexti->branch_end = false_branch->lasti;
(void) list_prepend(false_branch, instruction(Op_exec_count));
@@ -7280,7 +7290,7 @@ mk_condition(INSTRUCTION *cond, INSTRUCTION *ifp, INSTRUCTION *true_branch,
ip = list_append(cond, instruction(Op_jmp_false));
ip->lasti->target_jmp = false_branch->nexti->nexti;
- if (do_profiling) {
+ if (do_pretty_print) {
(void) list_prepend(ip, ifp);
(void) list_append(ip, instruction(Op_exec_count));
ip->nexti->branch_if = ip->lasti;
@@ -7342,7 +7352,7 @@ append_rule(INSTRUCTION *pattern, INSTRUCTION *action)
if (rule != Rule) {
rp = pattern;
- if (do_profiling)
+ if (do_pretty_print)
(void) list_append(action, instruction(Op_no_op));
(rp + 1)->firsti = action->nexti;
(rp + 1)->lasti = action->lasti;
@@ -7358,7 +7368,7 @@ append_rule(INSTRUCTION *pattern, INSTRUCTION *action)
if (pattern == NULL) {
/* assert(action != NULL); */
- if (do_profiling)
+ if (do_pretty_print)
(void) list_prepend(action, instruction(Op_exec_count));
(rp + 1)->firsti = action->nexti;
(rp + 1)->lasti = tp;
@@ -7374,12 +7384,12 @@ append_rule(INSTRUCTION *pattern, INSTRUCTION *action)
if (action == NULL) {
(rp + 2)->last_line = find_line(pattern, LAST_LINE);
action = list_create(instruction(Op_K_print_rec));
- if (do_profiling)
+ if (do_pretty_print)
(void) list_prepend(action, instruction(Op_exec_count));
} else
(rp + 2)->last_line = lastline;
- if (do_profiling) {
+ if (do_pretty_print) {
(void) list_prepend(pattern, instruction(Op_exec_count));
(void) list_prepend(action, instruction(Op_exec_count));
}
@@ -7720,7 +7730,7 @@ mk_for_loop(INSTRUCTION *forp, INSTRUCTION *init, INSTRUCTION *cond,
if (init != NULL)
ip = list_merge(init, ip);
- if (do_profiling) {
+ if (do_pretty_print) {
(void) list_append(ip, instruction(Op_exec_count));
(forp + 1)->forloop_cond = pp_cond;
(forp + 1)->forloop_body = ip->lasti;
@@ -7742,7 +7752,7 @@ mk_for_loop(INSTRUCTION *forp, INSTRUCTION *init, INSTRUCTION *cond,
ret = list_append(ip, tbreak);
fix_break_continue(ret, tbreak, tcont);
- if (do_profiling) {
+ if (do_pretty_print) {
forp->target_break = tbreak;
forp->target_continue = tcont;
ret = list_prepend(ret, forp);
diff --git a/awkgram.y b/awkgram.y
index 08eb9904..a64fff01 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -129,6 +129,7 @@ extern int sourceline;
extern SRCFILE *srcfiles;
extern INSTRUCTION *rule_list;
extern int max_args;
+extern NODE **args_array;
static INSTRUCTION *rule_block[sizeof(ruletab)];
@@ -268,7 +269,7 @@ pattern
add_lint($4, LINT_assign_in_cond);
tp = instruction(Op_no_op);
- list_prepend($1, bcalloc(Op_line_range, !!do_profiling + 1, 0));
+ list_prepend($1, bcalloc(Op_line_range, !!do_pretty_print + 1, 0));
$1->nexti->triggered = FALSE;
$1->nexti->target_jmp = $4->nexti;
@@ -279,7 +280,7 @@ pattern
list_append($4, instruction(Op_cond_pair));
$4->lasti->line_range = $1->nexti;
$4->lasti->target_jmp = tp;
- if (do_profiling) {
+ if (do_pretty_print) {
($1->nexti + 1)->condpair_left = $1->lasti;
($1->nexti + 1)->condpair_right = $4->lasti;
}
@@ -442,7 +443,7 @@ statement
{ $$ = $2; }
| if_statement
{
- if (do_profiling)
+ if (do_pretty_print)
$$ = list_prepend($1, instruction(Op_exec_count));
else
$$ = $1;
@@ -506,7 +507,7 @@ statement
else
dflt->target_jmp = casestmt->nexti;
- if (do_profiling) {
+ if (do_pretty_print) {
curr->stmt_start = casestmt->nexti;
curr->stmt_end = casestmt->lasti;
(void) list_prepend(cexp, curr);
@@ -521,7 +522,7 @@ statement
efree(case_values);
ip = $3;
- if (do_profiling) {
+ if (do_pretty_print) {
(void) list_prepend(ip, $1);
(void) list_prepend(ip, instruction(Op_exec_count));
$1->target_break = tbreak;
@@ -560,7 +561,7 @@ statement
ip = list_append($3, instruction(Op_jmp_false));
ip->lasti->target_jmp = tbreak;
- if (do_profiling) {
+ if (do_pretty_print) {
(void) list_append(ip, instruction(Op_exec_count));
$1->target_break = tbreak;
$1->target_continue = tcont;
@@ -602,7 +603,7 @@ statement
ip = list_merge($3, $6);
else
ip = list_prepend($6, instruction(Op_no_op));
- if (do_profiling)
+ if (do_pretty_print)
(void) list_prepend(ip, instruction(Op_exec_count));
(void) list_append(ip, instruction(Op_jmp_true));
ip->lasti->target_jmp = ip->nexti;
@@ -612,7 +613,7 @@ statement
continue_allowed--;
fix_break_continue(ip, tbreak, tcont);
- if (do_profiling) {
+ if (do_pretty_print) {
$1->target_break = tbreak;
$1->target_continue = tcont;
($1 + 1)->doloop_cond = tcont;
@@ -695,7 +696,7 @@ regular_loop:
$3->target_jmp = tbreak;
(void) list_append(ip, $3);
- if (do_profiling) {
+ if (do_pretty_print) {
$1->opcode = Op_K_arrayfor;
$1->target_continue = tcont;
$1->target_break = tbreak;
@@ -716,7 +717,7 @@ regular_loop:
ip->lasti->assign_var = $4->array_var->var_assign;
}
- if (do_profiling) {
+ if (do_pretty_print) {
(void) list_append(ip, instruction(Op_exec_count));
($1 + 1)->forloop_cond = $4;
($1 + 1)->forloop_body = ip->lasti;
@@ -750,7 +751,7 @@ regular_loop:
}
| non_compound_stmt
{
- if (do_profiling)
+ if (do_pretty_print)
$$ = list_prepend($1, instruction(Op_exec_count));
else
$$ = $1;
@@ -827,7 +828,7 @@ non_compound_stmt
} else {
if (do_optimize > 1
&& $3->lasti->opcode == Op_func_call
- && STREQ($3->lasti->func_name, in_function)
+ && strcmp($3->lasti->func_name, in_function) == 0
) {
/* Do tail recursion optimization. Tail
* call without a return value is recognized
@@ -1024,7 +1025,7 @@ case_statement
INSTRUCTION *casestmt = $5;
if ($5 == NULL)
casestmt = list_create(instruction(Op_no_op));
- if (do_profiling)
+ if (do_pretty_print)
(void) list_prepend(casestmt, instruction(Op_exec_count));
$1->case_exp = $2;
$1->case_stmt = casestmt;
@@ -1036,7 +1037,7 @@ case_statement
INSTRUCTION *casestmt = $4;
if ($4 == NULL)
casestmt = list_create(instruction(Op_no_op));
- if (do_profiling)
+ if (do_pretty_print)
(void) list_prepend(casestmt, instruction(Op_exec_count));
bcfree($2);
$1->case_stmt = casestmt;
@@ -1910,7 +1911,7 @@ print_included_from()
line--;
msg("%s %s:%d%c",
s->prev == sourcefile ? "In file included from"
- : " from",
+ : " from",
(s->stype == SRC_INC ||
s->stype == SRC_FILE) ? s->src : "cmd. line",
line,
@@ -2192,7 +2193,10 @@ parse_program(INSTRUCTION **pcode)
ip_atexit = instruction(Op_atexit); /* target for `exit' in END block */
}
- sourcefile = srcfiles->next;
+ for (sourcefile = srcfiles->next; sourcefile->stype == SRC_EXTLIB;
+ sourcefile = sourcefile->next)
+ ;
+
lexeof = FALSE;
lexptr = NULL;
lasttok = 0;
@@ -2209,6 +2213,11 @@ parse_program(INSTRUCTION **pcode)
if (ret == 0) /* avoid spurious warning if parser aborted with YYABORT */
check_funcs();
+ if (args_array == NULL)
+ emalloc(args_array, NODE **, (max_args + 2) * sizeof(NODE *), "parse_program");
+ else
+ erealloc(args_array, NODE **, (max_args + 2) * sizeof(NODE *), "parse_program");
+
return (ret || errcount);
}
@@ -2251,7 +2260,7 @@ add_srcfile(int stype, char *src, SRCFILE *thisfile, int *already_included, int
if (stype == SRC_CMDLINE || stype == SRC_STDIN)
return do_add_srcfile(stype, src, NULL, thisfile);
- path = find_source(src, &sbuf, &errno_val);
+ path = find_source(src, & sbuf, &errno_val, stype == SRC_EXTLIB);
if (path == NULL) {
if (errcode) {
*errcode = errno_val;
@@ -2262,7 +2271,7 @@ add_srcfile(int stype, char *src, SRCFILE *thisfile, int *already_included, int
}
for (s = srcfiles->next; s != srcfiles; s = s->next) {
- if ((s->stype == SRC_FILE || s->stype == SRC_INC)
+ if ((s->stype == SRC_FILE || s->stype == SRC_INC || s->stype == SRC_EXTLIB)
&& files_are_same(path, s)
) {
if (do_lint) {
@@ -2379,9 +2388,12 @@ next_sourcefile()
sourcefile->lexptr_begin = NULL;
}
- sourcefile = sourcefile->next;
- if (sourcefile == srcfiles)
- return;
+ while ((sourcefile = sourcefile->next) != NULL) {
+ if (sourcefile == srcfiles)
+ return;
+ if (sourcefile->stype != SRC_EXTLIB)
+ break;
+ }
if (sourcefile->lexptr_begin != NULL) {
/* resume reading from already opened file (postponed to process '@include') */
@@ -3478,7 +3490,7 @@ retry:
case LEX_WHILE:
case LEX_DO:
case LEX_SWITCH:
- if (! do_profiling)
+ if (! do_pretty_print)
return lasttok = class;
/* fall through */
case LEX_CASE:
@@ -3819,7 +3831,6 @@ parms_shadow(INSTRUCTION *pc, int *shadow)
return 0;
}
-
/* valinfo --- dump var info */
void
@@ -3919,8 +3930,7 @@ mk_function(INSTRUCTION *fi, INSTRUCTION *def)
for (t = def->nexti; t->nexti != def->lasti; t = t->nexti)
;
if (t->opcode == Op_func_call
- && STREQ(t->func_name, thisfunc->vname)
- )
+ && strcmp(t->func_name, thisfunc->vname) == 0)
(t + 1)->tail_call = TRUE;
}
@@ -3932,7 +3942,7 @@ mk_function(INSTRUCTION *fi, INSTRUCTION *def)
def->lasti->memory = dupnode(Nnull_string);
(void) list_append(def, instruction(Op_K_return));
- if (do_profiling)
+ if (do_pretty_print)
(void) list_prepend(def, instruction(Op_exec_count));
/* fi->opcode = Op_func */
@@ -4203,7 +4213,7 @@ variable(int location, char *name, NODETYPE type)
*/
return install_symbol(name, type);
}
- if (STREQ(name, dv->name)) {
+ if (strcmp(name, dv->name) == 0) {
r = (*dv->load_func)();
break;
}
@@ -4557,7 +4567,7 @@ mk_condition(INSTRUCTION *cond, INSTRUCTION *ifp, INSTRUCTION *true_branch,
if (false_branch == NULL) {
false_branch = list_create(instruction(Op_no_op));
if (elsep != NULL) { /* else { } */
- if (do_profiling)
+ if (do_pretty_print)
(void) list_prepend(false_branch, elsep);
else
bcfree(elsep);
@@ -4568,7 +4578,7 @@ mk_condition(INSTRUCTION *cond, INSTRUCTION *ifp, INSTRUCTION *true_branch,
/* avoid a series of no_op's: if .. else if .. else if .. */
if (false_branch->lasti->opcode != Op_no_op)
(void) list_append(false_branch, instruction(Op_no_op));
- if (do_profiling) {
+ if (do_pretty_print) {
(void) list_prepend(false_branch, elsep);
false_branch->nexti->branch_end = false_branch->lasti;
(void) list_prepend(false_branch, instruction(Op_exec_count));
@@ -4583,7 +4593,7 @@ mk_condition(INSTRUCTION *cond, INSTRUCTION *ifp, INSTRUCTION *true_branch,
ip = list_append(cond, instruction(Op_jmp_false));
ip->lasti->target_jmp = false_branch->nexti->nexti;
- if (do_profiling) {
+ if (do_pretty_print) {
(void) list_prepend(ip, ifp);
(void) list_append(ip, instruction(Op_exec_count));
ip->nexti->branch_if = ip->lasti;
@@ -4645,7 +4655,7 @@ append_rule(INSTRUCTION *pattern, INSTRUCTION *action)
if (rule != Rule) {
rp = pattern;
- if (do_profiling)
+ if (do_pretty_print)
(void) list_append(action, instruction(Op_no_op));
(rp + 1)->firsti = action->nexti;
(rp + 1)->lasti = action->lasti;
@@ -4661,7 +4671,7 @@ append_rule(INSTRUCTION *pattern, INSTRUCTION *action)
if (pattern == NULL) {
/* assert(action != NULL); */
- if (do_profiling)
+ if (do_pretty_print)
(void) list_prepend(action, instruction(Op_exec_count));
(rp + 1)->firsti = action->nexti;
(rp + 1)->lasti = tp;
@@ -4677,12 +4687,12 @@ append_rule(INSTRUCTION *pattern, INSTRUCTION *action)
if (action == NULL) {
(rp + 2)->last_line = find_line(pattern, LAST_LINE);
action = list_create(instruction(Op_K_print_rec));
- if (do_profiling)
+ if (do_pretty_print)
(void) list_prepend(action, instruction(Op_exec_count));
} else
(rp + 2)->last_line = lastline;
- if (do_profiling) {
+ if (do_pretty_print) {
(void) list_prepend(pattern, instruction(Op_exec_count));
(void) list_prepend(action, instruction(Op_exec_count));
}
@@ -5023,7 +5033,7 @@ mk_for_loop(INSTRUCTION *forp, INSTRUCTION *init, INSTRUCTION *cond,
if (init != NULL)
ip = list_merge(init, ip);
- if (do_profiling) {
+ if (do_pretty_print) {
(void) list_append(ip, instruction(Op_exec_count));
(forp + 1)->forloop_cond = pp_cond;
(forp + 1)->forloop_body = ip->lasti;
@@ -5045,7 +5055,7 @@ mk_for_loop(INSTRUCTION *forp, INSTRUCTION *init, INSTRUCTION *cond,
ret = list_append(ip, tbreak);
fix_break_continue(ret, tbreak, tcont);
- if (do_profiling) {
+ if (do_pretty_print) {
forp->target_break = tbreak;
forp->target_continue = tcont;
ret = list_prepend(ret, forp);
diff --git a/builtin.c b/builtin.c
index 5bc1c023..1da8a4f5 100644
--- a/builtin.c
+++ b/builtin.c
@@ -156,9 +156,9 @@ static FILE *
stdfile(const char *name, size_t len)
{
if (len == 11) {
- if (STREQN(name, "/dev/stderr", 11))
+ if (strncmp(name, "/dev/stderr", 11) == 0)
return stderr;
- else if (STREQN(name, "/dev/stdout", 11))
+ else if (strncmp(name, "/dev/stdout", 11) == 0)
return stdout;
}
diff --git a/cint_array.c b/cint_array.c
index 3d812cbb..8ec09239 100644
--- a/cint_array.c
+++ b/cint_array.c
@@ -316,10 +316,14 @@ cint_remove(NODE *symbol, NODE *subs)
int h1;
NODE *tn, *xn = symbol->xarray;
- assert(symbol->nodes != NULL);
+ if (symbol->table_size == 0)
+ return NULL;
+
if (! ISUINT(symbol, subs))
goto xremove;
+ assert(symbol->nodes != NULL);
+
k = subs->numbr;
h1 = cint_hash(k);
tn = symbol->nodes[h1];
@@ -338,6 +342,7 @@ cint_remove(NODE *symbol, NODE *subs)
init_array(symbol); /* re-initialize array 'symbol' */
} else if(xn != NULL && symbol->table_size == xn->table_size) {
/* promote xn to symbol */
+
xn->flags &= ~XARRAY;
xn->parent_array = symbol->parent_array;
efree(symbol->nodes);
@@ -627,7 +632,7 @@ cint_option(NODE *opt, NODE *val)
tmp = force_string(opt);
(void) force_number(val);
- if (STREQ(tmp->stptr, "NHAT"))
+ if (strcmp(tmp->stptr, "NHAT") == 0)
NHAT = (int) val->numbr;
else
ret = NULL;
diff --git a/command.c b/command.c
index c3fea2b8..17ba0476 100644
--- a/command.c
+++ b/command.c
@@ -1713,7 +1713,7 @@ yyreduce:
{
case 3:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 109 "command.y"
{
cmd_idx = -1;
@@ -1733,7 +1733,7 @@ yyreduce:
case 5:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 128 "command.y"
{
if (errcount == 0 && cmd_idx >= 0) {
@@ -1788,7 +1788,7 @@ yyreduce:
case 6:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 178 "command.y"
{
yyerrok;
@@ -1797,14 +1797,14 @@ yyreduce:
case 22:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 212 "command.y"
{ want_nodeval = TRUE; }
break;
case 23:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 217 "command.y"
{
if (errcount == 0) {
@@ -1824,7 +1824,7 @@ yyreduce:
case 24:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 235 "command.y"
{
(yyval) = append_statement(arg_list, (char *) start_EVAL);
@@ -1837,14 +1837,14 @@ yyreduce:
case 25:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 242 "command.y"
{ (yyval) = append_statement((yyvsp[(1) - (2)]), lexptr_begin); }
break;
case 26:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 243 "command.y"
{
(yyval) = (yyvsp[(3) - (4)]);
@@ -1853,7 +1853,7 @@ yyreduce:
case 27:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 250 "command.y"
{
arg_list = append_statement((yyvsp[(2) - (3)]), (char *) end_EVAL);
@@ -1874,7 +1874,7 @@ yyreduce:
case 28:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 266 "command.y"
{
NODE *n;
@@ -1890,7 +1890,7 @@ yyreduce:
case 34:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 285 "command.y"
{
if (cmdtab[cmd_idx].class == D_FRAME
@@ -1901,7 +1901,7 @@ yyreduce:
case 35:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 291 "command.y"
{
int idx = find_argument((yyvsp[(2) - (2)]));
@@ -1918,49 +1918,49 @@ yyreduce:
case 38:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 304 "command.y"
{ want_nodeval = TRUE; }
break;
case 40:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 305 "command.y"
{ want_nodeval = TRUE; }
break;
case 46:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 310 "command.y"
{ want_nodeval = TRUE; }
break;
case 49:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 312 "command.y"
{ want_nodeval = TRUE; }
break;
case 51:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 313 "command.y"
{ want_nodeval = TRUE; }
break;
case 53:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 314 "command.y"
{ want_nodeval = TRUE; }
break;
case 57:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 318 "command.y"
{
if (in_cmd_src((yyvsp[(2) - (2)])->a_string))
@@ -1970,7 +1970,7 @@ yyreduce:
case 58:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 323 "command.y"
{
if (! input_from_tty)
@@ -1980,7 +1980,7 @@ yyreduce:
case 59:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 328 "command.y"
{
int type = 0;
@@ -2011,7 +2011,7 @@ yyreduce:
case 60:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 354 "command.y"
{
if (! in_commands)
@@ -2026,7 +2026,7 @@ yyreduce:
case 61:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 364 "command.y"
{
if (! in_commands)
@@ -2036,7 +2036,7 @@ yyreduce:
case 62:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 369 "command.y"
{
int idx = find_argument((yyvsp[(2) - (2)]));
@@ -2053,14 +2053,14 @@ yyreduce:
case 63:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 380 "command.y"
{ want_nodeval = TRUE; }
break;
case 64:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 381 "command.y"
{
int type;
@@ -2073,7 +2073,7 @@ yyreduce:
case 65:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 389 "command.y"
{
if (in_commands) {
@@ -2089,7 +2089,7 @@ yyreduce:
case 66:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 403 "command.y"
{
if ((yyvsp[(1) - (1)]) != NULL) {
@@ -2104,42 +2104,42 @@ yyreduce:
case 68:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 417 "command.y"
{ (yyval) = NULL; }
break;
case 69:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 422 "command.y"
{ (yyval) = NULL; }
break;
case 74:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 431 "command.y"
{ (yyval) = NULL; }
break;
case 75:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 436 "command.y"
{ (yyval) = NULL; }
break;
case 77:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 439 "command.y"
{ (yyval) = NULL; }
break;
case 78:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 444 "command.y"
{
NODE *n;
@@ -2151,14 +2151,14 @@ yyreduce:
case 79:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 454 "command.y"
{ (yyval) = NULL; }
break;
case 80:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 456 "command.y"
{
if (find_option((yyvsp[(1) - (1)])->a_string) < 0)
@@ -2168,7 +2168,7 @@ yyreduce:
case 81:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 461 "command.y"
{
if (find_option((yyvsp[(1) - (3)])->a_string) < 0)
@@ -2178,7 +2178,7 @@ yyreduce:
case 82:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 469 "command.y"
{
NODE *n;
@@ -2196,56 +2196,56 @@ yyreduce:
case 83:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 485 "command.y"
{ (yyval) = NULL; }
break;
case 88:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 494 "command.y"
{ (yyval) = NULL; }
break;
case 89:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 495 "command.y"
{ want_nodeval = TRUE; }
break;
case 92:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 497 "command.y"
{ want_nodeval = TRUE; }
break;
case 95:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 503 "command.y"
{ (yyval) = NULL; }
break;
case 97:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 509 "command.y"
{ (yyval) = NULL; }
break;
case 99:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 515 "command.y"
{ (yyval) = NULL; }
break;
case 104:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 527 "command.y"
{
int idx = find_argument((yyvsp[(1) - (2)]));
@@ -2262,7 +2262,7 @@ yyreduce:
case 106:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 543 "command.y"
{
(yyvsp[(2) - (2)])->type = D_array; /* dump all items */
@@ -2272,7 +2272,7 @@ yyreduce:
case 107:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 548 "command.y"
{
(yyvsp[(2) - (3)])->type = D_array;
@@ -2282,21 +2282,21 @@ yyreduce:
case 117:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 574 "command.y"
{ (yyval) = NULL; }
break;
case 118:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 576 "command.y"
{ (yyval) = NULL; }
break;
case 119:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 578 "command.y"
{
CMDARG *a;
@@ -2308,7 +2308,7 @@ yyreduce:
case 126:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 594 "command.y"
{
if ((yyvsp[(1) - (3)])->a_int > (yyvsp[(3) - (3)])->a_int)
@@ -2322,28 +2322,28 @@ yyreduce:
case 127:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 606 "command.y"
{ (yyval) = NULL; }
break;
case 134:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 620 "command.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 135:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 622 "command.y"
{ (yyval) = (yyvsp[(1) - (3)]); }
break;
case 137:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 628 "command.y"
{
CMDARG *a;
@@ -2363,21 +2363,21 @@ yyreduce:
case 139:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 647 "command.y"
{ (yyval) = (yyvsp[(1) - (1)]); num_dim = 1; }
break;
case 140:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 649 "command.y"
{ (yyval) = (yyvsp[(1) - (2)]); num_dim++; }
break;
case 142:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 655 "command.y"
{
NODE *n = (yyvsp[(2) - (2)])->a_node;
@@ -2391,7 +2391,7 @@ yyreduce:
case 143:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 664 "command.y"
{
/* a_string is array name, a_count is dimension count */
@@ -2403,14 +2403,14 @@ yyreduce:
case 144:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 674 "command.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 145:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 676 "command.y"
{
NODE *n = (yyvsp[(2) - (2)])->a_node;
@@ -2422,7 +2422,7 @@ yyreduce:
case 146:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 683 "command.y"
{
NODE *n = (yyvsp[(2) - (2)])->a_node;
@@ -2436,35 +2436,35 @@ yyreduce:
case 147:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 695 "command.y"
{ (yyval) = NULL; }
break;
case 148:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 697 "command.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 149:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 702 "command.y"
{ (yyval) = NULL; }
break;
case 150:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 704 "command.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 151:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 709 "command.y"
{
if ((yyvsp[(1) - (1)])->a_int == 0)
@@ -2475,7 +2475,7 @@ yyreduce:
case 152:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 715 "command.y"
{
if ((yyvsp[(2) - (2)])->a_int == 0)
@@ -2486,21 +2486,21 @@ yyreduce:
case 153:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 724 "command.y"
{ (yyval) = (yyvsp[(1) - (1)]); }
break;
case 154:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 726 "command.y"
{ (yyval) = (yyvsp[(2) - (2)]); }
break;
case 155:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 728 "command.y"
{
(yyvsp[(2) - (2)])->a_int = - (yyvsp[(2) - (2)])->a_int;
@@ -2510,7 +2510,7 @@ yyreduce:
case 156:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 736 "command.y"
{
if (lexptr_begin != NULL) {
@@ -2524,7 +2524,7 @@ yyreduce:
-/* Line 1821 of yacc.c */
+/* Line 1806 of yacc.c */
#line 2541 "command.c"
default: break;
}
@@ -3447,7 +3447,7 @@ do_help(CMDARG *arg, int cmd)
i = find_command(name, strlen(name));
if (i >= 0) {
fprintf(out_fp, "%s\n", cmdtab[i].help_txt);
- if (STREQ(cmdtab[i].name, "option"))
+ if (strcmp(cmdtab[i].name, "option") == 0)
option_help();
} else
fprintf(out_fp, _("undefined command: %s\n"), name);
diff --git a/command.y b/command.y
index 18ef0613..64066a02 100644
--- a/command.y
+++ b/command.y
@@ -1433,7 +1433,7 @@ do_help(CMDARG *arg, int cmd)
i = find_command(name, strlen(name));
if (i >= 0) {
fprintf(out_fp, "%s\n", cmdtab[i].help_txt);
- if (STREQ(cmdtab[i].name, "option"))
+ if (strcmp(cmdtab[i].name, "option") == 0)
option_help();
} else
fprintf(out_fp, _("undefined command: %s\n"), name);
diff --git a/debug.c b/debug.c
index 5870a40f..5fb8d9e2 100644
--- a/debug.c
+++ b/debug.c
@@ -40,7 +40,6 @@ extern FILE *output_fp;
extern IOBUF *curfile;
extern const char *command_file;
extern const char *get_spec_varname(Func_ptr fptr);
-extern int r_interpret(INSTRUCTION *);
extern int zzparse(void);
#define read_command() (void) zzparse()
@@ -214,9 +213,9 @@ struct dbg_option {
const char *help_txt;
};
-#define DEFAULT_HISTFILE "./.dgawk_history"
-#define DEFAULT_OPTFILE "./.dgawkrc"
-#define DEFAULT_PROMPT "dgawk> "
+#define DEFAULT_HISTFILE "./.gawk_history"
+#define DEFAULT_OPTFILE "./.gawkrc"
+#define DEFAULT_PROMPT "gawk> "
#define DEFAULT_LISTSIZE 15
#define DEFAULT_HISTSIZE 100
@@ -235,7 +234,7 @@ static const char *history_file = DEFAULT_HISTFILE;
/* keep all option variables in one place */
static char *output_file = "/dev/stdout"; /* gawk output redirection */
-char *dgawk_Prompt = NULL; /* initialized in interpret */
+char *dgawk_Prompt = NULL; /* initialized in do_debug */
static int list_size = DEFAULT_LISTSIZE; /* # of lines that 'list' prints */
static int do_trace = FALSE;
static int do_save_history = TRUE;
@@ -485,16 +484,16 @@ source_find(char *src)
return s;
}
- path = find_source(src, &sbuf, &errno_val);
+ path = find_source(src, & sbuf, & errno_val, FALSE);
if (path != NULL) {
for (s = srcfiles->next; s != srcfiles; s = s->next) {
if ((s->stype == SRC_FILE || s->stype == SRC_INC)
- && files_are_same(path, s)) {
+ && files_are_same(path, s)) {
efree(path);
return s;
}
- efree(path);
}
+ efree(path);
}
d_error(_("cannot find source file named `%s' (%s)"), src, strerror(errno_val));
@@ -991,7 +990,7 @@ find_param(const char *name, long num, char **pname)
pcount = func->param_cnt;
for (i = 0; i < pcount; i++) {
fparam = func->fparms[i].param;
- if (STREQ(name, fparam)) {
+ if (strcmp(name, fparam) == 0) {
r = f->stack[i];
if (r->type == Node_array_ref)
r = r->orig_array;
@@ -2227,6 +2226,23 @@ set_breakpoint_at(INSTRUCTION *rp, int lineno, int silent)
INSTRUCTION *ip, *prevp;
for (prevp = rp, ip = rp->nexti; ip; prevp = ip, ip = ip->nexti) {
+ if (ip->opcode == Op_K_case) {
+ INSTRUCTION *i1, *i2;
+
+ /* Special case: the code line numbers for a switch do not form
+ * a monotonically increasing sequence. Check if the line # is between
+ * the first and last statements of the case block before continuing
+ * the search.
+ */
+ for (i2 = ip->stmt_start, i1 = i2->nexti; i2 != ip->stmt_end;
+ i2 = i1, i1 = i1->nexti) {
+ if (i1->source_line >= lineno)
+ return add_breakpoint(i2, i1, rp->source_file, silent);
+ if (i1 == ip->stmt_end)
+ break;
+ }
+ }
+
if (ip->source_line >= lineno)
return add_breakpoint(prevp, ip, rp->source_file, silent);
if (ip == (rp + 1)->lasti)
@@ -2705,10 +2721,10 @@ initialize_readline()
#endif
-/* interpret --- debugger entry point */
+/* debug_prog --- debugger entry point */
int
-interpret(INSTRUCTION *pc)
+debug_prog(INSTRUCTION *pc)
{
char *run;
@@ -2758,7 +2774,7 @@ interpret(INSTRUCTION *pc)
(void) do_run(NULL, 0);
} else if (command_file != NULL) {
- /* run commands from a file (--command=file or -R file) */
+ /* run commands from a file (--debug=file or -D file) */
int fd;
fd = open_readfd(command_file);
if (fd == INVALID_HANDLE) {
@@ -2905,7 +2921,7 @@ do_run(CMDARG *arg ATTRIBUTE_UNUSED, int cmd ATTRIBUTE_UNUSED)
prog_running = TRUE;
fatal_tag_valid = TRUE;
if (setjmp(fatal_tag) == 0)
- (void) r_interpret(code_block);
+ (void) interpret(code_block);
fatal_tag_valid = FALSE;
prog_running = FALSE;
@@ -4036,7 +4052,7 @@ do_save(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
*/
if (strlen(line) > 1
- && STREQN(line, "sa", 2))
+ && strncmp(line, "sa", 2) == 0)
continue;
fprintf(fp, "%s\n", line);
@@ -4070,7 +4086,7 @@ do_option(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
value = arg ? arg->a_string : NULL;
for (opt = option_list; opt->name; opt++) { /* linear search */
- if (STREQ(name, opt->name))
+ if (strcmp(name, opt->name) == 0)
break;
}
if (! opt->name)
@@ -4619,8 +4635,9 @@ unserialize_option(char **pstr, int *pstr_len, int field_cnt ATTRIBUTE_UNUSED)
const struct dbg_option *opt;
for (opt = option_list; opt->name; opt++) {
- if (STREQN(pstr[0], opt->name, pstr_len[0])) {
+ if (strncmp(pstr[0], opt->name, pstr_len[0]) == 0) {
char *value;
+
value = estrdup(pstr[1], pstr_len[1]);
(*(opt->assign))(value);
efree(value);
@@ -5031,7 +5048,7 @@ find_option(char *name)
int idx;
for (idx = 0; (p = option_list[idx].name); idx++) {
- if (STREQ(p, name))
+ if (strcmp(p, name) == 0)
return idx;
}
return -1;
@@ -5100,19 +5117,19 @@ set_gawk_output(const char *file)
if (fp == NULL)
close(fd);
- } else if (STREQN(file, "/dev/", 5)) {
+ } else if (strncmp(file, "/dev/", 5) == 0) {
char *cp = (char *) file + 5;
- if (STREQ(cp, "stdout"))
+ if (strcmp(cp, "stdout") == 0)
return;
- if (STREQ(cp, "stderr")) {
+ if (strcmp(cp, "stderr") == 0) {
output_fp = stderr;
output_file = "/dev/stderr";
output_is_tty = os_isatty(fileno(stderr));
return;
}
- if (STREQN(cp, "fd/", 3)) {
+ if (strncmp(cp, "fd/", 3) == 0) {
cp += 3;
fd = (int) strtoul(cp, NULL, 10);
if (errno == 0 && fd > INVALID_HANDLE) {
@@ -5166,9 +5183,9 @@ static int
set_option_flag(const char *value)
{
long n;
- if (STREQ(value, "on"))
+ if (strcmp(value, "on") == 0)
return TRUE;
- if (STREQ(value, "off"))
+ if (strcmp(value, "off") == 0)
return FALSE;
errno = 0;
n = strtol(value, NULL, 0);
@@ -5360,7 +5377,7 @@ execute_code(volatile INSTRUCTION *code)
PUSH_BINDING(fatal_tag_stack, fatal_tag, fatal_tag_valid);
if (setjmp(fatal_tag) == 0) {
- (void) r_interpret((INSTRUCTION *) code);
+ (void) interpret((INSTRUCTION *) code);
r = POP_SCALAR();
} else /* fatal error */
(void) unwind_stack(save_stack_size);
@@ -5500,7 +5517,7 @@ do_eval(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
}
/* always destroy symbol "@eval", however destroy all newly installed
- * globals only if fatal error in r_interpret (r == NULL).
+ * globals only if fatal error (execute_code() returing NULL).
*/
pop_context(); /* switch to prev context */
@@ -5641,7 +5658,7 @@ in_cmd_src(const char *filename)
{
struct command_source *cs;
for (cs = cmd_src; cs != NULL; cs = cs->next) {
- if (cs->str != NULL && STREQ(cs->str, filename))
+ if (cs->str != NULL && strcmp(cs->str, filename) == 0)
return TRUE;
}
return FALSE;
diff --git a/dfa.c b/dfa.c
index 789c6b91..acd1a947 100644
--- a/dfa.c
+++ b/dfa.c
@@ -68,18 +68,6 @@
#define bool int
#define true (1)
#define false (0)
-#if ! MBS_SUPPORT
-#define wctype_t int
-#define wint_t int
-#define mbstate_t int
-#define WEOF EOF
-#define towupper toupper
-#define towlower tolower
-#define btowc(x) (x)
-#define iswalnum isalnum
-#define iswalpha isalpha
-#define iswupper isupper
-#endif /* ! MBS_SUPPORT */
#endif /* GAWK */
#include "regex.h"
@@ -92,74 +80,6 @@ is_blank (int c)
{
return (c == ' ' || c == '\t');
}
-
-#if ! MBS_SUPPORT
-static const char *classes[] = {
- "<dummy>",
- "alnum",
- "alpha",
- "blank",
- "cntrl",
- "digit",
- "graph",
- "lower",
- "print",
- "punct",
- "space",
- "upper",
- "xdigit",
- NULL
-};
-
-static wctype_t wctype(const char *name)
-{
- int i;
-
- for (i = 1; classes[i] != NULL; i++)
- if (strcmp(name, classes[i]) == 0)
- return i;
-
- return 0;
-}
-
-static int iswctype(wint_t wc, wctype_t desc)
-{
- int j = sizeof(classes) / sizeof(classes[0]);
-
- if (desc >= j || desc == 0)
- return 0;
-
- switch (desc) {
- case 1: return isalnum(wc);
- case 2: return isalpha(wc);
- case 3: return is_blank(wc);
- case 4: return iscntrl(wc);
- case 5: return isdigit(wc);
- case 6: return isgraph(wc);
- case 7: return islower(wc);
- case 8: return isprint(wc);
- case 9: return ispunct(wc);
- case 10: return isspace(wc);
- case 11: return isupper(wc);
- case 12: return isxdigit(wc);
- default: return 0;
- }
-}
-
-static int wcscoll(const wchar_t *ws1, const wchar_t *ws2)
-{
- size_t i;
-
- for (i = 0; ws1[i] != 0 && ws2[i] != 0; i++) {
- if (ws1[i] < ws2[i])
- return -1;
- else if (ws1[i] > ws2[i])
- return 1;
- }
-
- return (ws1[i] - ws2[i]);
-}
-#endif /* ! MBS_SUPPORT */
#endif /* GAWK */
/* HPUX, define those as macros in sys/param.h */
@@ -688,7 +608,8 @@ setbit_c (int b, charclass c)
}
#else
# define setbit_c setbit
-static inline bool setbit_wc (wint_t wc, charclass c)
+static inline bool
+setbit_wc (wint_t wc, charclass c)
{
abort ();
/*NOTREACHED*/
@@ -862,7 +783,7 @@ static const struct dfa_ctype prednames[] = {
{ NULL, NULL, false }
};
-static const struct dfa_ctype *
+static const struct dfa_ctype * _GL_ATTRIBUTE_PURE
find_pred (const char *str)
{
unsigned int i;
@@ -882,7 +803,6 @@ parse_bracket_exp (void)
int invert;
int c, c1, c2;
charclass ccl;
- wint_t wc1 = 0;
/* Used to warn about [:space:].
Bit 0 = first character is a colon.
@@ -893,6 +813,7 @@ parse_bracket_exp (void)
wint_t wc;
wint_t wc2;
+ wint_t wc1 = 0;
/* Work area to build a mb_char_classes. */
struct mb_char_classes *work_mbc;
@@ -1160,8 +1081,18 @@ parse_bracket_exp (void)
return CSET + charclass_index(ccl);
}
+/* Add this to the test for whether a byte is word-constituent, since on
+ BSD-based systems, many values in the 128..255 range are classified as
+ alphabetic, while on glibc-based systems, they are not. */
+#ifdef __GLIBC__
+# define is_valid_unibyte_character(c) 1
+#else
+# define is_valid_unibyte_character(c) (MBS_SUPPORT && btowc (c) != WEOF)
+#endif
+
/* Return non-zero if C is a `word-constituent' byte; zero otherwise. */
-#define IS_WORD_CONSTITUENT(C) (isalnum(C) || (C) == '_')
+#define IS_WORD_CONSTITUENT(C) \
+ (is_valid_unibyte_character(C) && (isalnum(C) || (C) == '_'))
static token
lex (void)
@@ -1758,7 +1689,7 @@ atom (void)
}
/* Return the number of tokens in the given subexpression. */
-static int
+static int _GL_ATTRIBUTE_PURE
nsubtoks (int tindex)
{
int ntoks1;
@@ -2208,9 +2139,7 @@ dfaanalyze (struct dfa *d, int searchflag)
CALLOC(d->follows, d->tindex);
for (i = 0; i < d->tindex; ++i)
-#ifdef DEBUG
- { /* Nonsyntactic #ifdef goo... */
-#endif
+ {
switch (d->tokens[i])
{
case EMPTY:
@@ -2335,8 +2264,8 @@ dfaanalyze (struct dfa *d, int searchflag)
prtok(d->tokens[lastpos[j].index]);
}
putc('\n', stderr);
- }
#endif
+ }
/* For each follow set that is the follow set of a real position, replace
it with its epsilon closure. */
@@ -2958,7 +2887,6 @@ match_mb_charset (struct dfa *d, int s, position pos, int idx)
with which this operator match. */
int op_len; /* Length of the operator. */
char buffer[128];
- wchar_t wcbuf[6];
/* Pointer to the structure to which we are currently refering. */
struct mb_char_classes *work_mbc;
@@ -3035,17 +2963,11 @@ match_mb_charset (struct dfa *d, int s, position pos, int idx)
}
}
- wcbuf[0] = wc;
- wcbuf[1] = wcbuf[3] = wcbuf[5] = '\0';
-
/* match with a range? */
for (i = 0; i<work_mbc->nranges; i++)
{
- wcbuf[2] = work_mbc->range_sts[i];
- wcbuf[4] = work_mbc->range_ends[i];
-
- if (wcscoll(wcbuf, wcbuf+2) >= 0 &&
- wcscoll(wcbuf+4, wcbuf) >= 0)
+ if (work_mbc->range_sts[i] <= wc &&
+ wc <= work_mbc->range_ends[i])
goto charset_matched;
}
@@ -3336,7 +3258,7 @@ dfaexec (struct dfa *d, char const *begin, char *end,
for (;;)
{
if (d->mb_cur_max > 1)
- while ((t = trans[s]))
+ while ((t = trans[s]) != NULL)
{
if (p > buf_end)
break;
@@ -3369,10 +3291,10 @@ dfaexec (struct dfa *d, char const *begin, char *end,
}
else
{
- while ((t = trans[s]) != 0)
+ while ((t = trans[s]) != NULL)
{
s1 = t[*p++];
- if ((t = trans[s1]) == 0)
+ if ((t = trans[s1]) == NULL)
{
int tmp = s; s = s1; s1 = tmp; /* swap */
break;
@@ -3683,7 +3605,7 @@ icpyalloc (char const *string)
return icatalloc (NULL, string);
}
-static char *
+static char * _GL_ATTRIBUTE_PURE
istrstr (char const *lookin, char const *lookfor)
{
char const *cp;
@@ -4095,7 +4017,7 @@ dfaalloc (void)
return xmalloc (sizeof (struct dfa));
}
-struct dfamust *
+struct dfamust * _GL_ATTRIBUTE_PURE
dfamusts (struct dfa const *d)
{
return d->musts;
diff --git a/dfa.h b/dfa.h
index 4d65ee34..d45f3139 100644
--- a/dfa.h
+++ b/dfa.h
@@ -22,6 +22,13 @@
# define __attribute__(x)
#endif
+/* The __pure__ attribute was added in gcc 2.96. */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#else
+# define _GL_ATTRIBUTE_PURE /* empty */
+#endif
+
/* Element of a list of strings, at least one of which is known to
appear in any R.E. matching the DFA. */
struct dfamust
diff --git a/doc/ChangeLog b/doc/ChangeLog
index aa365d70..2bbb982d 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,41 @@
+2012-02-06 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawk.texi, gawk.1: And some minor edits thereunto.
+
+2012-02-03 John Haque <j.eh@mchsi.com>
+
+ * gawk.texi, gawk.1: Add text on read timeout.
+
+2011-12-28 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awkcard.in, gawk.1: Minor edits after merge of executables.
+
+2011-12-21 John Haque <j.eh@mchsi.com>
+
+ * gawk.texi: Updated sections on profiling and debugging
+ after merging the exes. Document new options --debug and
+ --load, and add a sub-section on loading extension library.
+ * gawk.1: Same.
+ * awkcard.in: Same.
+
+2011-12-06 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawk.texi: Various typo fixes from mailing list.
+
+2011-11-10 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawk.1: Fix some .BR to be .B.
+
+2011-11-08 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawk.texi: Further improvement in the discussion of sorted array
+ traversal. Some sections reordered and text edited to suit.
+
+2011-11-06 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawk.texi: Try to improve discussion of sorted array
+ traversal.
+
2011-09-24 Arnold D. Robbins <arnold@skeeve.com>
* gawk.1: Fix some spelling errors. Thanks to
diff --git a/doc/awkcard.in b/doc/awkcard.in
index 1c4d1910..c8d41833 100644
--- a/doc/awkcard.in
+++ b/doc/awkcard.in
@@ -25,7 +25,6 @@
.\" Strings to save typing
.ds AK \*(FCawk\*(FR
.ds GK \*(FCgawk\*(FR
-.ds PK \*(FCpgawk\*(FR
.ds NK Bell Labs \*(FCawk\*(FR
.ds MK \*(FCmawk\*(FR
.\"
@@ -76,7 +75,7 @@ Pattern Elements 8
Printf Formats 14
Records 10
Regular Expressions 11
-Signals (\*(PK) 4
+Signals (\*(GK \*(FC\-\^\-profile\*(FR) 4
Special Filenames 12
String Functions 16
Time Functions (\*(GK) 17
@@ -253,6 +252,9 @@ their types and final values to
If no \*(FIfile\*(FR
is provided, \*(FCgawk\*(FR
uses \*(FCawkvars.out\*(FR.
+.TI "\*(FC\-D\*(FR[\*(FC\*(FIfile\*(FR], \*(FC\-\^\-debug\*(FR[\*(FC=\*(FIfile\*(FR]
+Enable debugging of program. Optionally read stored commands
+from \*(FIfile\*(FR.
.TI "\*(FC-e '\*(FItext\*(FC'\*(FR, \*(FC\-\^\-source '\*(FItext\*(FC'\*(FR
Use \*(FItext\*(FR as AWK program source code.
.TI "\*(FC\-E \*(FIfile\*(FR, \*(FC\-\^\-exec \*(FIfile\*(FR
@@ -268,6 +270,8 @@ for localization.
.TI "\*(FC\-h\*(FR, \*(FC\-\^\-help\*(FR
Print a short summary of the available
options on \*(FCstdout\*(FR, then exit zero.
+.TI "\*(FC\-l \*(FIlib\*(FR, \*(FC\-\^\-load \*(FIlib\*(FR
+Load dynamic extension \*(FIlib\fP.
.TI "\*(FC\-L \*(FR[\*(FC\*(FIvalue\*(FR], \*(FC\-\^\-lint\*(FR[\*(FC=\*(FIvalue\*(FR]
Warn about dubious or non-portable constructs.
If \*(FIvalue\*(FR is
@@ -282,31 +286,23 @@ Recognize octal and hexadecimal values in input data.
\*(FIUse this option with great caution!\*(FR
.TI "\*(FC\-N\*(FR, \*(FC\-\^\-use\-lc\-numeric\*(FR
Force use of the locale's decimal point character when parsing input data.
+.TI "\*(FC\-o\*(FR[\*(FC\*(FIfile\*(FR], \*(FC\-\^\-pretty-print\*(FR[\*(FC=\*(FIfile\*(FR]
+Output a pretty printed version of the program to \*(FIfile\*(FR
+(default: \*(FCawkprof.out\*(FR).
.TI "\*(FC\-O\*(FR, \*(FC\-\^\-optimize\*(FR
Enable some internal optimizations.
.TI "\*(FC\-p\*(FR[\*(FC\*(FIfile\*(FR], \*(FC\-\^\-profile\*(FR[\*(FC=\*(FIfile\*(FR]
Send profiling data to \*(FIfile\*(FR
(default: \*(FCawkprof.out\*(FR).
-With \*(GK,
-the profile is just a ``pretty printed'' version of the program.
-With \*(PK,
-the profile contains execution counts in the left margin
+The profile contains execution counts in the left margin
of each statement in the program.
.TI "\*(FC\-P\*(FR, \*(FC\-\^\-posix\*(FR
Disable common and GNU extensions.
-.TI "\*(FC\-R \*(FIfile\*(FR, \*(FC\-\^\-command \*(FIfile\*(FR"
-\*(FCdgawk\*(FR only.
-Read stored debugger commands from \*(FIfile\*(FR.
.TI "\*(FC\-r\*(FR, \*(FC\-\^\-re\-interval\*(FR
Enable \*(FIinterval expressions\*(FR in regular
expression matching (see \fHRegular
Expressions\fP below). Useful if
-\*(FC\-\^\-traditional\*(FR is specified.
-.TI "\*(FC\-S\*(FR, \*(FC\-\^\-sandbox\*(FR
-Disable the \*(FCsystem()\*(FR function,
-input redirection with \*(FCgetline\*(FR,
-output redirection with \*(FCprint\*(FR and \*(FCprintf\*(FR,
-and dynamic extensions loading.\*(CB
+\*(FC\-\^\-traditional\*(FR is specified.\*(CB
.in -4n
.EB "\s+2\f(HBCOMMAND LINE ARGUMENTS (\*(GK\f(HB)\*(FR\s0"
@@ -318,6 +314,11 @@ and dynamic extensions loading.\*(CB
.ES
.fi
.in +4n
+.TI "\*(FC\-S\*(FR, \*(FC\-\^\-sandbox\*(FR
+Disable the \*(FCsystem()\*(FR function,
+input redirection with \*(FCgetline\*(FR,
+output redirection with \*(FCprint\*(FR and \*(FCprintf\*(FR,
+and dynamic extensions loading.
.TI "\*(FC-t\*(FR, \*(FC\-\^\-lint\-old\*(FR
Warn about constructs that are not
portable to the original version of
@@ -382,14 +383,14 @@ The options may be abbreviated using just the first letter, e.g.,
and so on.\*(CB
.EB "\s+2\f(HBCOMMAND LINE ARGUMENTS (\*(MK\f(HB)\*(FR\s0"
.sp .7
-.\" --- Signals (pgawk)
+.\" --- Signals (gawk --profile)
.ES
.fi
-\*(CD\*(PK accepts two signals.
+\*(CD\*(GK accepts two signals while profiling.
\*(FCSIGUSR1\fP dumps a profile and function call stack to the
profile file. It then continues to run.
\*(FCSIGHUP\fP is similar, but exits.\*(CB
-.EB "\s+2\f(HBSIGNALS (\*(PK\f(HB)\*(FR\s0"
+.EB "\s+2\f(HBSIGNALS (\*(GK \f(HB\-\^\-profile)\*(FR\s0"
.\" --- Lines And Statements
.ES
diff --git a/doc/gawk.1 b/doc/gawk.1
index 205eb389..07a8d0e3 100644
--- a/doc/gawk.1
+++ b/doc/gawk.1
@@ -14,7 +14,7 @@
. if \w'\(rq' .ds rq "\(rq
. \}
.\}
-.TH GAWK 1 "May 29 2011" "Free Software Foundation" "Utility Commands"
+.TH GAWK 1 "Nov 10 2011" "Free Software Foundation" "Utility Commands"
.SH NAME
gawk \- pattern scanning and processing language
.SH SYNOPSIS
@@ -33,30 +33,6 @@ gawk \- pattern scanning and processing language
]
.I program-text
file .\|.\|.
-.sp
-.B pgawk
-[ \*(PX or \*(GN style options ]
-.B \-f
-.I program-file
-[
-.B \-\^\-
-] file .\|.\|.
-.br
-.B pgawk
-[ \*(PX or \*(GN style options ]
-[
-.B \-\^\-
-]
-.I program-text
-file .\|.\|.
-.sp
-.B dgawk
-[ \*(PX or \*(GN style options ]
-.B \-f
-.I program-file
-[
-.B \-\^\-
-] file .\|.\|.
.SH DESCRIPTION
.I Gawk
is the \*(GN Project's implementation of the \*(AK programming language.
@@ -84,27 +60,31 @@ and
.B ARGV
pre-defined \*(AK variables.
.PP
-.I Pgawk
-is the profiling version of
-.IR gawk .
-It is identical in every way to
-.IR gawk ,
-except that programs run more slowly,
-and it automatically produces an execution profile in the file
+When
+.I gawk
+is invoked with the
+.B \-\^\-profile
+option, it starts gathering profiling statistics
+from the execution of the program.
+.I Gawk
+runs more slowly in this mode, and automatically produces an execution
+profile in the file
.B awkprof.out
when done.
See the
.B \-\^\-profile
option, below.
.PP
-.I Dgawk
-is an
-.I awk
-debugger. Instead of running the program directly, it loads the
+.I Gawk
+also has an integrated debugger. An interactive debugging session can
+be started by supplying the
+.B \-\^\-debug
+option to the command line. In this mode of execution,
+.I gawk
+loads the
AWK source code and then prompts for debugging commands.
-Unlike
-.IR gawk " and " pgawk ", " dgawk
-only processes AWK program source provided with the
+.I Gawk
+can only debug AWK program source provided with the
.B \-f
option.
The debugger is documented in \*(EP.
@@ -117,8 +97,8 @@ while long options start with \*(lq\-\^\-\*(rq.
Long options are provided for both \*(GN-specific features and
for \*(PX-mandated features.
.PP
-.IR Gawk -
-specific options are typically used in long-option form.
+.IR Gawk -specific
+options are typically used in long-option form.
Arguments to long options are either joined with the option
by an
.B =
@@ -273,6 +253,18 @@ names like
and so on.)
.TP
.PD 0
+\fB\-D\fR[\fIfile\fR]
+.TP
+.PD
+\fB\-\^\-debug\fR[\fB=\fIfile\fR]
+Enable debugging of \*(AK programs.
+By default, the debugger reads commands interactively from the terminal.
+The optional
+.IR file
+argument can be used to specify a file with a list
+of commands for the debugger to execute non-interactively.
+.TP
+.PD 0
.BI "\-e " program-text
.TP
.PD
@@ -331,6 +323,21 @@ the standard output.
these options cause an immediate, successful exit.)
.TP
.PD 0
+.BI "\-l " lib
+.TP
+.PD
+.BI \-\^\-load " lib"
+Load a shared library
+.IR lib .
+This searches for the library using the
+.B AWKPATH
+environment variable. The suffix
+.I .so
+in the library name is optional, and
+the library initialization routine is expected to be named
+.BR dlload() .
+.TP
+.PD 0
.BR "\-L " [ \fIvalue\fR ]
.TP
.PD
@@ -387,12 +394,28 @@ users.
..
.TP
.PD 0
+\fB\-o\fR[\fIfile\fR]
+.TP
+.PD
+\fB\-\^\-pretty-print\fR[\fB=\fIfile\fR]
+Output a pretty printed version of the program to
+.IR file .
+If no
+.I file
+is provided,
+.I gawk
+uses a file named
+.B awkprof.out
+in the current directory.
+.TP
+.PD 0
.B \-O
.TP
.PD
.B \-\^\-optimize
Enable optimizations upon the internal representation of the program.
-Currently, this includes just simple constant-folding. The
+Currently, this includes simple constant-folding, and tail call
+elimination for recursive functions. The
.I gawk
maintainer hopes to add additional optimizations over time.
.TP
@@ -401,16 +424,11 @@ maintainer hopes to add additional optimizations over time.
.TP
.PD
\fB\-\^\-profile\fR[\fB=\fIprof_file\fR]
-Send profiling data to
+Start a profiling session, and send the profiling data to
.IR prof_file .
The default is
.BR awkprof.out .
-When run with
-.IR gawk ,
-the profile is just a \*(lqpretty printed\*(rq version of the program.
-When run with
-.IR pgawk ,
-the profile contains execution counts of each statement in the program
+The profile contains execution counts of each statement in the program
in the left margin and function call counts for each user-defined function.
.TP
.PD 0
@@ -482,15 +500,6 @@ They are enabled by default, but this option remains for use with
.BR \-\^-traditional .
.TP
.PD 0
-.B \-R
-.TP
-.PD
-.BI \-\^\-command " file"
-.I Dgawk
-only. Read stored debugger commands from
-.IR file .
-.TP
-.PD 0
.BI \-S
.TP
.PD
@@ -782,7 +791,7 @@ each field is made up of text that matches that regular expression. In
this case, the regular expression describes the fields themselves,
instead of the text that separates the fields.
Assigning a new value to
-.BR FS
+.B FS
or
.B FIELDWIDTHS
overrides the use of
@@ -1120,6 +1129,14 @@ corresponding values of the two elements being compared.
It should return a number less than, equal to, or greater than 0,
depending on how the elements of the array are to be ordered.
.TP
+\fBPROCINFO["input", "READ_TIMEOUT"]\fP
+specifies the timeout in milliseconds for reading data from
+.IR input ,
+where
+.I input
+is a redirection string or a filename. A value of zero or
+less than zero means no timeout.
+.TP
\fBPROCINFO["version"]\fP
the version of
.IR gawk .
@@ -2089,7 +2106,7 @@ Sends data to a co-process or socket.
below.)
.PP
The
-.BR getline
+.B getline
command returns 1 on success, 0 on end of file, and \-1 on an error.
Upon an error,
.B ERRNO
@@ -2234,9 +2251,9 @@ For
and
.BR %X ,
supply a leading
-.BR 0x
+.B 0x
or
-.BR 0X
+.B 0X
for
a nonzero result.
For
@@ -2517,7 +2534,7 @@ a second array if you wish to preserve the original.
The purpose of the optional string
.I how
is the same as described in
-.BR asort()
+.B asort()
above.
.TP
\fBgensub(\fIr\fB, \fIs\fB, \fIh \fR[\fB, \fIt\fR]\fB)\fR
@@ -2589,7 +2606,7 @@ to get a literal
(This must be typed as \fB"\e\e&"\fP;
see \*(EP
for a fuller discussion of the rules for
-.BR &'s
+.BR & 's
and backslashes in the replacement text of
.BR sub() ,
.BR gsub() ,
@@ -3122,8 +3139,9 @@ Using this feature at the C level is not pretty, but
it is unlikely to go away. Additional mechanisms may
be added at some point.
.SH SIGNALS
-.I pgawk
-accepts two signals.
+The
+.I gawk
+profiler accepts two signals.
.B SIGUSR1
causes it to dump a profile and function call stack to the
profile file, which is either
@@ -3133,7 +3151,7 @@ or whatever file was named with the
option. It then continues to run.
.B SIGHUP
causes
-.I pgawk
+.I gawk
to dump the profile and function call stack and then exit.
.SH INTERNATIONALIZATION
.PP
@@ -3275,7 +3293,7 @@ the
array; the
.BR \ea ,
and
-.BR \ev
+.B \ev
escape sequences (done originally in
.I gawk
and fed back into the Bell Laboratories version); the
@@ -3577,6 +3595,12 @@ and
.B \-\^\-file
options.
.PP
+The
+.B GAWK_READ_TIMEOUT
+environment variable can be used to specify a timeout
+in milliseconds for reading input from a terminal, pipe
+or two-way communication including sockets.
+.PP
For socket communication, two special environment variables can be used to control the number of retries
.RB ( GAWK_SOCK_RETRIES ),
and the interval between retries
diff --git a/doc/gawk.info b/doc/gawk.info
index b92d1b87..06b8e119 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -1,4 +1,4 @@
-This is gawk.info, produced by makeinfo version 4.8 from gawk.texi.
+This is gawk.info, produced by makeinfo version 4.13 from gawk.texi.
INFO-DIR-SECTION Text creation and manipulation
START-INFO-DIR-ENTRY
@@ -15,7 +15,7 @@ Foundation, Inc.
This is Edition 4 of `GAWK: Effective AWK Programming: A User's
-Guide for GNU Awk', for the 4.0.0 (or later) version of the GNU
+Guide for GNU Awk', for the 4.0.1 (or later) version of the GNU
implementation of AWK.
Permission is granted to copy, distribute and/or modify this document
@@ -47,7 +47,7 @@ Foundation, Inc.
This is Edition 4 of `GAWK: Effective AWK Programming: A User's
-Guide for GNU Awk', for the 4.0.0 (or later) version of the GNU
+Guide for GNU Awk', for the 4.0.1 (or later) version of the GNU
implementation of AWK.
Permission is granted to copy, distribute and/or modify this document
@@ -94,7 +94,7 @@ texts being (a) (see below), and with the Back-Cover Texts being (b)
* Library Functions:: A Library of `awk' Functions.
* Sample Programs:: Many `awk' programs with complete
explanations.
-* Debugger:: The `dgawk' debugger.
+* Debugger:: The `gawk' debugger.
* Language History:: The evolution of the `awk'
language.
* Installation:: Installing `gawk' under various
@@ -109,439 +109,400 @@ texts being (a) (see below), and with the Back-Cover Texts being (b)
* GNU Free Documentation License:: The license for this Info file.
* Index:: Concept and Variable Index.
-* History:: The history of `gawk' and
- `awk'.
-* Names:: What name to use to find `awk'.
-* This Manual:: Using this Info file. Includes
- sample input files that you can use.
-* Conventions:: Typographical Conventions.
-* Manual History:: Brief history of the GNU project and
- this Info file.
-* How To Contribute:: Helping to save the world.
-* Acknowledgments:: Acknowledgments.
-* Running gawk:: How to run `gawk' programs;
- includes command-line syntax.
-* One-shot:: Running a short throwaway `awk'
- program.
-* Read Terminal:: Using no input files (input from
- terminal instead).
-* Long:: Putting permanent `awk'
- programs in files.
-* Executable Scripts:: Making self-contained `awk'
- programs.
-* Comments:: Adding documentation to `gawk'
- programs.
-* Quoting:: More discussion of shell quoting
- issues.
-* DOS Quoting:: Quoting in Windows Batch Files.
-* Sample Data Files:: Sample data files for use in the
- `awk' programs illustrated in
- this Info file.
-* Very Simple:: A very simple example.
-* Two Rules:: A less simple one-line example using
- two rules.
-* More Complex:: A more complex example.
-* Statements/Lines:: Subdividing or combining statements
- into lines.
-* Other Features:: Other Features of `awk'.
-* When:: When to use `gawk' and when to
- use other things.
-* Command Line:: How to run `awk'.
-* Options:: Command-line options and their
- meanings.
-* Other Arguments:: Input file names and variable
- assignments.
-* Naming Standard Input:: How to specify standard input with
- other files.
-* Environment Variables:: The environment variables
- `gawk' uses.
-* AWKPATH Variable:: Searching directories for `awk'
- programs.
-* Other Environment Variables:: The environment variables.
-* Exit Status:: `gawk''s exit status.
-* Include Files:: Including other files into your
- program.
-* Obsolete:: Obsolete Options and/or features.
-* Undocumented:: Undocumented Options and Features.
-* Regexp Usage:: How to Use Regular Expressions.
-* Escape Sequences:: How to write nonprinting characters.
-* Regexp Operators:: Regular Expression Operators.
-* Bracket Expressions:: What can go between `[...]'.
-* GNU Regexp Operators:: Operators specific to GNU software.
-* Case-sensitivity:: How to do case-insensitive matching.
-* Leftmost Longest:: How much text matches.
-* Computed Regexps:: Using Dynamic Regexps.
-* Records:: Controlling how data is split into
- records.
-* Fields:: An introduction to fields.
-* Nonconstant Fields:: Nonconstant Field Numbers.
-* Changing Fields:: Changing the Contents of a Field.
-* Field Separators:: The field separator and how to change
- it.
-* Default Field Splitting:: How fields are normally separated.
-* Regexp Field Splitting:: Using regexps as the field separator.
-* Single Character Fields:: Making each character a separate field.
-* Command Line Field Separator:: Setting `FS' from the
- command-line.
-* Field Splitting Summary:: Some final points and a summary table.
-* Constant Size:: Reading constant width data.
-* Splitting By Content:: Defining Fields By Content
-* Multiple Line:: Reading multi-line records.
-* Getline:: Reading files under explicit program
- control using the `getline'
- function.
-* Plain Getline:: Using `getline' with no arguments.
-* Getline/Variable:: Using `getline' into a variable.
-* Getline/File:: Using `getline' from a file.
-* Getline/Variable/File:: Using `getline' into a variable
- from a file.
-* Getline/Pipe:: Using `getline' from a pipe.
-* Getline/Variable/Pipe:: Using `getline' into a variable
- from a pipe.
-* Getline/Coprocess:: Using `getline' from a coprocess.
-* Getline/Variable/Coprocess:: Using `getline' into a variable
- from a coprocess.
-* Getline Notes:: Important things to know about
- `getline'.
-* Getline Summary:: Summary of `getline' Variants.
-* Command line directories:: What happens if you put a directory on
- the command line.
-* Print:: The `print' statement.
-* Print Examples:: Simple examples of `print'
- statements.
-* Output Separators:: The output separators and how to change
- them.
-* OFMT:: Controlling Numeric Output With
- `print'.
-* Printf:: The `printf' statement.
-* Basic Printf:: Syntax of the `printf' statement.
-* Control Letters:: Format-control letters.
-* Format Modifiers:: Format-specification modifiers.
-* Printf Examples:: Several examples.
-* Redirection:: How to redirect output to multiple
- files and pipes.
-* Special Files:: File name interpretation in
- `gawk'. `gawk' allows
- access to inherited file descriptors.
-* Special FD:: Special files for I/O.
-* Special Network:: Special files for network
- communications.
-* Special Caveats:: Things to watch out for.
-* Close Files And Pipes:: Closing Input and Output Files and
- Pipes.
-* Values:: Constants, Variables, and Regular
- Expressions.
-* Constants:: String, numeric and regexp constants.
-* Scalar Constants:: Numeric and string constants.
-* Nondecimal-numbers:: What are octal and hex numbers.
-* Regexp Constants:: Regular Expression constants.
-* Using Constant Regexps:: When and how to use a regexp constant.
-* Variables:: Variables give names to values for
- later use.
-* Using Variables:: Using variables in your programs.
-* Assignment Options:: Setting variables on the command-line
- and a summary of command-line syntax.
- This is an advanced method of input.
-* Conversion:: The conversion of strings to numbers
- and vice versa.
-* All Operators:: `gawk''s operators.
-* Arithmetic Ops:: Arithmetic operations (`+',
- `-', etc.)
-* Concatenation:: Concatenating strings.
-* Assignment Ops:: Changing the value of a variable or a
- field.
-* Increment Ops:: Incrementing the numeric value of a
- variable.
-* Truth Values and Conditions:: Testing for true and false.
-* Truth Values:: What is ``true'' and what is ``false''.
-* Typing and Comparison:: How variables acquire types and how
- this affects comparison of numbers and
- strings with `<', etc.
-* Variable Typing:: String type versus numeric type.
-* Comparison Operators:: The comparison operators.
-* POSIX String Comparison:: String comparison with POSIX rules.
-* Boolean Ops:: Combining comparison expressions using
- boolean operators `||' (``or''),
- `&&' (``and'') and `!'
- (``not'').
-* Conditional Exp:: Conditional expressions select between
- two subexpressions under control of a
- third subexpression.
-* Function Calls:: A function call is an expression.
-* Precedence:: How various operators nest.
-* Locales:: How the locale affects things.
-* Pattern Overview:: What goes into a pattern.
-* Regexp Patterns:: Using regexps as patterns.
-* Expression Patterns:: Any expression can be used as a
- pattern.
-* Ranges:: Pairs of patterns specify record
- ranges.
-* BEGIN/END:: Specifying initialization and cleanup
- rules.
-* Using BEGIN/END:: How and why to use BEGIN/END rules.
-* I/O And BEGIN/END:: I/O issues in BEGIN/END rules.
-* BEGINFILE/ENDFILE:: Two special patterns for advanced
- control.
-* Empty:: The empty pattern, which matches every
- record.
-* Using Shell Variables:: How to use shell variables with
- `awk'.
-* Action Overview:: What goes into an action.
-* Statements:: Describes the various control
- statements in detail.
-* If Statement:: Conditionally execute some
- `awk' statements.
-* While Statement:: Loop until some condition is satisfied.
-* Do Statement:: Do specified action while looping until
- 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 loop.
-* Next Statement:: Stop processing the current input
- record.
-* Nextfile Statement:: Stop processing the current file.
-* Exit Statement:: Stop execution of `awk'.
-* Built-in Variables:: Summarizes the built-in variables.
-* User-modified:: Built-in variables that you change to
- control `awk'.
-* Auto-set:: Built-in variables where `awk'
- gives you information.
-* ARGC and ARGV:: Ways to use `ARGC' and
- `ARGV'.
-* Array Basics:: The basics of arrays.
-* Array Intro:: Introduction to Arrays
-* Reference to Elements:: How to examine one element of an array.
-* Assigning Elements:: How to change an element of an array.
-* Array Example:: Basic Example of an Array
-* Scanning an Array:: A variation of the `for'
- statement. It loops through the indices
- of an array's existing elements.
-* Delete:: The `delete' statement removes an
- element from an array.
-* Numeric Array Subscripts:: How to use numbers as subscripts in
- `awk'.
-* Uninitialized Subscripts:: Using Uninitialized variables as
- subscripts.
-* Multi-dimensional:: Emulating multidimensional arrays in
- `awk'.
-* Multi-scanning:: Scanning multidimensional arrays.
-* Arrays of Arrays:: True multidimensional arrays.
-* Built-in:: Summarizes the built-in functions.
-* Calling Built-in:: How to call built-in functions.
-* Numeric Functions:: Functions that work with numbers,
- including `int()', `sin()'
- and `rand()'.
-* String Functions:: Functions for string manipulation, such
- as `split()', `match()' and
- `sprintf()'.
-* Gory Details:: More than you want to know about
- `\' and `&' with
- `sub()', `gsub()', and
- `gensub()'.
-* I/O Functions:: Functions for files and shell commands.
-* Time Functions:: Functions for dealing with timestamps.
-* Bitwise Functions:: Functions for bitwise operations.
-* Type Functions:: Functions for type information.
-* I18N Functions:: Functions for string translation.
-* User-defined:: Describes User-defined functions in
- detail.
-* Definition Syntax:: How to write definitions and what they
- mean.
-* Function Example:: An example function definition and what
- it does.
-* Function Caveats:: Things to watch out for.
-* Calling A Function:: Don't use spaces.
-* Variable Scope:: Controlling variable scope.
-* Pass By Value/Reference:: Passing parameters.
-* Return Statement:: Specifying the value a function
- returns.
-* Dynamic Typing:: How variable types can change at
- runtime.
-* Indirect Calls:: Choosing the function to call at
- runtime.
-* I18N and L10N:: Internationalization and Localization.
-* Explaining gettext:: How GNU `gettext' works.
-* Programmer i18n:: Features for the programmer.
-* Translator i18n:: Features for the translator.
-* String Extraction:: Extracting marked strings.
-* Printf Ordering:: Rearranging `printf' arguments.
-* I18N Portability:: `awk'-level portability issues.
-* I18N Example:: A simple i18n example.
-* Gawk I18N:: `gawk' is also
- internationalized.
-* Nondecimal Data:: Allowing nondecimal input data.
-* Array Sorting:: Facilities for controlling array
- traversal and sorting arrays.
-* Controlling Array Traversal:: How to use PROCINFO["sorted_in"].
-* Controlling Scanning With A Function:: Using a function to control scanning.
-* Controlling Scanning:: Controlling the order in which arrays
- are scanned.
-* Array Sorting Functions:: How to use `asort()' and
- `asorti()'.
-* Two-way I/O:: Two-way communications with another
- process.
-* TCP/IP Networking:: Using `gawk' for network
- programming.
-* Profiling:: Profiling your `awk' programs.
-* Library Names:: How to best name private global
- variables in library functions.
-* General Functions:: Functions that are of general use.
-* Strtonum Function:: A replacement for the built-in
- `strtonum()' function.
-* Assert Function:: A function for assertions in
- `awk' programs.
-* Round Function:: A function for rounding if
- `sprintf()' does not do it
- correctly.
-* Cliff Random Function:: The Cliff Random Number Generator.
-* Ordinal Functions:: Functions for using characters as
- numbers and vice versa.
-* Join Function:: A function to join an array into a
- string.
-* Gettimeofday Function:: A function to get formatted times.
-* Data File Management:: Functions for managing 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.
-* Getopt Function:: A function for processing command-line
- arguments.
-* Passwd Functions:: Functions for getting user information.
-* Group Functions:: Functions for getting group
- information.
-* Walking Arrays:: A function to walk arrays of arrays.
-* Running Examples:: How to run these examples.
-* Clones:: Clones of common utilities.
-* Cut Program:: The `cut' utility.
-* Egrep Program:: The `egrep' utility.
-* Id Program:: The `id' utility.
-* Split Program:: The `split' utility.
-* Tee Program:: The `tee' utility.
-* Uniq Program:: The `uniq' utility.
-* Wc Program:: The `wc' utility.
-* Miscellaneous Programs:: Some interesting `awk'
- programs.
-* Dupword Program:: Finding duplicated words in a document.
-* Alarm Program:: An alarm clock.
-* Translate Program:: A program similar to the `tr'
- utility.
-* Labels Program:: Printing mailing labels.
-* Word Sorting:: A program to produce a word usage
- count.
-* History Sorting:: Eliminating duplicate entries from a
- history file.
-* Extract Program:: Pulling out programs from Texinfo
- source files.
-* Simple Sed:: A Simple Stream Editor.
-* Igawk Program:: A wrapper for `awk' that
- includes files.
-* Anagram Program:: Finding anagrams from a dictionary.
-* Signature Program:: People do amazing things with too much
- time on their hands.
-* Debugging:: Introduction to `dgawk'.
-* Debugging Concepts:: Debugging In General.
-* Debugging Terms:: Additional Debugging Concepts.
-* Awk Debugging:: Awk Debugging.
-* Sample dgawk session:: Sample `dgawk' session.
-* dgawk invocation:: `dgawk' Invocation.
-* Finding The Bug:: Finding The Bug.
-* List of Debugger Commands:: Main `dgawk' Commands.
-* Breakpoint Control:: Control of breakpoints.
-* Dgawk Execution Control:: Control of execution.
-* Viewing And Changing Data:: Viewing and changing data.
-* Dgawk Stack:: Dealing with the stack.
-* Dgawk Info:: Obtaining information about the program
- and the debugger state.
-* Miscellaneous Dgawk Commands:: Miscellaneous Commands.
-* Readline Support:: Readline Support.
-* Dgawk Limitations:: Limitations and future plans.
-* V7/SVR3.1:: The major changes between V7 and System
- V Release 3.1.
-* SVR4:: Minor changes between System V Releases
- 3.1 and 4.
-* POSIX:: New features from the POSIX standard.
-* BTL:: New features from Brian Kernighan's
- version of `awk'.
-* POSIX/GNU:: The extensions in `gawk' not in
- POSIX `awk'.
-* Common Extensions:: Common Extensions Summary.
-* Ranges and Locales:: How locales used to affect regexp
- ranges.
-* Contributors:: The major contributors to
- `gawk'.
-* Gawk Distribution:: What is in the `gawk'
- distribution.
-* Getting:: How to get the distribution.
-* Extracting:: How to extract the distribution.
-* Distribution contents:: What is in the distribution.
-* Unix Installation:: Installing `gawk' under various
- versions of Unix.
-* Quick Installation:: Compiling `gawk' under Unix.
-* Additional Configuration Options:: Other compile-time options.
-* Configuration Philosophy:: How it's all supposed to work.
-* Non-Unix Installation:: Installation on Other Operating
- Systems.
-* 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,
- Windows32, and OS/2.
-* PC Testing:: Testing `gawk' on PC systems.
-* PC Using:: Running `gawk' on MS-DOS,
- Windows32 and OS/2.
-* Cygwin:: Building and running `gawk' for
- Cygwin.
-* MSYS:: Using `gawk' In The MSYS
- Environment.
-* VMS Installation:: Installing `gawk' on VMS.
-* VMS Compilation:: How to compile `gawk' under
- VMS.
-* VMS Installation Details:: How to install `gawk' under
- VMS.
-* VMS Running:: How to run `gawk' under VMS.
-* VMS Old Gawk:: An old version comes with some VMS
- systems.
-* Bugs:: Reporting Problems and Bugs.
-* Other Versions:: Other freely available `awk'
- implementations.
-* Compatibility Mode:: How to disable certain `gawk'
- extensions.
-* Additions:: Making Additions To `gawk'.
-* Accessing The Source:: Accessing the Git repository.
-* Adding Code:: Adding code to the main body of
- `gawk'.
-* New Ports:: Porting `gawk' to a new
- operating system.
-* Dynamic Extensions:: Adding new built-in functions to
- `gawk'.
-* Internals:: A brief look at some `gawk'
- internals.
-* Plugin License:: A note about licensing.
-* Sample Library:: A example of new functions.
-* Internal File Description:: What the new functions will do.
-* Internal File Ops:: The code for internal file operations.
-* Using Internal File Ops:: How to use an external extension.
-* Future Extensions:: New features that may be implemented
- one day.
-* Basic High Level:: The high level view.
-* Basic Data Typing:: A very quick intro to data types.
-* Floating Point Issues:: Stuff to know about floating-point
- numbers.
-* String Conversion Precision:: The String Value Can Lie.
-* Unexpected Results:: Floating Point Numbers Are Not Abstract
- Numbers.
-* POSIX Floating Point Problems:: Standards Versus Existing Practice.
+* History:: The history of `gawk' and
+ `awk'.
+* Names:: What name to use to find `awk'.
+* This Manual:: Using this Info file. Includes
+ sample input files that you can use.
+* Conventions:: Typographical Conventions.
+* Manual History:: Brief history of the GNU project and this
+ Info file.
+* How To Contribute:: Helping to save the world.
+* Acknowledgments:: Acknowledgments.
+* Running gawk:: How to run `gawk' programs;
+ includes command-line syntax.
+* One-shot:: Running a short throwaway `awk'
+ program.
+* Read Terminal:: Using no input files (input from terminal
+ instead).
+* Long:: Putting permanent `awk' programs in
+ files.
+* Executable Scripts:: Making self-contained `awk'
+ programs.
+* Comments:: Adding documentation to `gawk'
+ programs.
+* Quoting:: More discussion of shell quoting issues.
+* DOS Quoting:: Quoting in Windows Batch Files.
+* Sample Data Files:: Sample data files for use in the
+ `awk' programs illustrated in this
+ Info file.
+* Very Simple:: A very simple example.
+* Two Rules:: A less simple one-line example using two
+ rules.
+* More Complex:: A more complex example.
+* Statements/Lines:: Subdividing or combining statements into
+ lines.
+* Other Features:: Other Features of `awk'.
+* When:: When to use `gawk' and when to use
+ other things.
+* Command Line:: How to run `awk'.
+* Options:: Command-line options and their meanings.
+* Other Arguments:: Input file names and variable assignments.
+* Naming Standard Input:: How to specify standard input with other
+ files.
+* Environment Variables:: The environment variables `gawk'
+ uses.
+* AWKPATH Variable:: Searching directories for `awk'
+ programs.
+* Other Environment Variables:: The environment variables.
+* Exit Status:: `gawk''s exit status.
+* Include Files:: Including other files into your program.
+* Obsolete:: Obsolete Options and/or features.
+* Undocumented:: Undocumented Options and Features.
+* Regexp Usage:: How to Use Regular Expressions.
+* Escape Sequences:: How to write nonprinting characters.
+* Regexp Operators:: Regular Expression Operators.
+* Bracket Expressions:: What can go between `[...]'.
+* GNU Regexp Operators:: Operators specific to GNU software.
+* Case-sensitivity:: How to do case-insensitive matching.
+* Leftmost Longest:: How much text matches.
+* Computed Regexps:: Using Dynamic Regexps.
+* Records:: Controlling how data is split into records.
+* Fields:: An introduction to fields.
+* Nonconstant Fields:: Nonconstant Field Numbers.
+* Changing Fields:: Changing the Contents of a Field.
+* Field Separators:: The field separator and how to change it.
+* Default Field Splitting:: How fields are normally separated.
+* Regexp Field Splitting:: Using regexps as the field separator.
+* Single Character Fields:: Making each character a separate field.
+* Command Line Field Separator:: Setting `FS' from the command-line.
+* Field Splitting Summary:: Some final points and a summary table.
+* Constant Size:: Reading constant width data.
+* Splitting By Content:: Defining Fields By Content
+* Multiple Line:: Reading multi-line records.
+* Getline:: Reading files under explicit program
+ control using the `getline' function.
+* Plain Getline:: Using `getline' with no arguments.
+* Getline/Variable:: Using `getline' into a variable.
+* Getline/File:: Using `getline' from a file.
+* Getline/Variable/File:: Using `getline' into a variable from a
+ file.
+* Getline/Pipe:: Using `getline' from a pipe.
+* Getline/Variable/Pipe:: Using `getline' into a variable from a
+ pipe.
+* Getline/Coprocess:: Using `getline' from a coprocess.
+* Getline/Variable/Coprocess:: Using `getline' into a variable from a
+ coprocess.
+* Getline Notes:: Important things to know about
+ `getline'.
+* Getline Summary:: Summary of `getline' Variants.
+* Command line directories:: What happens if you put a directory on the
+ command line.
+* Print:: The `print' statement.
+* Print Examples:: Simple examples of `print' statements.
+* Output Separators:: The output separators and how to change
+ them.
+* OFMT:: Controlling Numeric Output With
+ `print'.
+* Printf:: The `printf' statement.
+* Basic Printf:: Syntax of the `printf' statement.
+* Control Letters:: Format-control letters.
+* Format Modifiers:: Format-specification modifiers.
+* Printf Examples:: Several examples.
+* Redirection:: How to redirect output to multiple files
+ and pipes.
+* Special Files:: File name interpretation in `gawk'.
+ `gawk' allows access to inherited
+ file descriptors.
+* Special FD:: Special files for I/O.
+* Special Network:: Special files for network communications.
+* Special Caveats:: Things to watch out for.
+* Close Files And Pipes:: Closing Input and Output Files and Pipes.
+* Values:: Constants, Variables, and Regular
+ Expressions.
+* Constants:: String, numeric and regexp constants.
+* Scalar Constants:: Numeric and string constants.
+* Nondecimal-numbers:: What are octal and hex numbers.
+* Regexp Constants:: Regular Expression constants.
+* Using Constant Regexps:: When and how to use a regexp constant.
+* Variables:: Variables give names to values for later
+ use.
+* Using Variables:: Using variables in your programs.
+* Assignment Options:: Setting variables on the command-line and a
+ summary of command-line syntax. This is an
+ advanced method of input.
+* Conversion:: The conversion of strings to numbers and
+ vice versa.
+* All Operators:: `gawk''s operators.
+* Arithmetic Ops:: Arithmetic operations (`+', `-',
+ etc.)
+* Concatenation:: Concatenating strings.
+* Assignment Ops:: Changing the value of a variable or a
+ field.
+* Increment Ops:: Incrementing the numeric value of a
+ variable.
+* Truth Values and Conditions:: Testing for true and false.
+* Truth Values:: What is ``true'' and what is ``false''.
+* Typing and Comparison:: How variables acquire types and how this
+ affects comparison of numbers and strings
+ with `<', etc.
+* Variable Typing:: String type versus numeric type.
+* Comparison Operators:: The comparison operators.
+* POSIX String Comparison:: String comparison with POSIX rules.
+* Boolean Ops:: Combining comparison expressions using
+ boolean operators `||' (``or''),
+ `&&' (``and'') and `!' (``not'').
+* Conditional Exp:: Conditional expressions select between two
+ subexpressions under control of a third
+ subexpression.
+* Function Calls:: A function call is an expression.
+* Precedence:: How various operators nest.
+* Locales:: How the locale affects things.
+* Pattern Overview:: What goes into a pattern.
+* Regexp Patterns:: Using regexps as patterns.
+* Expression Patterns:: Any expression can be used as a pattern.
+* Ranges:: Pairs of patterns specify record ranges.
+* BEGIN/END:: Specifying initialization and cleanup
+ rules.
+* Using BEGIN/END:: How and why to use BEGIN/END rules.
+* I/O And BEGIN/END:: I/O issues in BEGIN/END rules.
+* BEGINFILE/ENDFILE:: Two special patterns for advanced control.
+* Empty:: The empty pattern, which matches every
+ record.
+* Using Shell Variables:: How to use shell variables with
+ `awk'.
+* Action Overview:: What goes into an action.
+* Statements:: Describes the various control statements in
+ detail.
+* If Statement:: Conditionally execute some `awk'
+ statements.
+* While Statement:: Loop until some condition is satisfied.
+* Do Statement:: Do specified action while looping until
+ 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
+ loop.
+* Next Statement:: Stop processing the current input record.
+* Nextfile Statement:: Stop processing the current file.
+* Exit Statement:: Stop execution of `awk'.
+* Built-in Variables:: Summarizes the built-in variables.
+* User-modified:: Built-in variables that you change to
+ control `awk'.
+* Auto-set:: Built-in variables where `awk'
+ gives you information.
+* ARGC and ARGV:: Ways to use `ARGC' and `ARGV'.
+* Array Basics:: The basics of arrays.
+* Array Intro:: Introduction to Arrays
+* Reference to Elements:: How to examine one element of an array.
+* Assigning Elements:: How to change an element of an array.
+* Array Example:: Basic Example of an Array
+* Scanning an Array:: A variation of the `for' statement. It
+ loops through the indices of an array's
+ existing elements.
+* Controlling Scanning:: Controlling the order in which arrays are
+ scanned.
+* Delete:: The `delete' statement removes an
+ element from an array.
+* Numeric Array Subscripts:: How to use numbers as subscripts in
+ `awk'.
+* Uninitialized Subscripts:: Using Uninitialized variables as
+ subscripts.
+* Multi-dimensional:: Emulating multidimensional arrays in
+ `awk'.
+* Multi-scanning:: Scanning multidimensional arrays.
+* Arrays of Arrays:: True multidimensional arrays.
+* Built-in:: Summarizes the built-in functions.
+* Calling Built-in:: How to call built-in functions.
+* Numeric Functions:: Functions that work with numbers, including
+ `int()', `sin()' and
+ `rand()'.
+* String Functions:: Functions for string manipulation, such as
+ `split()', `match()' and
+ `sprintf()'.
+* Gory Details:: More than you want to know about `\'
+ and `&' with `sub()',
+ `gsub()', and `gensub()'.
+* I/O Functions:: Functions for files and shell commands.
+* Time Functions:: Functions for dealing with timestamps.
+* Bitwise Functions:: Functions for bitwise operations.
+* Type Functions:: Functions for type information.
+* I18N Functions:: Functions for string translation.
+* User-defined:: Describes User-defined functions in detail.
+* Definition Syntax:: How to write definitions and what they
+ mean.
+* Function Example:: An example function definition and what it
+ does.
+* Function Caveats:: Things to watch out for.
+* Calling A Function:: Don't use spaces.
+* Variable Scope:: Controlling variable scope.
+* Pass By Value/Reference:: Passing parameters.
+* Return Statement:: Specifying the value a function returns.
+* Dynamic Typing:: How variable types can change at runtime.
+* Indirect Calls:: Choosing the function to call at runtime.
+* I18N and L10N:: Internationalization and Localization.
+* Explaining gettext:: How GNU `gettext' works.
+* Programmer i18n:: Features for the programmer.
+* Translator i18n:: Features for the translator.
+* String Extraction:: Extracting marked strings.
+* Printf Ordering:: Rearranging `printf' arguments.
+* I18N Portability:: `awk'-level portability issues.
+* I18N Example:: A simple i18n example.
+* Gawk I18N:: `gawk' is also internationalized.
+* Nondecimal Data:: Allowing nondecimal input data.
+* Array Sorting:: Facilities for controlling array traversal
+ and sorting arrays.
+* Controlling Array Traversal:: How to use PROCINFO["sorted_in"].
+* Array Sorting Functions:: How to use `asort()' and
+ `asorti()'.
+* Two-way I/O:: Two-way communications with another
+ process.
+* TCP/IP Networking:: Using `gawk' for network
+ programming.
+* Profiling:: Profiling your `awk' programs.
+* Library Names:: How to best name private global variables
+ in library functions.
+* General Functions:: Functions that are of general use.
+* Strtonum Function:: A replacement for the built-in
+ `strtonum()' function.
+* Assert Function:: A function for assertions in `awk'
+ programs.
+* Round Function:: A function for rounding if `sprintf()'
+ does not do it correctly.
+* Cliff Random Function:: The Cliff Random Number Generator.
+* Ordinal Functions:: Functions for using characters as numbers
+ and vice versa.
+* Join Function:: A function to join an array into a string.
+* Gettimeofday Function:: A function to get formatted times.
+* Data File Management:: Functions for managing 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.
+* Getopt Function:: A function for processing command-line
+ arguments.
+* Passwd Functions:: Functions for getting user information.
+* Group Functions:: Functions for getting group information.
+* Walking Arrays:: A function to walk arrays of arrays.
+* Running Examples:: How to run these examples.
+* Clones:: Clones of common utilities.
+* Cut Program:: The `cut' utility.
+* Egrep Program:: The `egrep' utility.
+* Id Program:: The `id' utility.
+* Split Program:: The `split' utility.
+* Tee Program:: The `tee' utility.
+* Uniq Program:: The `uniq' utility.
+* Wc Program:: The `wc' utility.
+* Miscellaneous Programs:: Some interesting `awk' programs.
+* Dupword Program:: Finding duplicated words in a document.
+* Alarm Program:: An alarm clock.
+* Translate Program:: A program similar to the `tr'
+ utility.
+* Labels Program:: Printing mailing labels.
+* Word Sorting:: A program to produce a word usage count.
+* History Sorting:: Eliminating duplicate entries from a
+ history file.
+* Extract Program:: Pulling out programs from Texinfo source
+ files.
+* Simple Sed:: A Simple Stream Editor.
+* Igawk Program:: A wrapper for `awk' that includes
+ files.
+* Anagram Program:: Finding anagrams from a dictionary.
+* Signature Program:: People do amazing things with too much time
+ on their hands.
+* Debugging:: Introduction to `gawk' Debugger.
+* Debugging Concepts:: Debugging in General.
+* Debugging Terms:: Additional Debugging Concepts.
+* Awk Debugging:: Awk Debugging.
+* Sample Debugging Session:: Sample Debugging Session.
+* Debugger Invocation:: How to Start the Debugger.
+* Finding The Bug:: Finding the Bug.
+* List of Debugger Commands:: Main Commands.
+* Breakpoint Control:: Control of Breakpoints.
+* Debugger Execution Control:: Control of Execution.
+* Viewing And Changing Data:: Viewing and Changing Data.
+* Execution Stack:: Dealing with the Stack.
+* Debugger Info:: Obtaining Information about the Program and
+ the Debugger State.
+* Miscellaneous Debugger Commands:: Miscellaneous Commands.
+* Readline Support:: Readline Support.
+* Limitations:: Limitations and Future Plans.
+* V7/SVR3.1:: The major changes between V7 and System V
+ Release 3.1.
+* SVR4:: Minor changes between System V Releases 3.1
+ and 4.
+* POSIX:: New features from the POSIX standard.
+* BTL:: New features from Brian Kernighan's version
+ of `awk'.
+* POSIX/GNU:: The extensions in `gawk' not in
+ POSIX `awk'.
+* Common Extensions:: Common Extensions Summary.
+* Ranges and Locales:: How locales used to affect regexp ranges.
+* Contributors:: The major contributors to `gawk'.
+* Gawk Distribution:: What is in the `gawk' distribution.
+* Getting:: How to get the distribution.
+* Extracting:: How to extract the distribution.
+* Distribution contents:: What is in the distribution.
+* Unix Installation:: Installing `gawk' under various
+ versions of Unix.
+* Quick Installation:: Compiling `gawk' under Unix.
+* Additional Configuration Options:: Other compile-time options.
+* Configuration Philosophy:: How it's all supposed to work.
+* Non-Unix Installation:: Installation on Other Operating Systems.
+* 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,
+ Windows32, and OS/2.
+* PC Testing:: Testing `gawk' on PC systems.
+* PC Using:: Running `gawk' on MS-DOS, Windows32
+ and OS/2.
+* Cygwin:: Building and running `gawk' for
+ Cygwin.
+* MSYS:: Using `gawk' In The MSYS
+ Environment.
+* VMS Installation:: Installing `gawk' on VMS.
+* VMS Compilation:: How to compile `gawk' under VMS.
+* VMS Installation Details:: How to install `gawk' under VMS.
+* VMS Running:: How to run `gawk' under VMS.
+* VMS Old Gawk:: An old version comes with some VMS systems.
+* Bugs:: Reporting Problems and Bugs.
+* Other Versions:: Other freely available `awk'
+ implementations.
+* Compatibility Mode:: How to disable certain `gawk'
+ extensions.
+* Additions:: Making Additions To `gawk'.
+* Accessing The Source:: Accessing the Git repository.
+* Adding Code:: Adding code to the main body of
+ `gawk'.
+* New Ports:: Porting `gawk' to a new operating
+ system.
+* Dynamic Extensions:: Adding new built-in functions to
+ `gawk'.
+* Internals:: A brief look at some `gawk'
+ internals.
+* Plugin License:: A note about licensing.
+* Loading Extensions:: How to load dynamic extensions.
+* Sample Library:: A example of new functions.
+* Internal File Description:: What the new functions will do.
+* Internal File Ops:: The code for internal file operations.
+* Using Internal File Ops:: How to use an external extension.
+* Future Extensions:: New features that may be implemented one
+ day.
+* Basic High Level:: The high level view.
+* Basic Data Typing:: A very quick intro to data types.
+* Floating Point Issues:: Stuff to know about floating-point numbers.
+* String Conversion Precision:: The String Value Can Lie.
+* Unexpected Results:: Floating Point Numbers Are Not Abstract
+ Numbers.
+* POSIX Floating Point Problems:: Standards Versus Existing Practice.
To Miriam, for making me complete.
@@ -781,7 +742,7 @@ A Rose by Any Other Name
========================
The `awk' language has evolved over the years. Full details are
-provided in *Note Language History::. The language described in this
+provided in *note Language History::. The language described in this
Info file is often referred to as "new `awk'" (`nawk').
Because of this, there are systems with multiple versions of `awk'.
@@ -842,78 +803,78 @@ illustrates the concept currently being described.
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 Library Functions::, and in
-*Note 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::, provides the essentials you need to know to
+ *note Getting Started::, provides the essentials you need to know to
begin using `awk'.
- *Note Invoking Gawk::, describes how to run `gawk', the meaning of
+ *note Invoking Gawk::, describes how to run `gawk', the meaning of
its command-line options, and how it finds `awk' program source files.
- *Note Regexp::, introduces regular expressions in general, and in
+ *note Regexp::, introduces regular expressions in general, and in
particular the flavors supported by POSIX `awk' and `gawk'.
- *Note Reading Files::, describes how `awk' reads your data. It
+ *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. Network I/O is also
briefly introduced here.
- *Note Printing::, describes how `awk' programs can produce output
+ *note Printing::, describes how `awk' programs can produce output
with `print' and `printf'.
- *Note Expressions::, describes expressions, which are the basic
+ *note Expressions::, describes expressions, which are the basic
building blocks for getting most things done in a program.
- *Note Patterns and Actions::, describes how to write patterns for
+ *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::, covers `awk''s one-and-only data structure:
+ *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'. It also describes how
`gawk' provides arrays of arrays.
- *Note Functions::, describes the built-in functions `awk' and `gawk'
+ *note Functions::, describes the built-in functions `awk' and `gawk'
provide, as well as how to define your own functions.
- *Note Internationalization::, describes special features in `gawk'
+ *note Internationalization::, describes special features in `gawk'
for translating program messages into different languages at runtime.
- *Note Advanced Features::, describes a number of `gawk'-specific
+ *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 Library Functions::, and *Note Sample Programs::, provide many
+ *note Library Functions::, and *note Sample Programs::, provide many
sample `awk' programs. Reading them allows you to see `awk' solving
real problems.
- *Note Debugger::, describes the `awk' debugger, `dgawk'.
+ *note Debugger::, describes the `awk' debugger.
- *Note Language History::, describes how the `awk' language has
+ *note Language History::, describes how the `awk' language has
evolved since its first release to present. It also describes how
`gawk' has acquired features over time.
- *Note Installation::, describes how to get `gawk', how to compile it
+ *note Installation::, describes how to get `gawk', how to compile it
on POSIX-compatible systems, and how to compile and use it on different
non-POSIX systems. It also describes how to report bugs in `gawk' and
where to get other freely available `awk' implementations.
- *Note Notes::, describes how to disable `gawk''s extensions, as well
+ *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 Concepts::, provides some very cursory background
+ *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
+ 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 Copying::, and *Note GNU Free Documentation License::, present
+ *note Copying::, and *note GNU Free Documentation License::, present
the licenses that cover the `gawk' source code and this Info file,
respectively.
@@ -1029,7 +990,7 @@ Guide'.
This edition maintains the basic structure of the previous editions.
For Edition 4.0, the content has been thoroughly reviewed and updated.
All references to versions prior to 4.0 have been removed. Of
-significant note for this edition is *Note Debugger::.
+significant note for this edition is *note Debugger::.
`GAWK: Effective AWK Programming' will undoubtedly continue to
evolve. An electronic version comes with the `gawk' distribution from
@@ -1041,7 +1002,7 @@ electronically.
(1) GNU stands for "GNU's not Unix."
- (2) The terminology "GNU/Linux" is explained in the *Note Glossary::.
+ (2) The terminology "GNU/Linux" is explained in the *note Glossary::.

File: gawk.info, Node: How To Contribute, Next: Acknowledgments, Prev: Manual History, Up: Preface
@@ -1143,7 +1104,7 @@ this team of fine people.
byte-code interpreter, including the debugger. Stephen Davies
contributed to the effort to bring the byte-code changes into the
mainstream code base. Efraim Yawitz contributed the initial text of
-*Note Debugger::.
+*note Debugger::.
I would like to thank Brian Kernighan for invaluable assistance
during the testing and debugging of `gawk', and for ongoing help and
@@ -1277,7 +1238,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 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
@@ -1462,7 +1423,7 @@ 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::, you can enclose small
+ 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
@@ -1524,7 +1485,7 @@ Shell). If you use the C shell, 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::, 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
@@ -1536,7 +1497,7 @@ Shell). If you use the C shell, 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 Read Terminal::,
+ stripped first.) Thus, the example seen in *note Read Terminal::,
is applicable:
$ awk "BEGIN { print \"Don't Panic!\" }"
@@ -1691,7 +1652,7 @@ 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 Extract
+ 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.
@@ -2033,7 +1994,7 @@ minor node could also be written this way:
---------- Footnotes ----------
(1) The `?' and `:' referred to here is the three-operand
-conditional expression described in *Note Conditional Exp::. Splitting
+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.
@@ -2056,7 +2017,7 @@ determining the type of a variable, and array sorting.
As we develop our presentation of the `awk' language, we introduce
most of the variables and many of the functions. They are described
-systematically in *Note Built-in Variables::, and *Note Built-in::.
+systematically in *note Built-in Variables::, and *note Built-in::.

File: gawk.info, Node: When, Prev: Other Features, Up: Getting Started
@@ -2214,7 +2175,7 @@ The following list describes options mandated by the POSIX standard:
This is useful if you have file names that start with `-', or in
shell scripts, if you have file names that will be specified by
the user that could start with `-'. It is also useful for passing
- options on to the `awk' program; see *Note Getopt Function::.
+ options on to the `awk' program; see *note Getopt Function::.
The following list describes `gawk'-specific options:
@@ -2233,7 +2194,7 @@ The following list describes options mandated by the POSIX standard:
Specify "compatibility mode", in which the GNU extensions to the
`awk' language are disabled, so that `gawk' behaves just like
Brian Kernighan's version `awk'. *Note POSIX/GNU::, which
- summarizes the extensions. Also see *Note Compatibility Mode::.
+ summarizes the extensions. Also see *note Compatibility Mode::.
`-C'
`--copyright'
@@ -2255,6 +2216,15 @@ The following list describes options mandated by the POSIX standard:
particularly easy mistake to make with simple variable names like
`i', `j', etc.)
+`-D[FILE]'
+`--debug=[FILE]'
+ Enable debugging of `awk' programs (*note Debugging::). By
+ default, the debugger reads commands interactively from the
+ terminal. The optional FILE argument allows you to specify a file
+ with a list of commands for the debugger to execute
+ non-interactively. No space is allowed between the `-D' and FILE,
+ if FILE is supplied.
+
`-e PROGRAM-TEXT'
`--source PROGRAM-TEXT'
Provide program source code in the PROGRAM-TEXT. This option
@@ -2297,6 +2267,13 @@ The following list describes options mandated by the POSIX standard:
Print a "usage" message summarizing the short and long style
options that `gawk' accepts and then exit.
+`-l LIB'
+`--load LIB'
+ Load a shared library LIB. This searches for the library using the
+ `AWKPATH' environment variable. The suffix `.so' in the library
+ name is optional. The library initialization routine should be
+ named `dlload()'.
+
`-L [value]'
`--lint[=value]'
Warn about constructs that are dubious or nonportable to other
@@ -2329,6 +2306,14 @@ The following list describes options mandated by the POSIX standard:
Force the use of the locale's decimal point character when parsing
numeric input data (*note Locales::).
+`-o[FILE]'
+`--pretty-print[=FILE]'
+ Enable pretty-printing of `awk' programs. By default, output
+ program is created in a file named `awkprof.out'. The optional
+ FILE argument allows you to specify a different file name for the
+ output. No space is allowed between the `-o' and FILE, if FILE is
+ supplied.
+
`-O'
`--optimize'
Enable some optimizations on the internal representation of the
@@ -2344,10 +2329,9 @@ The following list describes options mandated by the POSIX standard:
for the profile file. No space is allowed between the `-p' and
FILE, if FILE is supplied.
- When run with `gawk', the profile is just a "pretty printed"
- version of the program. When run with `pgawk', the profile
- contains execution counts for each statement in the program in the
- left margin, and function call counts for each function.
+ The profile contains execution counts for each statement in the
+ program in the left margin, and function call counts for each
+ function.
`-P'
`--posix'
@@ -2381,11 +2365,6 @@ The following list describes options mandated by the POSIX standard:
remains both for backward compatibility, and for use in
combination with the `--traditional' option.
-`-R FILE'
-`--command=FILE'
- `dgawk' only. Read `dgawk' debugger options and commands from
- FILE. *Note Dgawk Info::, for more information.
-
`-S'
`--sandbox'
Disable the `system()' function, input redirections with `getline',
@@ -2421,7 +2400,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 Definition Syntax::, function names must be unique.)
+*note Definition Syntax::, function names must be unique.)
With standard `awk', library functions can still be used, even if
the program is entered at the terminal, by specifying `-f /dev/tty'.
@@ -2479,7 +2458,7 @@ File: gawk.info, Node: Other Arguments, Next: Naming Standard Input, Prev: Op
Any additional arguments on the command line are normally treated as
input files to be processed in the order specified. However, an
argument that has the form `VAR=VALUE', assigns the value VALUE to the
-variable VAR--it does not specify a file at all. (See *Note Assignment
+variable VAR--it does not specify a file at all. (See *note Assignment
Options::.)
All these arguments are made available to your `awk' program in the
@@ -2795,7 +2774,7 @@ reducing the need for writing complex and tedious command lines. In
particular, `@include' is very useful for writing CGI scripts to be run
from web pages.
- As mentioned in *Note AWKPATH Variable::, the current directory is
+ As mentioned in *note AWKPATH Variable::, the current directory is
always searched first for source files, before searching in `AWKPATH',
and this also applies to files named with `@include'.
@@ -2813,7 +2792,7 @@ they will _not_ be in the next release).
The process-related special files `/dev/pid', `/dev/ppid',
`/dev/pgrpid', and `/dev/user' were deprecated in `gawk' 3.1, but still
worked. As of version 4.0, they are no longer interpreted specially by
-`gawk'. (Use `PROCINFO' instead; see *Note Auto-set::.)
+`gawk'. (Use `PROCINFO' instead; see *note Auto-set::.)

File: gawk.info, Node: Undocumented, Prev: Obsolete, Up: Invoking Gawk
@@ -3006,7 +2985,7 @@ 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 GNU Regexp Operators::, means
+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'.
@@ -3021,7 +3000,7 @@ character not shown in the previous list.
early, as soon as `awk' reads your program.
* `gawk' processes both regexp constants and dynamic regexps (*note
- Computed Regexps::), for the special operators listed in *Note GNU
+ Computed Regexps::), for the special operators listed in *note GNU
Regexp Operators::.
* A backslash before any other character means to treat that
@@ -3050,7 +3029,7 @@ Advanced Notes: Escape Sequences for Metacharacters
---------------------------------------------------
Suppose you use an octal or hexadecimal escape to represent a regexp
-metacharacter. (See *Note Regexp Operators::.) Does `awk' treat the
+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.)
@@ -3070,7 +3049,7 @@ You can combine regular expressions with special characters, called
"regular expression operators" or "metacharacters", to increase the
power and versatility of regular expressions.
- The escape sequences described in *Note Escape Sequences::, are
+ The escape sequences described in *note Escape Sequences::, are
valid inside a regexp. They are introduced by a `\' and are recognized
and converted into corresponding real characters as the very first step
in processing regexps.
@@ -3120,7 +3099,7 @@ sequences and that are not listed in the table stand for themselves:
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 bracket expression is given in *Note Bracket
+ square brackets of a bracket expression is given in *note Bracket
Expressions::.
`[^ ...]'
@@ -3247,7 +3226,7 @@ those listed between the opening and closing square brackets.
characters separated by a hyphen. It matches any single character that
sorts between the two characters, based upon the system's native
character set. For example, `[0-9]' is equivalent to `[0123456789]'.
-(See *Note Ranges and Locales::, for an explanation of how the POSIX
+(See *note Ranges and Locales::, for an explanation of how the POSIX
standard and `gawk' have changed over time. This is mainly of
historical interest.)
@@ -3273,7 +3252,7 @@ differs between the United States and France.
A character class is only valid in a regexp _inside_ the brackets of
a bracket expression. Character classes consist of `[:', a keyword
-denoting the class, and `:]'. *Note table-char-classes:: lists the
+denoting the class, and `:]'. *note table-char-classes:: lists the
character classes defined by the POSIX standard.
Class Meaning
@@ -3404,7 +3383,7 @@ GNU `\b' appears to be the lesser of two evils.
No options
In the default case, `gawk' provides all the facilities of POSIX
- regexps and the GNU regexp operators described in *Note Regexp
+ regexps and the GNU regexp operators described in *note Regexp
Operators::.
`--posix'
@@ -3955,7 +3934,7 @@ that the multiplication is done before the `$' operation; they are
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
+operators are listed, in order of decreasing precedence, in *note
Precedence::.)
If the field number you compute is zero, you get the entire record.
@@ -3965,7 +3944,7 @@ 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 Fields::, `awk' stores the current record's
+ 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
@@ -4096,8 +4075,8 @@ rebuild the entire record, using the current value of the fields and
$1 = $1 # force record to be reconstituted
print $0 # or whatever else with $0
-This forces `awk' rebuild the record. It does help to add a comment,
-as we've shown here.
+This forces `awk' to rebuild the record. It does help to add a
+comment, as we've shown here.
There is a flip side to the relationship between `$0' and the
fields. Any assignment to `$0' causes the record to be reparsed into
@@ -5226,7 +5205,7 @@ in mind:
probably by accident, and you should reconsider what it is you're
trying to accomplish.
- * *Note Getline Summary::, presents a table summarizing the
+ * *note Getline Summary::, presents a table summarizing the
`getline' variants and which variables they can affect. It is
worth noting that those variants which do not use redirection can
cause `FILENAME' to be updated if they cause `awk' to start
@@ -5238,7 +5217,7 @@ File: gawk.info, Node: Getline Summary, Prev: Getline Notes, Up: Getline
4.9.10 Summary of `getline' Variants
------------------------------------
-*Note table-getline-variants:: summarizes the eight variants of
+*note table-getline-variants:: summarizes the eight variants of
`getline', listing which built-in variables are set by each one, and
whether the variant is standard or a `gawk' extension.
@@ -5286,7 +5265,7 @@ and the `printf' statement for fancier formatting. The `print'
statement is not limited when computing _which_ values to print.
However, with two exceptions, you cannot specify _how_ to print
them--how many columns, whether to use exponential notation or not, and
-so on. (For the exceptions, *note Output Separators::, and *Note
+so on. (For the exceptions, *note Output Separators::, and *note
OFMT::.) For printing with specifications, you need the `printf'
statement (*note Printf::).
@@ -5473,7 +5452,7 @@ that string. `awk' uses the `sprintf()' function to do this conversion
`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::.
+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
@@ -5523,8 +5502,8 @@ A simple `printf' statement looks like this:
printf FORMAT, ITEM1, ITEM2, ...
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 an output
+The parentheses are necessary if any of the item expressions use the `>'
+relational operator; otherwise, it can be confused with an output
redirection (*note Redirection::).
The difference between `printf' and `print' is the FORMAT argument.
@@ -5730,12 +5709,12 @@ which they may appear:
-| 1,234,567 Results in US English UTF locale
For more information about locales and internationalization issues,
- see *Note Locales::.
+ see *note Locales::.
NOTE: The `'' flag is a nice feature, but its use complicates
things: it becomes difficult to use it in command-line
programs. For information on appropriate quoting tricks, see
- *Note Quoting::.
+ *note Quoting::.
`WIDTH'
This is a number specifying the desired minimum width of a field.
@@ -5976,7 +5955,7 @@ 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 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
@@ -6161,7 +6140,7 @@ 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 I/O::). This is an advanced feature,
mentioned here only for completeness. Full discussion is delayed until
-*Note TCP/IP Networking::.
+*note TCP/IP Networking::.

File: gawk.info, Node: Special Caveats, Prev: Special Network, Up: Special Files
@@ -6308,7 +6287,7 @@ 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
+feature, a 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
@@ -6497,7 +6476,7 @@ 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
+manipulation functions; see *note Bitwise Functions::, for more
information.
Unlike some early C implementations, `8' and `9' are not valid in
@@ -6780,7 +6759,7 @@ your programs, just port `gawk' itself. *Note Print::, for more
information on the `print' statement.
And, once again, where you are can matter when it comes to converting
-between numbers and strings. In *Note Locales::, we mentioned that the
+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.
@@ -6821,7 +6800,7 @@ character. (`gawk' also uses the locale's decimal point character when
in POSIX mode, either via `--posix', or the `POSIXLY_CORRECT'
environment variable.)
- *Note table-locale-affects:: describes the cases in which the
+ *note table-locale-affects:: describes the cases in which the
locale's decimal point character is used and when a period is used.
Some of these features have not been described yet.
@@ -6837,7 +6816,7 @@ Table 6.1: Locale Decimal Point versus A Period
Finally, modern day formal standards and IEEE standard floating point
representation can have an unusual but important effect on the way
`gawk' converts some special string values to numbers. The details are
-presented in *Note POSIX Floating Point Problems::.
+presented in *note POSIX Floating Point Problems::.
---------- Footnotes ----------
@@ -7148,7 +7127,7 @@ 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::, and
-see *Note Numeric Functions::, for more information). This example
+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.
@@ -7159,7 +7138,7 @@ Consider this example:
The value of `a[3]' could be either two or four.
- *Note table-assign-ops:: lists the arithmetic assignment operators.
+ *note table-assign-ops:: lists the arithmetic assignment operators.
In each case, the righthand operand is an expression whose value is
converted to a number.
@@ -7197,7 +7176,7 @@ A workaround is:
awk '/[=]=/' /dev/null
`gawk' does not have this problem, nor do the other freely available
-versions described in *Note Other Versions::.
+versions described in *note Other Versions::.

File: gawk.info, Node: Increment Ops, Prev: Assignment Ops, Up: All Operators
@@ -7462,7 +7441,7 @@ File: gawk.info, Node: Comparison Operators, Next: POSIX String Comparison, P
"Comparison expressions" compare strings or numbers for relationships
such as equality. They are written using "relational operators", which
-are a superset of those in C. *Note table-relational-ops:: describes
+are a superset of those in C. *note table-relational-ops:: describes
them.
Expression Result
@@ -7638,8 +7617,8 @@ Boolean operators are:
if ($0 ~ /2400/ || $0 ~ /foo/) print
The subexpression BOOLEAN2 is evaluated only if BOOLEAN1 is false.
- This can make a difference when BOOLEAN2 contains expressions
- that have side effects.
+ This can make a difference when BOOLEAN2 contains expressions that
+ have side effects.
`! BOOLEAN'
True if BOOLEAN is false. For example, the following program
@@ -7649,7 +7628,7 @@ Boolean operators are:
BEGIN { if (! ("HOME" in ENVIRON))
print "no home!" }
- (The `in' operator is described in *Note 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
@@ -7679,7 +7658,7 @@ 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.(1)
- NOTE: The `next' statement is discussed in *Note Next Statement::.
+ 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
@@ -7782,7 +7761,7 @@ User-defined::).
As an advanced feature, `gawk' provides indirect function calls,
which is a way to choose the function to call at runtime, instead of
when you write the source code to your program. We defer discussion of
-this feature until later; see *Note Indirect Calls::.
+this feature until later; see *note Indirect Calls::.
Like every other expression, the function call has a value, which is
computed by the function based on the arguments you give it. In this
@@ -7942,12 +7921,12 @@ make several function calls, _per input character_, to find the record
terminator.
According to POSIX, string comparison is also affected by locales
-(similar to regular expressions). The details are presented in *Note
+(similar to regular expressions). The details are presented in *note
POSIX String Comparison::.
Finally, the locale affects the value of the decimal point character
used when `gawk' parses input data. This is discussed in detail in
-*Note Conversion::.
+*note Conversion::.

File: gawk.info, Node: Patterns and Actions, Next: Arrays, Prev: Expressions, Up: Top
@@ -8013,7 +7992,7 @@ summary of the types of `awk' patterns:
`BEGINFILE'
`ENDFILE'
- Special patterns for you to supply startup or cleanup actions to
+ Special patterns for you to supply startup or cleanup actions to be
done on a per file basis. (*Note BEGINFILE/ENDFILE::.)
`EMPTY'
@@ -8048,7 +8027,7 @@ 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 Typing and Comparison::, are a very common kind of pattern.
+*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
@@ -8114,7 +8093,7 @@ inside Boolean patterns. Likewise, the special patterns `BEGIN', `END',
expressions and cannot appear inside Boolean patterns.
The precedence of the different operators which can appear in
-patterns is described in *Note Precedence::.
+patterns is described in *note Precedence::.

File: gawk.info, Node: Ranges, Next: BEGIN/END, Prev: Expression Patterns, Up: Pattern Overview
@@ -8300,7 +8279,7 @@ 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 Next Statement::, and see *Note
+the input has been read. (*Note Next Statement::, and see *note
Nextfile Statement::.)

@@ -8839,7 +8818,7 @@ Statement::.)
}
The `break' statement is also used to break out of the `switch'
-statement. This is discussed in *Note Switch Statement::.
+statement. This is discussed in *note Switch Statement::.
The `break' statement has no meaning when used outside the body of a
loop or `switch'. However, although it was never documented,
@@ -8892,12 +8871,12 @@ the previous example with the following `while' loop:
This program loops forever once `x' reaches 5.
The `continue' statement has no special meaning with respect to the
-`switch' statement, nor does it any 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 Next Statement::).
-(d.c.) Recent versions of Brian Kernighan's `awk' no longer work this
-way, nor does `gawk'.
+`switch' statement, nor does it have any 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 Next
+Statement::). (d.c.) Recent versions of Brian Kernighan's `awk' no
+longer work this way, nor does `gawk'.

File: gawk.info, Node: Next Statement, Next: Nextfile Statement, Prev: Continue Statement, Up: Statements
@@ -8936,7 +8915,7 @@ 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 Files::.
+*note Special Files::.
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::.
@@ -9107,7 +9086,7 @@ specific to `gawk' are marked with a pound sign (`#').
string value of `"rw"' or `"wr"' indicates that all files should
use binary I/O. Any other string value is treated the same as
`"rw"', but causes `gawk' to generate a warning message.
- `BINMODE' is described in more detail in *Note 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 Versions::), or if
@@ -9411,7 +9390,7 @@ with a pound sign (`#').
If this element exists in `PROCINFO', its value controls the
order in which array indices will be processed by `for (index
in array) ...' loops. Since this is an advanced feature, we
- defer the full description until later; see *Note Scanning an
+ defer the full description until later; see *note Scanning an
Array::.
`PROCINFO["strftime"]'
@@ -9432,7 +9411,7 @@ with a pound sign (`#').
The `PROCINFO' array is also used to cause coprocesses to
communicate over pseudo-ttys instead of through two-way pipes;
- this is discussed further in *Note Two-way I/O::.
+ this is discussed further in *note Two-way I/O::.
This array is a `gawk' extension. In other `awk' implementations,
or if `gawk' is in compatibility mode (*note Options::), it is not
@@ -9494,7 +9473,7 @@ File: gawk.info, Node: ARGC and ARGV, Prev: Auto-set, Up: Built-in Variables
7.5.3 Using `ARGC' and `ARGV'
-----------------------------
-*Note Auto-set::, presented the following program describing the
+*note Auto-set::, presented the following program describing the
information contained in `ARGC' and `ARGV':
$ awk 'BEGIN {
@@ -9550,7 +9529,7 @@ elements from `ARGV' (*note Delete::).
All of these actions are typically done in the `BEGIN' rule, before
actual processing of the input begins. *Note Split Program::, and see
-*Note Tee Program::, for examples of each way of removing elements from
+*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:
@@ -9641,6 +9620,8 @@ one at a time, and traversing all of the elements in an array.
* Scanning an Array:: A variation of the `for' statement. It
loops through the indices of an array's
existing elements.
+* Controlling Scanning:: Controlling the order in which arrays are
+ scanned.

File: gawk.info, Node: Array Intro, Next: Reference to Elements, Up: Array Basics
@@ -9730,7 +9711,7 @@ 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 Numeric Array
+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.
@@ -9873,7 +9854,7 @@ easy improvement to the program's `END' rule, as follows:
}

-File: gawk.info, Node: Scanning an Array, Prev: Array Example, Up: Array Basics
+File: gawk.info, Node: Scanning an Array, Next: Controlling Scanning, Prev: Array Example, Up: Array Basics
8.1.5 Scanning All Elements of an Array
---------------------------------------
@@ -9928,14 +9909,147 @@ statements in the loop body; it is not predictable whether the `for'
loop will reach them. Similarly, changing VAR inside the loop may
produce strange results. It is best to avoid such things.
- As an extension, `gawk' makes it possible for you to loop over the
-elements of an array in order, based on the value of
-`PROCINFO["sorted_in"]' (*note Auto-set::). This is an advanced
-feature, so discussion of it is delayed until *Note Controlling Array
-Traversal::.
+
+File: gawk.info, Node: Controlling Scanning, Prev: Scanning an Array, Up: Array Basics
+
+8.1.6 Using Predefined Array Scanning Orders
+--------------------------------------------
+
+By default, when a `for' loop traverses an array, the order is
+undefined, meaning that the `awk' implementation determines the order
+in which the array is traversed. This order is usually based on the
+internal implementation of arrays and will vary from one version of
+`awk' to the next.
+
+ Often, though, you may wish to do something simple, such as
+"traverse the array by comparing the indices in ascending order," or
+"traverse the array by on comparing the values in descending order."
+`gawk' provides two mechanisms which give you this control.
+
+ * Set `PROCINFO["sorted_in"]' to one of a set of predefined values.
+ We describe this now.
+
+ * Set `PROCINFO["sorted_in"]' to the name of a user-defined function
+ to be used for comparison of array elements. This advanced feature
+ is described later, in *note Array Sorting::.
+
+ The following special values for `PROCINFO["sorted_in"]' are
+available:
+
+`"@unsorted"'
+ Array elements are processed in arbitrary order, which is the
+ default `awk' behavior.
+
+`"@ind_str_asc"'
+ Order by indices compared as strings; this is the most basic sort.
+ (Internally, array indices are always strings, so with `a[2*5] = 1'
+ the index is `"10"' rather than numeric 10.)
+
+`"@ind_num_asc"'
+ Order by indices but force them to be treated as numbers in the
+ process. Any index with a non-numeric value will end up
+ positioned as if it were zero.
+
+`"@val_type_asc"'
+ Order by element values rather than indices. Ordering is by the
+ type assigned to the element (*note Typing and Comparison::). All
+ numeric values come before all string values, which in turn come
+ before all subarrays. (Subarrays have not been described yet;
+ *note Arrays of Arrays::).
+
+`"@val_str_asc"'
+ Order by element values rather than by indices. Scalar values are
+ compared as strings. Subarrays, if present, come out last.
+
+`"@val_num_asc"'
+ Order by element values rather than by indices. Scalar values are
+ compared as numbers. Subarrays, if present, come out last. When
+ numeric values are equal, the string values are used to provide an
+ ordering: this guarantees consistent results across different
+ versions of the C `qsort()' function,(1) which `gawk' uses
+ internally to perform the sorting.
+
+`"@ind_str_desc"'
+ Reverse order from the most basic sort.
+
+`"@ind_num_desc"'
+ Numeric indices ordered from high to low.
+
+`"@val_type_desc"'
+ Element values, based on type, in descending order.
+
+`"@val_str_desc"'
+ Element values, treated as strings, ordered from high to low.
+ Subarrays, if present, come out first.
+
+`"@val_num_desc"'
+ Element values, treated as numbers, ordered from high to low.
+ Subarrays, if present, come out first.
+
+ The array traversal order is determined before the `for' loop starts
+to run. Changing `PROCINFO["sorted_in"]' in the loop body will not
+affect the loop.
+
+ For example:
+
+ $ gawk 'BEGIN {
+ > a[4] = 4
+ > a[3] = 3
+ > for (i in a)
+ > print i, a[i]
+ > }'
+ -| 4 4
+ -| 3 3
+ $ gawk 'BEGIN {
+ > PROCINFO["sorted_in"] = "@ind_str_asc"
+ > a[4] = 4
+ > a[3] = 3
+ > for (i in a)
+ > print i, a[i]
+ > }'
+ -| 3 3
+ -| 4 4
+
+ When sorting an array by element values, if a value happens to be a
+subarray then it is considered to be greater than any string or numeric
+value, regardless of what the subarray itself contains, and all
+subarrays are treated as being equal to each other. Their order
+relative to each other is determined by their index strings.
+
+ Here are some additional things to bear in mind about sorted array
+traversal.
+
+ * The value of `PROCINFO["sorted_in"]' is global. That is, it affects
+ all array traversal `for' loops. If you need to change it within
+ your own code, you should see if it's defined and save and restore
+ the value:
+
+ ...
+ if ("sorted_in" in PROCINFO) {
+ save_sorted = PROCINFO["sorted_in"]
+ PROCINFO["sorted_in"] = "@val_str_desc" # or whatever
+ }
+ ...
+ if (save_sorted)
+ PROCINFO["sorted_in"] = save_sorted
+
+ * As mentioned, the default array traversal order is represented by
+ `"@unsorted"'. You can also get the default behavior by assigning
+ the null string to `PROCINFO["sorted_in"]' or by just deleting the
+ `"sorted_in"' element from the `PROCINFO' array with the `delete'
+ statement. (The `delete' statement hasn't been described yet;
+ *note Delete::.)
In addition, `gawk' provides built-in functions for sorting arrays;
-see *Note Array Sorting Functions::.
+see *note Array Sorting Functions::.
+
+ ---------- Footnotes ----------
+
+ (1) When two elements compare as equal, the C `qsort()' function
+does not guarantee that they will maintain their original relative
+order after sorting. Using the string value to provide a unique
+ordering when the numeric values are equal ensures that `gawk' behaves
+consistently across different environments.

File: gawk.info, Node: Delete, Next: Numeric Array Subscripts, Prev: Array Basics, Up: Arrays
@@ -10203,7 +10317,7 @@ File: gawk.info, Node: Multi-scanning, Up: Multi-dimensional
--------------------------------------
There is no special `for' statement for scanning a "multidimensional"
-array. There cannot be one, because, in truth, there are no
+array. There cannot be one, because, in truth, `awk' does not have
multidimensional arrays or elements--there is only a multidimensional
_way of accessing_ an array.
@@ -10223,7 +10337,7 @@ in the array, and splits it into the individual indices by breaking it
apart where the value of `SUBSEP' appears. The individual indices then
become the elements of the array `separate'.
- Thus, if a value is previously stored in `array[1, "foo"]'; then an
+ Thus, if a value is previously stored in `array[1, "foo"]', then an
element with index `"1\034foo"' exists in `array'. (Recall that the
default value of `SUBSEP' is the character with code 034.) Sooner or
later, the `for' statement finds that index and does an iteration with
@@ -10242,8 +10356,9 @@ File: gawk.info, Node: Arrays of Arrays, Prev: Multi-dimensional, Up: Arrays
8.6 Arrays of Arrays
====================
-`gawk' supports arrays of arrays. Elements of a subarray are referred
-to by their own indices enclosed in square brackets, just like the
+`gawk' goes beyond standard `awk''s multidimensional array access and
+provides true arrays of arrays. Elements of a subarray are referred to
+by their own indices enclosed in square brackets, just like the
elements of the main array. For example, the following creates a
two-element subarray at index `1' of the main array `a':
@@ -10636,7 +10751,7 @@ pound sign (`#'):
asort(a, a, "descending")
- The `asort()' function is described in more detail in *Note Array
+ The `asort()' function is described in more detail in *note Array
Sorting Functions::. `asort()' is a `gawk' extension; it is not
available in compatibility mode (*note Options::).
@@ -10645,7 +10760,7 @@ pound sign (`#'):
similarly to `asort()', however, the _indices_ are sorted, instead
of the values. (Here too, `IGNORECASE' affects the sorting.)
- The `asorti()' function is described in more detail in *Note Array
+ The `asorti()' function is described in more detail in *note Array
Sorting Functions::. `asorti()' is a `gawk' extension; it is not
available in compatibility mode (*note Options::).
@@ -11128,7 +11243,7 @@ replacement string to determine what to generate.
At both levels, `awk' looks for a defined set of characters that can
come after a backslash. At the lexical level, it looks for the escape
-sequences listed in *Note Escape Sequences::. Thus, for every `\' that
+sequences listed in *note Escape Sequences::. Thus, for every `\' that
`awk' processes at the runtime level, you must type two backslashes at
the lexical level. When a character that is not valid for an escape
sequence follows the `\', Brian Kernighan's `awk' and `gawk' both
@@ -11141,7 +11256,7 @@ Historically, the `sub()' and `gsub()' functions treated the two
character sequence `\&' specially; this sequence was replaced in the
generated text with a single `&'. Any other `\' within the REPLACEMENT
string that did not precede an `&' was passed through unchanged. This
-is illustrated in *Note table-sub-escapes::.
+is illustrated in *note table-sub-escapes::.
You type `sub()' sees `sub()' generates
------- --------- --------------
@@ -11153,7 +11268,8 @@ is illustrated in *Note table-sub-escapes::.
`\\\\\\&' `\\\&' a literal `\\&'
`\\q' `\q' a literal `\q'
-Table 9.1: Historical Escape Sequence Processing for `sub()' and `gsub()'
+Table 9.1: Historical Escape Sequence Processing for `sub()' and
+`gsub()'
This table shows both the lexical-level processing, where an odd number
of backslashes becomes an even number at the runtime level, as well as
@@ -11168,7 +11284,7 @@ get a literal `\' followed by the matched text.
says that `sub()' and `gsub()' look for either a `\' or an `&' after
the `\'. If either one follows a `\', that character is output
literally. The interpretation of `\' and `&' then becomes as shown in
-*Note table-sub-posix-92::.
+*note table-sub-posix-92::.
You type `sub()' sees `sub()' generates
------- --------- --------------
@@ -11195,7 +11311,7 @@ problems:
submitted proposed text for a revised standard that reverts to rules
that correspond more closely to the original existing practice. The
proposed rules have special cases that make it possible to produce a
-`\' preceding the matched text. This is shown in *Note
+`\' preceding the matched text. This is shown in *note
table-sub-proposed::.
You type `sub()' sees `sub()' generates
@@ -11223,7 +11339,7 @@ except for one case.
The POSIX rules state that `\&' in the replacement string produces a
literal `&', `\\' produces a literal `\', and `\' followed by anything
else is not special; the `\' is placed straight into the output. These
-rules are presented in *Note table-posix-sub::.
+rules are presented in *note table-posix-sub::.
You type `sub()' sees `sub()' generates
------- --------- --------------
@@ -11254,7 +11370,7 @@ level, whenever `gawk' sees a `\', if the following character is a
digit, then the text that matched the corresponding parenthesized
subexpression is placed in the generated output. Otherwise, no matter
what character follows the `\', it appears in the generated text and
-the `\' does not, as shown in *Note table-gensub-escapes::.
+the `\' does not, as shown in *note table-gensub-escapes::.
You type `gensub()' sees `gensub()' generates
------- ------------ -----------------
@@ -11783,7 +11899,7 @@ 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
+Other internationalization features are described in *note
Internationalization::.
(6) This is because ISO C leaves the behavior of the C version of
@@ -11803,7 +11919,7 @@ File: gawk.info, Node: Bitwise Functions, Next: Type Functions, Prev: Time Fu
Many languages provide the ability to perform "bitwise" operations
on two integer numbers. In other words, the operation is performed on
each successive pair of bits in the operands. Three common operations
-are bitwise AND, OR, and XOR. The operations are described in *Note
+are bitwise AND, OR, and XOR. The operations are described in *note
table-bitwise-ops::.
Bit Operator
@@ -12071,7 +12187,7 @@ act of a function calling itself is called "recursion".
All the built-in functions return a value to their caller.
User-defined functions can do also, using the `return' statement, which
-is described in detail in *Note Return Statement::. Many of the
+is described in detail in *note Return Statement::. Many of the
subsequent examples in this minor node use the `return' statement.
In many `awk' implementations, including `gawk', the keyword
@@ -13004,7 +13120,7 @@ internationalization:
`"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 Explaining
+ 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.
@@ -13036,7 +13152,7 @@ internationalization:
current binding for the given DOMAIN.
To use these facilities in your `awk' program, follow the steps
-outlined in *Note 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 BEGIN/END::), or it can
@@ -13399,7 +13515,7 @@ full detail, along with the basics of TCP/IP networking. Finally,
`gawk' can "profile" an `awk' program, making it possible to tune it
for performance.
- *Note Dynamic Extensions::, discusses the ability to dynamically add
+ *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.
@@ -13460,8 +13576,8 @@ File: gawk.info, Node: Array Sorting, Next: Two-way I/O, Prev: Nondecimal Dat
11.2 Controlling Array Traversal and Array Sorting
==================================================
-`gawk' lets you control the order in which `for (i in array)' loops
-will traverse an array.
+`gawk' lets you control the order in which a `for (i in array)' loop
+traverses an array.
In addition, two built-in functions, `asort()' and `asorti()', let
you sort arrays based on the array values and indices, respectively.
@@ -13485,24 +13601,17 @@ of arrays inside `awk'.
Often, though, it is desirable to be able to loop over the elements
in a particular order that you, the programmer, choose. `gawk' lets
-you do this; this node describes how.
+you do this.
-* Menu:
-
-* Controlling Scanning With A Function:: Using a function to control scanning.
-* Controlling Scanning:: Controlling the order in which arrays
- are scanned.
-
-
-File: gawk.info, Node: Controlling Scanning With A Function, Next: Controlling Scanning, Up: Controlling Array Traversal
+ *note Controlling Scanning::, describes how you can assign special,
+pre-defined values to `PROCINFO["sorted_in"]' in order to control the
+order in which `gawk' will traverse an array during a `for' loop.
-11.2.1.1 Array Scanning Using A User-defined Function
-.....................................................
-
-The value of `PROCINFO["sorted_in"]' can be a function name. This lets
-you traverse an array based on any custom criterion. The array
-elements are ordered according to the return value of this function.
-The comparison function should be defined with at least four arguments:
+ In addition, the value of `PROCINFO["sorted_in"]' can be a function
+name. This lets you traverse an array based on any custom criterion.
+The array elements are ordered according to the return value of this
+function. The comparison function should be defined with at least four
+arguments:
function comp_func(i1, v1, i2, v2)
{
@@ -13512,8 +13621,9 @@ The comparison function should be defined with at least four arguments:
Here, I1 and I2 are the indices, and V1 and V2 are the corresponding
values of the two elements being compared. Either V1 or V2, or both,
-can be arrays if the array being traversed contains subarrays as
-values. The three possible return values are interpreted this way:
+can be arrays if the array being traversed contains subarrays as values.
+(*Note Arrays of Arrays::, for more information about subarrays.) The
+three possible return values are interpreted as follows:
`comp_func(i1, v1, i2, v2) < 0'
Index I1 comes before index I2 during loop traversal.
@@ -13602,7 +13712,7 @@ of the previous functions:
-| data[10] = one
-| data[20] = two
-|
- -| Sort function: cmp_num_str_val Sort all numbers before all strings
+ -| Sort function: cmp_num_str_val Sort all numeric values before all strings
-| data[one] = 10
-| data[two] = 20
-| data[100] = 100
@@ -13610,7 +13720,7 @@ of the previous functions:
-| data[20] = two
Consider sorting the entries of a GNU/Linux system password file
-according to login names. The following program sorts records by a
+according to login name. The following program sorts records by a
specific field position and can be used for this purpose:
# sort.awk --- simple program to sort by field position
@@ -13639,10 +13749,9 @@ specific field position and can be used for this purpose:
}
The first field in each entry of the password file is the user's
-login name, and the fields are seperated by colons. Each record
-defines a subarray (*note Arrays of Arrays::), with each field as an
-element in the subarray. Running the program produces the following
-output:
+login name, and the fields are separated by colons. Each record
+defines a subarray, with each field as an element in the subarray.
+Running the program produces the following output:
$ gawk -vPOS=1 -F: -f sort.awk /etc/passwd
-| adm:x:3:4:adm:/var/adm:/sbin/nologin
@@ -13712,126 +13821,16 @@ time of `awk' programs. For this reason, sorted array traversal is not
the default.

-File: gawk.info, Node: Controlling Scanning, Prev: Controlling Scanning With A Function, Up: Controlling Array Traversal
-
-11.2.1.2 Controlling Array Scanning Order
-.........................................
-
-As described in *Note Controlling Scanning With A Function::, you can
-provide the name of a function as the value of `PROCINFO["sorted_in"]'
-to specify custom sorting criteria.
-
- Often, though, you may wish to do something simple, such as "sort
-based on comparing the indices in ascending order," or "sort based on
-comparing the values in descending order." Having to write a simple
-comparison function for this purpose for use in all of your programs
-becomes tedious. For the common simple cases, `gawk' provides the
-option of supplying special names that do the requested sorting for you.
-You can think of them as "predefined" sorting functions, if you like,
-although the names purposely include characters that are not valid in
-real `awk' function names.
-
- The following special values are available:
-
-`"@ind_str_asc"'
- Order by indices compared as strings; this is the most basic sort.
- (Internally, array indices are always strings, so with `a[2*5] = 1'
- the index is `"10"' rather than numeric 10.)
-
-`"@ind_num_asc"'
- Order by indices but force them to be treated as numbers in the
- process. Any index with a non-numeric value will end up
- positioned as if it were zero.
-
-`"@val_type_asc"'
- Order by element values rather than indices. Ordering is by the
- type assigned to the element (*note Typing and Comparison::). All
- numeric values come before all string values, which in turn come
- before all subarrays.
-
-`"@val_str_asc"'
- Order by element values rather than by indices. Scalar values are
- compared as strings. Subarrays, if present, come out last.
-
-`"@val_num_asc"'
- Order by element values rather than by indices. Scalar values are
- compared as numbers. Subarrays, if present, come out last. When
- numeric values are equal, the string values are used to provide an
- ordering: this guarantees consistent results across different
- versions of the C `qsort()' function.(1)
-
-`"@ind_str_desc"'
- Reverse order from the most basic sort.
-
-`"@ind_num_desc"'
- Numeric indices ordered from high to low.
-
-`"@val_type_desc"'
- Element values, based on type, in descending order.
-
-`"@val_str_desc"'
- Element values, treated as strings, ordered from high to low.
- Subarrays, if present, come out first.
-
-`"@val_num_desc"'
- Element values, treated as numbers, ordered from high to low.
- Subarrays, if present, come out first.
-
-`"@unsorted"'
- Array elements are processed in arbitrary order, which is the
- normal `awk' behavior. You can also get the normal behavior by just
- deleting the `"sorted_in"' element from the `PROCINFO' array, if
- it previously had a value assigned to it.
-
- The array traversal order is determined before the `for' loop starts
-to run. Changing `PROCINFO["sorted_in"]' in the loop body will not
-affect the loop.
-
- For example:
-
- $ gawk 'BEGIN {
- > a[4] = 4
- > a[3] = 3
- > for (i in a)
- > print i, a[i]
- > }'
- -| 4 4
- -| 3 3
- $ gawk 'BEGIN {
- > PROCINFO["sorted_in"] = "@ind_str_asc"
- > a[4] = 4
- > a[3] = 3
- > for (i in a)
- > print i, a[i]
- > }'
- -| 3 3
- -| 4 4
-
- When sorting an array by element values, if a value happens to be a
-subarray then it is considered to be greater than any string or numeric
-value, regardless of what the subarray itself contains, and all
-subarrays are treated as being equal to each other. Their order
-relative to each other is determined by their index strings.
-
- ---------- Footnotes ----------
-
- (1) When two elements compare as equal, the C `qsort()' function
-does not guarantee that they will maintain their original relative
-order after sorting. Using the string value to provide a unique
-ordering when the numeric values are equal ensures that `gawk' behaves
-consistently across different environments.
-
-
File: gawk.info, Node: Array Sorting Functions, Prev: Controlling Array Traversal, Up: Array Sorting
11.2.2 Sorting Array Values and Indices with `gawk'
---------------------------------------------------
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 Functions::) for sorting arrays. For example:
+`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 Functions::) for sorting arrays. For example:
POPULATE THE ARRAY data
n = asort(data)
@@ -13841,7 +13840,9 @@ String Functions::) for sorting arrays. For example:
After the call to `asort()', the array `data' is indexed from 1 to
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 array elements are compared as strings.
+on. The comparison is based on the type of the elements (*note Typing
+and Comparison::). All numeric values come before all string values,
+which in turn come before all subarrays.
An important side effect of calling `asort()' is that _the array's
original indices are irrevocably lost_. As this isn't always
@@ -13858,8 +13859,9 @@ array is not affected.
`asort()' accepts a third string argument to control comparison of
array elements. As with `PROCINFO["sorted_in"]', this argument may be
-the name of a user-defined function, or one of the predefined names
-that `gawk' provides (*note Controlling Scanning With A Function::).
+one of the predefined names that `gawk' provides (*note Controlling
+Scanning::), or the name of a user-defined function (*note Controlling
+Array Traversal::).
NOTE: In all cases, the sorted element values consist of the
original array's element values. The ability to control
@@ -14132,25 +14134,22 @@ File: gawk.info, Node: Profiling, Prev: TCP/IP Networking, Up: Advanced Featu
==================================
You may produce execution traces of your `awk' programs. This is done
-with a specially compiled version of `gawk', called `pgawk' ("profiling
-`gawk'").
-
- `pgawk' is identical in every way to `gawk', except that when it has
-finished running, it creates a profile of your program in a file named
-`awkprof.out'. Because it is profiling, it also executes up to 45%
+by passing the option `--profile' to `gawk'. When `gawk' has finished
+running, it creates a profile of your program in a file named
+`awkprof.out'. Because it is profiling, it also executes up to 45%
slower than `gawk' normally does.
As shown in the following example, the `--profile' option can be
-used to change the name of the file where `pgawk' will write the
-profile:
+used to change the name of the file where `gawk' will write the profile:
- pgawk --profile=myprog.prof -f myprog.awk data1 data2
+ gawk --profile=myprog.prof -f myprog.awk data1 data2
-In the above example, `pgawk' places the profile in `myprog.prof'
+In the above example, `gawk' places the profile in `myprog.prof'
instead of in `awkprof.out'.
Here is a sample session showing a simple `awk' program, its input
-data, and the results from running `pgawk'. First, the `awk' program:
+data, and the results from running `gawk' with the `--profile' option.
+First, the `awk' program:
BEGIN { print "First BEGIN rule" }
@@ -14186,9 +14185,9 @@ data, and the results from running `pgawk'. First, the `awk' program:
foo
junk
- Here is the `awkprof.out' that results from running `pgawk' on this
-program and data (this example also illustrates that `awk' programmers
-sometimes have to work late):
+ Here is the `awkprof.out' that results from running the `gawk'
+profiler on this program and data (this example also illustrates that
+`awk' programmers sometimes have to work late):
# gawk profile, created Sun Aug 13 00:00:15 2000
@@ -14277,14 +14276,14 @@ output. They are as follows:
redirection. Similarly, if the target of a redirection isn't a
scalar, it gets parenthesized.
- * `pgawk' supplies leading comments in front of the `BEGIN' and
- `END' rules, the pattern/action rules, and the functions.
+ * `gawk' supplies leading comments in front of the `BEGIN' and `END'
+ rules, the pattern/action rules, and the functions.
The profiled version of your program may not look exactly like what
-you typed when you wrote it. This is because `pgawk' creates the
+you typed when you wrote it. This is because `gawk' creates the
profiled version by "pretty printing" its internal representation of
-the program. The advantage to this is that `pgawk' can produce a
+the program. The advantage to this is that `gawk' can produce a
standard representation. The disadvantage is that all source-code
comments are lost, as are the distinctions among multiple `BEGIN',
`END', `BEGINFILE', and `ENDFILE' rules. Also, things such as:
@@ -14299,21 +14298,23 @@ come out as:
which is correct, but possibly surprising.
- Besides creating profiles when a program has completed, `pgawk' can
+ Besides creating profiles when a program has completed, `gawk' can
produce a profile while it is running. This is useful if your `awk'
program goes into an infinite loop and you want to see what has been
-executed. To use this feature, run `pgawk' in the background:
+executed. To use this feature, run `gawk' with the `--profile' option
+in the background:
- $ pgawk -f myprog &
+ $ gawk --profile -f myprog &
[1] 13992
The shell prints a job number and process ID number; in this case,
-13992. Use the `kill' command to send the `USR1' signal to `pgawk':
+13992. Use the `kill' command to send the `USR1' signal to `gawk':
$ kill -USR1 13992
As usual, the profiled version of the program is written to
-`awkprof.out', or to a different file if you use the `--profile' option.
+`awkprof.out', or to a different file if one specified with the
+`--profile' option.
Along with the regular profile, as shown earlier, the profile
includes a trace of any active functions:
@@ -14325,22 +14326,22 @@ includes a trace of any active functions:
# 1. foo
# -- main --
- You may send `pgawk' the `USR1' signal as many times as you like.
+ You may send `gawk' the `USR1' signal as many times as you like.
Each time, the profile and function call trace are appended to the
output profile file.
- If you use the `HUP' signal instead of the `USR1' signal, `pgawk'
+ If you use the `HUP' signal instead of the `USR1' signal, `gawk'
produces the profile and the function call trace and then exits.
- When `pgawk' runs on MS-Windows systems, it uses the `INT' and
-`QUIT' signals for producing the profile and, in the case of the `INT'
-signal, `pgawk' exits. This is because these systems don't support the
-`kill' command, so the only signals you can deliver to a program are
-those generated by the keyboard. The `INT' signal is generated by the
+ When `gawk' runs on MS-Windows systems, it uses the `INT' and `QUIT'
+signals for producing the profile and, in the case of the `INT' signal,
+`gawk' exits. This is because these systems don't support the `kill'
+command, so the only signals you can deliver to a program are those
+generated by the keyboard. The `INT' signal is generated by the
`Ctrl-<C>' or `Ctrl-<BREAK>' key, while the `QUIT' signal is generated
by the `Ctrl-<\>' key.
- Finally, regular `gawk' also accepts the `--profile' option. When
+ Finally, `gawk' also accepts another option `--pretty-print'. When
called this way, `gawk' "pretty prints" the program into `awkprof.out',
without any execution counts.
@@ -14350,14 +14351,14 @@ File: gawk.info, Node: Library Functions, Next: Sample Programs, Prev: Advanc
12 A Library of `awk' Functions
*******************************
-*Note User-defined::, describes how to write your own `awk' functions.
+*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
+programs in that language. To that end, this major node and *note
Sample Programs::, provide a good-sized body of code for you to read,
and hopefully, to learn from.
@@ -14366,16 +14367,16 @@ 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 Extract Program::, presents a program that you can use to
+ *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 `awk' user
-community, see *Note How To Contribute::, for more information.
+community, see *note How To Contribute::, for more information.
- The programs in this major node and in *Note Sample Programs::,
+ 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.
@@ -14477,7 +14478,7 @@ 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 Passwd Functions::, might have used array elements
+*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'.
@@ -14915,7 +14916,7 @@ File: gawk.info, Node: Gettimeofday Function, Prev: Join Function, Up: Genera
12.2.7 Managing the Time of Day
-------------------------------
-The `systime()' and `strftime()' functions described in *Note Time
+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
@@ -14987,7 +14988,7 @@ 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 Alarm Program::, uses this function. A more general design for
+*note 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.
@@ -15088,7 +15089,7 @@ solves the problem:
END { endfile(_filename_) }
- *Note Wc Program::, shows how this library function can be used and
+ *note Wc Program::, shows how this library function can be used and
how it simplifies writing the main program.
Advanced Notes: So Why Does `gawk' have `BEGINFILE' and `ENDFILE'?
@@ -15142,7 +15143,7 @@ over with it from the top. For lack of a better name, we'll call it
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
+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
@@ -15175,7 +15176,7 @@ program to your `awk' program:
This works, because the `getline' won't be fatal. Removing the
element from `ARGV' with `delete' skips the file (since it's no longer
-in the list). See also *Note ARGC and ARGV::.
+in the list). See also *note ARGC and ARGV::.

File: gawk.info, Node: Empty Files, Next: Ignoring Assigns, Prev: File Checking, Up: Data File Management
@@ -15193,7 +15194,7 @@ 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
+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:
@@ -15561,7 +15562,7 @@ that it does not try to interpret the `-a', etc., as its own options.
`Optind', so that `awk' does not try to process the command-line
options as file names.
- Several of the sample programs presented in *Note Sample Programs::,
+ Several of the sample programs presented in *note Sample Programs::,
use `getopt()' to process their arguments.
---------- Footnotes ----------
@@ -15806,7 +15807,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
such a change would clutter up the code.
- The `id' program in *Note Id Program::, uses these functions.
+ The `id' program in *note Id Program::, uses these functions.
---------- Footnotes ----------
@@ -15819,7 +15820,7 @@ File: gawk.info, Node: Group Functions, Next: Walking Arrays, Prev: Passwd Fu
12.6 Reading the Group Database
===============================
-Much of the discussion presented in *Note Passwd Functions::, applies
+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
@@ -16045,7 +16046,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 Id Program::, uses these functions.
+ The `id' program in *note Id Program::, uses these functions.

File: gawk.info, Node: Walking Arrays, Prev: Group Functions, Up: Library Functions
@@ -16053,7 +16054,7 @@ File: gawk.info, Node: Walking Arrays, Prev: Group Functions, Up: Library Fun
12.7 Traversing Arrays of Arrays
================================
-*Note Arrays of Arrays::, described how `gawk' provides arrays of
+*note Arrays of Arrays::, described how `gawk' provides arrays of
arrays. In particular, any element of an array may be either a scalar,
or another array. The `isarray()' function (*note Type Functions::)
lets you distinguish an array from a scalar. The following function,
@@ -16104,12 +16105,12 @@ File: gawk.info, Node: Sample Programs, Next: Debugger, Prev: Library Functio
13 Practical `awk' Programs
***************************
-*Note Library Functions::, presents the idea that reading programs in a
+*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 library functions presented in *Note
+ Many of these programs use library functions presented in *note
Library Functions::.
* Menu:
@@ -16284,7 +16285,7 @@ by characters, the output field separator is set to the null string:
Using a single space (`" "') for the value of `FS' is incorrect--`awk'
would separate fields with runs of spaces, TABs, and/or newlines, and
we want them to be separated with individual spaces. Also remember
-that after `getopt()' is through (as described in *Note Getopt
+that after `getopt()' is through (as described in *note Getopt
Function::), we have to clear out all the elements of `ARGV' from 1 to
`Optind', so that `awk' does not try to process the command-line options
as file names.
@@ -16789,7 +16790,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 Ordinal Functions::.
+`chr()' 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
@@ -17323,7 +17324,7 @@ in its length. Next, `lines' is incremented for each line read, and
---------- Footnotes ----------
(1) `wc' can't just use the value of `FNR' in `endfile()'. If you
-examine the code in *Note Filetrans Function::, you will see that `FNR'
+examine the code in *note Filetrans Function::, you will see that `FNR'
has already been reset by the time `endfile()' is called.
(2) Since `gawk' understands multibyte locales, this code counts
@@ -17419,7 +17420,7 @@ 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
+ This program uses the `gettimeofday()' function from *note
Gettimeofday Function::.
All the work is done in the `BEGIN' rule. The first part is argument
@@ -17927,7 +17928,7 @@ File: gawk.info, Node: Extract Program, Next: Simple Sed, Prev: History Sorti
13.3.7 Extracting Programs from Texinfo Source Files
----------------------------------------------------
-The nodes *Note Library Functions::, and *Note Sample Programs::, are
+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
@@ -18208,7 +18209,7 @@ File: gawk.info, Node: Igawk Program, Next: Anagram Program, Prev: Simple Sed
13.3.9 An Easy Way to Use Library Functions
-------------------------------------------
-In *Note Include Files::, we saw how `gawk' provides a built-in
+In *note Include Files::, we saw how `gawk' provides a built-in
file-inclusion capability. However, this is a `gawk' extension. This
minor node provides the motivation for making file inclusion available
for standard `awk', and shows how to do it using a combination of shell
@@ -18719,45 +18720,46 @@ supplies the following copyright terms:

File: gawk.info, Node: Debugger, Next: Language History, Prev: Sample Programs, Up: Top
-14 `dgawk': The `awk' Debugger
-******************************
+14 Debugging `awk' Programs
+***************************
It would be nice if computer programs worked perfectly the first time
they were run, but in real life, this rarely happens for programs of
any complexity. Thus, most programming languages have facilities
available for "debugging" programs, and now `awk' is no exception.
- The `dgawk' debugger is purposely modeled after the GNU Debugger
+ The `gawk' debugger is purposely modeled after the GNU Debugger
(GDB) (http://www.gnu.org/software/gdb/) command-line debugger. If you
-are familiar with GDB, learning `dgawk' is easy.
+are familiar with GDB, learning how to use `gawk' for debugging your
+program is easy.
* Menu:
-* Debugging:: Introduction to `dgawk'.
-* Sample dgawk session:: Sample `dgawk' session.
-* List of Debugger Commands:: Main `dgawk' Commands.
-* Readline Support:: Readline Support.
-* Dgawk Limitations:: Limitations and future plans.
+* Debugging:: Introduction to `gawk' debugger.
+* Sample Debugging Session:: Sample debugging session.
+* List of Debugger Commands:: Main debugger commands.
+* Readline Support:: Readline support.
+* Limitations:: Limitations and future plans.

-File: gawk.info, Node: Debugging, Next: Sample dgawk session, Up: Debugger
+File: gawk.info, Node: Debugging, Next: Sample Debugging Session, Up: Debugger
-14.1 Introduction to `dgawk'
-============================
+14.1 Introduction to `gawk' Debugger
+====================================
This minor node introduces debugging in general and begins the
discussion of debugging in `gawk'.
* Menu:
-* Debugging Concepts:: Debugging In General.
+* Debugging Concepts:: Debugging in General.
* Debugging Terms:: Additional Debugging Concepts.
* Awk Debugging:: Awk Debugging.

File: gawk.info, Node: Debugging Concepts, Next: Debugging Terms, Up: Debugging
-14.1.1 Debugging In General
+14.1.1 Debugging in General
---------------------------
(If you have used debuggers in other languages, you may want to skip
@@ -18801,9 +18803,8 @@ File: gawk.info, Node: Debugging Terms, Next: Awk Debugging, Prev: Debugging
------------------------------------
Before diving in to the details, we need to introduce several important
-concepts that apply to just about all debuggers, including `dgawk'.
-The following list defines terms used throughout the rest of this
-major node.
+concepts that apply to just about all debuggers. The following list
+defines terms used throughout the rest of this major node.
"Stack Frame"
Programs generally call functions during the course of their
@@ -18821,11 +18822,11 @@ major node.
needed to manage the call stack. This data area is termed a
"stack frame".
- `gawk' also follows this model, and `dgawk' gives you access to
- the call stack and to each stack frame. You can see the call
- stack, as well as from where each function on the stack was
- invoked. Commands that print the call stack print information about
- each stack frame (as detailed later on).
+ `gawk' also follows this model, and gives you access to the call
+ stack and to each stack frame. You can see the call stack, as well
+ as from where each function on the stack was invoked. Commands
+ that print the call stack print information about each stack frame
+ (as detailed later on).
"Breakpoint"
During debugging, you often wish to let the program run until it
@@ -18870,54 +18871,57 @@ individual primitive instructions carried out by the higher-level `awk'
commands.

-File: gawk.info, Node: Sample dgawk session, Next: List of Debugger Commands, Prev: Debugging, Up: Debugger
+File: gawk.info, Node: Sample Debugging Session, Next: List of Debugger Commands, Prev: Debugging, Up: Debugger
-14.2 Sample `dgawk' session
-===========================
+14.2 Sample Debugging Session
+=============================
-In order to illustrate the use of `dgawk', let's look at a sample
-debugging session. We will use the `awk' implementation of the POSIX
-`uniq' command described earlier (*note Uniq Program::) as our example.
+In order to illustrate the use of `gawk' as a debugger, let's look at a
+sample debugging session. We will use the `awk' implementation of the
+POSIX `uniq' command described earlier (*note Uniq Program::) as our
+example.
* Menu:
-* dgawk invocation:: `dgawk' Invocation.
-* Finding The Bug:: Finding The Bug.
+* Debugger Invocation:: How to Start the Debugger.
+* Finding The Bug:: Finding the Bug.

-File: gawk.info, Node: dgawk invocation, Next: Finding The Bug, Up: Sample dgawk session
+File: gawk.info, Node: Debugger Invocation, Next: Finding The Bug, Up: Sample Debugging Session
-14.2.1 `dgawk' Invocation
--------------------------
+14.2.1 How to Start the Debugger
+--------------------------------
-Starting `dgawk' is exactly like running `awk'. The file(s) containing
-the program and any supporting code are given on the command line as
-arguments to one or more `-f' options. (`dgawk' is not designed to
-debug command-line programs, only programs contained in files.) In our
-case, we call `dgawk' like this:
+Starting the debugger is almost exactly like running `awk', except you
+have to pass an additional option `--debug' or the corresponding short
+option `-D'. The file(s) containing the program and any supporting
+code are given on the command line as arguments to one or more `-f'
+options. (`gawk' is not designed to debug command-line programs, only
+programs contained in files.) In our case, we invoke the debugger like
+this:
- $ dgawk -f getopt.awk -f join.awk -f uniq.awk inputfile
+ $ gawk -D -f getopt.awk -f join.awk -f uniq.awk inputfile
where both `getopt.awk' and `uniq.awk' are in `$AWKPATH'. (Experienced
users of GDB or similar debuggers should note that this syntax is
-slightly different from what they are used to. With `dgawk', the
-arguments for running the program are given in the command line to the
-debugger rather than as part of the `run' command at the debugger
+slightly different from what they are used to. With `gawk' debugger,
+the arguments for running the program are given in the command line to
+the debugger rather than as part of the `run' command at the debugger
prompt.)
Instead of immediately running the program on `inputfile', as `gawk'
-would ordinarily do, `dgawk' merely loads all the program source files,
-compiles them internally, and then gives us a prompt:
+would ordinarily do, the debugger merely loads all the program source
+files, compiles them internally, and then gives us a prompt:
- dgawk>
+ gawk>
from which we can issue commands to the debugger. At this point, no
code has been executed.

-File: gawk.info, Node: Finding The Bug, Prev: dgawk invocation, Up: Sample dgawk session
+File: gawk.info, Node: Finding The Bug, Prev: Debugger Invocation, Up: Sample Debugging Session
-14.2.2 Finding The Bug
+14.2.2 Finding the Bug
----------------------
Let's say that we are having a problem using (a faulty version of)
@@ -18947,27 +18951,27 @@ for a breakpoint in `uniq.awk' is at the beginning of the function
`are_equal()', which compares the current line with the previous one.
To set the breakpoint, use the `b' (breakpoint) command:
- dgawk> b are_equal
+ gawk> b are_equal
-| Breakpoint 1 set at file `awklib/eg/prog/uniq.awk', line 64
The debugger tells us the file and line number where the breakpoint
is. Now type `r' or `run' and the program runs until it hits the
breakpoint for the first time:
- dgawk> r
+ gawk> r
-| Starting program:
-| Stopping in Rule ...
-| Breakpoint 1, are_equal(n, m, clast, cline, alast, aline)
at `awklib/eg/prog/uniq.awk':64
-| 64 if (fcount == 0 && charcount == 0)
- dgawk>
+ gawk>
Now we can look at what's going on inside our program. First of all,
let's see how we got to where we are. At the prompt, we type `bt'
-(short for "backtrace"), and `dgawk' responds with a listing of the
-current stack frames:
+(short for "backtrace"), and the debugger responds with a listing of
+the current stack frames:
- dgawk> bt
+ gawk> bt
-| #0 are_equal(n, m, clast, cline, alast, aline)
at `awklib/eg/prog/uniq.awk':69
-| #1 in main() at `awklib/eg/prog/uniq.awk':89
@@ -18981,9 +18985,9 @@ the key to finding the source of the problem.)
Now that we're in `are_equal()', we can start looking at the values
of some variables. Let's say we type `p n' (`p' is short for "print").
We would expect to see the value of `n', a parameter to `are_equal()'.
-Actually, `dgawk' gives us:
+Actually, the debugger gives us:
- dgawk> p n
+ gawk> p n
-| n = untyped variable
In this case, `n' is an uninitialized local variable, since the
@@ -18991,13 +18995,13 @@ function was called without arguments (*note Function Calls::).
A more useful variable to display might be the current record:
- dgawk> p $0
+ gawk> p $0
-| $0 = string ("gawk is a wonderful program!")
This might be a bit puzzling at first since this is the second line of
our test input above. Let's look at `NR':
- dgawk> p NR
+ gawk> p NR
-| NR = number (2)
So we can see that `are_equal()' was only called for the second record
@@ -19011,7 +19015,7 @@ for `NR == 1':
OK, let's just check that that rule worked correctly:
- dgawk> p last
+ gawk> p last
-| last = string ("awk is a wonderful program!")
Everything we have done so far has verified that the program has
@@ -19020,7 +19024,7 @@ the problem must be inside this function. To investigate further, we
must begin "stepping through" the lines of `are_equal()'. We start by
typing `n' (for "next"):
- dgawk> n
+ gawk> n
-| 67 if (fcount > 0) {
This tells us that `gawk' is now ready to execute line 67, which
@@ -19036,15 +19040,15 @@ was false.)
Continuing to step, we now get to the splitting of the current and
last records:
- dgawk> n
+ gawk> n
-| 68 n = split(last, alast)
- dgawk> n
+ gawk> n
-| 69 m = split($0, aline)
At this point, we should be curious to see what our records were
split into, so we try to look:
- dgawk> p n m alast aline
+ gawk> p n m alast aline
-| n = number (5)
-| m = number (5)
-| alast = array, 5 elements
@@ -19060,19 +19064,19 @@ want to see inside the array?
The first choice would be to use subscripts:
- dgawk> p alast[0]
+ gawk> p alast[0]
-| "0" not in array `alast'
Oops!
- dgawk> p alast[1]
+ gawk> p alast[1]
-| alast["1"] = string ("awk")
- This would be kind of slow for a 100-member array, though, so
-`dgawk' provides a shortcut (reminiscent of another language not to be
+ This would be kind of slow for a 100-member array, though, so `gawk'
+provides a shortcut (reminiscent of another language not to be
mentioned):
- dgawk> p @alast
+ gawk> p @alast
-| alast["1"] = string ("awk")
-| alast["2"] = string ("is")
-| alast["3"] = string ("a")
@@ -19081,9 +19085,9 @@ mentioned):
It looks like we got this far OK. Let's take another step or two:
- dgawk> n
+ gawk> n
-| 70 clast = join(alast, fcount, n)
- dgawk> n
+ gawk> n
-| 71 cline = join(aline, fcount, m)
Well, here we are at our error (sorry to spoil the suspense). What
@@ -19091,7 +19095,7 @@ we had in mind was to join the fields starting from the second one to
make the virtual record to compare, and if the first field was numbered
zero, this would work. Let's look at what we've got:
- dgawk> p cline clast
+ gawk> p cline clast
-| cline = string ("gawk is a wonderful program!")
-| clast = string ("awk is a wonderful program!")
@@ -19099,9 +19103,9 @@ zero, this would work. Let's look at what we've got:
unaltered, input records. A little thinking (the human brain is still
the best debugging tool), and we realize that we were off by one!
- We get out of `dgawk':
+ We get out of the debugger:
- dgawk> q
+ gawk> q
-| The program is running. Exit anyway (y/n)? y
Then we get into an editor:
@@ -19112,12 +19116,13 @@ Then we get into an editor:
and problem solved!

-File: gawk.info, Node: List of Debugger Commands, Next: Readline Support, Prev: Sample dgawk session, Up: Debugger
+File: gawk.info, Node: List of Debugger Commands, Next: Readline Support, Prev: Sample Debugging Session, Up: Debugger
-14.3 Main `dgawk' Commands
-==========================
+14.3 Main Debugger Commands
+===========================
-The `dgawk' command set can be divided into the following categories:
+The `gawk' debugger command set can be divided into the following
+categories:
* Breakpoint control
@@ -19133,26 +19138,26 @@ The `dgawk' command set can be divided into the following categories:
Each of these are discussed in the following subsections. In the
following descriptions, commands which may be abbreviated show the
-abbreviation on a second description line. A `dgawk' command name may
-also be truncated if that partial name is unambiguous. `dgawk' has the
-built-in capability to automatically repeat the previous command when
-just hitting <Enter>. This works for the commands `list', `next',
+abbreviation on a second description line. A debugger command name may
+also be truncated if that partial name is unambiguous. The debugger has
+the built-in capability to automatically repeat the previous command
+when just hitting <Enter>. This works for the commands `list', `next',
`nexti', `step', `stepi' and `continue' executed without any argument.
* Menu:
-* Breakpoint Control:: Control of breakpoints.
-* Dgawk Execution Control:: Control of execution.
-* Viewing And Changing Data:: Viewing and changing data.
-* Dgawk Stack:: Dealing with the stack.
-* Dgawk Info:: Obtaining information about the program and
- the debugger state.
-* Miscellaneous Dgawk Commands:: Miscellaneous Commands.
+* Breakpoint Control:: Control of Breakpoints.
+* Debugger Execution Control:: Control of Execution.
+* Viewing And Changing Data:: Viewing and Changing Data.
+* Execution Stack:: Dealing with the Stack.
+* Debugger Info:: Obtaining Information about the Program and
+ the Debugger State.
+* Miscellaneous Debugger Commands:: Miscellaneous Commands.

-File: gawk.info, Node: Breakpoint Control, Next: Dgawk Execution Control, Up: List of Debugger Commands
+File: gawk.info, Node: Breakpoint Control, Next: Debugger Execution Control, Up: List of Debugger Commands
-14.3.1 Control Of Breakpoints
+14.3.1 Control of Breakpoints
-----------------------------
As we saw above, the first thing you probably want to do in a debugging
@@ -19180,10 +19185,10 @@ controlling breakpoints are:
it from the breakpoint list using the `delete' command.
With a breakpoint, you may also supply a condition. This is an
- `awk' expression (enclosed in double quotes) that `dgawk'
+ `awk' expression (enclosed in double quotes) that the debugger
evaluates whenever the breakpoint is reached. If the condition is
- true, then `dgawk' stops execution and prompts for a command.
- Otherwise, `dgawk' continues executing the program.
+ true, then the debugger stops execution and prompts for a command.
+ Otherwise, it continues executing the program.
`clear' [[FILENAME`:']N | FUNCTION]
Without any argument, delete any breakpoint at the next instruction
@@ -19205,12 +19210,13 @@ controlling breakpoints are:
`condition' N `"EXPRESSION"'
Add a condition to existing breakpoint or watchpoint N. The
- condition is an `awk' expression that `dgawk' evaluates whenever
- the breakpoint or watchpoint is reached. If the condition is true,
- then `dgawk' stops execution and prompts for a command. Otherwise,
- `dgawk' continues executing the program. If the condition
- expression is not specified, any existing condition is removed;
- i.e., the breakpoint or watchpoint is made unconditional.
+ condition is an `awk' expression that the debugger evaluates
+ whenever the breakpoint or watchpoint is reached. If the condition
+ is true, then the debugger stops execution and prompts for a
+ command. Otherwise, the debugger continues executing the program.
+ If the condition expression is not specified, any existing
+ condition is removed; i.e., the breakpoint or watchpoint is made
+ unconditional.
`delete' [N1 N2 ...] [N-M]
`d' [N1 N2 ...] [N-M]
@@ -19244,7 +19250,7 @@ controlling breakpoints are:
arguments are the same as for `break'.

-File: gawk.info, Node: Dgawk Execution Control, Next: Viewing And Changing Data, Prev: Breakpoint Control, Up: List of Debugger Commands
+File: gawk.info, Node: Debugger Execution Control, Next: Viewing And Changing Data, Prev: Breakpoint Control, Up: List of Debugger Commands
14.3.2 Control of Execution
---------------------------
@@ -19267,14 +19273,14 @@ execution of the program than we saw in our earlier example:
`continue') terminates the list (an implicit `end'), and
subsequent commands are ignored. For example:
- dgawk> commands
+ gawk> commands
> silent
> printf "A silent breakpoint; i = %d\n", i
> info locals
> set i = 10
> continue
> end
- dgawk>
+ gawk>
`continue' [COUNT]
`c' [COUNT]
@@ -19307,9 +19313,9 @@ execution of the program than we saw in our earlier example:
`run'
`r'
- Start/restart execution of the program. When restarting, `dgawk'
- retains the current breakpoints, watchpoints, command history,
- automatic display variables, and debugger options.
+ Start/restart execution of the program. When restarting, the
+ debugger retains the current breakpoints, watchpoints, command
+ history, automatic display variables, and debugger options.
`step' [COUNT]
`s' [COUNT]
@@ -19323,8 +19329,8 @@ execution of the program than we saw in our earlier example:
`si' [COUNT]
Execute one (or COUNT) instruction(s), stepping inside function
calls. (For illustration of what is meant by an "instruction" in
- `gawk', see the output shown under `dump' in *Note Miscellaneous
- Dgawk Commands::.)
+ `gawk', see the output shown under `dump' in *note Miscellaneous
+ Debugger Commands::.)
`until' [[FILENAME`:']N | FUNCTION]
`u' [[FILENAME`:']N | FUNCTION]
@@ -19334,7 +19340,7 @@ execution of the program than we saw in our earlier example:
current stack frame returns.

-File: gawk.info, Node: Viewing And Changing Data, Next: Dgawk Stack, Prev: Dgawk Execution Control, Up: List of Debugger Commands
+File: gawk.info, Node: Viewing And Changing Data, Next: Execution Stack, Prev: Debugger Execution Control, Up: List of Debugger Commands
14.3.3 Viewing and Changing Data
--------------------------------
@@ -19346,7 +19352,7 @@ The commands for viewing and changing variables inside of `gawk' are:
of the variable or field is displayed each time the program stops.
Each variable added to the list is identified by a unique number:
- dgawk> display x
+ gawk> display x
-| 10: x = 1
displays the assigned item number, the variable name and its
@@ -19374,7 +19380,7 @@ AWK STATEMENTS
Print the value of a `gawk' variable or field. Fields must be
referenced by constants:
- dgawk> print $3
+ gawk> print $3
This prints the third field in the input record (if the specified
field does not exist, it prints `Null field'). A variable can be
@@ -19402,16 +19408,16 @@ AWK STATEMENTS
`watch' VAR | `$'N [`"EXPRESSION"']
`w' VAR | `$'N [`"EXPRESSION"']
- Add variable VAR (or field `$N') to the watch list. `dgawk' then
- stops whenever the value of the variable or field changes. Each
- watched item is assigned a number which can be used to delete it
- from the watch list using the `unwatch' command.
+ Add variable VAR (or field `$N') to the watch list. The debugger
+ then stops whenever the value of the variable or field changes.
+ Each watched item is assigned a number which can be used to delete
+ it from the watch list using the `unwatch' command.
With a watchpoint, you may also supply a condition. This is an
- `awk' expression (enclosed in double quotes) that `dgawk'
+ `awk' expression (enclosed in double quotes) that the debugger
evaluates whenever the watchpoint is reached. If the condition is
- true, then `dgawk' stops execution and prompts for a command.
- Otherwise, `dgawk' continues executing the program.
+ true, then the debugger stops execution and prompts for a command.
+ Otherwise, `gawk' continues executing the program.
`undisplay' [N]
Remove item number N (or all items, if no argument) from the
@@ -19423,9 +19429,9 @@ AWK STATEMENTS

-File: gawk.info, Node: Dgawk Stack, Next: Dgawk Info, Prev: Viewing And Changing Data, Up: List of Debugger Commands
+File: gawk.info, Node: Execution Stack, Next: Debugger Info, Prev: Viewing And Changing Data, Up: List of Debugger Commands
-14.3.4 Dealing With The Stack
+14.3.4 Dealing with the Stack
-----------------------------
Whenever you run a program which contains any function calls, `gawk'
@@ -19460,16 +19466,17 @@ are:
frame. Then select and print the frame.

-File: gawk.info, Node: Dgawk Info, Next: Miscellaneous Dgawk Commands, Prev: Dgawk Stack, Up: List of Debugger Commands
+File: gawk.info, Node: Debugger Info, Next: Miscellaneous Debugger Commands, Prev: Execution Stack, Up: List of Debugger Commands
-14.3.5 Obtaining Information About The Program and The Debugger State
+14.3.5 Obtaining Information about the Program and the Debugger State
---------------------------------------------------------------------
Besides looking at the values of variables, there is often a need to get
other sorts of information about the state of your program and of the
-debugging environment itself. `dgawk' has one command which provides
-this information, appropriately called `info'. `info' is used with one
-of a number of arguments that tell it exactly what you want to know:
+debugging environment itself. The `gawk' debugger has one command which
+provides this information, appropriately called `info'. `info' is used
+with one of a number of arguments that tell it exactly what you want to
+know:
`info' WHAT
`i' WHAT
@@ -19497,10 +19504,10 @@ of a number of arguments that tell it exactly what you want to know:
`source'
The name of the current source file. Each time the program
stops, the current source file is the file containing the
- current instruction. When `dgawk' first starts, the current
- source file is the first file included via the `-f' option.
- The `list FILENAME:LINENO' command can be used at any time to
- change the current source.
+ current instruction. When the debugger first starts, the
+ current source file is the first file included via the `-f'
+ option. The `list FILENAME:LINENO' command can be used at any
+ time to change the current source.
`sources'
List all program sources.
@@ -19524,7 +19531,7 @@ from a file. The commands are:
`history_size'
The maximum number of lines to keep in the history file
- `./.dgawk_history'. The default is 100.
+ `./.gawk_history'. The default is 100.
`listsize'
The number of lines that `list' prints. The default is 15.
@@ -19535,14 +19542,14 @@ from a file. The commands are:
standard output.
`prompt'
- The debugger prompt. The default is `dgawk> '.
+ The debugger prompt. The default is `gawk> '.
`save_history [on | off]'
- Save command history to file `./.dgawk_history'. The default
+ Save command history to file `./.gawk_history'. The default
is `on'.
`save_options [on | off]'
- Save current options to file `./.dgawkrc' upon exit. The
+ Save current options to file `./.gawkrc' upon exit. The
default is `on'. Options are read back in to the next
session upon startup.
@@ -19560,15 +19567,15 @@ from a file. The commands are:
ignored; they do _not_ repeat the last command. You can't restart
the program by having more than one `run' command in the file.
Also, the list of commands may include additional `source'
- commands; however, `dgawk' will not source the same file more than
- once in order to avoid infinite recursion.
+ commands; however, the `gawk' debugger will not source the same
+ file more than once in order to avoid infinite recursion.
In addition to, or instead of the `source' command, you can use
- the `-R FILE' or `--command=FILE' command-line options to execute
+ the `-D FILE' or `--debug=FILE' command-line options to execute
commands from a file non-interactively (*note Options::.

-File: gawk.info, Node: Miscellaneous Dgawk Commands, Prev: Dgawk Info, Up: List of Debugger Commands
+File: gawk.info, Node: Miscellaneous Debugger Commands, Prev: Debugger Info, Up: List of Debugger Commands
14.3.6 Miscellaneous Commands
-----------------------------
@@ -19584,7 +19591,7 @@ categories, as follows:
partial dump of Davide Brini's obfuscated code (*note Signature
Program::) demonstrates:
- dgawk> dump
+ gawk> dump
-| # BEGIN
-|
-| [ 2:0x89faef4] Op_rule : [in_rule = BEGIN] [source_file = brini.awk]
@@ -19633,13 +19640,13 @@ categories, as follows:
-| [ :0x89fa3b0] Op_after_beginfile :
-| [ :0x89fa388] Op_no_op :
-| [ :0x89fa3c4] Op_after_endfile :
- dgawk>
+ gawk>
`help'
`h'
- Print a list of all of the `dgawk' commands with a short summary
- of their usage. `help COMMAND' prints the information about the
- command COMMAND.
+ Print a list of all of the `gawk' debugger commands with a short
+ summary of their usage. `help COMMAND' prints the information
+ about the command COMMAND.
`list' [`-' | `+' | N | FILENAME`:'N | N-M | FUNCTION]
`l' [`-' | `+' | N | FILENAME`:'N | N-M | FUNCTION]
@@ -19673,7 +19680,7 @@ categories, as follows:
Exit the debugger. Debugging is great fun, but sometimes we all
have to tend to other obligations in life, and sometimes we find
the bug, and are free to go on to the next one! As we saw above,
- if you are running a program, `dgawk' warns you if you
+ if you are running a program, the debugger warns you if you
accidentally type `q' or `quit', to make sure you really want to
quit.
@@ -19688,12 +19695,12 @@ categories, as follows:

-File: gawk.info, Node: Readline Support, Next: Dgawk Limitations, Prev: List of Debugger Commands, Up: Debugger
+File: gawk.info, Node: Readline Support, Next: Limitations, Prev: List of Debugger Commands, Up: Debugger
14.4 Readline Support
=====================
-If `dgawk' is compiled with the `readline' library, you can take
+If `gawk' is compiled with the `readline' library, you can take
advantage of that library's command completion and history expansion
features. The following types of completion are available:
@@ -19715,27 +19722,27 @@ Variable name completion

-File: gawk.info, Node: Dgawk Limitations, Prev: Readline Support, Up: Debugger
+File: gawk.info, Node: Limitations, Prev: Readline Support, Up: Debugger
14.5 Limitations and Future Plans
=================================
-We hope you find `dgawk' useful and enjoyable to work with, but as with
-any program, especially in its early releases, it still has some
-limitations. A few which are worth being aware of are:
+We hope you find the `gawk' debugger useful and enjoyable to work with,
+but as with any program, especially in its early releases, it still has
+some limitations. A few which are worth being aware of are:
- * At this point, `dgawk' does not give a detailed explanation of
+ * At this point, the debugger does not give a detailed explanation of
what you did wrong when you type in something it doesn't like.
Rather, it just responds `syntax error'. When you do figure out
what your mistake was, though, you'll feel like a real guru.
- * If you perused the dump of opcodes in *Note Miscellaneous Dgawk
+ * If you perused the dump of opcodes in *note Miscellaneous Debugger
Commands::, (or if you are already familiar with `gawk' internals),
you will realize that much of the internal manipulation of data in
`gawk', as in many interpreters, is done on a stack. `Op_push',
`Op_pop', etc., are the "bread and butter" of most `gawk' code.
- Unfortunately, as of now, `dgawk' does not allow you to examine
- the stack's contents.
+ Unfortunately, as of now, the `gawk' debugger does not allow you
+ to examine the stack's contents.
That is, the intermediate results of expression evaluation are on
the stack, but cannot be printed. Rather, only variables which
@@ -19748,13 +19755,15 @@ limitations. A few which are worth being aware of are:
expressions to see if you got it right. As an `awk' programmer,
you are expected to know what `/[^[:alnum:][:blank:]]/' means.
- * `dgawk' is designed to be used by running a program (with all its
- parameters) on the command line, as described in *Note dgawk
- invocation::. There is no way (as of now) to attach or "break in"
- to a running program. This seems reasonable for a language which
- is used mainly for quickly executing, short programs.
+ * The `gawk' debugger is designed to be used by running a program
+ (with all its parameters) on the command line, as described in
+ *note Debugger Invocation::. There is no way (as of now) to
+ attach or "break in" to a running program. This seems reasonable
+ for a language which is used mainly for quickly executing, short
+ programs.
- * `dgawk' only accepts source supplied with the `-f' option.
+ * The `gawk' debugger only accepts source supplied with the `-f'
+ option.
Look forward to a future release when these and other missing
features may be added, and of course feel free to try to add them
@@ -19939,7 +19948,7 @@ Other Versions::).
This minor node describes common extensions that originally appeared
in his version of `awk'.
- * The `**' and `**=' operators (*note Arithmetic Ops:: and *Note
+ * The `**' and `**=' operators (*note Arithmetic Ops:: and *note
Assignment Ops::).
* The use of `func' as an abbreviation for `function' (*note
@@ -20144,14 +20153,14 @@ inclusive. Ordering was based on the numeric value of each character
in the machine's native character set. Thus, on ASCII-based systems,
`[a-z]' matched all the lowercase letters, and only the lowercase
letters, since the numeric values for the letters from `a' through `z'
-were contigous. (On an EBCDIC system, the range `[a-z]' includes
+were contiguous. (On an EBCDIC system, the range `[a-z]' includes
additional, non-alphabetic characters as well.)
Almost all introductory Unix literature explained range expressions
as working in this fashion, and in particular, would teach that the
"correct" way to match lowercase letters was with `[a-z]', and that
-`[A-Z]' was the the "correct" way to match uppercase letters. And
-indeed, this was true.
+`[A-Z]' was the "correct" way to match uppercase letters. And indeed,
+this was true.
The 1993 POSIX standard introduced the idea of locales (*note
Locales::). Since many locales include other letters besides the plain
@@ -20330,9 +20339,9 @@ Info file, in approximate chronological order:
Windows32 environments. (This is no longer supported)
* John Haque reworked the `gawk' internals to use a byte-code engine,
- providing the `dgawk' debugger for `awk' programs.
+ providing the `gawk' debugger for `awk' programs.
- * Efraim Yawitz contributed the original text for *Note Debugger::.
+ * Efraim Yawitz contributed the original text for *note Debugger::.
* Arnold Robbins has been working on `gawk' since 1988, at first
helping David Trueman, and as the primary maintainer since around
@@ -20390,7 +20399,7 @@ There are three ways to get GNU software:
supported. If you have the `wget' program, you can use a command
like the following:
- wget http://ftp.gnu.org/gnu/gawk/gawk-4.0.0.tar.gz
+ wget http://ftp.gnu.org/gnu/gawk/gawk-4.0.1.tar.gz
The GNU software archive is mirrored around the world. The
up-to-date list of mirror sites is available from the main FSF web site
@@ -20409,26 +20418,26 @@ compression programs: `gzip', `bzip2', and `xz'. For simplicity, the
rest of these instructions assume you are using the one compressed with
the GNU Zip program, `gzip'.
- Once you have the distribution (for example, `gawk-4.0.0.tar.gz'),
+ Once you have the distribution (for example, `gawk-4.0.1.tar.gz'),
use `gzip' to expand the file and then use `tar' to extract it. You
can use the following pipeline to produce the `gawk' distribution:
# Under System V, add 'o' to the tar options
- gzip -d -c gawk-4.0.0.tar.gz | tar -xvpf -
+ gzip -d -c gawk-4.0.1.tar.gz | tar -xvpf -
On a system with GNU `tar', you can let `tar' do the decompression
for you:
- tar -xvpzf gawk-4.0.0.tar.gz
+ tar -xvpzf gawk-4.0.1.tar.gz
-Extracting the archive creates a directory named `gawk-4.0.0' in the
+Extracting the archive creates a directory named `gawk-4.0.1' in the
current directory.
The distribution file name is of the form `gawk-V.R.P.tar.gz'. The
V represents the major version of `gawk', the R represents the current
release of version V, and the P represents a "patch level", meaning
that minor bugs have been fixed in the release. The current patch
-level is 0, but when retrieving distributions, you should get the
+level is 1, but when retrieving distributions, you should get the
version with the highest version, release, and patch level. (Note,
however, that patch levels greater than or equal to 70 denote "beta" or
nonproduction software; you might not want to retrieve such a version
@@ -20536,7 +20545,7 @@ Various `.c', `.y', and `.h' files
`doc/igawk.1'
The `troff' source for a manual page describing the `igawk'
- program presented in *Note Igawk Program::.
+ program presented in *note Igawk Program::.
`doc/Makefile.in'
The input file used during the configuration process to generate
@@ -20556,7 +20565,7 @@ 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 Unix
+ for various Unix systems. They are explained in *note Unix
Installation::.
`po/*'
@@ -20571,8 +20580,8 @@ Various `.c', `.y', and `.h' files
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::,
+ `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
@@ -20622,7 +20631,7 @@ Unix-derived systems, GNU/Linux, BSD-based systems, and the Cygwin
environment for MS-Windows.
After you have extracted the `gawk' distribution, `cd' to
-`gawk-4.0.0'. Like most GNU software, `gawk' is configured
+`gawk-4.0.1'. Like most GNU software, `gawk' is configured
automatically for your 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 starting
@@ -20937,7 +20946,7 @@ MS-DOS or MS-Windows. EMX (OS/2 only) does support at least the `|&'
operator.
The MS-DOS and MS-Windows versions of `gawk' search for program
-files as described in *Note AWKPATH Variable::. However, semicolons
+files as 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
MS-Windows and MS-DOS versions is `".;c:/lib/awk;c:/gnu/lib/awk"'.
@@ -21032,8 +21041,8 @@ tools, such as Bash, the GNU Compiler Collection (GCC), GNU Make, and
other GNU programs. Compilation and installation for Cygwin is the
same as for a Unix system:
- tar -xvpzf gawk-4.0.0.tar.gz
- cd gawk-4.0.0
+ tar -xvpzf gawk-4.0.1.tar.gz
+ cd gawk-4.0.1
./configure
make
@@ -21347,9 +21356,10 @@ Unix `awk'
`pawk'
Nelson H.F. Beebe at the University of Utah has modified Brian
Kernighan's `awk' to provide timing and profiling information. It
- is 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-20030606.tar.gz' or
+ is different from `gawk' with the `--profile' option. (*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-20030606.tar.gz' or
`http://www.math.utah.edu/pub/pawk/pawk-20030606.tar.gz'.
Busybox Awk
@@ -21471,7 +21481,7 @@ File: gawk.info, Node: Accessing The Source, Next: Adding Code, Up: Additions
C.2.1 Accessing The `gawk' Git Repository
-----------------------------------------
-As `gawk' is Free Software, the source code is always available. *Note
+As `gawk' is Free Software, the source code is always available. *note
Gawk Distribution::, describes how to get and build the formal,
released versions of `gawk'.
@@ -21491,7 +21501,7 @@ access the repository using:
git clone http://git.savannah.gnu.org/r/gawk.git
Once you have made changes, you can use `git diff' to produce a
-patch, and send that to the `gawk' maintainer; see *Note Bugs:: for how
+patch, and send that to the `gawk' maintainer; see *note Bugs:: for how
to do that.
Finally, if you cannot install Git (e.g., if it hasn't been ported
@@ -21640,7 +21650,7 @@ C.2.3 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 Code::, concerning coding
+ 1. Follow the guidelines in *note Adding Code::, concerning coding
style, submission of diffs, and so on.
2. Be prepared to sign the appropriate paperwork. In order for the
@@ -21746,6 +21756,7 @@ is necessary when reading this minor node.
* Internals:: A brief look at some `gawk' internals.
* Plugin License:: A note about licensing.
+* Loading Extensions:: How to load dynamic extensions.
* Sample Library:: A example of new functions.

@@ -21945,7 +21956,7 @@ function parameter.
just blindly copy this code.

-File: gawk.info, Node: Plugin License, Next: Sample Library, Prev: Internals, Up: Dynamic Extensions
+File: gawk.info, Node: Plugin License, Next: Loading Extensions, Prev: Internals, Up: Dynamic Extensions
C.3.2 Extension Licensing
-------------------------
@@ -21962,9 +21973,54 @@ the symbol exists in the global scope. Something like this is enough:
int plugin_is_GPL_compatible;

-File: gawk.info, Node: Sample Library, Prev: Plugin License, Up: Dynamic Extensions
+File: gawk.info, Node: Loading Extensions, Next: Sample Library, Prev: Plugin License, Up: Dynamic Extensions
+
+C.3.3 Loading a Dynamic Extension
+---------------------------------
+
+There are two ways to load a dynamically linked library. The first is
+to use the builtin `extension()':
+
+ extension(libname, init_func)
+
+ where `libname' is the library to load, and `init_func' is the name
+of the initialization or bootstrap routine to run once loaded.
+
+ The second method for dynamic loading of a library is to use the
+command line option `-l':
+
+ $ gawk -l libname -f myprog
+
+ This will work only if the initialization routine is named
+`dlload()'.
+
+ If you use `extension()', the library will be loaded at run time.
+This means that the functions are available only to the rest of your
+script. If you use the command line option `-l' instead, the library
+will be loaded before `gawk' starts compiling the actual program. The
+net effect is that you can use those functions anywhere in the program.
-C.3.3 Example: Directory and File Operation Built-ins
+ `gawk' has a list of directories where it searches for libraries.
+By default, the list includes directories that depend upon how gawk was
+built and installed (*note AWKPATH Variable::). If you want `gawk' to
+look for libraries in your private directory, you have to tell it. The
+way to do it is to set the `AWKPATH' environment variable (*note
+AWKPATH Variable::). `gawk' supplies the default suffix `.so' if it is
+not present in the name of the library. If the name of your library is
+`mylib.so', you can simply type
+
+ $ gawk -l mylib -f myprog
+
+ and `gawk' will do everything necessary to load in your library, and
+then call your `dlload()' routine.
+
+ You can always specify the library using an absolute pathname, in
+which case `gawk' will not use `AWKPATH' to search for it.
+
+
+File: gawk.info, Node: Sample Library, Prev: Loading Extensions, Up: Dynamic Extensions
+
+C.3.4 Example: Directory and File Operation Built-ins
-----------------------------------------------------
Two useful functions that are not in `awk' are `chdir()' (so that an
@@ -21981,7 +22037,7 @@ implements these functions for `gawk' in an external extension library.

File: gawk.info, Node: Internal File Description, Next: Internal File Ops, Up: Sample Library
-C.3.3.1 Using `chdir()' and `stat()'
+C.3.4.1 Using `chdir()' and `stat()'
....................................
This minor node shows how to use the new functions at the `awk' level
@@ -22104,7 +22160,7 @@ Elements::):

File: gawk.info, Node: Internal File Ops, Next: Using Internal File Ops, Prev: Internal File Description, Up: Sample Library
-C.3.3.2 C Code for `chdir()' and `stat()'
+C.3.4.2 C Code for `chdir()' and `stat()'
.........................................
Here is the C code for these extensions. They were written for
@@ -22254,7 +22310,7 @@ version.

File: gawk.info, Node: Using Internal File Ops, Prev: Internal File Ops, Up: Sample Library
-C.3.3.3 Integrating the Extensions
+C.3.4.3 Integrating the Extensions
..................................
Now that the code is written, it must be possible to add it at runtime
@@ -22548,7 +22604,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 Issues::.
+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,
@@ -22571,7 +22627,7 @@ 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
+or decimal 10. Octal and hexadecimal are discussed more in *note
Nondecimal-numbers::.
Programs are written in programming languages. Hundreds, if not
@@ -22888,7 +22944,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 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
@@ -23071,7 +23127,7 @@ Field
built-in variable `FIELDWIDTHS' to describe their lengths. If you
wish to specify the contents of fields instead of the field
separator, you can use the built-in variable `FPAT' to do so.
- (*Note Field Separators::, *Note Constant Size::, and *Note
+ (*Note Field Separators::, *note Constant Size::, and *note
Splitting By Content::.)
Flag
@@ -23306,7 +23362,7 @@ Redirection
`|', and `|&' operators. You can redirect the output of the
`print' and `printf' statements to a file or a system command,
using the `>', `>>', `|', and `|&' operators. (*Note Getline::,
- and *Note Redirection::.)
+ and *note Redirection::.)
Regexp
See "Regular Expression."
@@ -24692,14 +24748,14 @@ Index
* ' (single quote): One-shot. (line 15)
* ' (single quote), vs. apostrophe: Comments. (line 27)
* ' (single quote), with double quotes: Quoting. (line 53)
+* () (parentheses) <1>: Profiling. (line 138)
* () (parentheses): Regexp Operators. (line 79)
-* () (parentheses), pgawk program: Profiling. (line 141)
* * (asterisk), * operator, as multiplication operator: Precedence.
(line 55)
* * (asterisk), * operator, as regexp operator: Regexp Operators.
(line 87)
* * (asterisk), * operator, null strings, matching: Gory Details.
- (line 163)
+ (line 164)
* * (asterisk), ** operator <1>: Precedence. (line 49)
* * (asterisk), ** operator: Arithmetic Ops. (line 81)
* * (asterisk), **= operator <1>: Precedence. (line 95)
@@ -24725,71 +24781,74 @@ Index
* --assign option: Options. (line 32)
* --c option: Options. (line 78)
* --characters-as-bytes option: Options. (line 68)
-* --command option: Options. (line 231)
* --copyright option: Options. (line 85)
+* --debug option: Options. (line 105)
* --disable-lint configuration option: Additional Configuration Options.
(line 9)
* --disable-nls configuration option: Additional Configuration Options.
(line 24)
* --dump-variables option <1>: Library Names. (line 45)
* --dump-variables option: Options. (line 90)
-* --exec option: Options. (line 113)
+* --exec option: Options. (line 122)
* --field-separator option: Options. (line 21)
* --file option: Options. (line 25)
* --gen-pot option <1>: String Extraction. (line 6)
-* --gen-pot option: Options. (line 135)
-* --help option: Options. (line 142)
-* --L option: Options. (line 245)
-* --lint option <1>: Options. (line 147)
+* --gen-pot option: Options. (line 144)
+* --help option: Options. (line 151)
+* --L option: Options. (line 263)
+* --lint option <1>: Options. (line 163)
* --lint option: Command Line. (line 20)
-* --lint-old option: Options. (line 245)
+* --lint-old option: Options. (line 263)
+* --load option: Options. (line 156)
* --non-decimal-data option <1>: Nondecimal Data. (line 6)
-* --non-decimal-data option: Options. (line 166)
+* --non-decimal-data option: Options. (line 182)
* --non-decimal-data option, strtonum() function and: Nondecimal Data.
(line 36)
-* --optimize option: Options. (line 179)
-* --posix option: Options. (line 199)
-* --posix option, --traditional option and: Options. (line 218)
-* --profile option <1>: Profiling. (line 15)
-* --profile option: Options. (line 186)
-* --re-interval option: Options. (line 224)
-* --sandbox option: Options. (line 236)
+* --optimize option: Options. (line 203)
+* --posix option: Options. (line 222)
+* --posix option, --traditional option and: Options. (line 241)
+* --pretty-print option: Options. (line 195)
+* --profile option <1>: Profiling. (line 12)
+* --profile option: Options. (line 210)
+* --re-interval option: Options. (line 247)
+* --sandbox option: Options. (line 254)
* --sandbox option, disabling system() function: I/O Functions.
(line 85)
* --sandbox option, input redirection with getline: Getline. (line 19)
* --sandbox option, output redirection with print, printf: Redirection.
(line 6)
-* --source option: Options. (line 105)
+* --source option: Options. (line 114)
* --traditional option: Options. (line 78)
-* --traditional option, --posix option and: Options. (line 218)
-* --use-lc-numeric option: Options. (line 174)
-* --version option: Options. (line 250)
+* --traditional option, --posix option and: Options. (line 241)
+* --use-lc-numeric option: Options. (line 190)
+* --version option: Options. (line 268)
* --with-whiny-user-strftime configuration option: Additional Configuration Options.
(line 29)
* -b option: Options. (line 68)
* -C option: Options. (line 85)
+* -D option: Options. (line 105)
* -d option: Options. (line 90)
-* -E option: Options. (line 113)
-* -e option: Options. (line 105)
+* -E option: Options. (line 122)
+* -e option: Options. (line 114)
* -F option: Command Line Field Separator.
(line 6)
* -f option: Options. (line 25)
* -F option: Options. (line 21)
* -f option: Long. (line 12)
-* -F option, -Ft sets FS to TAB: Options. (line 258)
-* -f option, on command line: Options. (line 263)
-* -g option: Options. (line 135)
-* -h option: Options. (line 142)
-* -l option: Options. (line 147)
-* -N option: Options. (line 174)
-* -n option: Options. (line 166)
-* -O option: Options. (line 179)
-* -P option: Options. (line 199)
-* -p option: Options. (line 186)
-* -R option: Options. (line 231)
-* -r option: Options. (line 224)
-* -S option: Options. (line 236)
-* -V option: Options. (line 250)
+* -F option, -Ft sets FS to TAB: Options. (line 276)
+* -f option, on command line: Options. (line 281)
+* -g option: Options. (line 144)
+* -h option: Options. (line 151)
+* -l option: Options. (line 156)
+* -N option: Options. (line 190)
+* -n option: Options. (line 182)
+* -O option: Options. (line 203)
+* -o option: Options. (line 195)
+* -P option: Options. (line 222)
+* -p option: Options. (line 210)
+* -r option: Options. (line 247)
+* -S option: Options. (line 254)
+* -V option: Options. (line 268)
* -v option: Options. (line 32)
* -v option, variables, assigning: Assignment Options. (line 12)
* -W option: Options. (line 46)
@@ -24939,7 +24998,7 @@ Index
(line 23)
* advanced features, network connections, See Also networks, connections: Advanced Features.
(line 6)
-* advanced features, null strings, matching: Gory Details. (line 163)
+* advanced features, null strings, matching: Gory Details. (line 164)
* advanced features, operators, precedence: Increment Ops. (line 61)
* advanced features, piping into sh: Redirection. (line 143)
* advanced features, regexp constants: Assignment Ops. (line 148)
@@ -25005,7 +25064,7 @@ Index
* arrays, sorting: Array Sorting Functions.
(line 6)
* arrays, sorting, IGNORECASE variable and: Array Sorting Functions.
- (line 78)
+ (line 81)
* arrays, sparse: Array Intro. (line 71)
* arrays, subscripts: Numeric Array Subscripts.
(line 6)
@@ -25036,7 +25095,7 @@ Index
* asterisk (*), * operator, as regexp operator: Regexp Operators.
(line 87)
* asterisk (*), * operator, null strings, matching: Gory Details.
- (line 163)
+ (line 164)
* asterisk (*), ** operator <1>: Precedence. (line 49)
* asterisk (*), ** operator: Arithmetic Ops. (line 81)
* asterisk (*), **= operator <1>: Precedence. (line 95)
@@ -25045,7 +25104,10 @@ Index
* asterisk (*), *= operator: Assignment Ops. (line 129)
* atan2() function: Numeric Functions. (line 11)
* awf (amazingly workable formatter) program: Glossary. (line 25)
+* awk debugging, enabling: Options. (line 105)
+* awk enabling: Options. (line 195)
* awk language, POSIX version: Assignment Ops. (line 136)
+* awk profiling, enabling: Options. (line 210)
* awk programs <1>: Two Rules. (line 6)
* awk programs <2>: Executable Scripts. (line 6)
* awk programs: Getting Started. (line 12)
@@ -25061,7 +25123,6 @@ Index
* awk programs, location of: Options. (line 25)
* awk programs, one-line examples: Very Simple. (line 45)
* awk programs, profiling: Profiling. (line 6)
-* awk programs, profiling, enabling: Options. (line 186)
* awk programs, running <1>: Long. (line 6)
* awk programs, running: Running gawk. (line 6)
* awk programs, running, from shell scripts: One-shot. (line 22)
@@ -25101,7 +25162,7 @@ Index
* AWKNUM internal type: Internals. (line 19)
* AWKPATH environment variable <1>: PC Using. (line 11)
* AWKPATH environment variable: AWKPATH Variable. (line 6)
-* awkprof.out file: Profiling. (line 10)
+* awkprof.out file: Profiling. (line 6)
* awksed.awk program: Simple Sed. (line 25)
* awkvars.out file: Options. (line 90)
* b debugger command (alias for break): Breakpoint Control. (line 11)
@@ -25155,12 +25216,13 @@ Index
* backslash (\), in escape sequences, POSIX and: Escape Sequences.
(line 113)
* backslash (\), regexp constants: Computed Regexps. (line 28)
-* backtrace debugger command: Dgawk Stack. (line 13)
+* backtrace debugger command: Execution Stack. (line 13)
* BBS-list file: Sample Data Files. (line 6)
* Beebe, Nelson <1>: Other Versions. (line 69)
* Beebe, Nelson: Acknowledgments. (line 60)
-* BEGIN pattern <1>: BEGIN/END. (line 6)
-* BEGIN pattern <2>: Field Separators. (line 44)
+* BEGIN pattern <1>: Profiling. (line 62)
+* BEGIN pattern <2>: BEGIN/END. (line 6)
+* BEGIN pattern <3>: Field Separators. (line 44)
* BEGIN pattern: Records. (line 29)
* BEGIN pattern, assert() user-defined function and: Assert Function.
(line 83)
@@ -25175,7 +25237,6 @@ Index
* BEGIN pattern, OFS/ORS variables, assigning values to: Output Separators.
(line 20)
* BEGIN pattern, operators and: Using BEGIN/END. (line 17)
-* BEGIN pattern, pgawk program: Profiling. (line 65)
* BEGIN pattern, print statement and: I/O And BEGIN/END. (line 16)
* BEGIN pattern, pwcat program: Passwd Functions. (line 143)
* BEGIN pattern, running awk programs and: Cut Program. (line 68)
@@ -25204,8 +25265,8 @@ Index
* Boolean expressions, as patterns: Expression Patterns. (line 41)
* Boolean operators, See Boolean expressions: Boolean Ops. (line 6)
* Bourne shell, quoting rules for: Quoting. (line 18)
+* braces ({}): Profiling. (line 134)
* braces ({}), actions and: Action Overview. (line 19)
-* braces ({}), pgawk program: Profiling. (line 137)
* braces ({}), statements, grouping: Statements. (line 10)
* bracket expressions <1>: Bracket Expressions. (line 6)
* bracket expressions: Regexp Operators. (line 55)
@@ -25232,7 +25293,7 @@ Index
* Broder, Alan J.: Contributors. (line 88)
* Brown, Martin: Contributors. (line 82)
* BSD-based operating systems: Glossary. (line 611)
-* bt debugger command (alias for backtrace): Dgawk Stack. (line 13)
+* bt debugger command (alias for backtrace): Execution Stack. (line 13)
* Buening, Andreas <1>: Bugs. (line 71)
* Buening, Andreas <2>: Contributors. (line 92)
* Buening, Andreas: Acknowledgments. (line 60)
@@ -25250,7 +25311,7 @@ Index
* built-in variables, -v option, setting with: Options. (line 40)
* built-in variables, conveying information: Auto-set. (line 6)
* built-in variables, user-modifiable: User-modified. (line 6)
-* Busybox Awk: Other Versions. (line 78)
+* Busybox Awk: Other Versions. (line 79)
* call by reference: Pass By Value/Reference.
(line 47)
* call by value: Pass By Value/Reference.
@@ -25270,7 +25331,7 @@ Index
* case sensitivity, regexps and <1>: User-modified. (line 82)
* case sensitivity, regexps and: Case-sensitivity. (line 6)
* case sensitivity, string comparisons and: User-modified. (line 82)
-* CGI, awk scripts for: Options. (line 113)
+* CGI, awk scripts for: Options. (line 122)
* character lists, See bracket expressions: Regexp Operators. (line 55)
* character sets (machine character encodings) <1>: Glossary. (line 141)
* character sets (machine character encodings): Ordinal Functions.
@@ -25324,7 +25385,7 @@ Index
* command line, variables, assigning on: Assignment Options. (line 6)
* command-line options, processing: Getopt Function. (line 6)
* command-line options, string extraction: String Extraction. (line 6)
-* commands debugger command: Dgawk Execution Control.
+* commands debugger command: Debugger Execution Control.
(line 10)
* commenting: Comments. (line 6)
* commenting, backslash continuation and: Statements/Lines. (line 76)
@@ -25401,7 +25462,7 @@ Index
* cos() function: Numeric Functions. (line 14)
* counting: Wc Program. (line 6)
* csh utility: Statements/Lines. (line 44)
-* csh utility, POSIXLY_CORRECT environment variable: Options. (line 305)
+* csh utility, POSIXLY_CORRECT environment variable: Options. (line 323)
* csh utility, |& operator, comparison with: Two-way I/O. (line 44)
* ctime() user-defined function: Function Example. (line 72)
* currency symbols, localization: Explaining gettext. (line 103)
@@ -25409,7 +25470,7 @@ Index
(line 30)
* cut utility: Cut Program. (line 6)
* cut.awk program: Cut Program. (line 45)
-* d debugger command (alias for delete): Breakpoint Control. (line 63)
+* d debugger command (alias for delete): Breakpoint Control. (line 64)
* d.c., See dark corner: Conventions. (line 38)
* dark corner <1>: Glossary. (line 193)
* dark corner <2>: Truth Values. (line 24)
@@ -25473,113 +25534,113 @@ Index
(line 33)
* deadlocks: Two-way I/O. (line 70)
* debugger commands, b (break): Breakpoint Control. (line 11)
-* debugger commands, backtrace: Dgawk Stack. (line 13)
+* debugger commands, backtrace: Execution Stack. (line 13)
* debugger commands, break: Breakpoint Control. (line 11)
-* debugger commands, bt (backtrace): Dgawk Stack. (line 13)
-* debugger commands, c (continue): Dgawk Execution Control.
+* debugger commands, bt (backtrace): Execution Stack. (line 13)
+* debugger commands, c (continue): Debugger Execution Control.
(line 33)
* debugger commands, clear: Breakpoint Control. (line 36)
-* debugger commands, commands: Dgawk Execution Control.
+* debugger commands, commands: Debugger Execution Control.
(line 10)
* debugger commands, condition: Breakpoint Control. (line 54)
-* debugger commands, continue: Dgawk Execution Control.
+* debugger commands, continue: Debugger Execution Control.
(line 33)
-* debugger commands, d (delete): Breakpoint Control. (line 63)
-* debugger commands, delete: Breakpoint Control. (line 63)
-* debugger commands, disable: Breakpoint Control. (line 68)
+* debugger commands, d (delete): Breakpoint Control. (line 64)
+* debugger commands, delete: Breakpoint Control. (line 64)
+* debugger commands, disable: Breakpoint Control. (line 69)
* debugger commands, display: Viewing And Changing Data.
(line 8)
-* debugger commands, down: Dgawk Stack. (line 21)
-* debugger commands, dump: Miscellaneous Dgawk Commands.
+* debugger commands, down: Execution Stack. (line 21)
+* debugger commands, dump: Miscellaneous Debugger Commands.
(line 9)
-* debugger commands, e (enable): Breakpoint Control. (line 72)
-* debugger commands, enable: Breakpoint Control. (line 72)
-* debugger commands, end: Dgawk Execution Control.
+* debugger commands, e (enable): Breakpoint Control. (line 73)
+* debugger commands, enable: Breakpoint Control. (line 73)
+* debugger commands, end: Debugger Execution Control.
(line 10)
* debugger commands, eval: Viewing And Changing Data.
(line 23)
-* debugger commands, f (frame): Dgawk Stack. (line 25)
-* debugger commands, finish: Dgawk Execution Control.
+* debugger commands, f (frame): Execution Stack. (line 25)
+* debugger commands, finish: Debugger Execution Control.
(line 39)
-* debugger commands, frame: Dgawk Stack. (line 25)
-* debugger commands, h (help): Miscellaneous Dgawk Commands.
+* debugger commands, frame: Execution Stack. (line 25)
+* debugger commands, h (help): Miscellaneous Debugger Commands.
(line 68)
-* debugger commands, help: Miscellaneous Dgawk Commands.
+* debugger commands, help: Miscellaneous Debugger Commands.
(line 68)
-* debugger commands, i (info): Dgawk Info. (line 12)
-* debugger commands, ignore: Breakpoint Control. (line 86)
-* debugger commands, info: Dgawk Info. (line 12)
-* debugger commands, l (list): Miscellaneous Dgawk Commands.
+* debugger commands, i (info): Debugger Info. (line 13)
+* debugger commands, ignore: Breakpoint Control. (line 87)
+* debugger commands, info: Debugger Info. (line 13)
+* debugger commands, l (list): Miscellaneous Debugger Commands.
(line 74)
-* debugger commands, list: Miscellaneous Dgawk Commands.
+* debugger commands, list: Miscellaneous Debugger Commands.
(line 74)
-* debugger commands, n (next): Dgawk Execution Control.
+* debugger commands, n (next): Debugger Execution Control.
(line 43)
-* debugger commands, next: Dgawk Execution Control.
+* debugger commands, next: Debugger Execution Control.
(line 43)
-* debugger commands, nexti: Dgawk Execution Control.
+* debugger commands, nexti: Debugger Execution Control.
(line 49)
-* debugger commands, ni (nexti): Dgawk Execution Control.
+* debugger commands, ni (nexti): Debugger Execution Control.
(line 49)
-* debugger commands, o (option): Dgawk Info. (line 56)
-* debugger commands, option: Dgawk Info. (line 56)
+* debugger commands, o (option): Debugger Info. (line 57)
+* debugger commands, option: Debugger Info. (line 57)
* debugger commands, p (print): Viewing And Changing Data.
(line 36)
* debugger commands, print: Viewing And Changing Data.
(line 36)
* debugger commands, printf: Viewing And Changing Data.
(line 54)
-* debugger commands, q (quit): Miscellaneous Dgawk Commands.
+* debugger commands, q (quit): Miscellaneous Debugger Commands.
(line 101)
-* debugger commands, quit: Miscellaneous Dgawk Commands.
+* debugger commands, quit: Miscellaneous Debugger Commands.
(line 101)
-* debugger commands, r (run): Dgawk Execution Control.
+* debugger commands, r (run): Debugger Execution Control.
(line 62)
-* debugger commands, return: Dgawk Execution Control.
+* debugger commands, return: Debugger Execution Control.
(line 54)
-* debugger commands, run: Dgawk Execution Control.
+* debugger commands, run: Debugger Execution Control.
(line 62)
-* debugger commands, s (step): Dgawk Execution Control.
+* debugger commands, s (step): Debugger Execution Control.
(line 68)
* debugger commands, set: Viewing And Changing Data.
(line 59)
-* debugger commands, si (stepi): Dgawk Execution Control.
+* debugger commands, si (stepi): Debugger Execution Control.
(line 76)
-* debugger commands, silent: Dgawk Execution Control.
+* debugger commands, silent: Debugger Execution Control.
(line 10)
-* debugger commands, step: Dgawk Execution Control.
+* debugger commands, step: Debugger Execution Control.
(line 68)
-* debugger commands, stepi: Dgawk Execution Control.
+* debugger commands, stepi: Debugger Execution Control.
(line 76)
-* debugger commands, t (tbreak): Breakpoint Control. (line 89)
-* debugger commands, tbreak: Breakpoint Control. (line 89)
-* debugger commands, trace: Miscellaneous Dgawk Commands.
+* debugger commands, t (tbreak): Breakpoint Control. (line 90)
+* debugger commands, tbreak: Breakpoint Control. (line 90)
+* debugger commands, trace: Miscellaneous Debugger Commands.
(line 110)
-* debugger commands, u (until): Dgawk Execution Control.
+* debugger commands, u (until): Debugger Execution Control.
(line 83)
* debugger commands, undisplay: Viewing And Changing Data.
(line 80)
-* debugger commands, until: Dgawk Execution Control.
+* debugger commands, until: Debugger Execution Control.
(line 83)
* debugger commands, unwatch: Viewing And Changing Data.
(line 84)
-* debugger commands, up: Dgawk Stack. (line 33)
+* debugger commands, up: Execution Stack. (line 33)
* debugger commands, w (watch): Viewing And Changing Data.
(line 67)
* debugger commands, watch: Viewing And Changing Data.
(line 67)
+* debugging awk programs: Debugger. (line 6)
* debugging gawk, bug reports: Bugs. (line 9)
-* decimal point character, locale specific: Options. (line 215)
+* decimal point character, locale specific: Options. (line 238)
* decrement operators: Increment Ops. (line 35)
* default keyword: Switch Statement. (line 6)
* Deifik, Scott <1>: Bugs. (line 70)
* Deifik, Scott <2>: Contributors. (line 54)
* Deifik, Scott: Acknowledgments. (line 60)
-* delete debugger command: Breakpoint Control. (line 63)
+* delete debugger command: Breakpoint Control. (line 64)
* delete statement: Delete. (line 6)
* deleting elements in arrays: Delete. (line 6)
* deleting entire arrays: Delete. (line 39)
-* dgawk: Debugger. (line 6)
* differences between gawk and awk: String Functions. (line 196)
* differences in awk and gawk, ARGC/ARGV variables: ARGC and ARGV.
(line 88)
@@ -25650,7 +25711,7 @@ Index
(line 6)
* directories, searching <1>: Igawk Program. (line 368)
* directories, searching: AWKPATH Variable. (line 6)
-* disable debugger command: Breakpoint Control. (line 68)
+* disable debugger command: Breakpoint Control. (line 69)
* display debugger command: Viewing And Changing Data.
(line 8)
* division: Arithmetic Ops. (line 44)
@@ -25668,14 +25729,14 @@ Index
* double quote (") <1>: Quoting. (line 37)
* double quote ("): Read Terminal. (line 25)
* double quote ("), regexp constants: Computed Regexps. (line 28)
-* down debugger command: Dgawk Stack. (line 21)
+* down debugger command: Execution Stack. (line 21)
* Drepper, Ulrich: Acknowledgments. (line 52)
* DuBois, John: Acknowledgments. (line 60)
-* dump debugger command: Miscellaneous Dgawk Commands.
+* dump debugger command: Miscellaneous Debugger Commands.
(line 9)
* dupnode() internal function: Internals. (line 87)
* dupword.awk program: Dupword Program. (line 31)
-* e debugger command (alias for enable): Breakpoint Control. (line 72)
+* e debugger command (alias for enable): Breakpoint Control. (line 73)
* EBCDIC: Ordinal Functions. (line 45)
* egrep utility <1>: Egrep Program. (line 6)
* egrep utility: Bracket Expressions. (line 24)
@@ -25691,9 +25752,10 @@ Index
* empty pattern: Empty. (line 6)
* empty strings, See null strings: Regexp Field Splitting.
(line 43)
-* enable debugger command: Breakpoint Control. (line 72)
-* end debugger command: Dgawk Execution Control.
+* enable debugger command: Breakpoint Control. (line 73)
+* end debugger command: Debugger Execution Control.
(line 10)
+* END pattern <1>: Profiling. (line 62)
* END pattern: BEGIN/END. (line 6)
* END pattern, assert() user-defined function and: Assert Function.
(line 75)
@@ -25705,7 +25767,6 @@ Index
* END pattern, next/nextfile statements and: I/O And BEGIN/END.
(line 37)
* END pattern, operators and: Using BEGIN/END. (line 17)
-* END pattern, pgawk program: Profiling. (line 65)
* END pattern, print statement and: I/O And BEGIN/END. (line 16)
* ENDFILE pattern: BEGINFILE/ENDFILE. (line 6)
* ENDFILE pattern, Boolean patterns and: Expression Patterns. (line 73)
@@ -25797,7 +25858,7 @@ Index
* extract.awk program: Extract Program. (line 78)
* extraction, of marked strings (internationalization): String Extraction.
(line 6)
-* f debugger command (alias for frame): Dgawk Stack. (line 25)
+* f debugger command (alias for frame): Execution Stack. (line 25)
* false, logical: Truth Values. (line 6)
* FDL (Free Documentation License): GNU Free Documentation License.
(line 6)
@@ -25864,7 +25925,7 @@ Index
* files, /inet6/... (gawk): TCP/IP Networking. (line 6)
* files, as single records: Records. (line 196)
* files, awk programs in: Long. (line 6)
-* files, awkprof.out: Profiling. (line 10)
+* files, awkprof.out: Profiling. (line 6)
* files, awkvars.out: Options. (line 90)
* files, closing: I/O Functions. (line 10)
* files, descriptors, See file descriptors: Special FD. (line 6)
@@ -25893,7 +25954,7 @@ Index
* files, portable object template: Explaining gettext. (line 30)
* files, portable object, converting to message object files: I18N Example.
(line 62)
-* files, portable object, generating: Options. (line 135)
+* files, portable object, generating: Options. (line 144)
* files, processing, ARGIND variable and: Auto-set. (line 47)
* files, reading: Rewind Function. (line 6)
* files, reading, multiline records: Multiple Line. (line 6)
@@ -25902,7 +25963,7 @@ Index
* files, source, search path for: Igawk Program. (line 368)
* files, splitting: Split Program. (line 6)
* files, Texinfo, extracting programs from: Extract Program. (line 6)
-* finish debugger command: Dgawk Execution Control.
+* finish debugger command: Debugger Execution Control.
(line 39)
* Fish, Fred: Contributors. (line 51)
* fixed-width data: Constant Size. (line 9)
@@ -25937,7 +25998,7 @@ Index
* FPAT variable <1>: User-modified. (line 45)
* FPAT variable: Splitting By Content.
(line 26)
-* frame debugger command: Dgawk Stack. (line 25)
+* frame debugger command: Execution Stack. (line 25)
* Free Documentation License (FDL): GNU Free Documentation License.
(line 6)
* Free Software Foundation (FSF) <1>: Glossary. (line 301)
@@ -25949,7 +26010,7 @@ Index
* FS variable, --field-separator option and: Options. (line 21)
* FS variable, as null string: Single Character Fields.
(line 20)
-* FS variable, as TAB character: Options. (line 211)
+* FS variable, as TAB character: Options. (line 234)
* FS variable, changing value of: Field Separators. (line 34)
* FS variable, running awk programs and: Cut Program. (line 68)
* FS variable, setting from command line: Command Line Field Separator.
@@ -26000,7 +26061,7 @@ Index
(line 71)
* functions, user-defined: User-defined. (line 6)
* functions, user-defined, calling: Calling A Function. (line 6)
-* functions, user-defined, counts: Profiling. (line 132)
+* functions, user-defined, counts: Profiling. (line 129)
* functions, user-defined, library of: Library Functions. (line 6)
* functions, user-defined, next/nextfile statements and <1>: Nextfile Statement.
(line 44)
@@ -26008,6 +26069,7 @@ Index
(line 45)
* G-d: Acknowledgments. (line 81)
* Garfinkle, Scott: Contributors. (line 35)
+* gawk program, dynamic profiling: Profiling. (line 171)
* gawk, ARGIND variable in: Other Arguments. (line 12)
* gawk, awk and <1>: This Manual. (line 14)
* gawk, awk and: Preface. (line 23)
@@ -26034,7 +26096,7 @@ Index
(line 139)
* gawk, ERRNO variable in: Getline. (line 19)
* gawk, escape sequences: Escape Sequences. (line 125)
-* gawk, extensions, disabling: Options. (line 199)
+* gawk, extensions, disabling: Options. (line 222)
* gawk, features, adding: Adding Code. (line 6)
* gawk, features, advanced: Advanced Features. (line 6)
* gawk, fflush() function in: I/O Functions. (line 44)
@@ -26048,9 +26110,10 @@ Index
(line 26)
* gawk, function arguments and: Calling Built-in. (line 16)
* gawk, functions, adding: Dynamic Extensions. (line 10)
+* gawk, functions, loading: Loading Extensions. (line 6)
* gawk, hexadecimal numbers and: Nondecimal-numbers. (line 42)
* gawk, IGNORECASE variable in <1>: Array Sorting Functions.
- (line 78)
+ (line 81)
* gawk, IGNORECASE variable in <2>: String Functions. (line 29)
* gawk, IGNORECASE variable in <3>: Array Intro. (line 92)
* gawk, IGNORECASE variable in <4>: User-modified. (line 82)
@@ -26098,7 +26161,7 @@ Index
* gawk, TEXTDOMAIN variable in: User-modified. (line 153)
* gawk, timestamps: Time Functions. (line 6)
* gawk, uses for: Preface. (line 36)
-* gawk, versions of, information about, printing: Options. (line 250)
+* gawk, versions of, information about, printing: Options. (line 268)
* gawk, VMS version of: VMS Installation. (line 6)
* gawk, word-boundary operator: GNU Regexp Operators.
(line 63)
@@ -26158,7 +26221,7 @@ Index
* GNU Lesser General Public License: Glossary. (line 397)
* GNU long options <1>: Options. (line 6)
* GNU long options: Command Line. (line 13)
-* GNU long options, printing list of: Options. (line 142)
+* GNU long options, printing list of: Options. (line 151)
* GNU Project <1>: Glossary. (line 319)
* GNU Project: Manual History. (line 11)
* GNU/Linux <1>: Glossary. (line 611)
@@ -26177,7 +26240,7 @@ Index
(line 43)
* gsub() function, arguments of: String Functions. (line 462)
* gsub() function, escape processing: Gory Details. (line 6)
-* h debugger command (alias for help): Miscellaneous Dgawk Commands.
+* h debugger command (alias for help): Miscellaneous Debugger Commands.
(line 68)
* Hankerson, Darrel <1>: Contributors. (line 61)
* Hankerson, Darrel: Acknowledgments. (line 60)
@@ -26186,13 +26249,13 @@ Index
* Hartholz, Elaine: Acknowledgments. (line 38)
* Hartholz, Marshall: Acknowledgments. (line 38)
* Hasegawa, Isamu: Contributors. (line 94)
-* help debugger command: Miscellaneous Dgawk Commands.
+* help debugger command: Miscellaneous Debugger Commands.
(line 68)
* hexadecimal numbers: Nondecimal-numbers. (line 6)
-* hexadecimal values, enabling interpretation of: Options. (line 166)
+* hexadecimal values, enabling interpretation of: Options. (line 182)
* histsort.awk program: History Sorting. (line 25)
* Hughes, Phil: Acknowledgments. (line 43)
-* HUP signal: Profiling. (line 204)
+* HUP signal: Profiling. (line 203)
* hyphen (-), - operator: Precedence. (line 52)
* hyphen (-), -- (decrement/increment) operators: Precedence. (line 46)
* hyphen (-), -- operator: Increment Ops. (line 48)
@@ -26200,22 +26263,22 @@ Index
* hyphen (-), -= operator: Assignment Ops. (line 129)
* hyphen (-), filenames beginning with: Options. (line 59)
* hyphen (-), in bracket expressions: Bracket Expressions. (line 17)
-* i debugger command (alias for info): Dgawk Info. (line 12)
+* i debugger command (alias for info): Debugger Info. (line 13)
* id utility: Id Program. (line 6)
* id.awk program: Id Program. (line 30)
* if statement <1>: If Statement. (line 6)
* if statement: Regexp Usage. (line 19)
* if statement, actions, changing: Ranges. (line 25)
* igawk.sh program: Igawk Program. (line 124)
-* ignore debugger command: Breakpoint Control. (line 86)
+* ignore debugger command: Breakpoint Control. (line 87)
* IGNORECASE variable <1>: Array Sorting Functions.
- (line 78)
+ (line 81)
* IGNORECASE variable <2>: String Functions. (line 29)
* IGNORECASE variable <3>: Array Intro. (line 92)
* IGNORECASE variable <4>: User-modified. (line 82)
* IGNORECASE variable: Case-sensitivity. (line 26)
* IGNORECASE variable, array sorting and: Array Sorting Functions.
- (line 78)
+ (line 81)
* IGNORECASE variable, array subscripts and: Array Intro. (line 92)
* IGNORECASE variable, in example programs: Library Functions.
(line 42)
@@ -26235,7 +26298,7 @@ Index
* index() function: String Functions. (line 155)
* indexing arrays: Array Intro. (line 50)
* indirect function calls: Indirect Calls. (line 6)
-* info debugger command: Dgawk Info. (line 12)
+* info debugger command: Debugger Info. (line 13)
* initialization, automatic: More Complex. (line 38)
* input files: Reading Files. (line 6)
* input files, closing: Close Files And Pipes.
@@ -26260,7 +26323,7 @@ Index
* insomnia, cure for: Alarm Program. (line 6)
* installation, VMS: VMS Installation. (line 6)
* installing gawk: Installation. (line 6)
-* INT signal (MS-Windows): Profiling. (line 207)
+* INT signal (MS-Windows): Profiling. (line 206)
* int() function: Numeric Functions. (line 22)
* integers: Basic Data Typing. (line 21)
* integers, unsigned: Basic Data Typing. (line 30)
@@ -26325,9 +26388,9 @@ Index
* Jacobs, Andrew: Passwd Functions. (line 90)
* Jaegermann, Michal <1>: Contributors. (line 46)
* Jaegermann, Michal: Acknowledgments. (line 60)
-* Java implementation of awk: Other Versions. (line 96)
+* Java implementation of awk: Other Versions. (line 97)
* Java programming language: Glossary. (line 380)
-* jawk: Other Versions. (line 96)
+* jawk: Other Versions. (line 97)
* Jedi knights: Undocumented. (line 6)
* join() user-defined function: Join Function. (line 18)
* Kahrs, Ju"rgen <1>: Contributors. (line 70)
@@ -26342,10 +26405,10 @@ Index
* Kernighan, Brian <6>: Acknowledgments. (line 75)
* Kernighan, Brian <7>: Conventions. (line 34)
* Kernighan, Brian: History. (line 17)
-* kill command, dynamic profiling: Profiling. (line 182)
+* kill command, dynamic profiling: Profiling. (line 180)
* Knights, jedi: Undocumented. (line 6)
* Kwok, Conrad: Contributors. (line 35)
-* l debugger command (alias for list): Miscellaneous Dgawk Commands.
+* l debugger command (alias for list): Miscellaneous Debugger Commands.
(line 74)
* labels.awk program: Labels Program. (line 51)
* languages, data-driven: Basic High Level. (line 83)
@@ -26371,7 +26434,7 @@ Index
* length() function: String Functions. (line 166)
* Lesser General Public License (LGPL): Glossary. (line 397)
* LGPL (Lesser General Public License): Glossary. (line 397)
-* libmawk: Other Versions. (line 104)
+* libmawk: Other Versions. (line 105)
* libraries of awk functions: Library Functions. (line 6)
* libraries of awk functions, assertions: Assert Function. (line 6)
* libraries of awk functions, associative arrays and: Library Names.
@@ -26409,20 +26472,22 @@ Index
* lint checking, array subscripts: Uninitialized Subscripts.
(line 43)
* lint checking, empty programs: Command Line. (line 16)
-* lint checking, issuing warnings: Options. (line 147)
+* lint checking, issuing warnings: Options. (line 163)
* lint checking, POSIXLY_CORRECT environment variable: Options.
- (line 289)
+ (line 307)
* lint checking, undefined functions: Pass By Value/Reference.
(line 88)
* LINT variable: User-modified. (line 98)
* Linux <1>: Glossary. (line 611)
* Linux <2>: I18N Example. (line 55)
* Linux: Manual History. (line 28)
-* list debugger command: Miscellaneous Dgawk Commands.
+* list debugger command: Miscellaneous Debugger Commands.
(line 74)
+* loading extension: Loading Extensions. (line 6)
+* loading, library: Options. (line 156)
* local variables: Variable Scope. (line 6)
* locale categories: Explaining gettext. (line 80)
-* locale decimal point character: Options. (line 215)
+* locale decimal point character: Options. (line 238)
* locale, definition of: Locales. (line 6)
* localization: I18N and L10N. (line 6)
* localization, See internationalization, localization: I18N and L10N.
@@ -26435,7 +26500,7 @@ Index
* long options: Command Line. (line 13)
* loops: While Statement. (line 6)
* loops, continue statements and: For Statement. (line 64)
-* loops, count for header: Profiling. (line 126)
+* loops, count for header: Profiling. (line 123)
* loops, exiting: Break Statement. (line 6)
* loops, See Also while statement: While Statement. (line 6)
* Lost In Space: Dynamic Extensions. (line 6)
@@ -26458,7 +26523,7 @@ Index
* matching, expressions, See comparison expressions: Typing and Comparison.
(line 9)
* matching, leftmost longest: Multiple Line. (line 26)
-* matching, null strings: Gory Details. (line 163)
+* matching, null strings: Gory Details. (line 164)
* mawk program: Other Versions. (line 35)
* McPhee, Patrick: Contributors. (line 100)
* memory, releasing: Internals. (line 92)
@@ -26474,7 +26539,7 @@ Index
* modifiers, in format specifiers: Format Modifiers. (line 6)
* monetary information, localization: Explaining gettext. (line 103)
* msgfmt utility: I18N Example. (line 62)
-* n debugger command (alias for next): Dgawk Execution Control.
+* n debugger command (alias for next): Debugger Execution Control.
(line 43)
* names, arrays/variables <1>: Library Names. (line 6)
* names, arrays/variables: Arrays. (line 18)
@@ -26490,7 +26555,7 @@ Index
* networks, programming: TCP/IP Networking. (line 6)
* networks, support for: Special Network. (line 6)
* newlines <1>: Boolean Ops. (line 67)
-* newlines <2>: Options. (line 205)
+* newlines <2>: Options. (line 228)
* newlines: Statements/Lines. (line 6)
* newlines, as field separators: Default Field Splitting.
(line 6)
@@ -26501,7 +26566,7 @@ Index
* newlines, separating statements in actions <1>: Statements. (line 10)
* newlines, separating statements in actions: Action Overview.
(line 19)
-* next debugger command: Dgawk Execution Control.
+* next debugger command: Debugger Execution Control.
(line 43)
* next statement <1>: Next Statement. (line 6)
* next statement: Boolean Ops. (line 85)
@@ -26516,12 +26581,12 @@ Index
(line 26)
* nextfile statement, user-defined functions and: Nextfile Statement.
(line 44)
-* nexti debugger command: Dgawk Execution Control.
+* nexti debugger command: Debugger Execution Control.
(line 49)
* NF variable <1>: Auto-set. (line 107)
* NF variable: Fields. (line 33)
* NF variable, decrementing: Changing Fields. (line 107)
-* ni debugger command (alias for nexti): Dgawk Execution Control.
+* ni debugger command (alias for nexti): Debugger Execution Control.
(line 49)
* noassign.awk program: Ignoring Assigns. (line 15)
* NODE internal type: Internals. (line 23)
@@ -26539,7 +26604,7 @@ Index
* null strings, as array subscripts: Uninitialized Subscripts.
(line 43)
* null strings, converting numbers to strings: Conversion. (line 21)
-* null strings, matching: Gory Details. (line 163)
+* null strings, matching: Gory Details. (line 164)
* null strings, quoting and: Quoting. (line 62)
* number sign (#), #! (executable scripts): Executable Scripts.
(line 6)
@@ -26566,11 +26631,11 @@ Index
* numeric, output format: OFMT. (line 6)
* numeric, strings: Variable Typing. (line 6)
* numeric, values: Internals. (line 27)
-* o debugger command (alias for option): Dgawk Info. (line 56)
+* o debugger command (alias for option): Debugger Info. (line 57)
* oawk utility: Names. (line 17)
* obsolete features: Obsolete. (line 6)
* octal numbers: Nondecimal-numbers. (line 6)
-* octal values, enabling interpretation of: Options. (line 166)
+* octal values, enabling interpretation of: Options. (line 182)
* OFMT variable <1>: User-modified. (line 115)
* OFMT variable <2>: Conversion. (line 55)
* OFMT variable: OFMT. (line 15)
@@ -26579,7 +26644,7 @@ Index
* OFS variable <2>: Output Separators. (line 6)
* OFS variable: Changing Fields. (line 64)
* OpenBSD: Glossary. (line 611)
-* OpenSolaris: Other Versions. (line 86)
+* OpenSolaris: Other Versions. (line 87)
* operating systems, BSD-based: Manual History. (line 28)
* operating systems, PC, gawk on: PC Using. (line 6)
* operating systems, PC, gawk on, installing: PC Installation.
@@ -26612,7 +26677,7 @@ Index
(line 48)
* operators, word-boundary (gawk): GNU Regexp Operators.
(line 63)
-* option debugger command: Dgawk Info. (line 56)
+* option debugger command: Debugger Info. (line 57)
* options, command-line <1>: Command Line Field Separator.
(line 6)
* options, command-line <2>: Options. (line 6)
@@ -26623,7 +26688,7 @@ Index
* options, deprecated: Obsolete. (line 6)
* options, long <1>: Options. (line 6)
* options, long: Command Line. (line 13)
-* options, printing list of: Options. (line 142)
+* options, printing list of: Options. (line 151)
* OR bitwise operation: Bitwise Functions. (line 6)
* or Boolean-logic operator: Boolean Ops. (line 6)
* or() function (gawk): Bitwise Functions. (line 48)
@@ -26650,14 +26715,14 @@ Index
* P1003.1 POSIX standard: Glossary. (line 454)
* P1003.2 POSIX standard: Glossary. (line 454)
* parameters, number of: Internals. (line 42)
+* parentheses () <1>: Profiling. (line 138)
* parentheses (): Regexp Operators. (line 79)
-* parentheses (), pgawk program: Profiling. (line 141)
* password file: Passwd Functions. (line 16)
* patsplit() function: String Functions. (line 293)
* patterns: Patterns and Actions.
(line 6)
* patterns, comparison expressions as: Expression Patterns. (line 14)
-* patterns, counts: Profiling. (line 113)
+* patterns, counts: Profiling. (line 110)
* patterns, default: Very Simple. (line 34)
* patterns, empty: Empty. (line 6)
* patterns, expressions as: Regexp Patterns. (line 6)
@@ -26675,9 +26740,6 @@ Index
* Perl: Future Extensions. (line 6)
* Peters, Arno: Contributors. (line 85)
* Peterson, Hal: Contributors. (line 40)
-* pgawk program: Profiling. (line 6)
-* pgawk program, awkprof.out file: Profiling. (line 10)
-* pgawk program, dynamic profiling: Profiling. (line 174)
* pipes, closing: Close Files And Pipes.
(line 6)
* pipes, input: Getline/Pipe. (line 6)
@@ -26718,13 +26780,13 @@ Index
* portability, NF variable, decrementing: Changing Fields. (line 115)
* portability, operators: Increment Ops. (line 61)
* portability, operators, not in POSIX awk: Precedence. (line 98)
-* portability, POSIXLY_CORRECT environment variable: Options. (line 310)
+* portability, POSIXLY_CORRECT environment variable: Options. (line 328)
* portability, substr() function: String Functions. (line 512)
* portable object files <1>: Translator i18n. (line 6)
* portable object files: Explaining gettext. (line 36)
* portable object files, converting to message object files: I18N Example.
(line 62)
-* portable object files, generating: Options. (line 135)
+* portable object files, generating: Options. (line 144)
* portable object template files: Explaining gettext. (line 30)
* porting gawk: New Ports. (line 6)
* positional specifiers, printf statement <1>: Printf Ordering.
@@ -26755,7 +26817,7 @@ Index
* POSIX awk, field separators and: Fields. (line 6)
* POSIX awk, FS variable and: User-modified. (line 66)
* POSIX awk, function keyword in: Definition Syntax. (line 83)
-* POSIX awk, functions and, gsub()/sub(): Gory Details. (line 53)
+* POSIX awk, functions and, gsub()/sub(): Gory Details. (line 54)
* POSIX awk, functions and, length(): String Functions. (line 175)
* POSIX awk, GNU long options and: Options. (line 15)
* POSIX awk, interval expressions in: Regexp Operators. (line 135)
@@ -26768,11 +26830,11 @@ Index
* POSIX awk, regular expressions and: Regexp Operators. (line 157)
* POSIX awk, timestamps and: Time Functions. (line 6)
* POSIX awk, | I/O operator and: Getline/Pipe. (line 52)
-* POSIX mode: Options. (line 199)
+* POSIX mode: Options. (line 222)
* POSIX, awk and: Preface. (line 23)
* POSIX, gawk extensions not included in: POSIX/GNU. (line 6)
* POSIX, programs, implementing in awk: Clones. (line 6)
-* POSIXLY_CORRECT environment variable: Options. (line 289)
+* POSIXLY_CORRECT environment variable: Options. (line 307)
* precedence <1>: Precedence. (line 6)
* precedence: Increment Ops. (line 61)
* precedence, regexp operators: Regexp Operators. (line 152)
@@ -26806,7 +26868,7 @@ Index
* printf statement, sprintf() function and: Round Function. (line 6)
* printf statement, syntax of: Basic Printf. (line 6)
* printing: Printing. (line 6)
-* printing, list of options: Options. (line 142)
+* printing, list of options: Options. (line 151)
* printing, mailing labels: Labels Program. (line 6)
* printing, unduplicated lines of text: Uniq Program. (line 6)
* printing, user information: Id Program. (line 6)
@@ -26822,8 +26884,8 @@ Index
* PROCINFO array <7>: Auto-set. (line 123)
* PROCINFO array: Obsolete. (line 11)
* profiling awk programs: Profiling. (line 6)
-* profiling awk programs, dynamically: Profiling. (line 174)
-* profiling gawk, See pgawk program: Profiling. (line 6)
+* profiling awk programs, dynamically: Profiling. (line 171)
+* profiling gawk: Profiling. (line 6)
* program, definition of: Getting Started. (line 21)
* programmers, attractiveness of: Two-way I/O. (line 6)
* programming conventions, --non-decimal-data option: Nondecimal Data.
@@ -26847,23 +26909,23 @@ Index
* programming, basic steps: Basic High Level. (line 19)
* programming, concepts: Basic Concepts. (line 6)
* pwcat program: Passwd Functions. (line 23)
-* q debugger command (alias for quit): Miscellaneous Dgawk Commands.
+* q debugger command (alias for quit): Miscellaneous Debugger Commands.
(line 101)
-* QSE Awk: Other Versions. (line 108)
+* QSE Awk: Other Versions. (line 109)
* question mark (?) regexp operator <1>: GNU Regexp Operators.
(line 59)
* question mark (?) regexp operator: Regexp Operators. (line 111)
* question mark (?), ?: operator: Precedence. (line 92)
-* QuikTrim Awk: Other Versions. (line 112)
-* quit debugger command: Miscellaneous Dgawk Commands.
+* QuikTrim Awk: Other Versions. (line 113)
+* quit debugger command: Miscellaneous Debugger Commands.
(line 101)
-* QUIT signal (MS-Windows): Profiling. (line 207)
+* QUIT signal (MS-Windows): Profiling. (line 206)
* quoting <1>: Comments. (line 27)
* quoting <2>: Long. (line 26)
* quoting: Read Terminal. (line 25)
* quoting, rules for: Quoting. (line 6)
* quoting, tricks for: Quoting. (line 71)
-* r debugger command (alias for run): Dgawk Execution Control.
+* r debugger command (alias for run): Debugger Execution Control.
(line 62)
* Rakitzis, Byron: History Sorting. (line 25)
* rand() function: Numeric Functions. (line 33)
@@ -26897,7 +26959,7 @@ Index
* redirection of input: Getline/File. (line 6)
* redirection of output: Redirection. (line 6)
* reference counting, sorting arrays: Array Sorting Functions.
- (line 72)
+ (line 75)
* regexp constants <1>: Comparison Operators.
(line 103)
* regexp constants <2>: Regexp Constants. (line 6)
@@ -26929,7 +26991,7 @@ Index
(line 59)
* regular expressions, gawk, command-line options: GNU Regexp Operators.
(line 70)
-* regular expressions, interval expressions and: Options. (line 224)
+* regular expressions, interval expressions and: Options. (line 247)
* regular expressions, leftmost longest match: Leftmost Longest.
(line 6)
* regular expressions, operators <1>: Regexp Operators. (line 6)
@@ -26945,7 +27007,7 @@ Index
* regular expressions, searching for: Egrep Program. (line 6)
* relational operators, See comparison operators: Typing and Comparison.
(line 9)
-* return debugger command: Dgawk Execution Control.
+* return debugger command: Debugger Execution Control.
(line 54)
* return statement, user-defined functions: Return Statement. (line 6)
* return values, close() function: Close Files And Pipes.
@@ -26998,12 +27060,12 @@ Index
* Rubin, Paul <1>: Contributors. (line 16)
* Rubin, Paul: History. (line 30)
* rule, definition of: Getting Started. (line 21)
-* run debugger command: Dgawk Execution Control.
+* run debugger command: Debugger Execution Control.
(line 62)
* rvalues/lvalues: Assignment Ops. (line 32)
-* s debugger command (alias for step): Dgawk Execution Control.
+* s debugger command (alias for step): Debugger Execution Control.
(line 68)
-* sandbox mode: Options. (line 236)
+* sandbox mode: Options. (line 254)
* scalar values: Basic Data Typing. (line 13)
* Schorr, Andrew: Acknowledgments. (line 60)
* Schreiber, Bert: Acknowledgments. (line 38)
@@ -27049,14 +27111,14 @@ Index
(line 6)
* shift, bitwise: Bitwise Functions. (line 32)
* short-circuit operators: Boolean Ops. (line 57)
-* si debugger command (alias for stepi): Dgawk Execution Control.
+* si debugger command (alias for stepi): Debugger Execution Control.
(line 76)
* side effects <1>: Increment Ops. (line 11)
* side effects: Concatenation. (line 42)
* side effects, array indexing: Reference to Elements.
(line 42)
* side effects, asort() function: Array Sorting Functions.
- (line 22)
+ (line 24)
* side effects, assignment expressions: Assignment Ops. (line 23)
* side effects, Boolean operators: Boolean Ops. (line 30)
* side effects, conditional expressions: Conditional Exp. (line 22)
@@ -27064,15 +27126,15 @@ Index
* side effects, FILENAME variable: Getline Notes. (line 19)
* side effects, function calls: Function Calls. (line 54)
* side effects, statements: Action Overview. (line 32)
-* SIGHUP signal: Profiling. (line 204)
-* SIGINT signal (MS-Windows): Profiling. (line 207)
-* signals, HUP/SIGHUP: Profiling. (line 204)
-* signals, INT/SIGINT (MS-Windows): Profiling. (line 207)
-* signals, QUIT/SIGQUIT (MS-Windows): Profiling. (line 207)
-* signals, USR1/SIGUSR1: Profiling. (line 182)
-* SIGQUIT signal (MS-Windows): Profiling. (line 207)
-* SIGUSR1 signal: Profiling. (line 182)
-* silent debugger command: Dgawk Execution Control.
+* SIGHUP signal: Profiling. (line 203)
+* SIGINT signal (MS-Windows): Profiling. (line 206)
+* signals, HUP/SIGHUP: Profiling. (line 203)
+* signals, INT/SIGINT (MS-Windows): Profiling. (line 206)
+* signals, QUIT/SIGQUIT (MS-Windows): Profiling. (line 206)
+* signals, USR1/SIGUSR1: Profiling. (line 180)
+* SIGQUIT signal (MS-Windows): Profiling. (line 206)
+* SIGUSR1 signal: Profiling. (line 180)
+* silent debugger command: Debugger Execution Control.
(line 10)
* sin() function: Numeric Functions. (line 74)
* single precision floating-point: Basic Data Typing. (line 36)
@@ -27085,7 +27147,7 @@ Index
(line 6)
* Skywalker, Luke: Undocumented. (line 6)
* sleep utility: Alarm Program. (line 109)
-* Solaris, POSIX-compliant awk: Other Versions. (line 86)
+* Solaris, POSIX-compliant awk: Other Versions. (line 87)
* sort function, arrays, sorting: Array Sorting Functions.
(line 6)
* sort utility: Word Sorting. (line 50)
@@ -27094,17 +27156,17 @@ Index
(line 93)
* source code, awka: Other Versions. (line 55)
* source code, Brian Kernighan's awk: Other Versions. (line 13)
-* source code, Busybox Awk: Other Versions. (line 78)
+* source code, Busybox Awk: Other Versions. (line 79)
* source code, gawk: Gawk Distribution. (line 6)
-* source code, jawk: Other Versions. (line 96)
-* source code, libmawk: Other Versions. (line 104)
+* source code, jawk: Other Versions. (line 97)
+* source code, libmawk: Other Versions. (line 105)
* source code, mawk: Other Versions. (line 35)
-* source code, mixing: Options. (line 105)
+* source code, mixing: Options. (line 114)
* source code, pawk: Other Versions. (line 69)
-* source code, QSE Awk: Other Versions. (line 108)
-* source code, QuikTrim Awk: Other Versions. (line 112)
-* source code, Solaris awk: Other Versions. (line 86)
-* source code, xgawk: Other Versions. (line 119)
+* source code, QSE Awk: Other Versions. (line 109)
+* source code, QuikTrim Awk: Other Versions. (line 113)
+* source code, Solaris awk: Other Versions. (line 87)
+* source code, xgawk: Other Versions. (line 120)
* source files, search path for: Igawk Program. (line 368)
* sparse arrays: Array Intro. (line 71)
* Spencer, Henry: Glossary. (line 12)
@@ -27132,9 +27194,9 @@ Index
* statements, compound, control statements and: Statements. (line 10)
* statements, control, in actions: Statements. (line 6)
* statements, multiple: Statements/Lines. (line 91)
-* step debugger command: Dgawk Execution Control.
+* step debugger command: Debugger Execution Control.
(line 68)
-* stepi debugger command: Dgawk Execution Control.
+* stepi debugger command: Debugger Execution Control.
(line 76)
* stlen internal variable: Internals. (line 46)
* stptr internal variable: Internals. (line 46)
@@ -27188,8 +27250,8 @@ Index
(line 148)
* system() function: I/O Functions. (line 63)
* systime() function (gawk): Time Functions. (line 64)
-* t debugger command (alias for tbreak): Breakpoint Control. (line 89)
-* tbreak debugger command: Breakpoint Control. (line 89)
+* t debugger command (alias for tbreak): Breakpoint Control. (line 90)
+* tbreak debugger command: Breakpoint Control. (line 90)
* Tcl: Library Names. (line 57)
* TCP/IP: TCP/IP Networking. (line 6)
* TCP/IP, support for: Special Network. (line 6)
@@ -27235,10 +27297,10 @@ Index
* tolower() function: String Functions. (line 523)
* toupper() function: String Functions. (line 529)
* tr utility: Translate Program. (line 6)
-* trace debugger command: Miscellaneous Dgawk Commands.
+* trace debugger command: Miscellaneous Debugger Commands.
(line 110)
* translate.awk program: Translate Program. (line 55)
-* troubleshooting, --non-decimal-data option: Options. (line 166)
+* troubleshooting, --non-decimal-data option: Options. (line 182)
* troubleshooting, == operator: Comparison Operators.
(line 37)
* troubleshooting, awk uses FS not IFS: Field Separators. (line 29)
@@ -27279,7 +27341,7 @@ Index
* truth values: Truth Values. (line 6)
* type conversion: Conversion. (line 21)
* type internal variable: Internals. (line 59)
-* u debugger command (alias for until): Dgawk Execution Control.
+* u debugger command (alias for until): Debugger Execution Control.
(line 83)
* undefined functions: Pass By Value/Reference.
(line 71)
@@ -27306,21 +27368,21 @@ Index
* UNIXROOT variable, on OS/2 systems: PC Using. (line 17)
* unref() internal function: Internals. (line 92)
* unsigned integers: Basic Data Typing. (line 30)
-* until debugger command: Dgawk Execution Control.
+* until debugger command: Debugger Execution Control.
(line 83)
* unwatch debugger command: Viewing And Changing Data.
(line 84)
-* up debugger command: Dgawk Stack. (line 33)
+* up debugger command: Execution Stack. (line 33)
* update_ERRNO() internal function: Internals. (line 130)
* update_ERRNO_saved() internal function: Internals. (line 135)
* user database, reading: Passwd Functions. (line 6)
* user-defined, functions: User-defined. (line 6)
-* user-defined, functions, counts: Profiling. (line 132)
+* user-defined, functions, counts: Profiling. (line 129)
* user-defined, variables: Variables. (line 6)
* user-modifiable variables: User-modified. (line 6)
* users, information about, printing: Id Program. (line 6)
* users, information about, retrieving: Passwd Functions. (line 16)
-* USR1 signal: Profiling. (line 182)
+* USR1 signal: Profiling. (line 180)
* values, numeric: Basic Data Typing. (line 13)
* values, string: Basic Data Typing. (line 13)
* variable typing: Typing and Comparison.
@@ -27371,7 +27433,7 @@ Index
* Wall, Larry <1>: Future Extensions. (line 6)
* Wall, Larry: Array Intro. (line 6)
* Wallin, Anders: Acknowledgments. (line 60)
-* warnings, issuing: Options. (line 147)
+* warnings, issuing: Options. (line 163)
* watch debugger command: Viewing And Changing Data.
(line 67)
* wc utility: Wc Program. (line 6)
@@ -27383,7 +27445,7 @@ Index
* whitespace, as field separators: Default Field Splitting.
(line 6)
* whitespace, functions, calling: Calling Built-in. (line 10)
-* whitespace, newlines as: Options. (line 205)
+* whitespace, newlines as: Options. (line 228)
* Williams, Kent: Contributors. (line 35)
* Woehlke, Matthew: Contributors. (line 79)
* Woods, John: Contributors. (line 28)
@@ -27399,7 +27461,7 @@ Index
* words, usage counts, generating: Word Sorting. (line 6)
* wstlen internal variable: Internals. (line 54)
* wstptr internal variable: Internals. (line 54)
-* xgawk: Other Versions. (line 119)
+* xgawk: Other Versions. (line 120)
* xgettext utility: String Extraction. (line 13)
* XML (eXtensible Markup Language): Internals. (line 151)
* XOR bitwise operation: Bitwise Functions. (line 6)
@@ -27411,8 +27473,8 @@ Index
* zero, negative vs. positive: Unexpected Results. (line 28)
* zerofile.awk program: Empty Files. (line 21)
* Zoulas, Christos: Contributors. (line 67)
+* {} (braces): Profiling. (line 134)
* {} (braces), actions and: Action Overview. (line 19)
-* {} (braces), pgawk program: Profiling. (line 137)
* {} (braces), statements, grouping: Statements. (line 10)
* | (vertical bar): Regexp Operators. (line 69)
* | (vertical bar), | operator (I/O) <1>: Precedence. (line 65)
@@ -27438,828 +27500,418 @@ Index

Tag Table:
-<<<<<<< HEAD
-Node: Top1345
-Node: Foreword33439
-Node: Preface37784
-Ref: Preface-Footnote-140837
-Ref: Preface-Footnote-240943
-Node: History41175
-Node: Names43566
-Ref: Names-Footnote-145043
-Node: This Manual45115
-Ref: This Manual-Footnote-150062
-Node: Conventions50162
-Node: Manual History52296
-Ref: Manual History-Footnote-155566
-Ref: Manual History-Footnote-255607
-Node: How To Contribute55681
-Node: Acknowledgments56825
-Node: Getting Started61156
-Node: Running gawk63535
-Node: One-shot64721
-Node: Read Terminal65946
-Ref: Read Terminal-Footnote-167596
-Ref: Read Terminal-Footnote-267872
-Node: Long68043
-Node: Executable Scripts69419
-Ref: Executable Scripts-Footnote-171288
-Ref: Executable Scripts-Footnote-271390
-Node: Comments71841
-Node: Quoting74308
-Node: DOS Quoting78931
-Node: Sample Data Files79606
-Node: Very Simple82638
-Node: Two Rules87237
-Node: More Complex89384
-Ref: More Complex-Footnote-192314
-Node: Statements/Lines92399
-Ref: Statements/Lines-Footnote-196861
-Node: Other Features97126
-Node: When98054
-Node: Invoking Gawk100201
-Node: Command Line101586
-Node: Options102369
-Ref: Options-Footnote-1115806
-Node: Other Arguments115831
-Node: Naming Standard Input118489
-Node: Environment Variables119583
-Node: AWKPATH Variable120027
-Ref: AWKPATH Variable-Footnote-1122624
-Node: Other Environment Variables122884
-Node: Exit Status125224
-Node: Include Files125899
-Node: Obsolete129384
-Node: Undocumented130070
-Node: Regexp130311
-Node: Regexp Usage131700
-Node: Escape Sequences133726
-Node: Regexp Operators139489
-Ref: Regexp Operators-Footnote-1146686
-Ref: Regexp Operators-Footnote-2146833
-Node: Bracket Expressions146931
-Ref: table-char-classes148821
-Node: GNU Regexp Operators151344
-Node: Case-sensitivity155067
-Ref: Case-sensitivity-Footnote-1158035
-Ref: Case-sensitivity-Footnote-2158270
-Node: Leftmost Longest158378
-Node: Computed Regexps159579
-Node: Reading Files162989
-Node: Records164930
-Ref: Records-Footnote-1173604
-Node: Fields173641
-Ref: Fields-Footnote-1176674
-Node: Nonconstant Fields176760
-Node: Changing Fields178962
-Node: Field Separators184940
-Node: Default Field Splitting187569
-Node: Regexp Field Splitting188686
-Node: Single Character Fields192028
-Node: Command Line Field Separator193087
-Node: Field Splitting Summary196528
-Ref: Field Splitting Summary-Footnote-1199720
-Node: Constant Size199821
-Node: Splitting By Content204405
-Ref: Splitting By Content-Footnote-1208131
-Node: Multiple Line208171
-Ref: Multiple Line-Footnote-1214018
-Node: Getline214197
-Node: Plain Getline216425
-Node: Getline/Variable218514
-Node: Getline/File219655
-Node: Getline/Variable/File220977
-Ref: Getline/Variable/File-Footnote-1222576
-Node: Getline/Pipe222663
-Node: Getline/Variable/Pipe225223
-Node: Getline/Coprocess226330
-Node: Getline/Variable/Coprocess227573
-Node: Getline Notes228287
-Node: Getline Summary230229
-Ref: table-getline-variants230572
-Node: Command line directories231428
-Node: Printing232053
-Node: Print233684
-Node: Print Examples235021
-Node: Output Separators237805
-Node: OFMT239565
-Node: Printf240923
-Node: Basic Printf241829
-Node: Control Letters243368
-Node: Format Modifiers247180
-Node: Printf Examples253189
-Node: Redirection255904
-Node: Special Files262888
-Node: Special FD263421
-Ref: Special FD-Footnote-1267046
-Node: Special Network267120
-Node: Special Caveats267970
-Node: Close Files And Pipes268766
-Ref: Close Files And Pipes-Footnote-1275789
-Ref: Close Files And Pipes-Footnote-2275937
-Node: Expressions276087
-Node: Values277219
-Node: Constants277895
-Node: Scalar Constants278575
-Ref: Scalar Constants-Footnote-1279434
-Node: Nondecimal-numbers279616
-Node: Regexp Constants282675
-Node: Using Constant Regexps283150
-Node: Variables286205
-Node: Using Variables286860
-Node: Assignment Options288584
-Node: Conversion290456
-Ref: table-locale-affects295832
-Ref: Conversion-Footnote-1296456
-Node: All Operators296565
-Node: Arithmetic Ops297195
-Node: Concatenation299700
-Ref: Concatenation-Footnote-1302493
-Node: Assignment Ops302613
-Ref: table-assign-ops307601
-Node: Increment Ops309009
-Node: Truth Values and Conditions312479
-Node: Truth Values313562
-Node: Typing and Comparison314611
-Node: Variable Typing315400
-Ref: Variable Typing-Footnote-1319297
-Node: Comparison Operators319419
-Ref: table-relational-ops319829
-Node: POSIX String Comparison323378
-Ref: POSIX String Comparison-Footnote-1324334
-Node: Boolean Ops324472
-Ref: Boolean Ops-Footnote-1328550
-Node: Conditional Exp328641
-Node: Function Calls330373
-Node: Precedence333967
-Node: Locales337636
-Node: Patterns and Actions338725
-Node: Pattern Overview339779
-Node: Regexp Patterns341445
-Node: Expression Patterns341988
-Node: Ranges345673
-Node: BEGIN/END348639
-Node: Using BEGIN/END349401
-Ref: Using BEGIN/END-Footnote-1352132
-Node: I/O And BEGIN/END352238
-Node: BEGINFILE/ENDFILE354520
-Node: Empty357413
-Node: Using Shell Variables357729
-Node: Action Overview360014
-Node: Statements362371
-Node: If Statement364225
-Node: While Statement365724
-Node: Do Statement367768
-Node: For Statement368924
-Node: Switch Statement372076
-Node: Break Statement374173
-Node: Continue Statement376163
-Node: Next Statement377950
-Node: Nextfile Statement380340
-Node: Exit Statement382885
-Node: Built-in Variables385301
-Node: User-modified386396
-Ref: User-modified-Footnote-1394422
-Node: Auto-set394484
-Ref: Auto-set-Footnote-1403775
-Node: ARGC and ARGV403980
-Node: Arrays407831
-Node: Array Basics409336
-Node: Array Intro410047
-Node: Reference to Elements414365
-Node: Assigning Elements416635
-Node: Array Example417126
-Node: Scanning an Array418858
-Node: Delete421524
-Ref: Delete-Footnote-1423959
-Node: Numeric Array Subscripts424016
-Node: Uninitialized Subscripts426199
-Node: Multi-dimensional427827
-Node: Multi-scanning430921
-Node: Arrays of Arrays432505
-Node: Functions437082
-Node: Built-in437904
-Node: Calling Built-in438982
-Node: Numeric Functions440970
-Ref: Numeric Functions-Footnote-1444735
-Ref: Numeric Functions-Footnote-2445092
-Ref: Numeric Functions-Footnote-3445140
-Node: String Functions445409
-Ref: String Functions-Footnote-1468906
-Ref: String Functions-Footnote-2469035
-Ref: String Functions-Footnote-3469283
-Node: Gory Details469370
-Ref: table-sub-escapes471049
-Ref: table-sub-posix-92472403
-Ref: table-sub-proposed473746
-Ref: table-posix-sub475096
-Ref: table-gensub-escapes476642
-Ref: Gory Details-Footnote-1477849
-Ref: Gory Details-Footnote-2477900
-Node: I/O Functions478051
-Ref: I/O Functions-Footnote-1484706
-Node: Time Functions484853
-Ref: Time Functions-Footnote-1495745
-Ref: Time Functions-Footnote-2495813
-Ref: Time Functions-Footnote-3495971
-Ref: Time Functions-Footnote-4496082
-Ref: Time Functions-Footnote-5496194
-Ref: Time Functions-Footnote-6496421
-Node: Bitwise Functions496687
-Ref: table-bitwise-ops497245
-Ref: Bitwise Functions-Footnote-1501405
-Node: Type Functions501589
-Node: I18N Functions502059
-Node: User-defined503686
-Node: Definition Syntax504490
-Ref: Definition Syntax-Footnote-1509400
-Node: Function Example509469
-Node: Function Caveats512063
-Node: Calling A Function512484
-Node: Variable Scope513599
-Node: Pass By Value/Reference515574
-Node: Return Statement519014
-Node: Dynamic Typing521995
-Node: Indirect Calls522730
-Node: Internationalization532415
-Node: I18N and L10N533841
-Node: Explaining gettext534527
-Ref: Explaining gettext-Footnote-1539593
-Ref: Explaining gettext-Footnote-2539777
-Node: Programmer i18n539942
-Node: Translator i18n544142
-Node: String Extraction544935
-Ref: String Extraction-Footnote-1545896
-Node: Printf Ordering545982
-Ref: Printf Ordering-Footnote-1548766
-Node: I18N Portability548830
-Ref: I18N Portability-Footnote-1551279
-Node: I18N Example551342
-Ref: I18N Example-Footnote-1553977
-Node: Gawk I18N554049
-Node: Advanced Features554666
-Node: Nondecimal Data556179
-Node: Array Sorting557762
-Node: Controlling Array Traversal558462
-Node: Controlling Scanning With A Function559209
-Node: Controlling Scanning566912
-Ref: Controlling Scanning-Footnote-1570713
-Node: Array Sorting Functions571029
-Ref: Array Sorting Functions-Footnote-1574545
-Ref: Array Sorting Functions-Footnote-2574638
-Node: Two-way I/O574832
-Ref: Two-way I/O-Footnote-1580264
-Node: TCP/IP Networking580334
-Node: Profiling583178
-Node: Library Functions590652
-Ref: Library Functions-Footnote-1593659
-Node: Library Names593830
-Ref: Library Names-Footnote-1597301
-Ref: Library Names-Footnote-2597521
-Node: General Functions597607
-Node: Strtonum Function598560
-Node: Assert Function601490
-Node: Round Function604816
-Node: Cliff Random Function606359
-Node: Ordinal Functions607375
-Ref: Ordinal Functions-Footnote-1610445
-Ref: Ordinal Functions-Footnote-2610697
-Node: Join Function610906
-Ref: Join Function-Footnote-1612677
-Node: Gettimeofday Function612877
-Node: Data File Management616592
-Node: Filetrans Function617224
-Node: Rewind Function621363
-Node: File Checking622750
-Node: Empty Files623844
-Node: Ignoring Assigns626074
-Node: Getopt Function627627
-Ref: Getopt Function-Footnote-1638931
-Node: Passwd Functions639134
-Ref: Passwd Functions-Footnote-1648109
-Node: Group Functions648197
-Node: Walking Arrays656281
-Node: Sample Programs657850
-Node: Running Examples658515
-Node: Clones659243
-Node: Cut Program660467
-Node: Egrep Program670312
-Ref: Egrep Program-Footnote-1678085
-Node: Id Program678195
-Node: Split Program681811
-Ref: Split Program-Footnote-1685330
-Node: Tee Program685458
-Node: Uniq Program688261
-Node: Wc Program695690
-Ref: Wc Program-Footnote-1699956
-Ref: Wc Program-Footnote-2700156
-Node: Miscellaneous Programs700248
-Node: Dupword Program701436
-Node: Alarm Program703467
-Node: Translate Program708216
-Ref: Translate Program-Footnote-1712603
-Ref: Translate Program-Footnote-2712831
-Node: Labels Program712965
-Ref: Labels Program-Footnote-1716336
-Node: Word Sorting716420
-Node: History Sorting720304
-Node: Extract Program722143
-Ref: Extract Program-Footnote-1729626
-Node: Simple Sed729754
-Node: Igawk Program732816
-Ref: Igawk Program-Footnote-1747973
-Ref: Igawk Program-Footnote-2748174
-Node: Anagram Program748312
-Node: Signature Program751380
-Node: Debugger752480
-Node: Debugging753391
-Node: Debugging Concepts753804
-Node: Debugging Terms755660
-Node: Awk Debugging758283
-Node: Sample dgawk session759175
-Node: dgawk invocation759667
-Node: Finding The Bug760849
-Node: List of Debugger Commands767335
-Node: Breakpoint Control768646
-Node: Dgawk Execution Control772282
-Node: Viewing And Changing Data775633
-Node: Dgawk Stack778970
-Node: Dgawk Info780430
-Node: Miscellaneous Dgawk Commands784378
-Node: Readline Support789806
-Node: Dgawk Limitations790644
-Node: Language History792833
-Node: V7/SVR3.1794345
-Node: SVR4796666
-Node: POSIX798108
-Node: BTL799116
-Node: POSIX/GNU799850
-Node: Common Extensions805001
-Node: Ranges and Locales806108
-Ref: Ranges and Locales-Footnote-1810715
-Node: Contributors810936
-Node: Installation815198
-Node: Gawk Distribution816092
-Node: Getting816576
-Node: Extracting817402
-Node: Distribution contents819094
-Node: Unix Installation824316
-Node: Quick Installation824933
-Node: Additional Configuration Options826895
-Node: Configuration Philosophy828372
-Node: Non-Unix Installation830714
-Node: PC Installation831172
-Node: PC Binary Installation832471
-Node: PC Compiling834319
-Node: PC Testing837263
-Node: PC Using838439
-Node: Cygwin842624
-Node: MSYS843624
-Node: VMS Installation844138
-Node: VMS Compilation844741
-Ref: VMS Compilation-Footnote-1845748
-Node: VMS Installation Details845806
-Node: VMS Running847441
-Node: VMS Old Gawk849048
-Node: Bugs849522
-=======
Node: Top1346
-Node: Foreword33440
-Node: Preface37785
-Ref: Preface-Footnote-140838
-Ref: Preface-Footnote-240944
-Node: History41176
-Node: Names43567
-Ref: Names-Footnote-145044
-Node: This Manual45116
-Ref: This Manual-Footnote-150063
-Node: Conventions50163
-Node: Manual History52297
-Ref: Manual History-Footnote-155567
-Ref: Manual History-Footnote-255608
-Node: How To Contribute55682
-Node: Acknowledgments56826
-Node: Getting Started61157
-Node: Running gawk63536
-Node: One-shot64722
-Node: Read Terminal65947
-Ref: Read Terminal-Footnote-167597
-Ref: Read Terminal-Footnote-267873
-Node: Long68044
-Node: Executable Scripts69420
-Ref: Executable Scripts-Footnote-171289
-Ref: Executable Scripts-Footnote-271391
-Node: Comments71842
-Node: Quoting74309
-Node: DOS Quoting78932
-Node: Sample Data Files79607
-Node: Very Simple82639
-Node: Two Rules87238
-Node: More Complex89385
-Ref: More Complex-Footnote-192315
-Node: Statements/Lines92400
-Ref: Statements/Lines-Footnote-196862
-Node: Other Features97127
-Node: When98055
-Node: Invoking Gawk100202
-Node: Command Line101587
-Node: Options102370
-Ref: Options-Footnote-1115807
-Node: Other Arguments115832
-Node: Naming Standard Input118490
-Node: Environment Variables119584
-Node: AWKPATH Variable120028
-Ref: AWKPATH Variable-Footnote-1122625
-Node: Other Environment Variables122885
-Node: Exit Status125225
-Node: Include Files125900
-Node: Obsolete129385
-Node: Undocumented130071
-Node: Regexp130312
-Node: Regexp Usage131701
-Node: Escape Sequences133727
-Node: Regexp Operators139490
-Ref: Regexp Operators-Footnote-1146687
-Ref: Regexp Operators-Footnote-2146834
-Node: Bracket Expressions146932
-Ref: table-char-classes148822
-Node: GNU Regexp Operators151345
-Node: Case-sensitivity155068
-Ref: Case-sensitivity-Footnote-1158036
-Ref: Case-sensitivity-Footnote-2158271
-Node: Leftmost Longest158379
-Node: Computed Regexps159580
-Node: Reading Files162990
-Node: Records164931
-Ref: Records-Footnote-1173605
-Node: Fields173642
-Ref: Fields-Footnote-1176675
-Node: Nonconstant Fields176761
-Node: Changing Fields178963
-Node: Field Separators184941
-Node: Default Field Splitting187570
-Node: Regexp Field Splitting188687
-Node: Single Character Fields192029
-Node: Command Line Field Separator193088
-Node: Field Splitting Summary196529
-Ref: Field Splitting Summary-Footnote-1199721
-Node: Constant Size199822
-Node: Splitting By Content204406
-Ref: Splitting By Content-Footnote-1208132
-Node: Multiple Line208172
-Ref: Multiple Line-Footnote-1214019
-Node: Getline214198
-Node: Plain Getline216426
-Node: Getline/Variable218515
-Node: Getline/File219656
-Node: Getline/Variable/File220978
-Ref: Getline/Variable/File-Footnote-1222577
-Node: Getline/Pipe222664
-Node: Getline/Variable/Pipe225224
-Node: Getline/Coprocess226331
-Node: Getline/Variable/Coprocess227574
-Node: Getline Notes228288
-Node: Getline Summary230230
-Ref: table-getline-variants230573
-Node: Command line directories231429
-Node: Printing232054
-Node: Print233685
-Node: Print Examples235022
-Node: Output Separators237806
-Node: OFMT239566
-Node: Printf240924
-Node: Basic Printf241830
-Node: Control Letters243369
-Node: Format Modifiers247181
-Node: Printf Examples253190
-Node: Redirection255905
-Node: Special Files262889
-Node: Special FD263422
-Ref: Special FD-Footnote-1267047
-Node: Special Network267121
-Node: Special Caveats267971
-Node: Close Files And Pipes268767
-Ref: Close Files And Pipes-Footnote-1275790
-Ref: Close Files And Pipes-Footnote-2275938
-Node: Expressions276088
-Node: Values277220
-Node: Constants277896
-Node: Scalar Constants278576
-Ref: Scalar Constants-Footnote-1279435
-Node: Nondecimal-numbers279617
-Node: Regexp Constants282676
-Node: Using Constant Regexps283151
-Node: Variables286206
-Node: Using Variables286861
-Node: Assignment Options288585
-Node: Conversion290457
-Ref: table-locale-affects295833
-Ref: Conversion-Footnote-1296457
-Node: All Operators296566
-Node: Arithmetic Ops297196
-Node: Concatenation299701
-Ref: Concatenation-Footnote-1302494
-Node: Assignment Ops302614
-Ref: table-assign-ops307602
-Node: Increment Ops309010
-Node: Truth Values and Conditions312480
-Node: Truth Values313563
-Node: Typing and Comparison314612
-Node: Variable Typing315401
-Ref: Variable Typing-Footnote-1319298
-Node: Comparison Operators319420
-Ref: table-relational-ops319830
-Node: POSIX String Comparison323379
-Ref: POSIX String Comparison-Footnote-1324335
-Node: Boolean Ops324473
-Ref: Boolean Ops-Footnote-1328551
-Node: Conditional Exp328642
-Node: Function Calls330374
-Node: Precedence333968
-Node: Locales337637
-Node: Patterns and Actions338726
-Node: Pattern Overview339780
-Node: Regexp Patterns341446
-Node: Expression Patterns341989
-Node: Ranges345674
-Node: BEGIN/END348640
-Node: Using BEGIN/END349402
-Ref: Using BEGIN/END-Footnote-1352133
-Node: I/O And BEGIN/END352239
-Node: BEGINFILE/ENDFILE354521
-Node: Empty357414
-Node: Using Shell Variables357730
-Node: Action Overview360015
-Node: Statements362372
-Node: If Statement364226
-Node: While Statement365725
-Node: Do Statement367769
-Node: For Statement368925
-Node: Switch Statement372077
-Node: Break Statement374174
-Node: Continue Statement376164
-Node: Next Statement377951
-Node: Nextfile Statement380341
-Node: Exit Statement382886
-Node: Built-in Variables385302
-Node: User-modified386397
-Ref: User-modified-Footnote-1394423
-Node: Auto-set394485
-Ref: Auto-set-Footnote-1403776
-Node: ARGC and ARGV403981
-Node: Arrays407832
-Node: Array Basics409337
-Node: Array Intro410048
-Node: Reference to Elements414366
-Node: Assigning Elements416636
-Node: Array Example417127
-Node: Scanning an Array418859
-Node: Delete421525
-Ref: Delete-Footnote-1423960
-Node: Numeric Array Subscripts424017
-Node: Uninitialized Subscripts426200
-Node: Multi-dimensional427828
-Node: Multi-scanning430922
-Node: Arrays of Arrays432506
-Node: Functions437083
-Node: Built-in437905
-Node: Calling Built-in438983
-Node: Numeric Functions440971
-Ref: Numeric Functions-Footnote-1444736
-Ref: Numeric Functions-Footnote-2445093
-Ref: Numeric Functions-Footnote-3445141
-Node: String Functions445410
-Ref: String Functions-Footnote-1468907
-Ref: String Functions-Footnote-2469036
-Ref: String Functions-Footnote-3469284
-Node: Gory Details469371
-Ref: table-sub-escapes471050
-Ref: table-sub-posix-92472404
-Ref: table-sub-proposed473747
-Ref: table-posix-sub475097
-Ref: table-gensub-escapes476643
-Ref: Gory Details-Footnote-1477850
-Ref: Gory Details-Footnote-2477901
-Node: I/O Functions478052
-Ref: I/O Functions-Footnote-1484707
-Node: Time Functions484854
-Ref: Time Functions-Footnote-1495746
-Ref: Time Functions-Footnote-2495814
-Ref: Time Functions-Footnote-3495972
-Ref: Time Functions-Footnote-4496083
-Ref: Time Functions-Footnote-5496195
-Ref: Time Functions-Footnote-6496422
-Node: Bitwise Functions496688
-Ref: table-bitwise-ops497246
-Ref: Bitwise Functions-Footnote-1501406
-Node: Type Functions501590
-Node: I18N Functions502060
-Node: User-defined503687
-Node: Definition Syntax504491
-Ref: Definition Syntax-Footnote-1509401
-Node: Function Example509470
-Node: Function Caveats512064
-Node: Calling A Function512485
-Node: Variable Scope513600
-Node: Pass By Value/Reference515575
-Node: Return Statement519015
-Node: Dynamic Typing521996
-Node: Indirect Calls522731
-Node: Internationalization532416
-Node: I18N and L10N533842
-Node: Explaining gettext534528
-Ref: Explaining gettext-Footnote-1539594
-Ref: Explaining gettext-Footnote-2539778
-Node: Programmer i18n539943
-Node: Translator i18n544143
-Node: String Extraction544936
-Ref: String Extraction-Footnote-1545897
-Node: Printf Ordering545983
-Ref: Printf Ordering-Footnote-1548767
-Node: I18N Portability548831
-Ref: I18N Portability-Footnote-1551280
-Node: I18N Example551343
-Ref: I18N Example-Footnote-1553978
-Node: Gawk I18N554050
-Node: Advanced Features554667
-Node: Nondecimal Data556180
-Node: Array Sorting557763
-Node: Controlling Array Traversal558463
-Node: Controlling Scanning With A Function559210
-Node: Controlling Scanning566913
-Ref: Controlling Scanning-Footnote-1570714
-Node: Array Sorting Functions571030
-Ref: Array Sorting Functions-Footnote-1574546
-Ref: Array Sorting Functions-Footnote-2574639
-Node: Two-way I/O574833
-Ref: Two-way I/O-Footnote-1580265
-Node: TCP/IP Networking580335
-Node: Profiling583179
-Node: Library Functions590653
-Ref: Library Functions-Footnote-1593660
-Node: Library Names593831
-Ref: Library Names-Footnote-1597302
-Ref: Library Names-Footnote-2597522
-Node: General Functions597608
-Node: Strtonum Function598561
-Node: Assert Function601491
-Node: Round Function604817
-Node: Cliff Random Function606360
-Node: Ordinal Functions607376
-Ref: Ordinal Functions-Footnote-1610446
-Ref: Ordinal Functions-Footnote-2610698
-Node: Join Function610907
-Ref: Join Function-Footnote-1612678
-Node: Gettimeofday Function612878
-Node: Data File Management616593
-Node: Filetrans Function617225
-Node: Rewind Function621364
-Node: File Checking622751
-Node: Empty Files623845
-Node: Ignoring Assigns626075
-Node: Getopt Function627628
-Ref: Getopt Function-Footnote-1638932
-Node: Passwd Functions639135
-Ref: Passwd Functions-Footnote-1648110
-Node: Group Functions648198
-Node: Walking Arrays656282
-Node: Sample Programs657851
-Node: Running Examples658516
-Node: Clones659244
-Node: Cut Program660468
-Node: Egrep Program670313
-Ref: Egrep Program-Footnote-1678086
-Node: Id Program678196
-Node: Split Program681812
-Ref: Split Program-Footnote-1685331
-Node: Tee Program685459
-Node: Uniq Program688262
-Node: Wc Program695691
-Ref: Wc Program-Footnote-1699957
-Ref: Wc Program-Footnote-2700157
-Node: Miscellaneous Programs700249
-Node: Dupword Program701437
-Node: Alarm Program703468
-Node: Translate Program708217
-Ref: Translate Program-Footnote-1712604
-Ref: Translate Program-Footnote-2712832
-Node: Labels Program712966
-Ref: Labels Program-Footnote-1716337
-Node: Word Sorting716421
-Node: History Sorting720305
-Node: Extract Program722144
-Ref: Extract Program-Footnote-1729627
-Node: Simple Sed729755
-Node: Igawk Program732817
-Ref: Igawk Program-Footnote-1747974
-Ref: Igawk Program-Footnote-2748175
-Node: Anagram Program748313
-Node: Signature Program751381
-Node: Debugger752481
-Node: Debugging753392
-Node: Debugging Concepts753805
-Node: Debugging Terms755661
-Node: Awk Debugging758284
-Node: Sample dgawk session759176
-Node: dgawk invocation759668
-Node: Finding The Bug760850
-Node: List of Debugger Commands767336
-Node: Breakpoint Control768647
-Node: Dgawk Execution Control772283
-Node: Viewing And Changing Data775634
-Node: Dgawk Stack778971
-Node: Dgawk Info780431
-Node: Miscellaneous Dgawk Commands784379
-Node: Readline Support789807
-Node: Dgawk Limitations790645
-Node: Language History792834
-Node: V7/SVR3.1794346
-Node: SVR4796667
-Node: POSIX798109
-Node: BTL799117
-Node: POSIX/GNU799851
-Node: Common Extensions805002
-Node: Ranges and Locales806109
-Ref: Ranges and Locales-Footnote-1810716
-Node: Contributors810937
-Node: Installation815199
-Node: Gawk Distribution816093
-Node: Getting816577
-Node: Extracting817403
-Node: Distribution contents819095
-Node: Unix Installation824317
-Node: Quick Installation824934
-Node: Additional Configuration Options826896
-Node: Configuration Philosophy828373
-Node: Non-Unix Installation830715
-Node: PC Installation831173
-Node: PC Binary Installation832472
-Node: PC Compiling834320
-Node: PC Testing837264
-Node: PC Using838440
-Node: Cygwin842625
-Node: MSYS843625
-Node: VMS Installation844139
-Node: VMS Compilation844742
-Ref: VMS Compilation-Footnote-1845749
-Node: VMS Installation Details845807
-Node: VMS Running847442
-Node: VMS Old Gawk849049
-Node: Bugs849523
->>>>>>> gawk-4.0-stable
-Node: Other Versions853375
-Node: Notes858656
-Node: Compatibility Mode859348
-Node: Additions860131
-Node: Accessing The Source860943
-Node: Adding Code862368
-Node: New Ports868335
-Node: Dynamic Extensions872448
-Node: Internals873824
-<<<<<<< HEAD
-Node: Plugin License882343
-Node: Sample Library882977
-Node: Internal File Description883663
-Node: Internal File Ops887378
-Ref: Internal File Ops-Footnote-1892102
-Node: Using Internal File Ops892242
-Node: Future Extensions894619
-Node: Basic Concepts897123
-Node: Basic High Level897880
-Ref: Basic High Level-Footnote-1901915
-Node: Basic Data Typing902100
-Node: Floating Point Issues906625
-Node: String Conversion Precision907708
-Ref: String Conversion Precision-Footnote-1909408
-Node: Unexpected Results909517
-Node: POSIX Floating Point Problems911343
-Ref: POSIX Floating Point Problems-Footnote-1915048
-Node: Glossary915086
-Node: Copying940062
-Node: GNU Free Documentation License977619
-Node: Index1002756
-=======
-Node: Plugin License882927
-Node: Sample Library883561
-Node: Internal File Description884247
-Node: Internal File Ops887962
-Ref: Internal File Ops-Footnote-1892743
-Node: Using Internal File Ops892883
-Node: Future Extensions895260
-Node: Basic Concepts897764
-Node: Basic High Level898521
-Ref: Basic High Level-Footnote-1902556
-Node: Basic Data Typing902741
-Node: Floating Point Issues907266
-Node: String Conversion Precision908349
-Ref: String Conversion Precision-Footnote-1910049
-Node: Unexpected Results910158
-Node: POSIX Floating Point Problems911984
-Ref: POSIX Floating Point Problems-Footnote-1915689
-Node: Glossary915727
-Node: Copying940703
-Node: GNU Free Documentation License978260
-Node: Index1003397
->>>>>>> gawk-4.0-stable
+Node: Foreword30346
+Node: Preface34691
+Ref: Preface-Footnote-137744
+Ref: Preface-Footnote-237850
+Node: History38082
+Node: Names40473
+Ref: Names-Footnote-141950
+Node: This Manual42022
+Ref: This Manual-Footnote-146960
+Node: Conventions47060
+Node: Manual History49194
+Ref: Manual History-Footnote-152464
+Ref: Manual History-Footnote-252505
+Node: How To Contribute52579
+Node: Acknowledgments53723
+Node: Getting Started58054
+Node: Running gawk60433
+Node: One-shot61619
+Node: Read Terminal62844
+Ref: Read Terminal-Footnote-164494
+Ref: Read Terminal-Footnote-264770
+Node: Long64941
+Node: Executable Scripts66317
+Ref: Executable Scripts-Footnote-168186
+Ref: Executable Scripts-Footnote-268288
+Node: Comments68739
+Node: Quoting71206
+Node: DOS Quoting75829
+Node: Sample Data Files76504
+Node: Very Simple79536
+Node: Two Rules84135
+Node: More Complex86282
+Ref: More Complex-Footnote-189212
+Node: Statements/Lines89297
+Ref: Statements/Lines-Footnote-193759
+Node: Other Features94024
+Node: When94952
+Node: Invoking Gawk97099
+Node: Command Line98484
+Node: Options99267
+Ref: Options-Footnote-1113412
+Node: Other Arguments113437
+Node: Naming Standard Input116095
+Node: Environment Variables117189
+Node: AWKPATH Variable117633
+Ref: AWKPATH Variable-Footnote-1120230
+Node: Other Environment Variables120490
+Node: Exit Status122830
+Node: Include Files123505
+Node: Obsolete126990
+Node: Undocumented127676
+Node: Regexp127917
+Node: Regexp Usage129306
+Node: Escape Sequences131332
+Node: Regexp Operators137095
+Ref: Regexp Operators-Footnote-1144292
+Ref: Regexp Operators-Footnote-2144439
+Node: Bracket Expressions144537
+Ref: table-char-classes146427
+Node: GNU Regexp Operators148950
+Node: Case-sensitivity152673
+Ref: Case-sensitivity-Footnote-1155641
+Ref: Case-sensitivity-Footnote-2155876
+Node: Leftmost Longest155984
+Node: Computed Regexps157185
+Node: Reading Files160595
+Node: Records162536
+Ref: Records-Footnote-1171210
+Node: Fields171247
+Ref: Fields-Footnote-1174280
+Node: Nonconstant Fields174366
+Node: Changing Fields176568
+Node: Field Separators182549
+Node: Default Field Splitting185178
+Node: Regexp Field Splitting186295
+Node: Single Character Fields189637
+Node: Command Line Field Separator190696
+Node: Field Splitting Summary194137
+Ref: Field Splitting Summary-Footnote-1197329
+Node: Constant Size197430
+Node: Splitting By Content202014
+Ref: Splitting By Content-Footnote-1205740
+Node: Multiple Line205780
+Ref: Multiple Line-Footnote-1211627
+Node: Getline211806
+Node: Plain Getline214034
+Node: Getline/Variable216123
+Node: Getline/File217264
+Node: Getline/Variable/File218586
+Ref: Getline/Variable/File-Footnote-1220185
+Node: Getline/Pipe220272
+Node: Getline/Variable/Pipe222832
+Node: Getline/Coprocess223939
+Node: Getline/Variable/Coprocess225182
+Node: Getline Notes225896
+Node: Getline Summary227838
+Ref: table-getline-variants228181
+Node: Command line directories229037
+Node: Printing229662
+Node: Print231293
+Node: Print Examples232630
+Node: Output Separators235414
+Node: OFMT237174
+Node: Printf238532
+Node: Basic Printf239438
+Node: Control Letters240977
+Node: Format Modifiers244789
+Node: Printf Examples250798
+Node: Redirection253513
+Node: Special Files260497
+Node: Special FD261030
+Ref: Special FD-Footnote-1264655
+Node: Special Network264729
+Node: Special Caveats265579
+Node: Close Files And Pipes266375
+Ref: Close Files And Pipes-Footnote-1273398
+Ref: Close Files And Pipes-Footnote-2273546
+Node: Expressions273696
+Node: Values274828
+Node: Constants275504
+Node: Scalar Constants276184
+Ref: Scalar Constants-Footnote-1277043
+Node: Nondecimal-numbers277225
+Node: Regexp Constants280284
+Node: Using Constant Regexps280759
+Node: Variables283814
+Node: Using Variables284469
+Node: Assignment Options286193
+Node: Conversion288065
+Ref: table-locale-affects293441
+Ref: Conversion-Footnote-1294065
+Node: All Operators294174
+Node: Arithmetic Ops294804
+Node: Concatenation297309
+Ref: Concatenation-Footnote-1300102
+Node: Assignment Ops300222
+Ref: table-assign-ops305210
+Node: Increment Ops306618
+Node: Truth Values and Conditions310088
+Node: Truth Values311171
+Node: Typing and Comparison312220
+Node: Variable Typing313009
+Ref: Variable Typing-Footnote-1316906
+Node: Comparison Operators317028
+Ref: table-relational-ops317438
+Node: POSIX String Comparison320987
+Ref: POSIX String Comparison-Footnote-1321943
+Node: Boolean Ops322081
+Ref: Boolean Ops-Footnote-1326159
+Node: Conditional Exp326250
+Node: Function Calls327982
+Node: Precedence331576
+Node: Locales335245
+Node: Patterns and Actions336334
+Node: Pattern Overview337388
+Node: Regexp Patterns339057
+Node: Expression Patterns339600
+Node: Ranges343285
+Node: BEGIN/END346251
+Node: Using BEGIN/END347013
+Ref: Using BEGIN/END-Footnote-1349744
+Node: I/O And BEGIN/END349850
+Node: BEGINFILE/ENDFILE352132
+Node: Empty355025
+Node: Using Shell Variables355341
+Node: Action Overview357626
+Node: Statements359983
+Node: If Statement361837
+Node: While Statement363336
+Node: Do Statement365380
+Node: For Statement366536
+Node: Switch Statement369688
+Node: Break Statement371785
+Node: Continue Statement373775
+Node: Next Statement375568
+Node: Nextfile Statement377958
+Node: Exit Statement380503
+Node: Built-in Variables382919
+Node: User-modified384014
+Ref: User-modified-Footnote-1392040
+Node: Auto-set392102
+Ref: Auto-set-Footnote-1401393
+Node: ARGC and ARGV401598
+Node: Arrays405449
+Node: Array Basics406954
+Node: Array Intro407780
+Node: Reference to Elements412098
+Node: Assigning Elements414368
+Node: Array Example414859
+Node: Scanning an Array416591
+Node: Controlling Scanning418905
+Ref: Controlling Scanning-Footnote-1423838
+Node: Delete424154
+Ref: Delete-Footnote-1426589
+Node: Numeric Array Subscripts426646
+Node: Uninitialized Subscripts428829
+Node: Multi-dimensional430457
+Node: Multi-scanning433551
+Node: Arrays of Arrays435142
+Node: Functions439787
+Node: Built-in440609
+Node: Calling Built-in441687
+Node: Numeric Functions443675
+Ref: Numeric Functions-Footnote-1447440
+Ref: Numeric Functions-Footnote-2447797
+Ref: Numeric Functions-Footnote-3447845
+Node: String Functions448114
+Ref: String Functions-Footnote-1471611
+Ref: String Functions-Footnote-2471740
+Ref: String Functions-Footnote-3471988
+Node: Gory Details472075
+Ref: table-sub-escapes473754
+Ref: table-sub-posix-92475108
+Ref: table-sub-proposed476451
+Ref: table-posix-sub477801
+Ref: table-gensub-escapes479347
+Ref: Gory Details-Footnote-1480554
+Ref: Gory Details-Footnote-2480605
+Node: I/O Functions480756
+Ref: I/O Functions-Footnote-1487411
+Node: Time Functions487558
+Ref: Time Functions-Footnote-1498450
+Ref: Time Functions-Footnote-2498518
+Ref: Time Functions-Footnote-3498676
+Ref: Time Functions-Footnote-4498787
+Ref: Time Functions-Footnote-5498899
+Ref: Time Functions-Footnote-6499126
+Node: Bitwise Functions499392
+Ref: table-bitwise-ops499950
+Ref: Bitwise Functions-Footnote-1504110
+Node: Type Functions504294
+Node: I18N Functions504764
+Node: User-defined506391
+Node: Definition Syntax507195
+Ref: Definition Syntax-Footnote-1512105
+Node: Function Example512174
+Node: Function Caveats514768
+Node: Calling A Function515189
+Node: Variable Scope516304
+Node: Pass By Value/Reference518279
+Node: Return Statement521719
+Node: Dynamic Typing524700
+Node: Indirect Calls525435
+Node: Internationalization535120
+Node: I18N and L10N536546
+Node: Explaining gettext537232
+Ref: Explaining gettext-Footnote-1542298
+Ref: Explaining gettext-Footnote-2542482
+Node: Programmer i18n542647
+Node: Translator i18n546847
+Node: String Extraction547640
+Ref: String Extraction-Footnote-1548601
+Node: Printf Ordering548687
+Ref: Printf Ordering-Footnote-1551471
+Node: I18N Portability551535
+Ref: I18N Portability-Footnote-1553984
+Node: I18N Example554047
+Ref: I18N Example-Footnote-1556682
+Node: Gawk I18N556754
+Node: Advanced Features557371
+Node: Nondecimal Data558884
+Node: Array Sorting560467
+Node: Controlling Array Traversal561164
+Node: Array Sorting Functions569401
+Ref: Array Sorting Functions-Footnote-1573075
+Ref: Array Sorting Functions-Footnote-2573168
+Node: Two-way I/O573362
+Ref: Two-way I/O-Footnote-1578794
+Node: TCP/IP Networking578864
+Node: Profiling581708
+Node: Library Functions589162
+Ref: Library Functions-Footnote-1592169
+Node: Library Names592340
+Ref: Library Names-Footnote-1595811
+Ref: Library Names-Footnote-2596031
+Node: General Functions596117
+Node: Strtonum Function597070
+Node: Assert Function600000
+Node: Round Function603326
+Node: Cliff Random Function604869
+Node: Ordinal Functions605885
+Ref: Ordinal Functions-Footnote-1608955
+Ref: Ordinal Functions-Footnote-2609207
+Node: Join Function609416
+Ref: Join Function-Footnote-1611187
+Node: Gettimeofday Function611387
+Node: Data File Management615102
+Node: Filetrans Function615734
+Node: Rewind Function619873
+Node: File Checking621260
+Node: Empty Files622354
+Node: Ignoring Assigns624584
+Node: Getopt Function626137
+Ref: Getopt Function-Footnote-1637441
+Node: Passwd Functions637644
+Ref: Passwd Functions-Footnote-1646619
+Node: Group Functions646707
+Node: Walking Arrays654791
+Node: Sample Programs656360
+Node: Running Examples657025
+Node: Clones657753
+Node: Cut Program658977
+Node: Egrep Program668822
+Ref: Egrep Program-Footnote-1676595
+Node: Id Program676705
+Node: Split Program680321
+Ref: Split Program-Footnote-1683840
+Node: Tee Program683968
+Node: Uniq Program686771
+Node: Wc Program694200
+Ref: Wc Program-Footnote-1698466
+Ref: Wc Program-Footnote-2698666
+Node: Miscellaneous Programs698758
+Node: Dupword Program699946
+Node: Alarm Program701977
+Node: Translate Program706726
+Ref: Translate Program-Footnote-1711113
+Ref: Translate Program-Footnote-2711341
+Node: Labels Program711475
+Ref: Labels Program-Footnote-1714846
+Node: Word Sorting714930
+Node: History Sorting718814
+Node: Extract Program720653
+Ref: Extract Program-Footnote-1728136
+Node: Simple Sed728264
+Node: Igawk Program731326
+Ref: Igawk Program-Footnote-1746483
+Ref: Igawk Program-Footnote-2746684
+Node: Anagram Program746822
+Node: Signature Program749890
+Node: Debugger750990
+Node: Debugging751942
+Node: Debugging Concepts752375
+Node: Debugging Terms754231
+Node: Awk Debugging756828
+Node: Sample Debugging Session757720
+Node: Debugger Invocation758240
+Node: Finding The Bug759569
+Node: List of Debugger Commands766057
+Node: Breakpoint Control767391
+Node: Debugger Execution Control771055
+Node: Viewing And Changing Data774415
+Node: Execution Stack777771
+Node: Debugger Info779238
+Node: Miscellaneous Debugger Commands783219
+Node: Readline Support788664
+Node: Limitations789495
+Node: Language History791747
+Node: V7/SVR3.1793259
+Node: SVR4795580
+Node: POSIX797022
+Node: BTL798030
+Node: POSIX/GNU798764
+Node: Common Extensions803915
+Node: Ranges and Locales805022
+Ref: Ranges and Locales-Footnote-1809626
+Node: Contributors809847
+Node: Installation814108
+Node: Gawk Distribution815002
+Node: Getting815486
+Node: Extracting816312
+Node: Distribution contents818004
+Node: Unix Installation823226
+Node: Quick Installation823843
+Node: Additional Configuration Options825805
+Node: Configuration Philosophy827282
+Node: Non-Unix Installation829624
+Node: PC Installation830082
+Node: PC Binary Installation831381
+Node: PC Compiling833229
+Node: PC Testing836173
+Node: PC Using837349
+Node: Cygwin841534
+Node: MSYS842534
+Node: VMS Installation843048
+Node: VMS Compilation843651
+Ref: VMS Compilation-Footnote-1844658
+Node: VMS Installation Details844716
+Node: VMS Running846351
+Node: VMS Old Gawk847958
+Node: Bugs848432
+Node: Other Versions852284
+Node: Notes857599
+Node: Compatibility Mode858291
+Node: Additions859074
+Node: Accessing The Source859886
+Node: Adding Code861311
+Node: New Ports867278
+Node: Dynamic Extensions871391
+Node: Internals872831
+Node: Plugin License881350
+Node: Loading Extensions881988
+Node: Sample Library883798
+Node: Internal File Description884488
+Node: Internal File Ops888203
+Ref: Internal File Ops-Footnote-1892927
+Node: Using Internal File Ops893067
+Node: Future Extensions895444
+Node: Basic Concepts897948
+Node: Basic High Level898705
+Ref: Basic High Level-Footnote-1902740
+Node: Basic Data Typing902925
+Node: Floating Point Issues907450
+Node: String Conversion Precision908533
+Ref: String Conversion Precision-Footnote-1910233
+Node: Unexpected Results910342
+Node: POSIX Floating Point Problems912168
+Ref: POSIX Floating Point Problems-Footnote-1915873
+Node: Glossary915911
+Node: Copying940887
+Node: GNU Free Documentation License978444
+Node: Index1003581

End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index fc569ffc..5b3dd71c 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -20,9 +20,9 @@
@c applies to and all the info about who's publishing this edition
@c These apply across the board.
-@set UPDATE-MONTH June, 2011
+@set UPDATE-MONTH November, 2011
@set VERSION 4.0
-@set PATCHLEVEL 0
+@set PATCHLEVEL 1
@set FSF
@@ -290,7 +290,7 @@ particular records in a file and perform operations upon them.
* Library Functions:: A Library of @command{awk} Functions.
* Sample Programs:: Many @command{awk} programs with complete
explanations.
-* Debugger:: The @code{dgawk} debugger.
+* Debugger:: The @code{gawk} debugger.
* Language History:: The evolution of the @command{awk}
language.
* Installation:: Installing @command{gawk} under various
@@ -306,439 +306,401 @@ particular records in a file and perform operations upon them.
* Index:: Concept and Variable Index.
@detailmenu
-* History:: The history of @command{gawk} and
- @command{awk}.
-* Names:: What name to use to find @command{awk}.
-* This Manual:: Using this @value{DOCUMENT}. Includes
- sample input files that you can use.
-* Conventions:: Typographical Conventions.
-* Manual History:: Brief history of the GNU project and
- this @value{DOCUMENT}.
-* How To Contribute:: Helping to save the world.
-* Acknowledgments:: Acknowledgments.
-* Running gawk:: How to run @command{gawk} programs;
- includes command-line syntax.
-* One-shot:: Running a short throwaway @command{awk}
- program.
-* Read Terminal:: Using no input files (input from
- terminal instead).
-* Long:: Putting permanent @command{awk}
- programs in files.
-* Executable Scripts:: Making self-contained @command{awk}
- programs.
-* Comments:: Adding documentation to @command{gawk}
- programs.
-* Quoting:: More discussion of shell quoting
- issues.
-* DOS Quoting:: Quoting in Windows Batch Files.
-* Sample Data Files:: Sample data files for use in the
- @command{awk} programs illustrated in
- this @value{DOCUMENT}.
-* Very Simple:: A very simple example.
-* Two Rules:: A less simple one-line example using
- two rules.
-* More Complex:: A more complex example.
-* Statements/Lines:: Subdividing or combining statements
- into lines.
-* Other Features:: Other Features of @command{awk}.
-* When:: When to use @command{gawk} and when to
- use other things.
-* Command Line:: How to run @command{awk}.
-* Options:: Command-line options and their
- meanings.
-* Other Arguments:: Input file names and variable
- assignments.
-* Naming Standard Input:: How to specify standard input with
- other files.
-* Environment Variables:: The environment variables
- @command{gawk} uses.
-* AWKPATH Variable:: Searching directories for @command{awk}
- programs.
-* Other Environment Variables:: The environment variables.
-* Exit Status:: @command{gawk}'s exit status.
-* Include Files:: Including other files into your
- program.
-* Obsolete:: Obsolete Options and/or features.
-* Undocumented:: Undocumented Options and Features.
-* Regexp Usage:: How to Use Regular Expressions.
-* Escape Sequences:: How to write nonprinting characters.
-* Regexp Operators:: Regular Expression Operators.
-* Bracket Expressions:: What can go between @samp{[...]}.
-* GNU Regexp Operators:: Operators specific to GNU software.
-* Case-sensitivity:: How to do case-insensitive matching.
-* Leftmost Longest:: How much text matches.
-* Computed Regexps:: Using Dynamic Regexps.
-* Records:: Controlling how data is split into
- records.
-* Fields:: An introduction to fields.
-* Nonconstant Fields:: Nonconstant Field Numbers.
-* Changing Fields:: Changing the Contents of a Field.
-* Field Separators:: The field separator and how to change
- it.
-* Default Field Splitting:: How fields are normally separated.
-* Regexp Field Splitting:: Using regexps as the field separator.
-* Single Character Fields:: Making each character a separate field.
-* Command Line Field Separator:: Setting @code{FS} from the
- command-line.
-* Field Splitting Summary:: Some final points and a summary table.
-* Constant Size:: Reading constant width data.
-* Splitting By Content:: Defining Fields By Content
-* Multiple Line:: Reading multi-line records.
-* Getline:: Reading files under explicit program
- control using the @code{getline}
- function.
-* Plain Getline:: Using @code{getline} with no arguments.
-* Getline/Variable:: Using @code{getline} into a variable.
-* Getline/File:: Using @code{getline} from a file.
-* Getline/Variable/File:: Using @code{getline} into a variable
- from a file.
-* Getline/Pipe:: Using @code{getline} from a pipe.
-* Getline/Variable/Pipe:: Using @code{getline} into a variable
- from a pipe.
-* Getline/Coprocess:: Using @code{getline} from a coprocess.
-* Getline/Variable/Coprocess:: Using @code{getline} into a variable
- from a coprocess.
-* Getline Notes:: Important things to know about
- @code{getline}.
-* Getline Summary:: Summary of @code{getline} Variants.
-* Command line directories:: What happens if you put a directory on
- the command line.
-* Print:: The @code{print} statement.
-* Print Examples:: Simple examples of @code{print}
- statements.
-* Output Separators:: The output separators and how to change
- them.
-* OFMT:: Controlling Numeric Output With
- @code{print}.
-* Printf:: The @code{printf} statement.
-* Basic Printf:: Syntax of the @code{printf} statement.
-* Control Letters:: Format-control letters.
-* Format Modifiers:: Format-specification modifiers.
-* Printf Examples:: Several examples.
-* Redirection:: How to redirect output to multiple
- files and pipes.
-* Special Files:: File name interpretation in
- @command{gawk}. @command{gawk} allows
- access to inherited file descriptors.
-* Special FD:: Special files for I/O.
-* Special Network:: Special files for network
- communications.
-* Special Caveats:: Things to watch out for.
-* Close Files And Pipes:: Closing Input and Output Files and
- Pipes.
-* Values:: Constants, Variables, and Regular
- Expressions.
-* Constants:: String, numeric and regexp constants.
-* Scalar Constants:: Numeric and string constants.
-* Nondecimal-numbers:: What are octal and hex numbers.
-* Regexp Constants:: Regular Expression constants.
-* Using Constant Regexps:: When and how to use a regexp constant.
-* Variables:: Variables give names to values for
- later use.
-* Using Variables:: Using variables in your programs.
-* Assignment Options:: Setting variables on the command-line
- and a summary of command-line syntax.
- This is an advanced method of input.
-* Conversion:: The conversion of strings to numbers
- and vice versa.
-* All Operators:: @command{gawk}'s operators.
-* Arithmetic Ops:: Arithmetic operations (@samp{+},
- @samp{-}, etc.)
-* Concatenation:: Concatenating strings.
-* Assignment Ops:: Changing the value of a variable or a
- field.
-* Increment Ops:: Incrementing the numeric value of a
- variable.
-* Truth Values and Conditions:: Testing for true and false.
-* Truth Values:: What is ``true'' and what is ``false''.
-* Typing and Comparison:: How variables acquire types and how
- this affects comparison of numbers and
- strings with @samp{<}, etc.
-* Variable Typing:: String type versus numeric type.
-* Comparison Operators:: The comparison operators.
-* POSIX String Comparison:: String comparison with POSIX rules.
-* Boolean Ops:: Combining comparison expressions using
- boolean operators @samp{||} (``or''),
- @samp{&&} (``and'') and @samp{!}
- (``not'').
-* Conditional Exp:: Conditional expressions select between
- two subexpressions under control of a
- third subexpression.
-* Function Calls:: A function call is an expression.
-* Precedence:: How various operators nest.
-* Locales:: How the locale affects things.
-* Pattern Overview:: What goes into a pattern.
-* Regexp Patterns:: Using regexps as patterns.
-* Expression Patterns:: Any expression can be used as a
- pattern.
-* Ranges:: Pairs of patterns specify record
- ranges.
-* BEGIN/END:: Specifying initialization and cleanup
- rules.
-* Using BEGIN/END:: How and why to use BEGIN/END rules.
-* I/O And BEGIN/END:: I/O issues in BEGIN/END rules.
-* BEGINFILE/ENDFILE:: Two special patterns for advanced
- control.
-* Empty:: The empty pattern, which matches every
- record.
-* Using Shell Variables:: How to use shell variables with
- @command{awk}.
-* Action Overview:: What goes into an action.
-* Statements:: Describes the various control
- statements in detail.
-* If Statement:: Conditionally execute some
- @command{awk} statements.
-* While Statement:: Loop until some condition is satisfied.
-* Do Statement:: Do specified action while looping until
- 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 loop.
-* Next Statement:: Stop processing the current input
- record.
-* Nextfile Statement:: Stop processing the current file.
-* Exit Statement:: Stop execution of @command{awk}.
-* Built-in Variables:: Summarizes the built-in variables.
-* User-modified:: Built-in variables that you change to
- control @command{awk}.
-* Auto-set:: Built-in variables where @command{awk}
- gives you information.
-* ARGC and ARGV:: Ways to use @code{ARGC} and
- @code{ARGV}.
-* Array Basics:: The basics of arrays.
-* Array Intro:: Introduction to Arrays
-* Reference to Elements:: How to examine one element of an array.
-* Assigning Elements:: How to change an element of an array.
-* Array Example:: Basic Example of an Array
-* Scanning an Array:: A variation of the @code{for}
- statement. It loops through the indices
- of an array's existing elements.
-* Delete:: The @code{delete} statement removes an
- element from an array.
-* Numeric Array Subscripts:: How to use numbers as subscripts in
- @command{awk}.
-* Uninitialized Subscripts:: Using Uninitialized variables as
- subscripts.
-* Multi-dimensional:: Emulating multidimensional arrays in
- @command{awk}.
-* Multi-scanning:: Scanning multidimensional arrays.
-* Arrays of Arrays:: True multidimensional arrays.
-* Built-in:: Summarizes the built-in functions.
-* Calling Built-in:: How to call built-in functions.
-* Numeric Functions:: Functions that work with numbers,
- including @code{int()}, @code{sin()}
- and @code{rand()}.
-* String Functions:: Functions for string manipulation, such
- as @code{split()}, @code{match()} and
- @code{sprintf()}.
-* Gory Details:: More than you want to know about
- @samp{\} and @samp{&} with
- @code{sub()}, @code{gsub()}, and
- @code{gensub()}.
-* I/O Functions:: Functions for files and shell commands.
-* Time Functions:: Functions for dealing with timestamps.
-* Bitwise Functions:: Functions for bitwise operations.
-* Type Functions:: Functions for type information.
-* I18N Functions:: Functions for string translation.
-* User-defined:: Describes User-defined functions in
- detail.
-* Definition Syntax:: How to write definitions and what they
- mean.
-* Function Example:: An example function definition and what
- it does.
-* Function Caveats:: Things to watch out for.
-* Calling A Function:: Don't use spaces.
-* Variable Scope:: Controlling variable scope.
-* Pass By Value/Reference:: Passing parameters.
-* Return Statement:: Specifying the value a function
- returns.
-* Dynamic Typing:: How variable types can change at
- runtime.
-* Indirect Calls:: Choosing the function to call at
- runtime.
-* I18N and L10N:: Internationalization and Localization.
-* Explaining gettext:: How GNU @code{gettext} works.
-* Programmer i18n:: Features for the programmer.
-* Translator i18n:: Features for the translator.
-* String Extraction:: Extracting marked strings.
-* Printf Ordering:: Rearranging @code{printf} arguments.
-* I18N Portability:: @command{awk}-level portability issues.
-* I18N Example:: A simple i18n example.
-* Gawk I18N:: @command{gawk} is also
- internationalized.
-* Nondecimal Data:: Allowing nondecimal input data.
-* Array Sorting:: Facilities for controlling array
- traversal and sorting arrays.
-* Controlling Array Traversal:: How to use PROCINFO["sorted_in"].
-* Controlling Scanning With A Function:: Using a function to control scanning.
-* Controlling Scanning:: Controlling the order in which arrays
- are scanned.
-* Array Sorting Functions:: How to use @code{asort()} and
- @code{asorti()}.
-* Two-way I/O:: Two-way communications with another
- process.
-* TCP/IP Networking:: Using @command{gawk} for network
- programming.
-* Profiling:: Profiling your @command{awk} programs.
-* Library Names:: How to best name private global
- variables in library functions.
-* General Functions:: Functions that are of general use.
-* Strtonum Function:: A replacement for the built-in
- @code{strtonum()} function.
-* Assert Function:: A function for assertions in
- @command{awk} programs.
-* Round Function:: A function for rounding if
- @code{sprintf()} does not do it
- correctly.
-* Cliff Random Function:: The Cliff Random Number Generator.
-* Ordinal Functions:: Functions for using characters as
- numbers and vice versa.
-* Join Function:: A function to join an array into a
- string.
-* Gettimeofday Function:: A function to get formatted times.
-* Data File Management:: Functions for managing 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.
-* Getopt Function:: A function for processing command-line
- arguments.
-* Passwd Functions:: Functions for getting user information.
-* Group Functions:: Functions for getting group
- information.
-* Walking Arrays:: A function to walk arrays of arrays.
-* Running Examples:: How to run these examples.
-* Clones:: Clones of common utilities.
-* Cut Program:: The @command{cut} utility.
-* Egrep Program:: The @command{egrep} utility.
-* Id Program:: The @command{id} utility.
-* Split Program:: The @command{split} utility.
-* Tee Program:: The @command{tee} utility.
-* Uniq Program:: The @command{uniq} utility.
-* Wc Program:: The @command{wc} utility.
-* Miscellaneous Programs:: Some interesting @command{awk}
- programs.
-* Dupword Program:: Finding duplicated words in a document.
-* Alarm Program:: An alarm clock.
-* Translate Program:: A program similar to the @command{tr}
- utility.
-* Labels Program:: Printing mailing labels.
-* Word Sorting:: A program to produce a word usage
- count.
-* History Sorting:: Eliminating duplicate entries from a
- history file.
-* Extract Program:: Pulling out programs from Texinfo
- source files.
-* Simple Sed:: A Simple Stream Editor.
-* Igawk Program:: A wrapper for @command{awk} that
- includes files.
-* Anagram Program:: Finding anagrams from a dictionary.
-* Signature Program:: People do amazing things with too much
- time on their hands.
-* Debugging:: Introduction to @command{dgawk}.
-* Debugging Concepts:: Debugging In General.
-* Debugging Terms:: Additional Debugging Concepts.
-* Awk Debugging:: Awk Debugging.
-* Sample dgawk session:: Sample @command{dgawk} session.
-* dgawk invocation:: @command{dgawk} Invocation.
-* Finding The Bug:: Finding The Bug.
-* List of Debugger Commands:: Main @command{dgawk} Commands.
-* Breakpoint Control:: Control of breakpoints.
-* Dgawk Execution Control:: Control of execution.
-* Viewing And Changing Data:: Viewing and changing data.
-* Dgawk Stack:: Dealing with the stack.
-* Dgawk Info:: Obtaining information about the program
- and the debugger state.
-* Miscellaneous Dgawk Commands:: Miscellaneous Commands.
-* Readline Support:: Readline Support.
-* Dgawk Limitations:: Limitations and future plans.
-* V7/SVR3.1:: The major changes between V7 and System
- V Release 3.1.
-* SVR4:: Minor changes between System V Releases
- 3.1 and 4.
-* POSIX:: New features from the POSIX standard.
-* BTL:: New features from Brian Kernighan's
- version of @command{awk}.
-* POSIX/GNU:: The extensions in @command{gawk} not in
- POSIX @command{awk}.
-* Common Extensions:: Common Extensions Summary.
-* Ranges and Locales:: How locales used to affect regexp
- ranges.
-* Contributors:: The major contributors to
- @command{gawk}.
-* Gawk Distribution:: What is in the @command{gawk}
- distribution.
-* Getting:: How to get the distribution.
-* Extracting:: How to extract the distribution.
-* Distribution contents:: What is in the distribution.
-* Unix Installation:: Installing @command{gawk} under various
- versions of Unix.
-* Quick Installation:: Compiling @command{gawk} under Unix.
-* Additional Configuration Options:: Other compile-time options.
-* Configuration Philosophy:: How it's all supposed to work.
-* Non-Unix Installation:: Installation on Other Operating
- Systems.
-* 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,
- Windows32, and OS/2.
-* PC Testing:: Testing @command{gawk} on PC systems.
-* PC Using:: Running @command{gawk} on MS-DOS,
- Windows32 and OS/2.
-* Cygwin:: Building and running @command{gawk} for
- Cygwin.
-* MSYS:: Using @command{gawk} In The MSYS
- Environment.
-* VMS Installation:: Installing @command{gawk} on VMS.
-* VMS Compilation:: How to compile @command{gawk} under
- VMS.
-* VMS Installation Details:: How to install @command{gawk} under
- VMS.
-* VMS Running:: How to run @command{gawk} under VMS.
-* VMS Old Gawk:: An old version comes with some VMS
- systems.
-* Bugs:: Reporting Problems and Bugs.
-* Other Versions:: Other freely available @command{awk}
- implementations.
-* Compatibility Mode:: How to disable certain @command{gawk}
- extensions.
-* Additions:: Making Additions To @command{gawk}.
-* Accessing The Source:: Accessing the Git repository.
-* Adding Code:: Adding code to the main body of
- @command{gawk}.
-* New Ports:: Porting @command{gawk} to a new
- operating system.
-* Dynamic Extensions:: Adding new built-in functions to
- @command{gawk}.
-* Internals:: A brief look at some @command{gawk}
- internals.
-* Plugin License:: A note about licensing.
-* Sample Library:: A example of new functions.
-* Internal File Description:: What the new functions will do.
-* Internal File Ops:: The code for internal file operations.
-* Using Internal File Ops:: How to use an external extension.
-* Future Extensions:: New features that may be implemented
- one day.
-* Basic High Level:: The high level view.
-* Basic Data Typing:: A very quick intro to data types.
-* Floating Point Issues:: Stuff to know about floating-point
- numbers.
-* String Conversion Precision:: The String Value Can Lie.
-* Unexpected Results:: Floating Point Numbers Are Not Abstract
- Numbers.
-* POSIX Floating Point Problems:: Standards Versus Existing Practice.
+* History:: The history of @command{gawk} and
+ @command{awk}.
+* Names:: What name to use to find @command{awk}.
+* This Manual:: Using this @value{DOCUMENT}. Includes
+ sample input files that you can use.
+* Conventions:: Typographical Conventions.
+* Manual History:: Brief history of the GNU project and this
+ @value{DOCUMENT}.
+* How To Contribute:: Helping to save the world.
+* Acknowledgments:: Acknowledgments.
+* Running gawk:: How to run @command{gawk} programs;
+ includes command-line syntax.
+* One-shot:: Running a short throwaway @command{awk}
+ program.
+* Read Terminal:: Using no input files (input from terminal
+ instead).
+* Long:: Putting permanent @command{awk} programs in
+ files.
+* Executable Scripts:: Making self-contained @command{awk}
+ programs.
+* Comments:: Adding documentation to @command{gawk}
+ programs.
+* Quoting:: More discussion of shell quoting issues.
+* DOS Quoting:: Quoting in Windows Batch Files.
+* Sample Data Files:: Sample data files for use in the
+ @command{awk} programs illustrated in this
+ @value{DOCUMENT}.
+* Very Simple:: A very simple example.
+* Two Rules:: A less simple one-line example using two
+ rules.
+* More Complex:: A more complex example.
+* Statements/Lines:: Subdividing or combining statements into
+ lines.
+* Other Features:: Other Features of @command{awk}.
+* When:: When to use @command{gawk} and when to use
+ other things.
+* Command Line:: How to run @command{awk}.
+* Options:: Command-line options and their meanings.
+* Other Arguments:: Input file names and variable assignments.
+* Naming Standard Input:: How to specify standard input with other
+ files.
+* Environment Variables:: The environment variables @command{gawk}
+ uses.
+* AWKPATH Variable:: Searching directories for @command{awk}
+ programs.
+* Other Environment Variables:: The environment variables.
+* Exit Status:: @command{gawk}'s exit status.
+* Include Files:: Including other files into your program.
+* Obsolete:: Obsolete Options and/or features.
+* Undocumented:: Undocumented Options and Features.
+* Regexp Usage:: How to Use Regular Expressions.
+* Escape Sequences:: How to write nonprinting characters.
+* Regexp Operators:: Regular Expression Operators.
+* Bracket Expressions:: What can go between @samp{[...]}.
+* GNU Regexp Operators:: Operators specific to GNU software.
+* Case-sensitivity:: How to do case-insensitive matching.
+* Leftmost Longest:: How much text matches.
+* Computed Regexps:: Using Dynamic Regexps.
+* Records:: Controlling how data is split into records.
+* Fields:: An introduction to fields.
+* Nonconstant Fields:: Nonconstant Field Numbers.
+* Changing Fields:: Changing the Contents of a Field.
+* Field Separators:: The field separator and how to change it.
+* Default Field Splitting:: How fields are normally separated.
+* Regexp Field Splitting:: Using regexps as the field separator.
+* Single Character Fields:: Making each character a separate field.
+* Command Line Field Separator:: Setting @code{FS} from the command-line.
+* Field Splitting Summary:: Some final points and a summary table.
+* Constant Size:: Reading constant width data.
+* Splitting By Content:: Defining Fields By Content
+* Multiple Line:: Reading multi-line records.
+* Getline:: Reading files under explicit program
+ control using the @code{getline} function.
+* Plain Getline:: Using @code{getline} with no arguments.
+* Getline/Variable:: Using @code{getline} into a variable.
+* Getline/File:: Using @code{getline} from a file.
+* Getline/Variable/File:: Using @code{getline} into a variable from a
+ file.
+* Getline/Pipe:: Using @code{getline} from a pipe.
+* Getline/Variable/Pipe:: Using @code{getline} into a variable from a
+ pipe.
+* Getline/Coprocess:: Using @code{getline} from a coprocess.
+* Getline/Variable/Coprocess:: Using @code{getline} into a variable from a
+ coprocess.
+* Getline Notes:: Important things to know about
+ @code{getline}.
+* Getline Summary:: Summary of @code{getline} Variants.
+* Read Timeout:: Reading input with a timeout.
+* Command line directories:: What happens if you put a directory on the
+ command line.
+* Print:: The @code{print} statement.
+* Print Examples:: Simple examples of @code{print} statements.
+* Output Separators:: The output separators and how to change
+ them.
+* OFMT:: Controlling Numeric Output With
+ @code{print}.
+* Printf:: The @code{printf} statement.
+* Basic Printf:: Syntax of the @code{printf} statement.
+* Control Letters:: Format-control letters.
+* Format Modifiers:: Format-specification modifiers.
+* Printf Examples:: Several examples.
+* Redirection:: How to redirect output to multiple files
+ and pipes.
+* Special Files:: File name interpretation in @command{gawk}.
+ @command{gawk} allows access to inherited
+ file descriptors.
+* Special FD:: Special files for I/O.
+* Special Network:: Special files for network communications.
+* Special Caveats:: Things to watch out for.
+* Close Files And Pipes:: Closing Input and Output Files and Pipes.
+* Values:: Constants, Variables, and Regular
+ Expressions.
+* Constants:: String, numeric and regexp constants.
+* Scalar Constants:: Numeric and string constants.
+* Nondecimal-numbers:: What are octal and hex numbers.
+* Regexp Constants:: Regular Expression constants.
+* Using Constant Regexps:: When and how to use a regexp constant.
+* Variables:: Variables give names to values for later
+ use.
+* Using Variables:: Using variables in your programs.
+* Assignment Options:: Setting variables on the command-line and a
+ summary of command-line syntax. This is an
+ advanced method of input.
+* Conversion:: The conversion of strings to numbers and
+ vice versa.
+* All Operators:: @command{gawk}'s operators.
+* Arithmetic Ops:: Arithmetic operations (@samp{+}, @samp{-},
+ etc.)
+* Concatenation:: Concatenating strings.
+* Assignment Ops:: Changing the value of a variable or a
+ field.
+* Increment Ops:: Incrementing the numeric value of a
+ variable.
+* Truth Values and Conditions:: Testing for true and false.
+* Truth Values:: What is ``true'' and what is ``false''.
+* Typing and Comparison:: How variables acquire types and how this
+ affects comparison of numbers and strings
+ with @samp{<}, etc.
+* Variable Typing:: String type versus numeric type.
+* Comparison Operators:: The comparison operators.
+* POSIX String Comparison:: String comparison with POSIX rules.
+* Boolean Ops:: Combining comparison expressions using
+ boolean operators @samp{||} (``or''),
+ @samp{&&} (``and'') and @samp{!} (``not'').
+* Conditional Exp:: Conditional expressions select between two
+ subexpressions under control of a third
+ subexpression.
+* Function Calls:: A function call is an expression.
+* Precedence:: How various operators nest.
+* Locales:: How the locale affects things.
+* Pattern Overview:: What goes into a pattern.
+* Regexp Patterns:: Using regexps as patterns.
+* Expression Patterns:: Any expression can be used as a pattern.
+* Ranges:: Pairs of patterns specify record ranges.
+* BEGIN/END:: Specifying initialization and cleanup
+ rules.
+* Using BEGIN/END:: How and why to use BEGIN/END rules.
+* I/O And BEGIN/END:: I/O issues in BEGIN/END rules.
+* BEGINFILE/ENDFILE:: Two special patterns for advanced control.
+* Empty:: The empty pattern, which matches every
+ record.
+* Using Shell Variables:: How to use shell variables with
+ @command{awk}.
+* Action Overview:: What goes into an action.
+* Statements:: Describes the various control statements in
+ detail.
+* If Statement:: Conditionally execute some @command{awk}
+ statements.
+* While Statement:: Loop until some condition is satisfied.
+* Do Statement:: Do specified action while looping until
+ 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
+ loop.
+* Next Statement:: Stop processing the current input record.
+* Nextfile Statement:: Stop processing the current file.
+* Exit Statement:: Stop execution of @command{awk}.
+* Built-in Variables:: Summarizes the built-in variables.
+* User-modified:: Built-in variables that you change to
+ control @command{awk}.
+* Auto-set:: Built-in variables where @command{awk}
+ gives you information.
+* ARGC and ARGV:: Ways to use @code{ARGC} and @code{ARGV}.
+* Array Basics:: The basics of arrays.
+* Array Intro:: Introduction to Arrays
+* Reference to Elements:: How to examine one element of an array.
+* Assigning Elements:: How to change an element of an array.
+* Array Example:: Basic Example of an Array
+* Scanning an Array:: A variation of the @code{for} statement. It
+ loops through the indices of an array's
+ existing elements.
+* Controlling Scanning:: Controlling the order in which arrays are
+ scanned.
+* Delete:: The @code{delete} statement removes an
+ element from an array.
+* Numeric Array Subscripts:: How to use numbers as subscripts in
+ @command{awk}.
+* Uninitialized Subscripts:: Using Uninitialized variables as
+ subscripts.
+* Multi-dimensional:: Emulating multidimensional arrays in
+ @command{awk}.
+* Multi-scanning:: Scanning multidimensional arrays.
+* Arrays of Arrays:: True multidimensional arrays.
+* Built-in:: Summarizes the built-in functions.
+* Calling Built-in:: How to call built-in functions.
+* Numeric Functions:: Functions that work with numbers, including
+ @code{int()}, @code{sin()} and
+ @code{rand()}.
+* String Functions:: Functions for string manipulation, such as
+ @code{split()}, @code{match()} and
+ @code{sprintf()}.
+* Gory Details:: More than you want to know about @samp{\}
+ and @samp{&} with @code{sub()},
+ @code{gsub()}, and @code{gensub()}.
+* I/O Functions:: Functions for files and shell commands.
+* Time Functions:: Functions for dealing with timestamps.
+* Bitwise Functions:: Functions for bitwise operations.
+* Type Functions:: Functions for type information.
+* I18N Functions:: Functions for string translation.
+* User-defined:: Describes User-defined functions in detail.
+* Definition Syntax:: How to write definitions and what they
+ mean.
+* Function Example:: An example function definition and what it
+ does.
+* Function Caveats:: Things to watch out for.
+* Calling A Function:: Don't use spaces.
+* Variable Scope:: Controlling variable scope.
+* Pass By Value/Reference:: Passing parameters.
+* Return Statement:: Specifying the value a function returns.
+* Dynamic Typing:: How variable types can change at runtime.
+* Indirect Calls:: Choosing the function to call at runtime.
+* I18N and L10N:: Internationalization and Localization.
+* Explaining gettext:: How GNU @code{gettext} works.
+* Programmer i18n:: Features for the programmer.
+* Translator i18n:: Features for the translator.
+* String Extraction:: Extracting marked strings.
+* Printf Ordering:: Rearranging @code{printf} arguments.
+* I18N Portability:: @command{awk}-level portability issues.
+* I18N Example:: A simple i18n example.
+* Gawk I18N:: @command{gawk} is also internationalized.
+* Nondecimal Data:: Allowing nondecimal input data.
+* Array Sorting:: Facilities for controlling array traversal
+ and sorting arrays.
+* Controlling Array Traversal:: How to use PROCINFO["sorted_in"].
+* Array Sorting Functions:: How to use @code{asort()} and
+ @code{asorti()}.
+* Two-way I/O:: Two-way communications with another
+ process.
+* TCP/IP Networking:: Using @command{gawk} for network
+ programming.
+* Profiling:: Profiling your @command{awk} programs.
+* Library Names:: How to best name private global variables
+ in library functions.
+* General Functions:: Functions that are of general use.
+* Strtonum Function:: A replacement for the built-in
+ @code{strtonum()} function.
+* Assert Function:: A function for assertions in @command{awk}
+ programs.
+* Round Function:: A function for rounding if @code{sprintf()}
+ does not do it correctly.
+* Cliff Random Function:: The Cliff Random Number Generator.
+* Ordinal Functions:: Functions for using characters as numbers
+ and vice versa.
+* Join Function:: A function to join an array into a string.
+* Gettimeofday Function:: A function to get formatted times.
+* Data File Management:: Functions for managing 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.
+* Getopt Function:: A function for processing command-line
+ arguments.
+* Passwd Functions:: Functions for getting user information.
+* Group Functions:: Functions for getting group information.
+* Walking Arrays:: A function to walk arrays of arrays.
+* Running Examples:: How to run these examples.
+* Clones:: Clones of common utilities.
+* Cut Program:: The @command{cut} utility.
+* Egrep Program:: The @command{egrep} utility.
+* Id Program:: The @command{id} utility.
+* Split Program:: The @command{split} utility.
+* Tee Program:: The @command{tee} utility.
+* Uniq Program:: The @command{uniq} utility.
+* Wc Program:: The @command{wc} utility.
+* Miscellaneous Programs:: Some interesting @command{awk} programs.
+* Dupword Program:: Finding duplicated words in a document.
+* Alarm Program:: An alarm clock.
+* Translate Program:: A program similar to the @command{tr}
+ utility.
+* Labels Program:: Printing mailing labels.
+* Word Sorting:: A program to produce a word usage count.
+* History Sorting:: Eliminating duplicate entries from a
+ history file.
+* Extract Program:: Pulling out programs from Texinfo source
+ files.
+* Simple Sed:: A Simple Stream Editor.
+* Igawk Program:: A wrapper for @command{awk} that includes
+ files.
+* Anagram Program:: Finding anagrams from a dictionary.
+* Signature Program:: People do amazing things with too much time
+ on their hands.
+* Debugging:: Introduction to @command{gawk} Debugger.
+* Debugging Concepts:: Debugging in General.
+* Debugging Terms:: Additional Debugging Concepts.
+* Awk Debugging:: Awk Debugging.
+* Sample Debugging Session:: Sample Debugging Session.
+* Debugger Invocation:: How to Start the Debugger.
+* Finding The Bug:: Finding the Bug.
+* List of Debugger Commands:: Main Commands.
+* Breakpoint Control:: Control of Breakpoints.
+* Debugger Execution Control:: Control of Execution.
+* Viewing And Changing Data:: Viewing and Changing Data.
+* Execution Stack:: Dealing with the Stack.
+* Debugger Info:: Obtaining Information about the Program and
+ the Debugger State.
+* Miscellaneous Debugger Commands:: Miscellaneous Commands.
+* Readline Support:: Readline Support.
+* Limitations:: Limitations and Future Plans.
+* V7/SVR3.1:: The major changes between V7 and System V
+ Release 3.1.
+* SVR4:: Minor changes between System V Releases 3.1
+ and 4.
+* POSIX:: New features from the POSIX standard.
+* BTL:: New features from Brian Kernighan's version
+ of @command{awk}.
+* POSIX/GNU:: The extensions in @command{gawk} not in
+ POSIX @command{awk}.
+* Common Extensions:: Common Extensions Summary.
+* Ranges and Locales:: How locales used to affect regexp ranges.
+* Contributors:: The major contributors to @command{gawk}.
+* Gawk Distribution:: What is in the @command{gawk} distribution.
+* Getting:: How to get the distribution.
+* Extracting:: How to extract the distribution.
+* Distribution contents:: What is in the distribution.
+* Unix Installation:: Installing @command{gawk} under various
+ versions of Unix.
+* Quick Installation:: Compiling @command{gawk} under Unix.
+* Additional Configuration Options:: Other compile-time options.
+* Configuration Philosophy:: How it's all supposed to work.
+* Non-Unix Installation:: Installation on Other Operating Systems.
+* 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,
+ Windows32, and OS/2.
+* PC Testing:: Testing @command{gawk} on PC systems.
+* PC Using:: Running @command{gawk} on MS-DOS, Windows32
+ and OS/2.
+* Cygwin:: Building and running @command{gawk} for
+ Cygwin.
+* MSYS:: Using @command{gawk} In The MSYS
+ Environment.
+* VMS Installation:: Installing @command{gawk} on VMS.
+* VMS Compilation:: How to compile @command{gawk} under VMS.
+* VMS Installation Details:: How to install @command{gawk} under VMS.
+* VMS Running:: How to run @command{gawk} under VMS.
+* VMS Old Gawk:: An old version comes with some VMS systems.
+* Bugs:: Reporting Problems and Bugs.
+* Other Versions:: Other freely available @command{awk}
+ implementations.
+* Compatibility Mode:: How to disable certain @command{gawk}
+ extensions.
+* Additions:: Making Additions To @command{gawk}.
+* Accessing The Source:: Accessing the Git repository.
+* Adding Code:: Adding code to the main body of
+ @command{gawk}.
+* New Ports:: Porting @command{gawk} to a new operating
+ system.
+* Dynamic Extensions:: Adding new built-in functions to
+ @command{gawk}.
+* Internals:: A brief look at some @command{gawk}
+ internals.
+* Plugin License:: A note about licensing.
+* Loading Extensions:: How to load dynamic extensions.
+* Sample Library:: A example of new functions.
+* Internal File Description:: What the new functions will do.
+* Internal File Ops:: The code for internal file operations.
+* Using Internal File Ops:: How to use an external extension.
+* Future Extensions:: New features that may be implemented one
+ day.
+* Basic High Level:: The high level view.
+* Basic Data Typing:: A very quick intro to data types.
+* Floating Point Issues:: Stuff to know about floating-point numbers.
+* String Conversion Precision:: The String Value Can Lie.
+* Unexpected Results:: Floating Point Numbers Are Not Abstract
+ Numbers.
+* POSIX Floating Point Problems:: Standards Versus Existing Practice.
@end detailmenu
@end menu
@@ -1204,8 +1166,7 @@ provide many sample @command{awk} programs.
Reading them allows you to see @command{awk}
solving real problems.
-@ref{Debugger}, describes the @command{awk} debugger,
-@command{dgawk}.
+@ref{Debugger}, describes the @command{awk} debugger.
@ref{Language History},
describes how the @command{awk} language has evolved since
@@ -3141,6 +3102,19 @@ inadvertently use global variables that you meant to be local.
(This is a particularly easy mistake to make with simple variable
names like @code{i}, @code{j}, etc.)
+@item -D@r{[}@var{file}@r{]}
+@itemx --debug=@r{[}@var{file}@r{]}
+@cindex @code{-D} option
+@cindex @code{--debug} option
+@cindex @command{awk} debugging, enabling
+Enable debugging of @command{awk} programs
+(@pxref{Debugging}).
+By default, the debugger reads commands interactively from the terminal.
+The optional @var{file} argument allows you to specify a file with a list
+of commands for the debugger to execute non-interactively.
+No space is allowed between the @option{-D} and @var{file}, if
+@var{file} is supplied.
+
@item -e @var{program-text}
@itemx --source @var{program-text}
@cindex @code{-e} option
@@ -3206,6 +3180,15 @@ for information about this option.
Print a ``usage'' message summarizing the short and long style options
that @command{gawk} accepts and then exit.
+@item -l @var{lib}
+@itemx --load @var{lib}
+@cindex @code{-l} option
+@cindex @code{--load} option
+@cindex loading, library
+Load a shared library @var{lib}. This searches for the library using the @env{AWKPATH}
+environment variable. The suffix @samp{.so} in the library name is optional.
+The library initialization routine should be named @code{dlload()}.
+
@item -L @r{[}value@r{]}
@itemx --lint@r{[}=value@r{]}
@cindex @code{-l} option
@@ -3252,6 +3235,18 @@ Use with care.
Force the use of the locale's decimal point character
when parsing numeric input data (@pxref{Locales}).
+@item -o@r{[}@var{file}@r{]}
+@itemx --pretty-print@r{[}=@var{file}@r{]}
+@cindex @code{-o} option
+@cindex @code{--pretty-print} option
+@cindex @command{awk} enabling
+Enable pretty-printing of @command{awk} programs.
+By default, output program is created in a file named @file{awkprof.out}.
+The optional @var{file} argument allows you to specify a different
+@value{FN} for the output.
+No space is allowed between the @option{-o} and @var{file}, if
+@var{file} is supplied.
+
@item -O
@itemx --optimize
@cindex @code{--optimize} option
@@ -3264,7 +3259,7 @@ maintainer hopes to add more optimizations over time.
@itemx --profile@r{[}=@var{file}@r{]}
@cindex @code{-p} option
@cindex @code{--profile} option
-@cindex @command{awk} programs, profiling, enabling
+@cindex @command{awk} profiling, enabling
Enable profiling of @command{awk} programs
(@pxref{Profiling}).
By default, profiles are created in a file named @file{awkprof.out}.
@@ -3273,10 +3268,8 @@ The optional @var{file} argument allows you to specify a different
No space is allowed between the @option{-p} and @var{file}, if
@var{file} is supplied.
-When run with @command{gawk}, the profile is just a ``pretty printed'' version
-of the program. When run with @command{pgawk}, the profile contains execution
-counts for each statement in the program in the left margin, and function
-call counts for each function.
+The profile contains execution counts for each statement in the program
+in the left margin, and function call counts for each function.
@item -P
@itemx --posix
@@ -3340,14 +3333,6 @@ This is now @command{gawk}'s default behavior.
Nevertheless, this option remains both for backward compatibility,
and for use in combination with the @option{--traditional} option.
-@item -R @var{file}
-@itemx --command=@var{file}
-@cindex @code{-R} option
-@cindex @code{--command} option
-@command{dgawk} only.
-Read @command{dgawk} debugger options and commands from @var{file}.
-@xref{Dgawk Info}, for more information.
-
@item -S
@itemx --sandbox
@cindex @code{-S} option
@@ -3671,6 +3656,11 @@ Specifies the interval between connection retries,
in milliseconds. On systems that do not support
the @code{usleep()} system call,
the value is rounded up to an integral number of seconds.
+
+@item GAWK_READ_TIMEOUT
+Specifies the time, in milliseconds, for @command{gawk} to
+wait for input before returning with an error.
+@xref{Read Timeout}.
@end table
The environment variables in the following list are meant
@@ -3744,7 +3734,7 @@ into smaller, more manageable pieces, and also lets you reuse common @command{aw
code from various @command{awk} scripts. In other words, you can group
together @command{awk} functions, used to carry out specific tasks,
into external files. These files can be used just like function libraries,
-using the @samp{@@include} keyword in conjunction with the @code{AWKPATH}
+using the @samp{@@include} keyword in conjunction with the @env{AWKPATH}
environment variable.
Let's see an example.
@@ -5153,6 +5143,8 @@ used with it do not have to be named on the @command{awk} command line
* Multiple Line:: Reading multi-line records.
* Getline:: Reading files under explicit program control
using the @code{getline} function.
+* Read Timeout:: Reading input with a timeout.
+
* Command line directories:: What happens if you put a directory on the
command line.
@end menu
@@ -5746,7 +5738,7 @@ print $0 # or whatever else with $0
@end example
@noindent
-This forces @command{awk} rebuild the record. It does help
+This forces @command{awk} to rebuild the record. It does help
to add a comment, as we've shown here.
There is a flip side to the relationship between @code{$0} and
@@ -7231,6 +7223,110 @@ and whether the variant is standard or a @command{gawk} extension.
@c ENDOFRANGE inex
@c ENDOFRANGE infir
+@node Read Timeout
+@section Reading Input With A Timeout
+@cindex timeout, reading input
+
+You may specify a timeout in milliseconds for reading input from a terminal,
+pipe or two-way communication including, TCP/IP sockets. This can be done
+on a per input, command or connection basis, by setting a special element
+in the @code{PROCINFO} array:
+
+@example
+PROCINFO["input_name", "READ_TIMEOUT"] = @var{timeout in milliseconds}
+@end example
+
+When set, this will cause @command{gawk} to time out and return failure
+if no data is available to read within the specified timeout period.
+For example, a TCP client can decide to give up on receiving
+any response from the server after a certain amount of time:
+
+@example
+Service = "/inet/tcp/0/localhost/daytime"
+PROCINFO[Service, "READ_TIMEOUT"] = 100
+if ((Service |& getline) > 0)
+ print $0
+else if (ERRNO != "")
+ print ERRNO
+@end example
+
+Here is how to read interactively from the terminal@footnote{This assumes
+that standard input is the keyboard} without waiting
+for more than five seconds:
+
+@example
+PROCINFO["/dev/stdin", "READ_TIMEOUT"] = 5000
+while ((getline < "/dev/stdin") > 0)
+ print $0
+@end example
+
+@command{gawk} will terminate the read operation if input does not
+arrive after waiting for the timeout period, return failure
+and set the @code{ERRNO} variable to an appropriate string value.
+A negative or zero value for the timeout is the same as specifying
+no timeout at all.
+
+A timeout can also be set for reading from the terminal in the implicit
+loop that reads input records and matches them against patterns,
+like so:
+
+@example
+$ @kbd{ gawk 'BEGIN @{ PROCINFO["-", "READ_TIMEOUT"] = 5000 @}}
+> @kbd{@{ print "You entered: " $0 @}'}
+@kbd{gawk}
+@print{} You entered: gawk
+@end example
+
+In this case, failure to respond within five seconds results in the following
+error message:
+
+@example
+@error{} gawk: cmd. line:2: (FILENAME=- FNR=1) fatal: error reading input file `-': Connection timed out
+@end example
+
+The timeout can be set or changed at any time, and will take effect on the
+next attempt to read from the input device. In the following example,
+we start with a timeout value of one second, and progressively
+reduce it by one-tenth of a second until we wait indefinitely
+for the input to arrive:
+
+@example
+PROCINFO[Service, "READ_TIMEOUT"] = 1000
+while ((Service |& getline) > 0) @{
+ print $0
+ PROCINFO[S, "READ_TIMEOUT"] -= 100
+@}
+@end example
+
+@quotation NOTE
+You should not assume that the read operation will block
+exactly after the tenth record has been printed. It is possible that
+@command{gawk} will read and buffer more than one record's
+worth of data the first time. Because of this, changing the value
+of timeout like in the above example is not very useful.
+@end quotation
+
+If the @code{PROCINFO} element is not present and the environment
+variable @env{GAWK_READ_TIMEOUT} exists,
+@command{gawk} uses its value to initialize the timeout value.
+The exclusive use of the environment variable to specify timeout
+has the disadvantage of not being able to control it
+on a per command or connection basis.
+
+@command{gawk} considers a timeout event to be an error even though
+the attempt to read from the underlying device may
+succeed in a later attempt. This is a limitation, and it also
+means that you cannot use this to multiplex input from
+two or more sources.
+
+Assigning a timeout value prevents read operations from
+blocking indefinitely. But bear in mind that there are other ways
+@command{gawk} can stall waiting for an input device to be ready.
+A network client can sometimes take a long time to establish
+a connection before it can start reading any data,
+or the attempt to open a FIFO special file for reading can block
+indefinitely until some other process opens it for writing.
+
@node Command line directories
@section Directories On The Command Line
@cindex directories, command line
@@ -10948,7 +11044,7 @@ Special patterns for you to supply startup or cleanup actions for your
@item BEGINFILE
@itemx ENDFILE
-Special patterns for you to supply startup or cleanup actions to
+Special patterns for you to supply startup or cleanup actions to be
done on a per file basis.
(@xref{BEGINFILE/ENDFILE}.)
@@ -12063,8 +12159,8 @@ This program loops forever once @code{x} reaches 5.
@cindex dark corner, @code{continue} statement
@cindex @command{gawk}, @code{continue} statement in
The @code{continue} statement has no special meaning with respect to the
-@code{switch} statement, nor does it any meaning when used outside the body of
-a loop. Historical versions of @command{awk} treated a @code{continue}
+@code{switch} statement, nor does it have any meaning when used outside the
+body of a loop. Historical versions of @command{awk} treated a @code{continue}
statement outside a loop the same way they treated a @code{break}
statement outside a loop: as if it were a @code{next}
statement
@@ -13054,6 +13150,8 @@ an array.
* Scanning an Array:: A variation of the @code{for} statement. It
loops through the indices of an array's
existing elements.
+* Controlling Scanning:: Controlling the order in which arrays are
+ scanned.
@end menu
@node Array Intro
@@ -13441,11 +13539,151 @@ 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.
-As an extension, @command{gawk} makes it possible for you to
-loop over the elements of an array in order, based on the value of
-@code{PROCINFO["sorted_in"]} (@pxref{Auto-set}).
-This is an advanced feature, so discussion of it is delayed
-until @ref{Controlling Array Traversal}.
+@node Controlling Scanning
+@subsection Using Predefined Array Scanning Orders
+
+By default, when a @code{for} loop traverses an array, the order
+is undefined, meaning that the @command{awk} implementation
+determines the order in which the array is traversed.
+This order is usually based on the internal implementation of arrays
+and will vary from one version of @command{awk} to the next.
+
+Often, though, you may wish to do something simple, such as
+``traverse the array by comparing the indices in ascending order,''
+or ``traverse the array by on comparing the values in descending order.''
+@command{gawk} provides two mechanisms which give you this control.
+
+@itemize @bullet
+@item
+Set @code{PROCINFO["sorted_in"]} to one of a set of predefined values.
+We describe this now.
+
+@item
+Set @code{PROCINFO["sorted_in"]} to the name of a user-defined function
+to be used for comparison of array elements. This advanced feature
+is described later, in @ref{Array Sorting}.
+@end itemize
+
+The following special values for @code{PROCINFO["sorted_in"]} are available:
+
+@table @code
+@item "@@unsorted"
+Array elements are processed in arbitrary order, which is the default
+@command{awk} behavior.
+
+@item "@@ind_str_asc"
+Order by indices compared as strings; this is the most basic sort.
+(Internally, array indices are always strings, so with @samp{a[2*5] = 1}
+the index is @code{"10"} rather than numeric 10.)
+
+@item "@@ind_num_asc"
+Order by indices but force them to be treated as numbers in the process.
+Any index with a non-numeric value will end up positioned as if it were zero.
+
+@item "@@val_type_asc"
+Order by element values rather than indices.
+Ordering is by the type assigned to the element
+(@pxref{Typing and Comparison}).
+All numeric values come before all string values,
+which in turn come before all subarrays.
+(Subarrays have not been described yet;
+@pxref{Arrays of Arrays}).
+
+@item "@@val_str_asc"
+Order by element values rather than by indices. Scalar values are
+compared as strings. Subarrays, if present, come out last.
+
+@item "@@val_num_asc"
+Order by element values rather than by indices. Scalar values are
+compared as numbers. Subarrays, if present, come out last.
+When numeric values are equal, the string values are used to provide
+an ordering: this guarantees consistent results across different
+versions of the C @code{qsort()} function,@footnote{When two elements
+compare as equal, the C @code{qsort()} function does not guarantee
+that they will maintain their original relative order after sorting.
+Using the string value to provide a unique ordering when the numeric
+values are equal ensures that @command{gawk} behaves consistently
+across different environments.} which @command{gawk} uses internally
+to perform the sorting.
+
+@item "@@ind_str_desc"
+Reverse order from the most basic sort.
+
+@item "@@ind_num_desc"
+Numeric indices ordered from high to low.
+
+@item "@@val_type_desc"
+Element values, based on type, in descending order.
+
+@item "@@val_str_desc"
+Element values, treated as strings, ordered from high to low.
+Subarrays, if present, come out first.
+
+@item "@@val_num_desc"
+Element values, treated as numbers, ordered from high to low.
+Subarrays, if present, come out first.
+@end table
+
+The array traversal order is determined before the @code{for} loop
+starts to run. Changing @code{PROCINFO["sorted_in"]} in the loop body
+will not affect the loop.
+
+For example:
+
+@example
+$ @kbd{gawk 'BEGIN @{}
+> @kbd{ a[4] = 4}
+> @kbd{ a[3] = 3}
+> @kbd{ for (i in a)}
+> @kbd{ print i, a[i]}
+> @kbd{@}'}
+@print{} 4 4
+@print{} 3 3
+$ @kbd{gawk 'BEGIN @{}
+> @kbd{ PROCINFO["sorted_in"] = "@@ind_str_asc"}
+> @kbd{ a[4] = 4}
+> @kbd{ a[3] = 3}
+> @kbd{ for (i in a)}
+> @kbd{ print i, a[i]}
+> @kbd{@}'}
+@print{} 3 3
+@print{} 4 4
+@end example
+
+When sorting an array by element values, if a value happens to be
+a subarray then it is considered to be greater than any string or
+numeric value, regardless of what the subarray itself contains,
+and all subarrays are treated as being equal to each other. Their
+order relative to each other is determined by their index strings.
+
+Here are some additional things to bear in mind about sorted
+array traversal.
+
+@itemize @bullet
+@item
+The value of @code{PROCINFO["sorted_in"]} is global. That is, it affects
+all array traversal @code{for} loops. If you need to change it within your
+own code, you should see if it's defined and save and restore the value:
+
+@example
+@dots{}
+if ("sorted_in" in PROCINFO) @{
+ save_sorted = PROCINFO["sorted_in"]
+ PROCINFO["sorted_in"] = "@@val_str_desc" # or whatever
+@}
+@dots{}
+if (save_sorted)
+ PROCINFO["sorted_in"] = save_sorted
+@end example
+
+@item
+As mentioned, the default array traversal order is represented by
+@code{"@@unsorted"}. You can also get the default behavior by assigning
+the null string to @code{PROCINFO["sorted_in"]} or by just deleting the
+@code{"sorted_in"} element from the @code{PROCINFO} array with
+the @code{delete} statement.
+(The @code{delete} statement hasn't been described yet; @pxref{Delete}.)
+@end itemize
In addition, @command{gawk} provides built-in functions for
sorting arrays; see @ref{Array Sorting Functions}.
@@ -13785,8 +14023,9 @@ the program produces the following output:
@subsection Scanning Multidimensional Arrays
There is no special @code{for} statement for scanning a
-``multidimensional'' array. There cannot be one, because, in truth, there
-are no multidimensional arrays or elements---there is only a
+``multidimensional'' array. There cannot be one, because, in truth,
+@command{awk} does not have
+multidimensional arrays or elements---there is only a
multidimensional @emph{way of accessing} an array.
@cindex subscripts in arrays, multidimensional, scanning
@@ -13813,7 +14052,7 @@ into the individual indices by breaking it apart where the value of
@code{SUBSEP} appears. The individual indices then become the elements of
the array @code{separate}.
-Thus, if a value is previously stored in @code{array[1, "foo"]}; then
+Thus, if a value is previously stored in @code{array[1, "foo"]}, then
an element with index @code{"1\034foo"} exists in @code{array}. (Recall
that the default value of @code{SUBSEP} is the character with code 034.)
Sooner or later, the @code{for} statement finds that index and does an
@@ -13833,7 +14072,8 @@ separate indices is recovered.
@node Arrays of Arrays
@section Arrays of Arrays
-@command{gawk} supports arrays of
+@command{gawk} goes beyond standard @command{awk}'s multidimensional
+array access and provides true arrays of
arrays. Elements of a subarray are referred to by their own indices
enclosed in square brackets, just like the elements of the main array.
For example, the following creates a two-element subarray at index @samp{1}
@@ -18162,8 +18402,8 @@ leads to less surprising results.
@node Array Sorting
@section Controlling Array Traversal and Array Sorting
-@command{gawk} lets you control the order in which @samp{for (i in array)} loops
-will traverse an array.
+@command{gawk} lets you control the order in which a @samp{for (i in array)}
+loop traverses an array.
In addition, two built-in functions, @code{asort()} and @code{asorti()},
let you sort arrays based on the array values and indices, respectively.
@@ -18184,18 +18424,14 @@ the internal implementation of arrays inside @command{awk}.
Often, though, it is desirable to be able to loop over the elements
in a particular order that you, the programmer, choose. @command{gawk}
-lets you do this; this @value{SUBSECTION} describes how.
+lets you do this.
-@menu
-* Controlling Scanning With A Function:: Using a function to control scanning.
-* Controlling Scanning:: Controlling the order in which arrays
- are scanned.
-@end menu
-
-@node Controlling Scanning With A Function
-@subsubsection Array Scanning Using A User-defined Function
+@ref{Controlling Scanning}, describes how you can assign special,
+pre-defined values to @code{PROCINFO["sorted_in"]} in order to
+control the order in which @command{gawk} will traverse an array
+during a @code{for} loop.
-The value of @code{PROCINFO["sorted_in"]} can be a function name.
+In addition, the value of @code{PROCINFO["sorted_in"]} can be a function name.
This lets you traverse an array based on any custom criterion.
The array elements are ordered according to the return value of this
function. The comparison function should be defined with at least
@@ -18212,8 +18448,9 @@ function comp_func(i1, v1, i2, v2)
Here, @var{i1} and @var{i2} are the indices, and @var{v1} and @var{v2}
are the corresponding values of the two elements being compared.
Either @var{v1} or @var{v2}, or both, can be arrays if the array being
-traversed contains subarrays as values. The three possible return values
-are interpreted this way:
+traversed contains subarrays as values.
+(@xref{Arrays of Arrays}, for more information about subarrays.)
+The three possible return values are interpreted as follows:
@table @code
@item comp_func(i1, v1, i2, v2) < 0
@@ -18314,7 +18551,7 @@ $ @kbd{gawk -f compdemo.awk}
@print{} data[10] = one
@print{} data[20] = two
@print{}
-@print{} Sort function: cmp_num_str_val @ii{Sort all numbers before all strings}
+@print{} Sort function: cmp_num_str_val @ii{Sort all numeric values before all strings}
@print{} data[one] = 10
@print{} data[two] = 20
@print{} data[100] = 100
@@ -18323,7 +18560,7 @@ $ @kbd{gawk -f compdemo.awk}
@end example
Consider sorting the entries of a GNU/Linux system password file
-according to login names. The following program sorts records
+according to login name. The following program sorts records
by a specific field position and can be used for this purpose:
@example
@@ -18354,8 +18591,8 @@ END @{
@end example
The first field in each entry of the password file is the user's login name,
-and the fields are seperated by colons.
-Each record defines a subarray (@pxref{Arrays of Arrays}),
+and the fields are separated by colons.
+Each record defines a subarray,
with each field as an element in the subarray.
Running the program produces the
following output:
@@ -18445,122 +18682,6 @@ sorted array traversal is not the default.
@c maintainers believe that only the people who wish to use a
@c feature should have to pay for it.
-@node Controlling Scanning
-@subsubsection Controlling Array Scanning Order
-
-As described in
-@iftex
-the previous subsubsection,
-@end iftex
-@ifnottex
-@ref{Controlling Scanning With A Function},
-@end ifnottex
-you can provide the name of a function as the value of
-@code{PROCINFO["sorted_in"]} to specify custom sorting criteria.
-
-Often, though, you may wish to do something simple, such as
-``sort based on comparing the indices in ascending order,''
-or ``sort based on comparing the values in descending order.''
-Having to write a simple comparison function for this purpose
-for use in all of your programs becomes tedious.
-For the common simple cases, @command{gawk} provides
-the option of supplying special names that do the requested
-sorting for you.
-You can think of them as ``predefined'' sorting functions,
-if you like, although the names purposely include characters
-that are not valid in real @command{awk} function names.
-
-The following special values are available:
-
-@table @code
-@item "@@ind_str_asc"
-Order by indices compared as strings; this is the most basic sort.
-(Internally, array indices are always strings, so with @samp{a[2*5] = 1}
-the index is @code{"10"} rather than numeric 10.)
-
-@item "@@ind_num_asc"
-Order by indices but force them to be treated as numbers in the process.
-Any index with a non-numeric value will end up positioned as if it were zero.
-
-@item "@@val_type_asc"
-Order by element values rather than indices.
-Ordering is by the type assigned to the element
-(@pxref{Typing and Comparison}).
-All numeric values come before all string values,
-which in turn come before all subarrays.
-
-@item "@@val_str_asc"
-Order by element values rather than by indices. Scalar values are
-compared as strings. Subarrays, if present, come out last.
-
-@item "@@val_num_asc"
-Order by element values rather than by indices. Scalar values are
-compared as numbers. Subarrays, if present, come out last.
-When numeric values are equal, the string values are used to provide
-an ordering: this guarantees consistent results across different
-versions of the C @code{qsort()} function.@footnote{When two elements
-compare as equal, the C @code{qsort()} function does not guarantee
-that they will maintain their original relative order after sorting.
-Using the string value to provide a unique ordering when the numeric
-values are equal ensures that @command{gawk} behaves consistently
-across different environments.}
-
-@item "@@ind_str_desc"
-Reverse order from the most basic sort.
-
-@item "@@ind_num_desc"
-Numeric indices ordered from high to low.
-
-@item "@@val_type_desc"
-Element values, based on type, in descending order.
-
-@item "@@val_str_desc"
-Element values, treated as strings, ordered from high to low.
-Subarrays, if present, come out first.
-
-@item "@@val_num_desc"
-Element values, treated as numbers, ordered from high to low.
-Subarrays, if present, come out first.
-
-@item "@@unsorted"
-Array elements are processed in arbitrary order, which is the normal
-@command{awk} behavior. You can also get the normal behavior by just
-deleting the @code{"sorted_in"} element from the @code{PROCINFO} array,
-if it previously had a value assigned to it.
-@end table
-
-The array traversal order is determined before the @code{for} loop
-starts to run. Changing @code{PROCINFO["sorted_in"]} in the loop body
-will not affect the loop.
-
-For example:
-
-@example
-$ @kbd{gawk 'BEGIN @{}
-> @kbd{ a[4] = 4}
-> @kbd{ a[3] = 3}
-> @kbd{ for (i in a)}
-> @kbd{ print i, a[i]}
-> @kbd{@}'}
-@print{} 4 4
-@print{} 3 3
-$ @kbd{gawk 'BEGIN @{}
-> @kbd{ PROCINFO["sorted_in"] = "@@ind_str_asc"}
-> @kbd{ a[4] = 4}
-> @kbd{ a[3] = 3}
-> @kbd{ for (i in a)}
-> @kbd{ print i, a[i]}
-> @kbd{@}'}
-@print{} 3 3
-@print{} 4 4
-@end example
-
-When sorting an array by element values, if a value happens to be
-a subarray then it is considered to be greater than any string or
-numeric value, regardless of what the subarray itself contains,
-and all subarrays are treated as being equal to each other. Their
-order relative to each other is determined by their index strings.
-
@node Array Sorting Functions
@subsection Sorting Array Values and Indices with @command{gawk}
@@ -18569,7 +18690,7 @@ order relative to each other is determined by their index strings.
@cindex @code{asort()} function (@command{gawk}), arrays@comma{} sorting
@cindex sort function, arrays, sorting
In most @command{awk} implementations, sorting an array requires
-writing a @code{sort} function.
+writing a @code{sort()} function.
While this can be educational for exploring different sorting algorithms,
usually that's not the point of the program.
@command{gawk} provides the built-in @code{asort()}
@@ -18588,7 +18709,10 @@ After the call to @code{asort()}, the array @code{data} is indexed from 1
to some number @var{n}, the total number of elements in @code{data}.
(This count is @code{asort()}'s return value.)
@code{data[1]} @value{LEQ} @code{data[2]} @value{LEQ} @code{data[3]}, and so on.
-The array elements are compared as strings.
+The comparison is based on the type of the elements
+(@pxref{Typing and Comparison}).
+All numeric values come before all string values,
+which in turn come before all subarrays.
@cindex side effects, @code{asort()} function
An important side effect of calling @code{asort()} is that
@@ -18607,12 +18731,11 @@ In this case, @command{gawk} copies the @code{source} array into the
@code{dest} array and then sorts @code{dest}, destroying its indices.
However, the @code{source} array is not affected.
-@code{asort()} accepts a third string argument
-to control comparison of array elements.
-As with @code{PROCINFO["sorted_in"]}, this argument may be the
-name of a user-defined function, or one of the predefined names
-that @command{gawk} provides
-(@pxref{Controlling Scanning With A Function}).
+@code{asort()} accepts a third string argument to control comparison of
+array elements. As with @code{PROCINFO["sorted_in"]}, this argument
+may be one of the predefined names that @command{gawk} provides
+(@pxref{Controlling Scanning}), or the name of a user-defined function
+(@pxref{Controlling Array Traversal}).
@quotation NOTE
In all cases, the sorted element values consist of the original
@@ -18967,40 +19090,32 @@ extensive examples.
@cindex @command{awk} programs, profiling
@c STARTOFRANGE proawk
@cindex profiling @command{awk} programs
-@c STARTOFRANGE pgawk
-@cindex @command{pgawk} program
-@cindex profiling @command{gawk}, See @command{pgawk} program
-
-You may produce execution
-traces of your @command{awk} programs.
-This is done with a specially compiled version of @command{gawk},
-called @command{pgawk} (``profiling @command{gawk}'').
-
+@cindex profiling @command{gawk}
@cindex @code{awkprof.out} file
@cindex files, @code{awkprof.out}
-@cindex @command{pgawk} program, @code{awkprof.out} file
-@command{pgawk} is identical in every way to @command{gawk}, except that when
-it has finished running, it creates a profile of your program in a file
-named @file{awkprof.out}.
-Because it is profiling, it also executes up to 45% slower than
+
+You may produce execution traces of your @command{awk} programs.
+This is done by passing the option @option{--profile} to @command{gawk}.
+When @command{gawk} has finished running, it creates a profile of your program in a file
+named @file{awkprof.out}. Because it is profiling, it also executes up to 45% slower than
@command{gawk} normally does.
@cindex @code{--profile} option
As shown in the following example,
the @option{--profile} option can be used to change the name of the file
-where @command{pgawk} will write the profile:
+where @command{gawk} will write the profile:
@example
-pgawk --profile=myprog.prof -f myprog.awk data1 data2
+gawk --profile=myprog.prof -f myprog.awk data1 data2
@end example
@noindent
-In the above example, @command{pgawk} places the profile in
+In the above example, @command{gawk} places the profile in
@file{myprog.prof} instead of in @file{awkprof.out}.
-Here is a sample
-session showing a simple @command{awk} program, its input data, and the
-results from running @command{pgawk}. First, the @command{awk} program:
+Here is a sample session showing a simple @command{awk} program, its input data, and the
+results from running @command{gawk} with the @option{--profile} option.
+First, the @command{awk} program:
@example
BEGIN @{ print "First BEGIN rule" @}
@@ -19040,12 +19155,12 @@ foo
junk
@end example
-Here is the @file{awkprof.out} that results from running @command{pgawk}
-on this program and data (this example also illustrates that @command{awk}
+Here is the @file{awkprof.out} that results from running the @command{gawk}
+profiler on this program and data (this example also illustrates that @command{awk}
programmers sometimes have to work late):
-@cindex @code{BEGIN} pattern, @command{pgawk} program
-@cindex @code{END} pattern, @command{pgawk} program
+@cindex @code{BEGIN} pattern
+@cindex @code{END} pattern
@example
# gawk profile, created Sun Aug 13 00:00:15 2000
@@ -19137,15 +19252,15 @@ keyword indicates how many times the function was called.
The counts next to the statements in the body show how many times
those statements were executed.
-@cindex @code{@{@}} (braces), @command{pgawk} program
-@cindex braces (@code{@{@}}), @command{pgawk} program
+@cindex @code{@{@}} (braces)
+@cindex braces (@code{@{@}})
@item
The layout uses ``K&R'' style with TABs.
Braces are used everywhere, even when
the body of an @code{if}, @code{else}, or loop is only a single statement.
-@cindex @code{()} (parentheses), @command{pgawk} program
-@cindex parentheses @code{()}, @command{pgawk} program
+@cindex @code{()} (parentheses)
+@cindex parentheses @code{()}
@item
Parentheses are used only where needed, as indicated by the structure
of the program and the precedence rules.
@@ -19168,16 +19283,16 @@ Similarly, if
the target of a redirection isn't a scalar, it gets parenthesized.
@item
-@command{pgawk} supplies leading comments in
+@command{gawk} supplies leading comments in
front of the @code{BEGIN} and @code{END} rules,
the pattern/action rules, and the functions.
@end itemize
The profiled version of your program may not look exactly like what you
-typed when you wrote it. This is because @command{pgawk} creates the
+typed when you wrote it. This is because @command{gawk} creates the
profiled version by ``pretty printing'' its internal representation of
-the program. The advantage to this is that @command{pgawk} can produce
+the program. The advantage to this is that @command{gawk} can produce
a standard representation. The disadvantage is that all source-code
comments are lost, as are the distinctions among multiple @code{BEGIN},
@code{END}, @code{BEGINFILE}, and @code{ENDFILE} rules. Also, things such as:
@@ -19199,15 +19314,16 @@ come out as:
which is correct, but possibly surprising.
@cindex profiling @command{awk} programs, dynamically
-@cindex @command{pgawk} program, dynamic profiling
+@cindex @command{gawk} program, dynamic profiling
Besides creating profiles when a program has completed,
-@command{pgawk} can produce a profile while it is running.
+@command{gawk} can produce a profile while it is running.
This is useful if your @command{awk} program goes into an
infinite loop and you want to see what has been executed.
-To use this feature, run @command{pgawk} in the background:
+To use this feature, run @command{gawk} with the @option{--profile}
+option in the background:
@example
-$ @kbd{pgawk -f myprog &}
+$ @kbd{gawk --profile -f myprog &}
[1] 13992
@end example
@@ -19218,7 +19334,7 @@ $ @kbd{pgawk -f myprog &}
@noindent
The shell prints a job number and process ID number; in this case, 13992.
Use the @command{kill} command to send the @code{USR1} signal
-to @command{pgawk}:
+to @command{gawk}:
@example
$ @kbd{kill -USR1 13992}
@@ -19226,8 +19342,8 @@ $ @kbd{kill -USR1 13992}
@noindent
As usual, the profiled version of the program is written to
-@file{awkprof.out}, or to a different file if you use the @option{--profile}
-option.
+@file{awkprof.out}, or to a different file if one specified with
+the @option{--profile} option.
Along with the regular profile, as shown earlier, the profile
includes a trace of any active functions:
@@ -19241,7 +19357,7 @@ includes a trace of any active functions:
# -- main --
@end example
-You may send @command{pgawk} the @code{USR1} signal as many times as you like.
+You may send @command{gawk} the @code{USR1} signal as many times as you like.
Each time, the profile and function call trace are appended to the output
profile file.
@@ -19249,7 +19365,7 @@ profile file.
@cindex @code{SIGHUP} signal
@cindex signals, @code{HUP}/@code{SIGHUP}
If you use the @code{HUP} signal instead of the @code{USR1} signal,
-@command{pgawk} produces the profile and the function call trace and then exits.
+@command{gawk} produces the profile and the function call trace and then exits.
@cindex @code{INT} signal (MS-Windows)
@cindex @code{SIGINT} signal (MS-Windows)
@@ -19257,21 +19373,20 @@ If you use the @code{HUP} signal instead of the @code{USR1} signal,
@cindex @code{QUIT} signal (MS-Windows)
@cindex @code{SIGQUIT} signal (MS-Windows)
@cindex signals, @code{QUIT}/@code{SIGQUIT} (MS-Windows)
-When @command{pgawk} runs on MS-Windows systems, it uses the
+When @command{gawk} runs on MS-Windows systems, it uses the
@code{INT} and @code{QUIT} signals for producing the profile and, in
-the case of the @code{INT} signal, @command{pgawk} exits. This is
+the case of the @code{INT} signal, @command{gawk} exits. This is
because these systems don't support the @command{kill} command, so the
only signals you can deliver to a program are those generated by the
keyboard. The @code{INT} signal is generated by the
@kbd{@value{CTL}-@key{C}} or @kbd{@value{CTL}-@key{BREAK}} key, while the
@code{QUIT} signal is generated by the @kbd{@value{CTL}-@key{\}} key.
-Finally, regular @command{gawk} also accepts the @option{--profile} option.
+Finally, @command{gawk} also accepts another option @option{--pretty-print}.
When called this way, @command{gawk} ``pretty prints'' the program into
@file{awkprof.out}, without any execution counts.
@c ENDOFRANGE advgaw
@c ENDOFRANGE gawadv
-@c ENDOFRANGE pgawk
@c ENDOFRANGE awkp
@c ENDOFRANGE proawk
@@ -25153,41 +25268,41 @@ BEGIN {
@c FIXME: Add more indexing.
@node Debugger
-@chapter @command{dgawk}: The @command{awk} Debugger
-@cindex @command{dgawk}
+@chapter Debugging @command{awk} Programs
+@cindex debugging @command{awk} programs
It would be nice if computer programs worked perfectly the first time they
were run, but in real life, this rarely happens for programs of
any complexity. Thus, most programming languages have facilities available
for ``debugging'' programs, and now @command{awk} is no exception.
-The @command{dgawk} debugger is purposely modeled after
+The @command{gawk} debugger is purposely modeled after
@uref{http://www.gnu.org/software/gdb/, the GNU Debugger (GDB)}
command-line debugger. If you are familiar with GDB, learning
-@command{dgawk} is easy.
+how to use @command{gawk} for debugging your program is easy.
@menu
-* Debugging:: Introduction to @command{dgawk}.
-* Sample dgawk session:: Sample @command{dgawk} session.
-* List of Debugger Commands:: Main @command{dgawk} Commands.
-* Readline Support:: Readline Support.
-* Dgawk Limitations:: Limitations and future plans.
+* Debugging:: Introduction to @command{gawk} debugger.
+* Sample Debugging Session:: Sample debugging session.
+* List of Debugger Commands:: Main debugger commands.
+* Readline Support:: Readline support.
+* Limitations:: Limitations and future plans.
@end menu
@node Debugging
-@section Introduction to @command{dgawk}
+@section Introduction to @command{gawk} Debugger
This @value{SECTION} introduces debugging in general and begins
the discussion of debugging in @command{gawk}.
@menu
-* Debugging Concepts:: Debugging In General.
+* Debugging Concepts:: Debugging in General.
* Debugging Terms:: Additional Debugging Concepts.
* Awk Debugging:: Awk Debugging.
@end menu
@node Debugging Concepts
-@subsection Debugging In General
+@subsection Debugging in General
(If you have used debuggers in other languages, you may want to skip
ahead to the next section on the specific features of the @command{awk}
@@ -25233,8 +25348,7 @@ functional program that you or someone else wrote).
@subsection Additional Debugging Concepts
Before diving in to the details, we need to introduce several
-important concepts that apply to just about all debuggers, including
-@command{dgawk}.
+important concepts that apply to just about all debuggers.
The following list defines terms used throughout the rest of
this @value{CHAPTER}.
@@ -25253,7 +25367,7 @@ that contains the function's parameters, local variables, and return value,
as well as any other ``bookkeeping'' information needed to manage the
call stack. This data area is termed a @dfn{stack frame}.
-@command{gawk} also follows this model, and @command{dgawk} gives you
+@command{gawk} also follows this model, and gives you
access to the call stack and to each stack frame. You can see the
call stack, as well as from where each function on the stack was
invoked. Commands that print the call stack print information about
@@ -25298,48 +25412,48 @@ each line of @command{awk} code. The debugger provides the opportunity
to look at the individual primitive instructions carried out
by the higher-level @command{awk} commands.
-@node Sample dgawk session
-@section Sample @command{dgawk} session
+@node Sample Debugging Session
+@section Sample Debugging Session
-In order to illustrate the use of @command{dgawk}, let's look at a sample
+In order to illustrate the use of @command{gawk} as a debugger, let's look at a sample
debugging session. We will use the @command{awk} implementation of the
POSIX @command{uniq} command described earlier (@pxref{Uniq Program})
as our example.
@menu
-* dgawk invocation:: @command{dgawk} Invocation.
-* Finding The Bug:: Finding The Bug.
+* Debugger Invocation:: How to Start the Debugger.
+* Finding The Bug:: Finding the Bug.
@end menu
-@node dgawk invocation
-@subsection @command{dgawk} Invocation
+@node Debugger Invocation
+@subsection How to Start the Debugger
-Starting @command{dgawk} is exactly like running @command{awk}. The
-file(s) containing the program and any supporting code are given on the
-command line as arguments to one or more @option{-f} options.
-(@command{dgawk} is not designed to debug command-line
-programs, only programs contained in files.) In our case,
-we call @command{dgawk} like this:
+Starting the debugger is almost exactly like running @command{awk}, except you have to
+pass an additional option @option{--debug} or the corresponding short option @option{-D}.
+The file(s) containing the program and any supporting code are given on the command
+line as arguments to one or more @option{-f} options. (@command{gawk} is not designed
+to debug command-line programs, only programs contained in files.) In our case,
+we invoke the debugger like this:
@example
-$ @kbd{dgawk -f getopt.awk -f join.awk -f uniq.awk inputfile}
+$ @kbd{gawk -D -f getopt.awk -f join.awk -f uniq.awk inputfile}
@end example
@noindent
where both @file{getopt.awk} and @file{uniq.awk} are in @env{$AWKPATH}.
(Experienced users of GDB or similar debuggers should note that
this syntax is slightly different from what they are used to.
-With @command{dgawk}, the arguments for running the program are given
+With @command{gawk} debugger, the arguments for running the program are given
in the command line to the debugger rather than as part of the @code{run}
command at the debugger prompt.)
Instead of immediately running the program on @file{inputfile}, as
-@command{gawk} would ordinarily do, @command{dgawk} merely loads all
+@command{gawk} would ordinarily do, the debugger merely loads all
the program source files, compiles them internally, and then gives
us a prompt:
@example
-dgawk>
+gawk>
@end example
@noindent
@@ -25347,7 +25461,7 @@ from which we can issue commands to the debugger. At this point, no
code has been executed.
@node Finding The Bug
-@subsection Finding The Bug
+@subsection Finding the Bug
Let's say that we are having a problem using (a faulty version of)
@file{uniq.awk} in the ``field-skipping'' mode, and it doesn't seem to be
@@ -25383,7 +25497,7 @@ a breakpoint in @file{uniq.awk} is at the beginning of the function
the breakpoint, use the @code{b} (breakpoint) command:
@example
-dgawk> @kbd{b are_equal}
+gawk> @kbd{b are_equal}
@print{} Breakpoint 1 set at file `awklib/eg/prog/uniq.awk', line 64
@end example
@@ -25392,22 +25506,22 @@ Now type @samp{r} or @samp{run} and the program runs until it hits
the breakpoint for the first time:
@example
-dgawk> @kbd{r}
+gawk> @kbd{r}
@print{} Starting program:
@print{} Stopping in Rule ...
@print{} Breakpoint 1, are_equal(n, m, clast, cline, alast, aline)
at `awklib/eg/prog/uniq.awk':64
@print{} 64 if (fcount == 0 && charcount == 0)
-dgawk>
+gawk>
@end example
Now we can look at what's going on inside our program. First of all,
let's see how we got to where we are. At the prompt, we type @samp{bt}
-(short for ``backtrace''), and @command{dgawk} responds with a
+(short for ``backtrace''), and the debugger responds with a
listing of the current stack frames:
@example
-dgawk> @kbd{bt}
+gawk> @kbd{bt}
@print{} #0 are_equal(n, m, clast, cline, alast, aline)
at `awklib/eg/prog/uniq.awk':69
@print{} #1 in main() at `awklib/eg/prog/uniq.awk':89
@@ -25422,11 +25536,11 @@ the key to finding the source of the problem.)
Now that we're in @code{are_equal()}, we can start looking at the values
of some variables. Let's say we type @samp{p n}
(@code{p} is short for ``print''). We would expect to see the value of
-@code{n}, a parameter to @code{are_equal()}. Actually, @command{dgawk}
+@code{n}, a parameter to @code{are_equal()}. Actually, the debugger
gives us:
@example
-dgawk> @kbd{p n}
+gawk> @kbd{p n}
@print{} n = untyped variable
@end example
@@ -25437,7 +25551,7 @@ function was called without arguments (@pxref{Function Calls}).
A more useful variable to display might be the current record:
@example
-dgawk> @kbd{p $0}
+gawk> @kbd{p $0}
@print{} $0 = string ("gawk is a wonderful program!")
@end example
@@ -25446,7 +25560,7 @@ This might be a bit puzzling at first since this is the second line of
our test input above. Let's look at @code{NR}:
@example
-dgawk> @kbd{p NR}
+gawk> @kbd{p NR}
@print{} NR = number (2)
@end example
@@ -25465,7 +25579,7 @@ NR == 1 @{
OK, let's just check that that rule worked correctly:
@example
-dgawk> @kbd{p last}
+gawk> @kbd{p last}
@print{} last = string ("awk is a wonderful program!")
@end example
@@ -25476,7 +25590,7 @@ be inside this function. To investigate further, we must begin
@samp{n} (for ``next''):
@example
-dgawk> @kbd{n}
+gawk> @kbd{n}
@print{} 67 if (fcount > 0) @{
@end example
@@ -25496,9 +25610,9 @@ Continuing to step, we now get to the splitting of the current and
last records:
@example
-dgawk> @kbd{n}
+gawk> @kbd{n}
@print{} 68 n = split(last, alast)
-dgawk> @kbd{n}
+gawk> @kbd{n}
@print{} 69 m = split($0, aline)
@end example
@@ -25506,7 +25620,7 @@ At this point, we should be curious to see what our records were split
into, so we try to look:
@example
-dgawk> @kbd{p n m alast aline}
+gawk> @kbd{p n m alast aline}
@print{} n = number (5)
@print{} m = number (5)
@print{} alast = array, 5 elements
@@ -25525,7 +25639,7 @@ inside the array?
The first choice would be to use subscripts:
@example
-dgawk> @kbd{p alast[0]}
+gawk> @kbd{p alast[0]}
@print{} "0" not in array `alast'
@end example
@@ -25533,16 +25647,16 @@ dgawk> @kbd{p alast[0]}
Oops!
@example
-dgawk> @kbd{p alast[1]}
+gawk> @kbd{p alast[1]}
@print{} alast["1"] = string ("awk")
@end example
This would be kind of slow for a 100-member array, though, so
-@command{dgawk} provides a shortcut (reminiscent of another language
+@command{gawk} provides a shortcut (reminiscent of another language
not to be mentioned):
@example
-dgawk> @kbd{p @@alast}
+gawk> @kbd{p @@alast}
@print{} alast["1"] = string ("awk")
@print{} alast["2"] = string ("is")
@print{} alast["3"] = string ("a")
@@ -25554,9 +25668,9 @@ It looks like we got this far OK. Let's take another step
or two:
@example
-dgawk> @kbd{n}
+gawk> @kbd{n}
@print{} 70 clast = join(alast, fcount, n)
-dgawk> @kbd{n}
+gawk> @kbd{n}
@print{} 71 cline = join(aline, fcount, m)
@end example
@@ -25566,7 +25680,7 @@ the virtual record to compare, and if the first field was numbered zero,
this would work. Let's look at what we've got:
@example
-dgawk> @kbd{p cline clast}
+gawk> @kbd{p cline clast}
@print{} cline = string ("gawk is a wonderful program!")
@print{} clast = string ("awk is a wonderful program!")
@end example
@@ -25575,10 +25689,10 @@ Hey, those look pretty familiar! They're just our original, unaltered,
input records. A little thinking (the human brain is still the best
debugging tool), and we realize that we were off by one!
-We get out of @command{dgawk}:
+We get out of the debugger:
@example
-dgawk> @kbd{q}
+gawk> @kbd{q}
@print{} The program is running. Exit anyway (y/n)? @kbd{y}
@end example
@@ -25594,9 +25708,9 @@ cline = join(aline, fcount+1, m)
and problem solved!
@node List of Debugger Commands
-@section Main @command{dgawk} Commands
+@section Main Debugger Commands
-The @command{dgawk} command set can be divided into the
+The @command{gawk} debugger command set can be divided into the
following categories:
@itemize @bullet{}
@@ -25623,24 +25737,24 @@ Miscellaneous
Each of these are discussed in the following subsections.
In the following descriptions, commands which may be abbreviated
show the abbreviation on a second description line.
-A @command{dgawk} command name may also be truncated if that partial
-name is unambiguous. @command{dgawk} has the built-in capability to
+A debugger command name may also be truncated if that partial
+name is unambiguous. The debugger has the built-in capability to
automatically repeat the previous command when just hitting @key{Enter}.
This works for the commands @code{list}, @code{next}, @code{nexti}, @code{step}, @code{stepi}
and @code{continue} executed without any argument.
@menu
-* Breakpoint Control:: Control of breakpoints.
-* Dgawk Execution Control:: Control of execution.
-* Viewing And Changing Data:: Viewing and changing data.
-* Dgawk Stack:: Dealing with the stack.
-* Dgawk Info:: Obtaining information about the program and
- the debugger state.
-* Miscellaneous Dgawk Commands:: Miscellaneous Commands.
+* Breakpoint Control:: Control of Breakpoints.
+* Debugger Execution Control:: Control of Execution.
+* Viewing And Changing Data:: Viewing and Changing Data.
+* Execution Stack:: Dealing with the Stack.
+* Debugger Info:: Obtaining Information about the Program and
+ the Debugger State.
+* Miscellaneous Debugger Commands:: Miscellaneous Commands.
@end menu
@node Breakpoint Control
-@subsection Control Of Breakpoints
+@subsection Control of Breakpoints
As we saw above, the first thing you probably want to do in a debugging
session is to get your breakpoints set up, since otherwise your program
@@ -25675,10 +25789,10 @@ Each breakpoint is assigned a number which can be used to delete it from
the breakpoint list using the @code{delete} command.
With a breakpoint, you may also supply a condition. This is an
-@command{awk} expression (enclosed in double quotes) that @command{dgawk}
+@command{awk} expression (enclosed in double quotes) that the debugger
evaluates whenever the breakpoint is reached. If the condition is true,
-then @command{dgawk} stops execution and prompts for a command. Otherwise,
-@command{dgawk} continues executing the program.
+then the debugger stops execution and prompts for a command. Otherwise,
+it continues executing the program.
@cindex debugger commands, @code{clear}
@cindex @code{clear} debugger command
@@ -25704,10 +25818,10 @@ Delete breakpoint(s) set at entry to function @var{function}.
@cindex @code{condition} debugger command
@item @code{condition} @var{n} @code{"@var{expression}"}
Add a condition to existing breakpoint or watchpoint @var{n}. The
-condition is an @command{awk} expression that @command{dgawk} evaluates
+condition is an @command{awk} expression that the debugger evaluates
whenever the breakpoint or watchpoint is reached. If the condition is true, then
-@command{dgawk} stops execution and prompts for a command. Otherwise,
-@command{dgawk} continues executing the program. If the condition expression is
+the debugger stops execution and prompts for a command. Otherwise,
+the debugger continues executing the program. If the condition expression is
not specified, any existing condition is removed; i.e., the breakpoint or
watchpoint is made unconditional.
@@ -25763,7 +25877,7 @@ Set a temporary breakpoint (enabled for only one stop).
The arguments are the same as for @code{break}.
@end table
-@node Dgawk Execution Control
+@node Debugger Execution Control
@subsection Control of Execution
Now that your breakpoints are ready, you can start running the program
@@ -25792,14 +25906,14 @@ in the list that resumes execution (e.g., @code{continue}) terminates the list
For example:
@example
-dgawk> @kbd{commands}
+gawk> @kbd{commands}
> @kbd{silent}
> @kbd{printf "A silent breakpoint; i = %d\n", i}
> @kbd{info locals}
> @kbd{set i = 10}
> @kbd{continue}
> @kbd{end}
-dgawk>
+gawk>
@end example
@cindex debugger commands, @code{c} (@code{continue})
@@ -25849,7 +25963,7 @@ and the caller of that frame becomes the innermost frame.
@cindex @code{r} debugger command (alias for @code{run})
@item @code{run}
@itemx @code{r}
-Start/restart execution of the program. When restarting, @command{dgawk}
+Start/restart execution of the program. When restarting, the debugger
retains the current breakpoints, watchpoints, command history,
automatic display variables, and debugger options.
@@ -25872,7 +25986,7 @@ stopping, unless it encounters a breakpoint or watchpoint.
@itemx @code{si} [@var{count}]
Execute one (or @var{count}) instruction(s), stepping inside function calls.
(For illustration of what is meant by an ``instruction'' in @command{gawk},
-see the output shown under @code{dump} in @ref{Miscellaneous Dgawk Commands}.)
+see the output shown under @code{dump} in @ref{Miscellaneous Debugger Commands}.)
@cindex debugger commands, @code{u} (@code{until})
@cindex debugger commands, @code{until}
@@ -25900,7 +26014,7 @@ The value of the variable or field is displayed each time the program stops.
Each variable added to the list is identified by a unique number:
@example
-dgawk> @kbd{display x}
+gawk> @kbd{display x}
@print{} 10: x = 1
@end example
@@ -25937,7 +26051,7 @@ Print the value of a @command{gawk} variable or field.
Fields must be referenced by constants:
@example
-dgawk> @kbd{print $3}
+gawk> @kbd{print $3}
@end example
@noindent
@@ -25979,16 +26093,16 @@ You can also set special @command{awk} variables, such as @code{FS},
@item @code{watch} @var{var} | @code{$}@var{n} [@code{"@var{expression}"}]
@itemx @code{w} @var{var} | @code{$}@var{n} [@code{"@var{expression}"}]
Add variable @var{var} (or field @code{$@var{n}}) to the watch list.
-@command{dgawk} then stops whenever
+The debugger then stops whenever
the value of the variable or field changes. Each watched item is assigned a
number which can be used to delete it from the watch list using the
@code{unwatch} command.
With a watchpoint, you may also supply a condition. This is an
-@command{awk} expression (enclosed in double quotes) that @command{dgawk}
+@command{awk} expression (enclosed in double quotes) that the debugger
evaluates whenever the watchpoint is reached. If the condition is true,
-then @command{dgawk} stops execution and prompts for a command. Otherwise,
-@command{dgawk} continues executing the program.
+then the debugger stops execution and prompts for a command. Otherwise,
+@command{gawk} continues executing the program.
@cindex debugger commands, @code{undisplay}
@cindex @code{undisplay} debugger command
@@ -26004,8 +26118,8 @@ watch list.
@end table
-@node Dgawk Stack
-@subsection Dealing With The Stack
+@node Execution Stack
+@subsection Dealing with the Stack
Whenever you run a program which contains any function calls,
@command{gawk} maintains a stack of all of the function calls leading up
@@ -26049,12 +26163,12 @@ Move @var{count} (default 1) frames up the stack toward the outermost frame.
Then select and print the frame.
@end table
-@node Dgawk Info
-@subsection Obtaining Information About The Program and The Debugger State
+@node Debugger Info
+@subsection Obtaining Information about the Program and the Debugger State
Besides looking at the values of variables, there is often a need to get
other sorts of information about the state of your program and of the
-debugging environment itself. @command{dgawk} has one command which
+debugging environment itself. The @command{gawk} debugger has one command which
provides this information, appropriately called @code{info}. @code{info}
is used with one of a number of arguments that tell it exactly what
you want to know:
@@ -26092,7 +26206,7 @@ Local variables of the selected frame.
@item source
The name of the current source file. Each time the program stops, the
current source file is the file containing the current instruction.
-When @command{dgawk} first starts, the current source file is the first file
+When the debugger first starts, the current source file is the first file
included via the @option{-f} option. The
@samp{list @var{filename}:@var{lineno}} command can
be used at any time to change the current source.
@@ -26128,7 +26242,7 @@ The available options are:
@c nested table
@table @code
@item history_size
-The maximum number of lines to keep in the history file @file{./.dgawk_history}.
+The maximum number of lines to keep in the history file @file{./.gawk_history}.
The default is 100.
@item listsize
@@ -26140,14 +26254,14 @@ to standard output. An empty string (@code{""}) resets output to
standard output.
@item prompt
-The debugger prompt. The default is @samp{@w{dgawk> }}.
+The debugger prompt. The default is @samp{@w{gawk> }}.
@item save_history @r{[}on @r{|} off@r{]}
-Save command history to file @file{./.dgawk_history}.
+Save command history to file @file{./.gawk_history}.
The default is @code{on}.
@item save_options @r{[}on @r{|} off@r{]}
-Save current options to file @file{./.dgawkrc} upon exit.
+Save current options to file @file{./.gawkrc} upon exit.
The default is @code{on}.
Options are read back in to the next session upon startup.
@@ -26167,16 +26281,16 @@ Empty lines are ignored; they do @emph{not}
repeat the last command.
You can't restart the program by having more than one @code{run}
command in the file. Also, the list of commands may include additional
-@code{source} commands; however, @command{dgawk} will not source the
+@code{source} commands; however, the @command{gawk} debugger will not source the
same file more than once in order to avoid infinite recursion.
In addition to, or instead of the @code{source} command, you can use
-the @option{-R @var{file}} or @option{--command=@var{file}} command-line
+the @option{-D @var{file}} or @option{--debug=@var{file}} command-line
options to execute commands from a file non-interactively
(@pxref{Options}.
@end table
-@node Miscellaneous Dgawk Commands
+@node Miscellaneous Debugger Commands
@subsection Miscellaneous Commands
There are a few more commands which do not fit into the
@@ -26194,7 +26308,7 @@ partial dump of Davide Brini's obfuscated code
(@pxref{Signature Program}) demonstrates:
@smallexample
-dgawk> @kbd{dump}
+gawk> @kbd{dump}
@print{} # BEGIN
@print{}
@print{} [ 2:0x89faef4] Op_rule : [in_rule = BEGIN] [source_file = brini.awk]
@@ -26243,7 +26357,7 @@ dgawk> @kbd{dump}
@print{} [ :0x89fa3b0] Op_after_beginfile :
@print{} [ :0x89fa388] Op_no_op :
@print{} [ :0x89fa3c4] Op_after_endfile :
-dgawk>
+gawk>
@end smallexample
@cindex debugger commands, @code{h} (@code{help})
@@ -26252,7 +26366,7 @@ dgawk>
@cindex @code{h} debugger command (alias for @code{help})
@item @code{help}
@itemx @code{h}
-Print a list of all of the @command{dgawk} commands with a short
+Print a list of all of the @command{gawk} debugger commands with a short
summary of their usage. @samp{help @var{command}} prints the information
about the command @var{command}.
@@ -26299,7 +26413,7 @@ function @var{function}. This command may change the current source file.
Exit the debugger. Debugging is great fun, but sometimes we all have
to tend to other obligations in life, and sometimes we find the bug,
and are free to go on to the next one! As we saw above, if you are
-running a program, @command{dgawk} warns you if you accidentally type
+running a program, the debugger warns you if you accidentally type
@samp{q} or @samp{quit}, to make sure you really want to quit.
@cindex debugger commands, @code{trace}
@@ -26318,7 +26432,7 @@ fairly self-explanatory, and using @code{stepi} and @code{nexti} while
@node Readline Support
@section Readline Support
-If @command{dgawk} is compiled with the @code{readline} library, you
+If @command{gawk} is compiled with the @code{readline} library, you
can take advantage of that library's command completion and history expansion
features. The following types of completion are available:
@@ -26350,28 +26464,28 @@ and
@end table
-@node Dgawk Limitations
+@node Limitations
@section Limitations and Future Plans
-We hope you find @command{dgawk} useful and enjoyable to work with,
+We hope you find the @command{gawk} debugger useful and enjoyable to work with,
but as with any program, especially in its early releases, it still has
some limitations. A few which are worth being aware of are:
@itemize @bullet{}
@item
-At this point, @command{dgawk} does not give a detailed explanation of
+At this point, the debugger does not give a detailed explanation of
what you did wrong when you type in something it doesn't like. Rather, it just
responds @samp{syntax error}. When you do figure out what your mistake was,
though, you'll feel like a real guru.
@item
-If you perused the dump of opcodes in @ref{Miscellaneous Dgawk Commands},
+If you perused the dump of opcodes in @ref{Miscellaneous Debugger Commands},
(or if you are already familiar with @command{gawk} internals),
you will realize that much of the internal manipulation of data
in @command{gawk}, as in many interpreters, is done on a stack.
@code{Op_push}, @code{Op_pop}, etc., are the ``bread and butter'' of
-most @command{gawk} code. Unfortunately, as of now, @command{dgawk}
-does not allow you to examine the stack's contents.
+most @command{gawk} code. Unfortunately, as of now, the @command{gawk}
+debugger does not allow you to examine the stack's contents.
That is, the intermediate results of expression evaluation are on the
stack, but cannot be printed. Rather, only variables which are defined
@@ -26386,14 +26500,14 @@ programmer, you are expected to know what @code{/[^[:alnum:][:blank:]]/}
means.
@item
-@command{dgawk} is designed to be used by running a program (with all its
-parameters) on the command line, as described in @ref{dgawk invocation}.
+The @command{gawk} debugger is designed to be used by running a program (with all its
+parameters) on the command line, as described in @ref{Debugger Invocation}.
There is no way (as of now) to attach or ``break in'' to a running program.
This seems reasonable for a language which is used mainly for quickly
executing, short programs.
@item
-@command{dgawk} only accepts source supplied with the @option{-f} option.
+The @command{gawk} debugger only accepts source supplied with the @option{-f} option.
@end itemize
Look forward to a future release when these and other missing features may
@@ -27024,13 +27138,13 @@ inclusive. Ordering was based on the numeric value of each character
in the machine's native character set. Thus, on ASCII-based systems,
@code{[a-z]} matched all the lowercase letters, and only the lowercase
letters, since the numeric values for the letters from @samp{a} through
-@samp{z} were contigous. (On an EBCDIC system, the range @samp{[a-z]}
+@samp{z} were contiguous. (On an EBCDIC system, the range @samp{[a-z]}
includes additional, non-alphabetic characters as well.)
Almost all introductory Unix literature explained range expressions
as working in this fashion, and in particular, would teach that the
``correct'' way to match lowercase letters was with @samp{[a-z]}, and
-that @samp{[A-Z]} was the the ``correct'' way to match uppercase letters.
+that @samp{[A-Z]} was the ``correct'' way to match uppercase letters.
And indeed, this was true.
The 1993 POSIX standard introduced the idea of locales (@pxref{Locales}).
@@ -27302,7 +27416,7 @@ environments.
@cindex Haque, John
John Haque
reworked the @command{gawk} internals to use a byte-code engine,
-providing the @command{dgawk} debugger for @command{awk} programs.
+providing the @command{gawk} debugger for @command{awk} programs.
@item
@cindex Yawitz, Efraim
@@ -28572,7 +28686,7 @@ since approximately 2003.
@item @command{pawk}
Nelson H.F.@: Beebe at the University of Utah has modified
Brian Kernighan's @command{awk} to provide timing and profiling information.
-It is different from @command{pgawk}
+It is different from @command{gawk} with the @option{--profile} option.
(@pxref{Profiling}),
in that it uses CPU-based profiling, not line-count
profiling. You may find it at either
@@ -29077,6 +29191,7 @@ When @option{--sandbox} is specified, extensions are disabled
@menu
* Internals:: A brief look at some @command{gawk} internals.
* Plugin License:: A note about licensing.
+* Loading Extensions:: How to load dynamic extensions.
* Sample Library:: A example of new functions.
@end menu
@@ -29387,6 +29502,56 @@ the symbol exists in the global scope. Something like this is enough:
int plugin_is_GPL_compatible;
@end example
+@node Loading Extensions
+@appendixsubsec Loading a Dynamic Extension
+@cindex loading extension
+@cindex @command{gawk}, functions, loading
+There are two ways to load a dynamically linked library. The first is to use the
+builtin @code{extension()}:
+
+@example
+extension(libname, init_func)
+@end example
+
+where @file{libname} is the library to load, and @samp{init_func} is the
+name of the initialization or bootstrap routine to run once loaded.
+
+The second method for dynamic loading of a library is to use the
+command line option @option{-l}:
+
+@example
+$ @kbd{gawk -l libname -f myprog}
+@end example
+
+This will work only if the initialization routine is named @code{dlload()}.
+
+If you use @code{extension()}, the library will be loaded
+at run time. This means that the functions are available only to the rest of
+your script. If you use the command line option @option{-l} instead,
+the library will be loaded before @command{gawk} starts compiling the
+actual program. The net effect is that you can use those functions
+anywhere in the program.
+
+@command{gawk} has a list of directories where it searches for libraries.
+By default, the list includes directories that depend upon how gawk was built
+and installed (@pxref{AWKPATH Variable}). If you want @command{gawk}
+to look for libraries in your private directory, you have to tell it.
+The way to do it is to set the @env{AWKPATH} environment variable
+(@pxref{AWKPATH Variable}).
+@command{gawk} supplies the default suffix @samp{.so} if it is not
+present in the name of the library.
+If the name of your library is @file{mylib.so}, you can simply type
+
+@example
+$ @kbd{gawk -l mylib -f myprog}
+@end example
+
+and @command{gawk} will do everything necessary to load in your library,
+and then call your @code{dlload()} routine.
+
+You can always specify the library using an absolute pathname, in which
+case @command{gawk} will not use @env{AWKPATH} to search for it.
+
@node Sample Library
@appendixsubsec Example: Directory and File Operation Built-ins
@c STARTOFRANGE chdirg
diff --git a/eval.c b/eval.c
index 76c537e1..78598b21 100644
--- a/eval.c
+++ b/eval.c
@@ -29,34 +29,17 @@ extern void after_beginfile(IOBUF **curfile);
extern double pow(double x, double y);
extern double modf(double x, double *yp);
extern double fmod(double x, double y);
-NODE **fcall_list;
+NODE **fcall_list = NULL;
long fcall_count = 0;
int currule = 0;
IOBUF *curfile = NULL; /* current data file */
int exiting = FALSE;
-#ifdef DEBUGGING
+int (*interpret)(INSTRUCTION *);
+
extern int pre_execute(INSTRUCTION **);
extern void post_execute(INSTRUCTION *);
-#else
-#define r_interpret interpret
-#endif
-
-/*
- * Flag which executable this is; done here because eval.c is compiled
- * differently for each of them.
- */
-enum exe_mode which_gawk =
-#ifdef PROFILING
- exe_profiling /* pgawk */
-#else
-# ifdef DEBUGGING
- exe_debugging /* dgawk */
-# else
- exe_normal /* normal gawk */
-# endif
-#endif
- ; /* which_gawk */
+extern void frame_popped();
#if __GNUC__ < 2
NODE *_t; /* used as a temporary in macros */
@@ -66,12 +49,7 @@ int ORSlen;
int OFMTidx;
int CONVFMTidx;
-/* Profiling stuff */
-#ifdef PROFILING
-#define INCREMENT(n) n++
-#else
-#define INCREMENT(n) /* nothing */
-#endif
+static NODE *node_Boolean[2];
/* This rather ugly macro is for VMS C */
#ifdef C
@@ -649,8 +627,8 @@ cmp_nodes(NODE *t1, NODE *t2)
return ret;
}
+/* push_frame --- push a frame NODE onto stack */
-#if defined(PROFILING) || defined(DEBUGGING)
static void
push_frame(NODE *f)
{
@@ -672,27 +650,20 @@ push_frame(NODE *f)
fcall_list[1] = f;
}
+
+/* pop_frame --- pop off a frame NODE*/
+
static void
pop_frame()
{
-#ifdef DEBUGGING
- extern void frame_popped();
-#endif
if (fcall_count > 1)
memmove(fcall_list + 1, fcall_list + 2, (fcall_count - 1) * sizeof(NODE *));
fcall_count--;
assert(fcall_count >= 0);
-#ifdef DEBUGGING
- frame_popped();
-#endif
+ if (do_debug)
+ frame_popped();
}
-#else /* not PROFILING or DEBUGGING */
-#define push_frame(p) /* nothing */
-#define pop_frame() /* nothing */
-#endif
-
-#ifdef PROFILING
/* dump_fcall_stack --- print a backtrace of the awk function calls */
@@ -722,7 +693,6 @@ dump_fcall_stack(FILE *fp)
fprintf(fp, "\t# %3ld. -- main --\n", k);
}
-#endif /* PROFILING */
/* set_IGNORECASE --- update IGNORECASE as appropriate */
@@ -1098,26 +1068,6 @@ NODE **args_array = NULL;
STACK_ITEM *
grow_stack()
{
- if (stack_ptr == NULL) {
- long newval;
-
- if ((newval = getenv_long("GAWK_STACKSIZE")) > 0)
- STACK_SIZE = newval;
-
- emalloc(stack_bottom, STACK_ITEM *, STACK_SIZE * sizeof(STACK_ITEM), "grow_stack");
- stack_ptr = stack_bottom - 1;
- stack_top = stack_bottom + STACK_SIZE - 1;
-
- /* initialize frame pointer */
- getnode(frame_ptr);
- frame_ptr->type = Node_frame;
- frame_ptr->stack = NULL;
- frame_ptr->func_node = NULL; /* in main */
- frame_ptr->num_tail_calls = 0;
- frame_ptr->vname = NULL;
- return stack_ptr;
- }
-
STACK_SIZE *= 2;
erealloc(stack_bottom, STACK_ITEM *, STACK_SIZE * sizeof(STACK_ITEM), "grow_stack");
stack_top = stack_bottom + STACK_SIZE - 1;
@@ -1260,10 +1210,9 @@ setup_frame(INSTRUCTION *pc)
fp = f->fparms;
arg_count = (pc + 1)->expr_count;
-#ifndef DEBUGGING
/* tail recursion optimization */
- tail_optimize = (do_optimize > 1 && (pc + 1)->tail_call);
-#endif
+ tail_optimize = ((pc + 1)->tail_call && do_optimize > 1
+ && ! do_debug && ! do_profile);
if (tail_optimize) {
/* free local vars of calling frame */
@@ -1367,7 +1316,8 @@ setup_frame(INSTRUCTION *pc)
frame_ptr->vname = source; /* save current source */
- push_frame(frame_ptr);
+ if (do_profile || do_debug)
+ push_frame(frame_ptr);
/* save current frame in stack */
PUSH(frame_ptr);
@@ -1416,7 +1366,8 @@ restore_frame(NODE *fp)
* resumes from ri->nexti.
*/
freenode(frame_ptr);
- pop_frame();
+ if (do_profile || do_debug)
+ pop_frame();
/* restore frame */
frame_ptr = fp;
@@ -1519,6 +1470,12 @@ unwind_stack(long n)
static inline int
eval_condition(NODE *t)
{
+ if (t == node_Boolean[FALSE])
+ return FALSE;
+
+ if (t == node_Boolean[TRUE])
+ return TRUE;
+
if ((t->flags & MAYBE_NUM) != 0)
force_number(t);
@@ -1706,1179 +1663,47 @@ pop_exec_state(int *rule, char **src, long *sz)
return cp;
}
-
-/*
- * r_interpret:
- * code is a list of instructions to run. returns the exit value
- * from the awk code.
- */
-
- /* N.B.:
- * 1) reference counting done for both number and string values.
- * 2) Stack operations:
- * Use REPLACE[_XX] if last stack operation was TOP[_XX],
- * PUSH[_XX] if last operation was POP[_XX] instead.
- * 3) UPREF and DREF -- see awk.h
- */
-
-
-int
-r_interpret(INSTRUCTION *code)
+void
+init_interpret()
{
- INSTRUCTION *pc; /* current instruction */
- NODE *r = NULL;
- NODE *m;
- INSTRUCTION *ni;
- NODE *t1, *t2;
- NODE *f; /* function definition */
- NODE **lhs;
- AWKNUM x, x1, x2;
- int di;
- Regexp *rp;
- int stdio_problem = FALSE;
-
-
- if (args_array == NULL)
- emalloc(args_array, NODE **, (max_args + 2)*sizeof(NODE *), "r_interpret");
- else
- erealloc(args_array, NODE **, (max_args + 2)*sizeof(NODE *), "r_interpret");
-
-/* array subscript */
-#define mk_sub(n) (n == 1 ? POP_SCALAR() : concat_exp(n, TRUE))
-
-#ifdef DEBUGGING
-#define JUMPTO(x) do { post_execute(pc); pc = (x); goto top; } while(FALSE)
-#else
-#define JUMPTO(x) do { pc = (x); goto top; } while(FALSE)
-#endif
-
- pc = code;
-
- /* N.B.: always use JUMPTO for next instruction, otherwise bad things
- * may happen. DO NOT add a real loop (for/while) below to
- * replace ' forever {'; this catches failure to use JUMPTO to execute
- * next instruction (e.g. continue statement).
- */
-
- /* loop until hit Op_stop instruction */
-
- /* forever { */
-top:
- if (pc->source_line > 0)
- sourceline = pc->source_line;
-
-#ifdef DEBUGGING
- if (! pre_execute(&pc))
- goto top;
-#endif
-
- switch (pc->opcode) {
- case Op_rule:
- currule = pc->in_rule; /* for sole use in Op_K_next, Op_K_nextfile, Op_K_getline* */
- /* fall through */
- case Op_func:
- source = pc->source_file;
- break;
-
- case Op_atexit:
- /* avoid false source indications */
- source = NULL;
- sourceline = 0;
- (void) nextfile(& curfile, TRUE); /* close input data file */
- /*
- * This used to be:
- *
- * if (close_io() != 0 && ! exiting && exit_val == 0)
- * exit_val = 1;
- *
- * Other awks don't care about problems closing open files
- * and pipes, in that it doesn't affect their exit status.
- * So we no longer do either.
- */
- (void) close_io(& stdio_problem);
- /*
- * However, we do want to exit non-zero if there was a problem
- * with stdout/stderr, so we reinstate a slightly different
- * version of the above:
- */
- if (stdio_problem && ! exiting && exit_val == 0)
- exit_val = 1;
- break;
-
- case Op_stop:
- return 0;
-
- case Op_push_i:
- m = pc->memory;
- if (! do_traditional && (m->flags & INTLSTR) != 0) {
- char *orig, *trans, save;
-
- save = m->stptr[m->stlen];
- m->stptr[m->stlen] = '\0';
- orig = m->stptr;
- trans = dgettext(TEXTDOMAIN, orig);
- m->stptr[m->stlen] = save;
- m = make_string(trans, strlen(trans));
- } else
- UPREF(m);
- PUSH(m);
- break;
-
- case Op_push:
- case Op_push_arg:
- {
- NODE *save_symbol;
- int isparam = FALSE;
-
- save_symbol = m = pc->memory;
- if (m->type == Node_param_list) {
- isparam = TRUE;
- save_symbol = m = GET_PARAM(m->param_cnt);
- if (m->type == Node_array_ref)
- m = m->orig_array;
- }
-
- switch (m->type) {
- case Node_var:
- if (do_lint && var_uninitialized(m))
- lintwarn(isparam ?
- _("reference to uninitialized argument `%s'") :
- _("reference to uninitialized variable `%s'"),
- save_symbol->vname);
- m = m->var_value;
- UPREF(m);
- PUSH(m);
- break;
-
- case Node_var_new:
- m->type = Node_var;
- m->var_value = dupnode(Nnull_string);
- if (do_lint)
- lintwarn(isparam ?
- _("reference to uninitialized argument `%s'") :
- _("reference to uninitialized variable `%s'"),
- save_symbol->vname);
- m = dupnode(Nnull_string);
- PUSH(m);
- break;
-
- case Node_var_array:
- if (pc->opcode == Op_push_arg)
- PUSH(m);
- else
- fatal(_("attempt to use array `%s' in a scalar context"),
- array_vname(save_symbol));
- break;
-
- default:
- cant_happen();
- }
- }
- break;
-
- case Op_push_param: /* function argument */
- m = pc->memory;
- if (m->type == Node_param_list)
- m = GET_PARAM(m->param_cnt);
- if (m->type == Node_var) {
- m = m->var_value;
- UPREF(m);
- PUSH(m);
- break;
- }
- /* else
- fall through */
- case Op_push_array:
- PUSH(pc->memory);
- break;
-
- case Op_push_lhs:
- lhs = get_lhs(pc->memory, pc->do_reference);
- PUSH_ADDRESS(lhs);
- break;
-
- case Op_subscript:
- t2 = mk_sub(pc->sub_count);
- t1 = POP_ARRAY();
-
- if (do_lint && in_array(t1, t2) == NULL) {
- t2 = force_string(t2);
- lintwarn(_("reference to uninitialized element `%s[\"%.*s\"]'"),
- array_vname(t1), (int) t2->stlen, t2->stptr);
- if (t2->stlen == 0)
- lintwarn(_("subscript of array `%s' is null string"), array_vname(t1));
- }
-
- r = *assoc_lookup(t1, t2);
- DEREF(t2);
- if (r->type == Node_val)
- UPREF(r);
- PUSH(r);
- break;
-
- case Op_sub_array:
- t2 = mk_sub(pc->sub_count);
- t1 = POP_ARRAY();
- r = in_array(t1, t2);
- if (r == NULL) {
- r = make_array();
- r->parent_array = t1;
- *assoc_lookup(t1, t2) = r;
- t2 = force_string(t2);
- r->vname = estrdup(t2->stptr, t2->stlen); /* the subscript in parent array */
- } else if (r->type != Node_var_array) {
- t2 = force_string(t2);
- fatal(_("attempt to use scalar `%s[\"%.*s\"]' as an array"),
- array_vname(t1), (int) t2->stlen, t2->stptr);
- }
-
- DEREF(t2);
- PUSH(r);
- break;
-
- case Op_subscript_lhs:
- t2 = mk_sub(pc->sub_count);
- t1 = POP_ARRAY();
- if (do_lint && in_array(t1, t2) == NULL) {
- t2 = force_string(t2);
- if (pc->do_reference)
- lintwarn(_("reference to uninitialized element `%s[\"%.*s\"]'"),
- array_vname(t1), (int) t2->stlen, t2->stptr);
- if (t2->stlen == 0)
- lintwarn(_("subscript of array `%s' is null string"), array_vname(t1));
- }
-
- lhs = assoc_lookup(t1, t2);
- if ((*lhs)->type == Node_var_array) {
- t2 = force_string(t2);
- fatal(_("attempt to use array `%s[\"%.*s\"]' in a scalar context"),
- array_vname(t1), (int) t2->stlen, t2->stptr);
- }
-
- DEREF(t2);
- PUSH_ADDRESS(lhs);
- break;
-
- case Op_field_spec:
- t1 = TOP_SCALAR();
- lhs = r_get_field(t1, (Func_ptr *) 0, TRUE);
- decr_sp();
- DEREF(t1);
- r = dupnode(*lhs); /* can't use UPREF here */
- PUSH(r);
- break;
-
- case Op_field_spec_lhs:
- t1 = TOP_SCALAR();
- lhs = r_get_field(t1, &pc->target_assign->field_assign, pc->do_reference);
- decr_sp();
- DEREF(t1);
- PUSH_ADDRESS(lhs);
- break;
-
- case Op_lint:
- if (do_lint) {
- switch (pc->lint_type) {
- case LINT_assign_in_cond:
- lintwarn(_("assignment used in conditional context"));
- break;
-
- case LINT_no_effect:
- lintwarn(_("statement has no effect"));
- break;
-
- default:
- cant_happen();
- }
- }
- break;
-
- case Op_K_break:
- case Op_K_continue:
- case Op_jmp:
- JUMPTO(pc->target_jmp);
-
- case Op_jmp_false:
- r = POP_SCALAR();
- di = eval_condition(r);
- DEREF(r);
- if (! di)
- JUMPTO(pc->target_jmp);
- break;
-
- case Op_jmp_true:
- r = POP_SCALAR();
- di = eval_condition(r);
- DEREF(r);
- if (di)
- JUMPTO(pc->target_jmp);
- break;
-
- case Op_and:
- case Op_or:
- t1 = POP_SCALAR();
- di = eval_condition(t1);
- DEREF(t1);
- if ((pc->opcode == Op_and && di)
- || (pc->opcode == Op_or && ! di))
- break;
- r = make_number((AWKNUM) di);
- PUSH(r);
- ni = pc->target_jmp;
- JUMPTO(ni->nexti);
-
- case Op_and_final:
- case Op_or_final:
- t1 = TOP_SCALAR();
- r = make_number((AWKNUM) eval_condition(t1));
- DEREF(t1);
- REPLACE(r);
- break;
-
- case Op_not:
- t1 = TOP_SCALAR();
- r = make_number((AWKNUM) ! eval_condition(t1));
- DEREF(t1);
- REPLACE(r);
- break;
-
- case Op_equal:
- r = make_number((AWKNUM) (cmp_scalar() == 0));
- REPLACE(r);
- break;
-
- case Op_notequal:
- r = make_number((AWKNUM) (cmp_scalar() != 0));
- REPLACE(r);
- break;
-
- case Op_less:
- r = make_number((AWKNUM) (cmp_scalar() < 0));
- REPLACE(r);
- break;
-
- case Op_greater:
- r = make_number((AWKNUM) (cmp_scalar() > 0));
- REPLACE(r);
- break;
-
- case Op_leq:
- r = make_number((AWKNUM) (cmp_scalar() <= 0));
- REPLACE(r);
- break;
-
- case Op_geq:
- r = make_number((AWKNUM) (cmp_scalar() >= 0));
- REPLACE(r);
- break;
-
- case Op_plus_i:
- x2 = force_number(pc->memory);
- goto plus;
-
- case Op_plus:
- POP_NUMBER(x2);
-plus:
- TOP_NUMBER(x1);
- r = make_number(x1 + x2);
- REPLACE(r);
- break;
-
- case Op_minus_i:
- x2 = force_number(pc->memory);
- goto minus;
-
- case Op_minus:
- POP_NUMBER(x2);
-minus:
- TOP_NUMBER(x1);
- r = make_number(x1 - x2);
- REPLACE(r);
- break;
-
- case Op_times_i:
- x2 = force_number(pc->memory);
- goto times;
-
- case Op_times:
- POP_NUMBER(x2);
-times:
- TOP_NUMBER(x1);
- r = make_number(x1 * x2);
- REPLACE(r);
- break;
-
- case Op_exp_i:
- x2 = force_number(pc->memory);
- goto exponent;
-
- case Op_exp:
- POP_NUMBER(x2);
-exponent:
- TOP_NUMBER(x1);
- x = calc_exp(x1, x2);
- r = make_number(x);
- REPLACE(r);
- break;
-
- case Op_quotient_i:
- x2 = force_number(pc->memory);
- goto quotient;
-
- case Op_quotient:
- POP_NUMBER(x2);
-quotient:
- if (x2 == 0)
- fatal(_("division by zero attempted"));
-
- TOP_NUMBER(x1);
- x = x1 / x2;
- r = make_number(x);
- REPLACE(r);
- break;
-
- case Op_mod_i:
- x2 = force_number(pc->memory);
- goto mod;
-
- case Op_mod:
- POP_NUMBER(x2);
-mod:
- if (x2 == 0)
- fatal(_("division by zero attempted in `%%'"));
-
- TOP_NUMBER(x1);
-#ifdef HAVE_FMOD
- x = fmod(x1, x2);
-#else /* ! HAVE_FMOD */
- (void) modf(x1 / x2, &x);
- x = x1 - x * x2;
-#endif /* ! HAVE_FMOD */
- r = make_number(x);
- REPLACE(r);
- break;
-
- case Op_preincrement:
- case Op_predecrement:
- x2 = pc->opcode == Op_preincrement ? 1.0 : -1.0;
- lhs = TOP_ADDRESS();
- t1 = *lhs;
- x1 = force_number(t1);
- if (t1->valref == 1 && t1->flags == (MALLOC|NUMCUR|NUMBER)) {
- /* optimization */
- t1->numbr = x1 + x2;
- } else {
- unref(t1);
- t1 = *lhs = make_number(x1 + x2);
- }
- UPREF(t1);
- REPLACE(t1);
- break;
-
- case Op_postincrement:
- case Op_postdecrement:
- x2 = pc->opcode == Op_postincrement ? 1.0 : -1.0;
- lhs = TOP_ADDRESS();
- t1 = *lhs;
- x1 = force_number(t1);
- if (t1->valref == 1 && t1->flags == (MALLOC|NUMCUR|NUMBER)) {
- /* optimization */
- t1->numbr = x1 + x2;
- } else {
- unref(t1);
- *lhs = make_number(x1 + x2);
- }
- r = make_number(x1);
- REPLACE(r);
- break;
-
- case Op_unary_minus:
- TOP_NUMBER(x1);
- r = make_number(-x1);
- REPLACE(r);
- break;
-
- case Op_store_sub:
- /* array[sub] assignment optimization,
- * see awkgram.y (optimize_assignment)
- */
- t1 = get_array(pc->memory, TRUE); /* array */
- t2 = mk_sub(pc->expr_count); /* subscript */
- lhs = assoc_lookup(t1, t2);
- if ((*lhs)->type == Node_var_array) {
- t2 = force_string(t2);
- fatal(_("attempt to use array `%s[\"%.*s\"]' in a scalar context"),
- array_vname(t1), (int) t2->stlen, t2->stptr);
- }
- DEREF(t2);
- unref(*lhs);
- *lhs = POP_SCALAR();
- break;
-
- case Op_store_var:
- /* simple variable assignment optimization,
- * see awkgram.y (optimize_assignment)
- */
-
- lhs = get_lhs(pc->memory, FALSE);
- unref(*lhs);
- r = pc->initval; /* constant initializer */
- if (r == NULL)
- *lhs = POP_SCALAR();
- else {
- UPREF(r);
- *lhs = r;
- }
- break;
-
- case Op_store_field:
- {
- /* field assignment optimization,
- * see awkgram.y (optimize_assignment)
- */
-
- Func_ptr assign;
- t1 = TOP_SCALAR();
- lhs = r_get_field(t1, &assign, FALSE);
- decr_sp();
- DEREF(t1);
- unref(*lhs);
- *lhs = POP_SCALAR();
- assert(assign != NULL);
- assign();
- }
- break;
-
- case Op_assign_concat:
- /* x = x ... string concatenation optimization */
- lhs = get_lhs(pc->memory, FALSE);
- t1 = force_string(*lhs);
- t2 = POP_STRING();
-
- free_wstr(*lhs);
-
- if (t1 != *lhs) {
- unref(*lhs);
- *lhs = dupnode(t1);
- }
-
- if (t1 != t2 && t1->valref == 1) {
- size_t nlen = t1->stlen + t2->stlen;
-
- erealloc(t1->stptr, char *, nlen + 2, "r_interpret");
- memcpy(t1->stptr + t1->stlen, t2->stptr, t2->stlen);
- t1->stlen = nlen;
- t1->stptr[nlen] = '\0';
- t1->flags &= ~(NUMCUR|NUMBER|NUMINT);
- } else {
- size_t nlen = t1->stlen + t2->stlen;
- char *p;
-
- emalloc(p, char *, nlen + 2, "r_interpret");
- memcpy(p, t1->stptr, t1->stlen);
- memcpy(p + t1->stlen, t2->stptr, t2->stlen);
- unref(*lhs);
- t1 = *lhs = make_str_node(p, nlen, ALREADY_MALLOCED);
- }
- DEREF(t2);
- break;
+ long newval;
- case Op_assign:
- lhs = POP_ADDRESS();
- r = TOP_SCALAR();
- unref(*lhs);
- *lhs = r;
- UPREF(r);
- REPLACE(r);
- break;
-
- /* numeric assignments */
- case Op_assign_plus:
- case Op_assign_minus:
- case Op_assign_times:
- case Op_assign_quotient:
- case Op_assign_mod:
- case Op_assign_exp:
- op_assign(pc->opcode);
- break;
-
- case Op_var_update: /* update value of NR, FNR or NF */
- pc->update_var();
- break;
-
- case Op_var_assign:
- case Op_field_assign:
- if (pc->assign_ctxt == Op_sub_builtin
- && TOP()->numbr == 0.0 /* top of stack has a number == 0 */
- ) {
- /* There wasn't any substitutions. If the target is a FIELD,
- * this means no field re-splitting or $0 reconstruction.
- * Skip the set_FOO routine if the target is a special variable.
- */
-
- break;
- } else if ((pc->assign_ctxt == Op_K_getline
- || pc->assign_ctxt == Op_K_getline_redir)
- && TOP()->numbr <= 0.0 /* top of stack has a number <= 0 */
- ) {
- /* getline returned EOF or error */
-
- break;
- }
-
- if (pc->opcode == Op_var_assign)
- pc->assign_var();
- else
- pc->field_assign();
- break;
-
- case Op_concat:
- r = concat_exp(pc->expr_count, pc->concat_flag & CSUBSEP);
- PUSH(r);
- break;
-
- case Op_K_case:
- if ((pc + 1)->match_exp) {
- /* match a constant regex against switch expression instead of $0. */
-
- m = POP(); /* regex */
- t2 = TOP_SCALAR(); /* switch expression */
- t2 = force_string(t2);
- rp = re_update(m);
- di = (research(rp, t2->stptr, 0, t2->stlen,
- avoid_dfa(m, t2->stptr, t2->stlen)) >= 0);
- } else {
- t1 = POP_SCALAR(); /* case value */
- t2 = TOP_SCALAR(); /* switch expression */
- di = (cmp_nodes(t2, t1) == 0);
- DEREF(t1);
- }
-
- if (di) {
- /* match found */
-
- t2 = POP_SCALAR();
- DEREF(t2);
- JUMPTO(pc->target_jmp);
- }
- break;
-
- case Op_K_delete:
- t1 = POP_ARRAY();
- do_delete(t1, pc->expr_count);
- stack_adj(-pc->expr_count);
- break;
-
- case Op_K_delete_loop:
- t1 = POP_ARRAY();
- lhs = POP_ADDRESS(); /* item */
- do_delete_loop(t1, lhs);
- break;
-
- case Op_in_array:
- t1 = POP_ARRAY();
- t2 = mk_sub(pc->expr_count);
- di = (in_array(t1, t2) != NULL);
- DEREF(t2);
- PUSH(make_number((AWKNUM) di));
- break;
-
- case Op_arrayfor_init:
- {
- NODE **list = NULL;
- NODE *array, *sort_str;
- size_t num_elems = 0;
- static NODE *sorted_in = NULL;
- const char *how_to_sort = "@unsorted";
-
- /* get the array */
- array = POP_ARRAY();
-
- /* sanity: check if empty */
- if (array_empty(array))
- goto arrayfor;
-
- num_elems = array->table_size;
-
- if (sorted_in == NULL) /* do this once */
- sorted_in = make_string("sorted_in", 9);
-
- sort_str = NULL;
- /*
- * If posix, or if there's no PROCINFO[],
- * there's no ["sorted_in"], so no sorting
- */
- if (! do_posix && PROCINFO_node != NULL)
- sort_str = in_array(PROCINFO_node, sorted_in);
-
- if (sort_str != NULL) {
- sort_str = force_string(sort_str);
- if (sort_str->stlen > 0)
- how_to_sort = sort_str->stptr;
- }
-
- list = assoc_list(array, how_to_sort, SORTED_IN);
-
-arrayfor:
- getnode(r);
- r->type = Node_arrayfor;
- r->for_list = list;
- r->for_list_size = num_elems; /* # of elements in list */
- r->cur_idx = -1; /* current index */
- r->for_array = array; /* array */
- PUSH(r);
-
- if (num_elems == 0)
- JUMPTO(pc->target_jmp); /* Op_arrayfor_final */
- }
- break;
-
- case Op_arrayfor_incr:
- r = TOP(); /* Node_arrayfor */
- if (++r->cur_idx == r->for_list_size) {
- NODE *array;
- array = r->for_array; /* actual array */
- if (do_lint && array->table_size != r->for_list_size)
- lintwarn(_("for loop: array `%s' changed size from %ld to %ld during loop execution"),
- array_vname(array), (long) r->for_list_size, (long) array->table_size);
- JUMPTO(pc->target_jmp); /* Op_arrayfor_final */
- }
-
- t1 = r->for_list[r->cur_idx];
- lhs = get_lhs(pc->array_var, FALSE);
- unref(*lhs);
- *lhs = dupnode(t1);
- break;
-
- case Op_arrayfor_final:
- r = POP();
- assert(r->type == Node_arrayfor);
- free_arrayfor(r);
- break;
-
- case Op_builtin:
- r = pc->builtin(pc->expr_count);
- PUSH(r);
- break;
-
- case Op_ext_builtin:
- {
- int arg_count = pc->expr_count;
-
- PUSH_CODE(pc);
- r = pc->builtin(arg_count);
- (void) POP_CODE();
- while (arg_count-- > 0) {
- t1 = POP();
- if (t1->type == Node_val)
- DEREF(t1);
- }
- PUSH(r);
- }
- break;
-
- case Op_sub_builtin: /* sub, gsub and gensub */
- r = do_sub(pc->expr_count, pc->sub_flags);
- PUSH(r);
- break;
-
- case Op_K_print:
- do_print(pc->expr_count, pc->redir_type);
- break;
-
- case Op_K_printf:
- do_printf(pc->expr_count, pc->redir_type);
- break;
-
- case Op_K_print_rec:
- do_print_rec(pc->expr_count, pc->redir_type);
- break;
-
- case Op_push_re:
- m = pc->memory;
- if (m->type == Node_dynregex) {
- r = POP_STRING();
- unref(m->re_exp);
- m->re_exp = r;
- }
- PUSH(m);
- break;
-
- case Op_match_rec:
- m = pc->memory;
- t1 = *get_field(0, (Func_ptr *) 0);
-match_re:
- rp = re_update(m);
- /*
- * Any place where research() is called with a last parameter of
- * zero, we need to use the avoid_dfa test. This appears here and
- * in the code for Op_K_case.
- *
- * A new or improved dfa that distinguishes beginning/end of
- * string from beginning/end of line will allow us to get rid of
- * this hack.
- *
- * The avoid_dfa() function is in re.c; it is not very smart.
- */
-
- di = research(rp, t1->stptr, 0, t1->stlen,
- avoid_dfa(m, t1->stptr, t1->stlen));
- di = (di == -1) ^ (pc->opcode != Op_nomatch);
- if(pc->opcode != Op_match_rec) {
- decr_sp();
- DEREF(t1);
- }
- r = make_number((AWKNUM) di);
- PUSH(r);
- break;
-
- case Op_nomatch:
- /* fall through */
- case Op_match:
- m = pc->memory;
- t1 = TOP_STRING();
- if (m->type == Node_dynregex) {
- unref(m->re_exp);
- m->re_exp = t1;
- decr_sp();
- t1 = TOP_STRING();
- }
- goto match_re;
- break;
-
- case Op_indirect_func_call:
- {
- int arg_count;
-
- f = NULL;
- arg_count = (pc + 1)->expr_count;
- t1 = PEEK(arg_count); /* indirect var */
- assert(t1->type == Node_val); /* @a[1](p) not allowed in grammar */
- t1 = force_string(t1);
- if (t1->stlen > 0) {
- /* retrieve function definition node */
- f = pc->func_body;
- if (f != NULL && STREQ(f->vname, t1->stptr)) {
- /* indirect var hasn't been reassigned */
-
- goto func_call;
- }
- f = lookup(t1->stptr);
- }
-
- if (f == NULL || f->type != Node_func)
- fatal(_("function called indirectly through `%s' does not exist"),
- pc->func_name);
- pc->func_body = f; /* save for next call */
-
- goto func_call;
- }
+ if ((newval = getenv_long("GAWK_STACKSIZE")) > 0)
+ STACK_SIZE = newval;
- case Op_func_call:
- /* retrieve function definition node */
- f = pc->func_body;
- if (f == NULL) {
- f = lookup(pc->func_name);
- if (f == NULL || (f->type != Node_func && f->type != Node_ext_func))
- fatal(_("function `%s' not defined"), pc->func_name);
- pc->func_body = f; /* save for next call */
- }
-
- if (f->type == Node_ext_func) {
- INSTRUCTION *bc;
- char *fname = pc->func_name;
- int arg_count = (pc + 1)->expr_count;
-
- bc = f->code_ptr;
- assert(bc->opcode == Op_symbol);
- pc->opcode = Op_ext_builtin; /* self modifying code */
- pc->builtin = bc->builtin;
- pc->expr_count = arg_count; /* actual argument count */
- (pc + 1)->func_name = fname; /* name of the builtin */
- (pc + 1)->expr_count = bc->expr_count; /* defined max # of arguments */
- ni = pc;
- JUMPTO(ni);
- }
-
-func_call:
- ni = setup_frame(pc);
-
- /* run the function instructions */
- JUMPTO(ni); /* Op_func */
-
- case Op_K_return:
- m = POP_SCALAR(); /* return value */
-
- ni = pop_fcall();
-
- /* put the return value back on stack */
- PUSH(m);
-
- JUMPTO(ni);
-
- case Op_K_getline_redir:
- if ((currule == BEGINFILE || currule == ENDFILE)
- && pc->into_var == FALSE
- && pc->redir_type == redirect_input)
- fatal(_("`getline' invalid inside `%s' rule"), ruletab[currule]);
- r = do_getline_redir(pc->into_var, pc->redir_type);
- PUSH(r);
- break;
-
- case Op_K_getline: /* no redirection */
- if (currule == BEGINFILE || currule == ENDFILE)
- fatal(_("non-redirected `getline' invalid inside `%s' rule"),
- ruletab[currule]);
-
- do {
- int ret;
- ret = nextfile(& curfile, FALSE);
- if (ret <= 0)
- r = do_getline(pc->into_var, curfile);
- else {
-
- /* Save execution state so that we can return to it
- * from Op_after_beginfile or Op_after_endfile.
- */
-
- push_exec_state(pc, currule, source, stack_ptr);
-
- if (curfile == NULL)
- JUMPTO((pc + 1)->target_endfile);
- else
- JUMPTO((pc + 1)->target_beginfile);
- }
- } while (r == NULL); /* EOF */
-
- PUSH(r);
- break;
-
- case Op_after_endfile:
- /* Find the execution state to return to */
- ni = pop_exec_state(& currule, & source, NULL);
-
- assert(ni->opcode == Op_newfile || ni->opcode == Op_K_getline);
- JUMPTO(ni);
-
- case Op_after_beginfile:
- after_beginfile(& curfile);
-
- /* Find the execution state to return to */
- ni = pop_exec_state(& currule, & source, NULL);
-
- assert(ni->opcode == Op_newfile || ni->opcode == Op_K_getline);
- if (ni->opcode == Op_K_getline
- || curfile == NULL /* skipping directory argument */
- )
- JUMPTO(ni);
-
- break; /* read a record, Op_get_record */
-
- case Op_newfile:
- {
- int ret;
-
- ret = nextfile(& curfile, FALSE);
-
- if (ret < 0) /* end of input */
- JUMPTO(pc->target_jmp); /* end block or Op_atexit */
-
- if (ret == 0) /* read a record */
- JUMPTO((pc + 1)->target_get_record);
-
- /* ret > 0 */
- /* Save execution state for use in Op_after_beginfile or Op_after_endfile. */
-
- push_exec_state(pc, currule, source, stack_ptr);
-
- if (curfile == NULL) /* EOF */
- JUMPTO(pc->target_endfile);
- /* else
- execute beginfile block */
- }
- break;
-
- case Op_get_record:
- {
- int errcode = 0;
-
- ni = pc->target_newfile;
- if (curfile == NULL) {
- /* from non-redirected getline, e.g.:
- * {
- * while (getline > 0) ;
- * }
- */
-
- ni = ni->target_jmp; /* end_block or Op_atexit */
- JUMPTO(ni);
- }
-
- if (inrec(curfile, & errcode) != 0) {
- if (errcode > 0 && (do_traditional || ! pc->has_endfile))
- fatal(_("error reading input file `%s': %s"),
- curfile->name, strerror(errcode));
-
- JUMPTO(ni);
- } /* else
- prog (rule) block */
- }
- break;
-
- case Op_K_nextfile:
- {
- int ret;
-
- if (currule != Rule && currule != BEGINFILE)
- fatal(_("`nextfile' cannot be called from a `%s' rule"),
- ruletab[currule]);
-
- ret = nextfile(& curfile, TRUE); /* skip current file */
-
- if (currule == BEGINFILE) {
- long stack_size;
-
- ni = pop_exec_state(& currule, & source, & stack_size);
-
- assert(ni->opcode == Op_K_getline || ni->opcode == Op_newfile);
-
- /* pop stack returning to the state of Op_K_getline or Op_newfile. */
- unwind_stack(stack_size);
-
- if (ret == 0) {
- /* There was an error opening the file;
- * don't run ENDFILE block(s).
- */
-
- JUMPTO(ni);
- } else {
- /* do run ENDFILE block(s) first. */
-
- /* Execution state to return to in Op_after_endfile. */
- push_exec_state(ni, currule, source, stack_ptr);
-
- JUMPTO(pc->target_endfile);
- }
- } /* else
- Start over with the first rule. */
-
- /* empty the run-time stack to avoid memory leak */
- pop_stack();
-
- /* Push an execution state for Op_after_endfile to return to */
- push_exec_state(pc->target_newfile, currule, source, stack_ptr);
-
- JUMPTO(pc->target_endfile);
- }
- break;
-
- case Op_K_exit:
- exiting = TRUE;
- POP_NUMBER(x1);
- exit_val = (int) x1;
-#ifdef VMS
- if (exit_val == 0)
- exit_val = EXIT_SUCCESS;
- else if (exit_val == 1)
- exit_val = EXIT_FAILURE;
- /* else
- just pass anything else on through */
-#endif
-
- if (currule == BEGINFILE || currule == ENDFILE) {
-
- /* Find the rule of the saved execution state (Op_K_getline/Op_newfile).
- * This is needed to prevent multiple execution of any END rules:
- * gawk 'BEGINFILE { exit(1) } \
- * END { while (getline > 0); }' in1 in2
- */
-
- (void) pop_exec_state(& currule, & source, NULL);
- }
-
- pop_stack(); /* empty stack, don't leak memory */
-
- /* Jump to either the first END block instruction
- * or to Op_atexit.
- */
-
- if (currule == END)
- ni = pc->target_atexit;
- else
- ni = pc->target_end;
- JUMPTO(ni);
-
- case Op_K_next:
- if (currule != Rule)
- fatal(_("`next' cannot be called from a `%s' rule"), ruletab[currule]);
-
- pop_stack();
- JUMPTO(pc->target_jmp); /* Op_get_record, read next record */
-
- case Op_pop:
- r = POP_SCALAR();
- DEREF(r);
- break;
-
- case Op_line_range:
- if (pc->triggered) /* evaluate right expression */
- JUMPTO(pc->target_jmp);
- /* else
- evaluate left expression */
- break;
-
- case Op_cond_pair:
- {
- int result;
- INSTRUCTION *ip;
-
- t1 = TOP_SCALAR(); /* from right hand side expression */
- di = (eval_condition(t1) != 0);
- DEREF(t1);
-
- ip = pc->line_range; /* Op_line_range */
-
- if (! ip->triggered && di) {
- /* not already triggered and left expression is TRUE */
- decr_sp();
- ip->triggered = TRUE;
- JUMPTO(ip->target_jmp); /* evaluate right expression */
- }
-
- result = ip->triggered || di;
- ip->triggered ^= di; /* update triggered flag */
- r = make_number((AWKNUM) result); /* final value of condition pair */
- REPLACE(r);
- JUMPTO(pc->target_jmp);
- }
+ emalloc(stack_bottom, STACK_ITEM *, STACK_SIZE * sizeof(STACK_ITEM), "grow_stack");
+ stack_ptr = stack_bottom - 1;
+ stack_top = stack_bottom + STACK_SIZE - 1;
- case Op_exec_count:
- INCREMENT(pc->exec_count);
- break;
+ /* initialize frame pointer */
+ getnode(frame_ptr);
+ frame_ptr->type = Node_frame;
+ frame_ptr->stack = NULL;
+ frame_ptr->func_node = NULL; /* in main */
+ frame_ptr->num_tail_calls = 0;
+ frame_ptr->vname = NULL;
- case Op_no_op:
- case Op_K_do:
- case Op_K_while:
- case Op_K_for:
- case Op_K_arrayfor:
- case Op_K_switch:
- case Op_K_default:
- case Op_K_if:
- case Op_K_else:
- case Op_cond_exp:
- break;
+ /* initialize TRUE and FALSE nodes */
+ node_Boolean[FALSE] = make_number(0);
+ node_Boolean[FALSE]->flags |= NUMINT;
+ node_Boolean[TRUE] = make_number(1.0);
+ node_Boolean[TRUE]->flags |= NUMINT;
- default:
- fatal(_("Sorry, don't know how to interpret `%s'"), opcode2str(pc->opcode));
- }
+ /* select the interpreter routine */
+ if (do_debug)
+ interpret = debug_interpret;
+ else
+ interpret = r_interpret;
+}
- JUMPTO(pc->nexti);
-/* } forever */
+/* interpreter routine when not debugging */
+#include "interpret.h"
- /* not reached */
- return 0;
+/* interpreter routine when deubugging with gawk --debug */
+#define r_interpret debug_interpret
+#define DEBUGGING 1
+#include "interpret.h"
+#undef DEBUGGING
+#undef r_interpret
-#undef mk_sub
-#undef JUMPTO
-}
diff --git a/eval_d.c b/eval_d.c
deleted file mode 100644
index 64a8e55a..00000000
--- a/eval_d.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * eval_p.c - compile eval.c with debugging turned on.
- */
-
-/*
- * Copyright (C) 2001 the Free Software Foundation, Inc.
- *
- * This file is part of GAWK, the GNU implementation of the
- * AWK Programming Language.
- *
- * GAWK is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GAWK is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
- */
-
-#define DEBUGGING 1
-#include "eval.c"
diff --git a/eval_p.c b/eval_p.c
deleted file mode 100644
index c8afe666..00000000
--- a/eval_p.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * eval_p.c - compile eval.c with profiling turned on.
- */
-
-/*
- * Copyright (C) 2001 the Free Software Foundation, Inc.
- *
- * This file is part of GAWK, the GNU implementation of the
- * AWK Programming Language.
- *
- * GAWK is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#define PROFILING 1
-#include "eval.c"
diff --git a/ext.c b/ext.c
index 19e0eec5..39e512fb 100644
--- a/ext.c
+++ b/ext.c
@@ -37,18 +37,37 @@
static unsigned long long dummy; /* fake out gcc for dynamic loading? */
#endif
-/* do_ext --- load an extension */
-
+/* do_ext --- load an extension at run-time: interface to load_ext */
+
NODE *
do_ext(int nargs)
{
- NODE *obj;
- NODE *fun;
+ NODE *obj, *fun, *ret = NULL;
+ SRCFILE *s;
+ extern SRCFILE *srcfiles;
+
+ fun = POP_STRING();
+ obj = POP_STRING();
+
+ s = add_srcfile(SRC_EXTLIB, obj->stptr, srcfiles, NULL, NULL);
+ if (s != NULL)
+ ret = load_ext(s->fullpath, fun->stptr, obj);
+ DEREF(obj);
+ DEREF(fun);
+ if (ret == NULL)
+ ret = dupnode(Nnull_string);
+ return ret;
+}
+
+/* load_ext --- load an external library */
+
+NODE *
+load_ext(const char *lib_name, const char *init_func, NODE *obj)
+{
NODE *tmp = NULL;
NODE *(*func)(NODE *, void *);
void *dl;
int flags = RTLD_LAZY;
- int fatal_error = FALSE;
int *gpl_compat;
#ifdef __GNUC__
@@ -61,47 +80,36 @@ do_ext(int nargs)
fatal(_("extensions are not allowed in sandbox mode"));
if (do_traditional || do_posix)
- error(_("`extension' is a gawk extension"));
-
- fun = POP_STRING();
- obj = POP_STRING();
+ fatal(_("`extension' is a gawk extension"));
#ifdef RTLD_GLOBAL
flags |= RTLD_GLOBAL;
#endif
- if ((dl = dlopen(obj->stptr, flags)) == NULL) {
- /* fatal needs `obj', and we need to deallocate it! */
- msg(_("fatal: extension: cannot open `%s' (%s)\n"), obj->stptr,
+
+ if ((dl = dlopen(lib_name, flags)) == NULL)
+ fatal(_("extension: cannot open library `%s' (%s)\n"), lib_name,
dlerror());
- fatal_error = TRUE;
- goto done;
- }
/* Per the GNU Coding standards */
gpl_compat = (int *) dlsym(dl, "plugin_is_GPL_compatible");
- if (gpl_compat == NULL) {
- msg(_("fatal: extension: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n"),
- obj->stptr, dlerror());
- fatal_error = TRUE;
- goto done;
- }
-
- func = (NODE *(*)(NODE *, void *)) dlsym(dl, fun->stptr);
- if (func == NULL) {
- msg(_("fatal: extension: library `%s': cannot call function `%s' (%s)\n"),
- obj->stptr, fun->stptr, dlerror());
- fatal_error = TRUE;
- goto done;
+ if (gpl_compat == NULL)
+ fatal(_("extension: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n"),
+ lib_name, dlerror());
+
+ func = (NODE *(*)(NODE *, void *)) dlsym(dl, init_func);
+ if (func == NULL)
+ fatal(_("extension: library `%s': cannot call function `%s' (%s)\n"),
+ lib_name, init_func, dlerror());
+
+ if (obj == NULL) {
+ obj = make_string(lib_name, strlen(lib_name));
+ tmp = (*func)(obj, dl);
+ unref(tmp);
+ unref(obj);
+ return NULL;
}
tmp = (*func)(obj, dl);
- if (tmp == NULL)
- tmp = dupnode(Nnull_string);
-done:
- DEREF(obj);
- DEREF(fun);
- if (fatal_error)
- gawk_exit(EXIT_FATAL);
return tmp;
}
@@ -173,8 +181,11 @@ get_argument(int i)
if (i < 0 || i >= pcount || i >= arg_count)
return NULL;
- i++;
- t = PEEK(i);
+
+ t = PEEK(arg_count - i);
+ if (t->type == Node_param_list)
+ t = GET_PARAM(t->param_cnt);
+
if (t->type == Node_array_ref)
t = t->orig_array;
if (t->type == Node_var) /* See Case Node_var in setup_frame(), eval.c */
@@ -247,4 +258,13 @@ do_ext(int nargs)
ERRNO_node->var_value = make_string(emsg, strlen(emsg));
return make_number((AWKNUM) -1);
}
+
+/* load_ext --- dummy version if extensions not available */
+
+NODE *
+load_ext(const char *lib_name, const char *init_func, NODE *obj)
+{
+ fatal(_("dynamic loading of library not supported"));
+ return NULL;
+}
#endif
diff --git a/int_array.c b/int_array.c
index fd58de26..9dd20bea 100644
--- a/int_array.c
+++ b/int_array.c
@@ -290,7 +290,8 @@ int_remove(NODE *symbol, NODE *subs)
int i;
NODE *xn = symbol->xarray;
- assert(symbol->buckets != NULL);
+ if (symbol->table_size == 0 || symbol->buckets == NULL)
+ return NULL;
if (! is_integer(symbol, subs)) {
if (xn == NULL || xn->aremove(xn, subs) == NULL)
@@ -462,7 +463,8 @@ int_list(NODE *symbol, NODE *t)
long num;
static char buf[100];
- assert(symbol->table_size > 0);
+ if (symbol->table_size == 0)
+ return NULL;
num_elems = symbol->table_size;
if ((t->flags & (AINDEX|AVALUE|ADELETE)) == (AINDEX|ADELETE))
@@ -582,7 +584,7 @@ int_dump(NODE *symbol, NODE *ndump)
fprintf(output_fp, "flags: %s\n", flags2str(symbol->flags));
}
indent(indent_level);
- fprintf(output_fp, "INT_CHAIN_MAX: %lu\n", INT_CHAIN_MAX);
+ fprintf(output_fp, "INT_CHAIN_MAX: %lu\n", (unsigned long) INT_CHAIN_MAX);
indent(indent_level);
fprintf(output_fp, "array_size: %lu (int)\n", (unsigned long) symbol->array_size);
indent(indent_level);
@@ -815,7 +817,7 @@ int_option(NODE *opt, NODE *val)
tmp = force_string(opt);
(void) force_number(val);
- if (STREQ(tmp->stptr, "INT_CHAIN_MAX")) {
+ if (strcmp(tmp->stptr, "INT_CHAIN_MAX") == 0) {
newval = (int) val->numbr;
if (newval > 0)
INT_CHAIN_MAX = newval;
diff --git a/interpret.h b/interpret.h
new file mode 100644
index 00000000..67a702e3
--- /dev/null
+++ b/interpret.h
@@ -0,0 +1,1187 @@
+/*
+ * interpret:
+ * code is a list of instructions to run. returns the exit value
+ * from the awk code.
+ */
+
+ /* N.B.:
+ * 1) reference counting done for both number and string values.
+ * 2) Stack operations:
+ * Use REPLACE[_XX] if last stack operation was TOP[_XX],
+ * PUSH[_XX] if last operation was POP[_XX] instead.
+ * 3) UPREF and DREF -- see awk.h
+ */
+
+int
+r_interpret(INSTRUCTION *code)
+{
+ INSTRUCTION *pc; /* current instruction */
+ NODE *r = NULL;
+ NODE *m;
+ INSTRUCTION *ni;
+ NODE *t1, *t2;
+ NODE *f; /* function definition */
+ NODE **lhs;
+ AWKNUM x, x1, x2;
+ int di;
+ Regexp *rp;
+ int stdio_problem = FALSE;
+
+/* array subscript */
+#define mk_sub(n) (n == 1 ? POP_SCALAR() : concat_exp(n, TRUE))
+
+#ifdef DEBUGGING
+#define JUMPTO(x) do { post_execute(pc); pc = (x); goto top; } while (FALSE)
+#else
+#define JUMPTO(x) do { pc = (x); goto top; } while (FALSE)
+#endif
+
+ pc = code;
+
+ /* N.B.: always use JUMPTO for next instruction, otherwise bad things
+ * may happen. DO NOT add a real loop (for/while) below to
+ * replace ' forever {'; this catches failure to use JUMPTO to execute
+ * next instruction (e.g. continue statement).
+ */
+
+ /* loop until hit Op_stop instruction */
+
+ /* forever { */
+top:
+ if (pc->source_line > 0)
+ sourceline = pc->source_line;
+
+#ifdef DEBUGGING
+ if (! pre_execute(&pc))
+ goto top;
+#endif
+
+ switch (pc->opcode) {
+ case Op_rule:
+ currule = pc->in_rule; /* for sole use in Op_K_next, Op_K_nextfile, Op_K_getline */
+ /* fall through */
+ case Op_func:
+ source = pc->source_file;
+ break;
+
+ case Op_atexit:
+ /* avoid false source indications */
+ source = NULL;
+ sourceline = 0;
+ (void) nextfile(& curfile, TRUE); /* close input data file */
+ /*
+ * This used to be:
+ *
+ * if (close_io() != 0 && ! exiting && exit_val == 0)
+ * exit_val = 1;
+ *
+ * Other awks don't care about problems closing open files
+ * and pipes, in that it doesn't affect their exit status.
+ * So we no longer do either.
+ */
+ (void) close_io(& stdio_problem);
+ /*
+ * However, we do want to exit non-zero if there was a problem
+ * with stdout/stderr, so we reinstate a slightly different
+ * version of the above:
+ */
+ if (stdio_problem && ! exiting && exit_val == 0)
+ exit_val = 1;
+ break;
+
+ case Op_stop:
+ return 0;
+
+ case Op_push_i:
+ m = pc->memory;
+ if (! do_traditional && (m->flags & INTLSTR) != 0) {
+ char *orig, *trans, save;
+
+ save = m->stptr[m->stlen];
+ m->stptr[m->stlen] = '\0';
+ orig = m->stptr;
+ trans = dgettext(TEXTDOMAIN, orig);
+ m->stptr[m->stlen] = save;
+ m = make_string(trans, strlen(trans));
+ } else
+ UPREF(m);
+ PUSH(m);
+ break;
+
+ case Op_push:
+ case Op_push_arg:
+ {
+ NODE *save_symbol;
+ int isparam = FALSE;
+
+ save_symbol = m = pc->memory;
+ if (m->type == Node_param_list) {
+ isparam = TRUE;
+ save_symbol = m = GET_PARAM(m->param_cnt);
+ if (m->type == Node_array_ref)
+ m = m->orig_array;
+ }
+
+ switch (m->type) {
+ case Node_var:
+ if (do_lint && var_uninitialized(m))
+ lintwarn(isparam ?
+ _("reference to uninitialized argument `%s'") :
+ _("reference to uninitialized variable `%s'"),
+ save_symbol->vname);
+ m = m->var_value;
+ UPREF(m);
+ PUSH(m);
+ break;
+
+ case Node_var_new:
+ m->type = Node_var;
+ m->var_value = dupnode(Nnull_string);
+ if (do_lint)
+ lintwarn(isparam ?
+ _("reference to uninitialized argument `%s'") :
+ _("reference to uninitialized variable `%s'"),
+ save_symbol->vname);
+ m = dupnode(Nnull_string);
+ PUSH(m);
+ break;
+
+ case Node_var_array:
+ if (pc->opcode == Op_push_arg)
+ PUSH(m);
+ else
+ fatal(_("attempt to use array `%s' in a scalar context"),
+ array_vname(save_symbol));
+ break;
+
+ default:
+ cant_happen();
+ }
+ }
+ break;
+
+ case Op_push_param: /* function argument */
+ m = pc->memory;
+ if (m->type == Node_param_list)
+ m = GET_PARAM(m->param_cnt);
+ if (m->type == Node_var) {
+ m = m->var_value;
+ UPREF(m);
+ PUSH(m);
+ break;
+ }
+ /* else
+ fall through */
+ case Op_push_array:
+ PUSH(pc->memory);
+ break;
+
+ case Op_push_lhs:
+ lhs = get_lhs(pc->memory, pc->do_reference);
+ PUSH_ADDRESS(lhs);
+ break;
+
+ case Op_subscript:
+ t2 = mk_sub(pc->sub_count);
+ t1 = POP_ARRAY();
+
+ if (do_lint && in_array(t1, t2) == NULL) {
+ t2 = force_string(t2);
+ lintwarn(_("reference to uninitialized element `%s[\"%.*s\"]'"),
+ array_vname(t1), (int) t2->stlen, t2->stptr);
+ if (t2->stlen == 0)
+ lintwarn(_("subscript of array `%s' is null string"), array_vname(t1));
+ }
+
+ r = *assoc_lookup(t1, t2);
+ DEREF(t2);
+ if (r->type == Node_val)
+ UPREF(r);
+ PUSH(r);
+ break;
+
+ case Op_sub_array:
+ t2 = mk_sub(pc->sub_count);
+ t1 = POP_ARRAY();
+ r = in_array(t1, t2);
+ if (r == NULL) {
+ r = make_array();
+ r->parent_array = t1;
+ *assoc_lookup(t1, t2) = r;
+ t2 = force_string(t2);
+ r->vname = estrdup(t2->stptr, t2->stlen); /* the subscript in parent array */
+ } else if (r->type != Node_var_array) {
+ t2 = force_string(t2);
+ fatal(_("attempt to use scalar `%s[\"%.*s\"]' as an array"),
+ array_vname(t1), (int) t2->stlen, t2->stptr);
+ }
+
+ DEREF(t2);
+ PUSH(r);
+ break;
+
+ case Op_subscript_lhs:
+ t2 = mk_sub(pc->sub_count);
+ t1 = POP_ARRAY();
+ if (do_lint && in_array(t1, t2) == NULL) {
+ t2 = force_string(t2);
+ if (pc->do_reference)
+ lintwarn(_("reference to uninitialized element `%s[\"%.*s\"]'"),
+ array_vname(t1), (int) t2->stlen, t2->stptr);
+ if (t2->stlen == 0)
+ lintwarn(_("subscript of array `%s' is null string"), array_vname(t1));
+ }
+
+ lhs = assoc_lookup(t1, t2);
+ if ((*lhs)->type == Node_var_array) {
+ t2 = force_string(t2);
+ fatal(_("attempt to use array `%s[\"%.*s\"]' in a scalar context"),
+ array_vname(t1), (int) t2->stlen, t2->stptr);
+ }
+
+ DEREF(t2);
+ PUSH_ADDRESS(lhs);
+ break;
+
+ case Op_field_spec:
+ t1 = TOP_SCALAR();
+ lhs = r_get_field(t1, (Func_ptr *) 0, TRUE);
+ decr_sp();
+ DEREF(t1);
+ r = dupnode(*lhs); /* can't use UPREF here */
+ PUSH(r);
+ break;
+
+ case Op_field_spec_lhs:
+ t1 = TOP_SCALAR();
+ lhs = r_get_field(t1, &pc->target_assign->field_assign, pc->do_reference);
+ decr_sp();
+ DEREF(t1);
+ PUSH_ADDRESS(lhs);
+ break;
+
+ case Op_lint:
+ if (do_lint) {
+ switch (pc->lint_type) {
+ case LINT_assign_in_cond:
+ lintwarn(_("assignment used in conditional context"));
+ break;
+
+ case LINT_no_effect:
+ lintwarn(_("statement has no effect"));
+ break;
+
+ default:
+ cant_happen();
+ }
+ }
+ break;
+
+ case Op_K_break:
+ case Op_K_continue:
+ case Op_jmp:
+ JUMPTO(pc->target_jmp);
+
+ case Op_jmp_false:
+ r = POP_SCALAR();
+ di = eval_condition(r);
+ DEREF(r);
+ if (! di)
+ JUMPTO(pc->target_jmp);
+ break;
+
+ case Op_jmp_true:
+ r = POP_SCALAR();
+ di = eval_condition(r);
+ DEREF(r);
+ if (di)
+ JUMPTO(pc->target_jmp);
+ break;
+
+ case Op_and:
+ case Op_or:
+ t1 = POP_SCALAR();
+ di = eval_condition(t1);
+ DEREF(t1);
+ if ((pc->opcode == Op_and && di)
+ || (pc->opcode == Op_or && ! di))
+ break;
+ r = node_Boolean[di];
+ UPREF(r);
+ PUSH(r);
+ ni = pc->target_jmp;
+ JUMPTO(ni->nexti);
+
+ case Op_and_final:
+ case Op_or_final:
+ t1 = TOP_SCALAR();
+ r = node_Boolean[eval_condition(t1)];
+ DEREF(t1);
+ UPREF(r);
+ REPLACE(r);
+ break;
+
+ case Op_not:
+ t1 = TOP_SCALAR();
+ r = node_Boolean[! eval_condition(t1)];
+ DEREF(t1);
+ UPREF(r);
+ REPLACE(r);
+ break;
+
+ case Op_equal:
+ r = node_Boolean[cmp_scalar() == 0];
+ UPREF(r);
+ REPLACE(r);
+ break;
+
+ case Op_notequal:
+ r = node_Boolean[cmp_scalar() != 0];
+ UPREF(r);
+ REPLACE(r);
+ break;
+
+ case Op_less:
+ r = node_Boolean[cmp_scalar() < 0];
+ UPREF(r);
+ REPLACE(r);
+ break;
+
+ case Op_greater:
+ r = node_Boolean[cmp_scalar() > 0];
+ UPREF(r);
+ REPLACE(r);
+ break;
+
+ case Op_leq:
+ r = node_Boolean[cmp_scalar() <= 0];
+ UPREF(r);
+ REPLACE(r);
+ break;
+
+ case Op_geq:
+ r = node_Boolean[cmp_scalar() >= 0];
+ UPREF(r);
+ REPLACE(r);
+ break;
+
+ case Op_plus_i:
+ x2 = force_number(pc->memory);
+ goto plus;
+
+ case Op_plus:
+ POP_NUMBER(x2);
+plus:
+ TOP_NUMBER(x1);
+ r = make_number(x1 + x2);
+ REPLACE(r);
+ break;
+
+ case Op_minus_i:
+ x2 = force_number(pc->memory);
+ goto minus;
+
+ case Op_minus:
+ POP_NUMBER(x2);
+minus:
+ TOP_NUMBER(x1);
+ r = make_number(x1 - x2);
+ REPLACE(r);
+ break;
+
+ case Op_times_i:
+ x2 = force_number(pc->memory);
+ goto times;
+
+ case Op_times:
+ POP_NUMBER(x2);
+times:
+ TOP_NUMBER(x1);
+ r = make_number(x1 * x2);
+ REPLACE(r);
+ break;
+
+ case Op_exp_i:
+ x2 = force_number(pc->memory);
+ goto exponent;
+
+ case Op_exp:
+ POP_NUMBER(x2);
+exponent:
+ TOP_NUMBER(x1);
+ x = calc_exp(x1, x2);
+ r = make_number(x);
+ REPLACE(r);
+ break;
+
+ case Op_quotient_i:
+ x2 = force_number(pc->memory);
+ goto quotient;
+
+ case Op_quotient:
+ POP_NUMBER(x2);
+quotient:
+ if (x2 == 0)
+ fatal(_("division by zero attempted"));
+
+ TOP_NUMBER(x1);
+ x = x1 / x2;
+ r = make_number(x);
+ REPLACE(r);
+ break;
+
+ case Op_mod_i:
+ x2 = force_number(pc->memory);
+ goto mod;
+
+ case Op_mod:
+ POP_NUMBER(x2);
+mod:
+ if (x2 == 0)
+ fatal(_("division by zero attempted in `%%'"));
+
+ TOP_NUMBER(x1);
+#ifdef HAVE_FMOD
+ x = fmod(x1, x2);
+#else /* ! HAVE_FMOD */
+ (void) modf(x1 / x2, &x);
+ x = x1 - x * x2;
+#endif /* ! HAVE_FMOD */
+ r = make_number(x);
+ REPLACE(r);
+ break;
+
+ case Op_preincrement:
+ case Op_predecrement:
+ x2 = pc->opcode == Op_preincrement ? 1.0 : -1.0;
+ lhs = TOP_ADDRESS();
+ t1 = *lhs;
+ x1 = force_number(t1);
+ if (t1->valref == 1 && t1->flags == (MALLOC|NUMCUR|NUMBER)) {
+ /* optimization */
+ t1->numbr = x1 + x2;
+ } else {
+ unref(t1);
+ t1 = *lhs = make_number(x1 + x2);
+ }
+ UPREF(t1);
+ REPLACE(t1);
+ break;
+
+ case Op_postincrement:
+ case Op_postdecrement:
+ x2 = pc->opcode == Op_postincrement ? 1.0 : -1.0;
+ lhs = TOP_ADDRESS();
+ t1 = *lhs;
+ x1 = force_number(t1);
+ if (t1->valref == 1 && t1->flags == (MALLOC|NUMCUR|NUMBER)) {
+ /* optimization */
+ t1->numbr = x1 + x2;
+ } else {
+ unref(t1);
+ *lhs = make_number(x1 + x2);
+ }
+ r = make_number(x1);
+ REPLACE(r);
+ break;
+
+ case Op_unary_minus:
+ TOP_NUMBER(x1);
+ r = make_number(-x1);
+ REPLACE(r);
+ break;
+
+ case Op_store_sub:
+ /* array[sub] assignment optimization,
+ * see awkgram.y (optimize_assignment)
+ */
+ t1 = get_array(pc->memory, TRUE); /* array */
+ t2 = mk_sub(pc->expr_count); /* subscript */
+ lhs = assoc_lookup(t1, t2);
+ if ((*lhs)->type == Node_var_array) {
+ t2 = force_string(t2);
+ fatal(_("attempt to use array `%s[\"%.*s\"]' in a scalar context"),
+ array_vname(t1), (int) t2->stlen, t2->stptr);
+ }
+ DEREF(t2);
+ unref(*lhs);
+ *lhs = POP_SCALAR();
+ break;
+
+ case Op_store_var:
+ /* simple variable assignment optimization,
+ * see awkgram.y (optimize_assignment)
+ */
+
+ lhs = get_lhs(pc->memory, FALSE);
+ unref(*lhs);
+ r = pc->initval; /* constant initializer */
+ if (r == NULL)
+ *lhs = POP_SCALAR();
+ else {
+ UPREF(r);
+ *lhs = r;
+ }
+ break;
+
+ case Op_store_field:
+ {
+ /* field assignment optimization,
+ * see awkgram.y (optimize_assignment)
+ */
+
+ Func_ptr assign;
+ t1 = TOP_SCALAR();
+ lhs = r_get_field(t1, &assign, FALSE);
+ decr_sp();
+ DEREF(t1);
+ unref(*lhs);
+ *lhs = POP_SCALAR();
+ assert(assign != NULL);
+ assign();
+ }
+ break;
+
+ case Op_assign_concat:
+ /* x = x ... string concatenation optimization */
+ lhs = get_lhs(pc->memory, FALSE);
+ t1 = force_string(*lhs);
+ t2 = POP_STRING();
+
+ free_wstr(*lhs);
+
+ if (t1 != *lhs) {
+ unref(*lhs);
+ *lhs = dupnode(t1);
+ }
+
+ if (t1 != t2 && t1->valref == 1) {
+ size_t nlen = t1->stlen + t2->stlen;
+
+ erealloc(t1->stptr, char *, nlen + 2, "r_interpret");
+ memcpy(t1->stptr + t1->stlen, t2->stptr, t2->stlen);
+ t1->stlen = nlen;
+ t1->stptr[nlen] = '\0';
+ t1->flags &= ~(NUMCUR|NUMBER|NUMINT);
+ } else {
+ size_t nlen = t1->stlen + t2->stlen;
+ char *p;
+
+ emalloc(p, char *, nlen + 2, "r_interpret");
+ memcpy(p, t1->stptr, t1->stlen);
+ memcpy(p + t1->stlen, t2->stptr, t2->stlen);
+ unref(*lhs);
+ t1 = *lhs = make_str_node(p, nlen, ALREADY_MALLOCED);
+ }
+ DEREF(t2);
+ break;
+
+ case Op_assign:
+ lhs = POP_ADDRESS();
+ r = TOP_SCALAR();
+ unref(*lhs);
+ *lhs = r;
+ UPREF(r);
+ REPLACE(r);
+ break;
+
+ /* numeric assignments */
+ case Op_assign_plus:
+ case Op_assign_minus:
+ case Op_assign_times:
+ case Op_assign_quotient:
+ case Op_assign_mod:
+ case Op_assign_exp:
+ op_assign(pc->opcode);
+ break;
+
+ case Op_var_update: /* update value of NR, FNR or NF */
+ pc->update_var();
+ break;
+
+ case Op_var_assign:
+ case Op_field_assign:
+ if (pc->assign_ctxt == Op_sub_builtin
+ && TOP()->numbr == 0.0 /* top of stack has a number == 0 */
+ ) {
+ /* There wasn't any substitutions. If the target is a FIELD,
+ * this means no field re-splitting or $0 reconstruction.
+ * Skip the set_FOO routine if the target is a special variable.
+ */
+
+ break;
+ } else if ((pc->assign_ctxt == Op_K_getline
+ || pc->assign_ctxt == Op_K_getline_redir)
+ && TOP()->numbr <= 0.0 /* top of stack has a number <= 0 */
+ ) {
+ /* getline returned EOF or error */
+
+ break;
+ }
+
+ if (pc->opcode == Op_var_assign)
+ pc->assign_var();
+ else
+ pc->field_assign();
+ break;
+
+ case Op_concat:
+ r = concat_exp(pc->expr_count, pc->concat_flag & CSUBSEP);
+ PUSH(r);
+ break;
+
+ case Op_K_case:
+ if ((pc + 1)->match_exp) {
+ /* match a constant regex against switch expression instead of $0. */
+
+ m = POP(); /* regex */
+ t2 = TOP_SCALAR(); /* switch expression */
+ t2 = force_string(t2);
+ rp = re_update(m);
+ di = (research(rp, t2->stptr, 0, t2->stlen,
+ avoid_dfa(m, t2->stptr, t2->stlen)) >= 0);
+ } else {
+ t1 = POP_SCALAR(); /* case value */
+ t2 = TOP_SCALAR(); /* switch expression */
+ di = (cmp_nodes(t2, t1) == 0);
+ DEREF(t1);
+ }
+
+ if (di) {
+ /* match found */
+
+ t2 = POP_SCALAR();
+ DEREF(t2);
+ JUMPTO(pc->target_jmp);
+ }
+ break;
+
+ case Op_K_delete:
+ t1 = POP_ARRAY();
+ do_delete(t1, pc->expr_count);
+ stack_adj(-pc->expr_count);
+ break;
+
+ case Op_K_delete_loop:
+ t1 = POP_ARRAY();
+ lhs = POP_ADDRESS(); /* item */
+ do_delete_loop(t1, lhs);
+ break;
+
+ case Op_in_array:
+ t1 = POP_ARRAY();
+ t2 = mk_sub(pc->expr_count);
+ di = (in_array(t1, t2) != NULL);
+ DEREF(t2);
+ PUSH(make_number((AWKNUM) di));
+ break;
+
+ case Op_arrayfor_init:
+ {
+ NODE **list = NULL;
+ NODE *array, *sort_str;
+ size_t num_elems = 0;
+ static NODE *sorted_in = NULL;
+ const char *how_to_sort = "@unsorted";
+
+ /* get the array */
+ array = POP_ARRAY();
+
+ /* sanity: check if empty */
+ if (array_empty(array))
+ goto arrayfor;
+
+ num_elems = array->table_size;
+
+ if (sorted_in == NULL) /* do this once */
+ sorted_in = make_string("sorted_in", 9);
+
+ sort_str = NULL;
+ /*
+ * If posix, or if there's no PROCINFO[],
+ * there's no ["sorted_in"], so no sorting
+ */
+ if (! do_posix && PROCINFO_node != NULL)
+ sort_str = in_array(PROCINFO_node, sorted_in);
+
+ if (sort_str != NULL) {
+ sort_str = force_string(sort_str);
+ if (sort_str->stlen > 0)
+ how_to_sort = sort_str->stptr;
+ }
+
+ list = assoc_list(array, how_to_sort, SORTED_IN);
+
+arrayfor:
+ getnode(r);
+ r->type = Node_arrayfor;
+ r->for_list = list;
+ r->for_list_size = num_elems; /* # of elements in list */
+ r->cur_idx = -1; /* current index */
+ r->for_array = array; /* array */
+ PUSH(r);
+
+ if (num_elems == 0)
+ JUMPTO(pc->target_jmp); /* Op_arrayfor_final */
+ }
+ break;
+
+ case Op_arrayfor_incr:
+ r = TOP(); /* Node_arrayfor */
+ if (++r->cur_idx == r->for_list_size) {
+ NODE *array;
+ array = r->for_array; /* actual array */
+ if (do_lint && array->table_size != r->for_list_size)
+ lintwarn(_("for loop: array `%s' changed size from %ld to %ld during loop execution"),
+ array_vname(array), (long) r->for_list_size, (long) array->table_size);
+ JUMPTO(pc->target_jmp); /* Op_arrayfor_final */
+ }
+
+ t1 = r->for_list[r->cur_idx];
+ lhs = get_lhs(pc->array_var, FALSE);
+ unref(*lhs);
+ *lhs = dupnode(t1);
+ break;
+
+ case Op_arrayfor_final:
+ r = POP();
+ assert(r->type == Node_arrayfor);
+ free_arrayfor(r);
+ break;
+
+ case Op_builtin:
+ r = pc->builtin(pc->expr_count);
+ PUSH(r);
+ break;
+
+ case Op_ext_builtin:
+ {
+ int arg_count = pc->expr_count;
+
+ PUSH_CODE(pc);
+ r = pc->builtin(arg_count);
+ (void) POP_CODE();
+ while (arg_count-- > 0) {
+ t1 = POP();
+ if (t1->type == Node_val)
+ DEREF(t1);
+ }
+ PUSH(r);
+ }
+ break;
+
+ case Op_sub_builtin: /* sub, gsub and gensub */
+ r = do_sub(pc->expr_count, pc->sub_flags);
+ PUSH(r);
+ break;
+
+ case Op_K_print:
+ do_print(pc->expr_count, pc->redir_type);
+ break;
+
+ case Op_K_printf:
+ do_printf(pc->expr_count, pc->redir_type);
+ break;
+
+ case Op_K_print_rec:
+ do_print_rec(pc->expr_count, pc->redir_type);
+ break;
+
+ case Op_push_re:
+ m = pc->memory;
+ if (m->type == Node_dynregex) {
+ r = POP_STRING();
+ unref(m->re_exp);
+ m->re_exp = r;
+ }
+ PUSH(m);
+ break;
+
+ case Op_match_rec:
+ m = pc->memory;
+ t1 = *get_field(0, (Func_ptr *) 0);
+match_re:
+ rp = re_update(m);
+ /*
+ * Any place where research() is called with a last parameter of
+ * zero, we need to use the avoid_dfa test. This appears here and
+ * in the code for Op_K_case.
+ *
+ * A new or improved dfa that distinguishes beginning/end of
+ * string from beginning/end of line will allow us to get rid of
+ * this hack.
+ *
+ * The avoid_dfa() function is in re.c; it is not very smart.
+ */
+
+ di = research(rp, t1->stptr, 0, t1->stlen,
+ avoid_dfa(m, t1->stptr, t1->stlen));
+ di = (di == -1) ^ (pc->opcode != Op_nomatch);
+ if(pc->opcode != Op_match_rec) {
+ decr_sp();
+ DEREF(t1);
+ }
+ r = node_Boolean[di];
+ UPREF(r);
+ PUSH(r);
+ break;
+
+ case Op_nomatch:
+ /* fall through */
+ case Op_match:
+ m = pc->memory;
+ t1 = TOP_STRING();
+ if (m->type == Node_dynregex) {
+ unref(m->re_exp);
+ m->re_exp = t1;
+ decr_sp();
+ t1 = TOP_STRING();
+ }
+ goto match_re;
+ break;
+
+ case Op_indirect_func_call:
+ {
+ int arg_count;
+
+ f = NULL;
+ arg_count = (pc + 1)->expr_count;
+ t1 = PEEK(arg_count); /* indirect var */
+ assert(t1->type == Node_val); /* @a[1](p) not allowed in grammar */
+ t1 = force_string(t1);
+ if (t1->stlen > 0) {
+ /* retrieve function definition node */
+ f = pc->func_body;
+ if (f != NULL && strcmp(f->vname, t1->stptr) == 0) {
+ /* indirect var hasn't been reassigned */
+
+ goto func_call;
+ }
+ f = lookup(t1->stptr);
+ }
+
+ if (f == NULL || f->type != Node_func)
+ fatal(_("function called indirectly through `%s' does not exist"),
+ pc->func_name);
+ pc->func_body = f; /* save for next call */
+
+ goto func_call;
+ }
+
+ case Op_func_call:
+ /* retrieve function definition node */
+ f = pc->func_body;
+ if (f == NULL) {
+ f = lookup(pc->func_name);
+ if (f == NULL || (f->type != Node_func && f->type != Node_ext_func))
+ fatal(_("function `%s' not defined"), pc->func_name);
+ pc->func_body = f; /* save for next call */
+ }
+
+ if (f->type == Node_ext_func) {
+ INSTRUCTION *bc;
+ char *fname = pc->func_name;
+ int arg_count = (pc + 1)->expr_count;
+
+ bc = f->code_ptr;
+ assert(bc->opcode == Op_symbol);
+ pc->opcode = Op_ext_builtin; /* self modifying code */
+ pc->builtin = bc->builtin;
+ pc->expr_count = arg_count; /* actual argument count */
+ (pc + 1)->func_name = fname; /* name of the builtin */
+ (pc + 1)->expr_count = bc->expr_count; /* defined max # of arguments */
+ ni = pc;
+ JUMPTO(ni);
+ }
+
+func_call:
+ ni = setup_frame(pc);
+
+ /* run the function instructions */
+ JUMPTO(ni); /* Op_func */
+
+ case Op_K_return:
+ m = POP_SCALAR(); /* return value */
+
+ ni = pop_fcall();
+
+ /* put the return value back on stack */
+ PUSH(m);
+
+ JUMPTO(ni);
+
+ case Op_K_getline_redir:
+ if ((currule == BEGINFILE || currule == ENDFILE)
+ && pc->into_var == FALSE
+ && pc->redir_type == redirect_input)
+ fatal(_("`getline' invalid inside `%s' rule"), ruletab[currule]);
+ r = do_getline_redir(pc->into_var, pc->redir_type);
+ PUSH(r);
+ break;
+
+ case Op_K_getline: /* no redirection */
+ if (! currule || currule == BEGINFILE || currule == ENDFILE)
+ fatal(_("non-redirected `getline' invalid inside `%s' rule"),
+ ruletab[currule]);
+
+ do {
+ int ret;
+ ret = nextfile(& curfile, FALSE);
+ if (ret <= 0)
+ r = do_getline(pc->into_var, curfile);
+ else {
+
+ /* Save execution state so that we can return to it
+ * from Op_after_beginfile or Op_after_endfile.
+ */
+
+ push_exec_state(pc, currule, source, stack_ptr);
+
+ if (curfile == NULL)
+ JUMPTO((pc + 1)->target_endfile);
+ else
+ JUMPTO((pc + 1)->target_beginfile);
+ }
+ } while (r == NULL); /* EOF */
+
+ PUSH(r);
+ break;
+
+ case Op_after_endfile:
+ /* Find the execution state to return to */
+ ni = pop_exec_state(& currule, & source, NULL);
+
+ assert(ni->opcode == Op_newfile || ni->opcode == Op_K_getline);
+ JUMPTO(ni);
+
+ case Op_after_beginfile:
+ after_beginfile(& curfile);
+
+ /* Find the execution state to return to */
+ ni = pop_exec_state(& currule, & source, NULL);
+
+ assert(ni->opcode == Op_newfile || ni->opcode == Op_K_getline);
+ if (ni->opcode == Op_K_getline
+ || curfile == NULL /* skipping directory argument */
+ )
+ JUMPTO(ni);
+
+ break; /* read a record, Op_get_record */
+
+ case Op_newfile:
+ {
+ int ret;
+
+ ret = nextfile(& curfile, FALSE);
+
+ if (ret < 0) /* end of input */
+ JUMPTO(pc->target_jmp); /* end block or Op_atexit */
+
+ if (ret == 0) /* read a record */
+ JUMPTO((pc + 1)->target_get_record);
+
+ /* ret > 0 */
+ /* Save execution state for use in Op_after_beginfile or Op_after_endfile. */
+
+ push_exec_state(pc, currule, source, stack_ptr);
+
+ if (curfile == NULL) /* EOF */
+ JUMPTO(pc->target_endfile);
+ /* else
+ execute beginfile block */
+ }
+ break;
+
+ case Op_get_record:
+ {
+ int errcode = 0;
+
+ ni = pc->target_newfile;
+ if (curfile == NULL) {
+ /* from non-redirected getline, e.g.:
+ * {
+ * while (getline > 0) ;
+ * }
+ */
+
+ ni = ni->target_jmp; /* end_block or Op_atexit */
+ JUMPTO(ni);
+ }
+
+ if (inrec(curfile, & errcode) != 0) {
+ if (errcode > 0 && (do_traditional || ! pc->has_endfile))
+ fatal(_("error reading input file `%s': %s"),
+ curfile->name, strerror(errcode));
+
+ JUMPTO(ni);
+ } /* else
+ prog (rule) block */
+ }
+ break;
+
+ case Op_K_nextfile:
+ {
+ int ret;
+
+ if (currule != Rule && currule != BEGINFILE)
+ fatal(_("`nextfile' cannot be called from a `%s' rule"),
+ ruletab[currule]);
+
+ ret = nextfile(& curfile, TRUE); /* skip current file */
+
+ if (currule == BEGINFILE) {
+ long stack_size;
+
+ ni = pop_exec_state(& currule, & source, & stack_size);
+
+ assert(ni->opcode == Op_K_getline || ni->opcode == Op_newfile);
+
+ /* pop stack returning to the state of Op_K_getline or Op_newfile. */
+ unwind_stack(stack_size);
+
+ if (ret == 0) {
+ /* There was an error opening the file;
+ * don't run ENDFILE block(s).
+ */
+
+ JUMPTO(ni);
+ } else {
+ /* do run ENDFILE block(s) first. */
+
+ /* Execution state to return to in Op_after_endfile. */
+ push_exec_state(ni, currule, source, stack_ptr);
+
+ JUMPTO(pc->target_endfile);
+ }
+ } /* else
+ Start over with the first rule. */
+
+ /* empty the run-time stack to avoid memory leak */
+ pop_stack();
+
+ /* Push an execution state for Op_after_endfile to return to */
+ push_exec_state(pc->target_newfile, currule, source, stack_ptr);
+
+ JUMPTO(pc->target_endfile);
+ }
+ break;
+
+ case Op_K_exit:
+ /* exit not allowed in user-defined comparison functions for "sorted_in";
+ * This is done so that END blocks aren't executed more than once.
+ */
+ if (! currule)
+ fatal(_("`exit' cannot be called in the current context"));
+
+ exiting = TRUE;
+ POP_NUMBER(x1);
+ exit_val = (int) x1;
+#ifdef VMS
+ if (exit_val == 0)
+ exit_val = EXIT_SUCCESS;
+ else if (exit_val == 1)
+ exit_val = EXIT_FAILURE;
+ /* else
+ just pass anything else on through */
+#endif
+
+ if (currule == BEGINFILE || currule == ENDFILE) {
+
+ /* Find the rule of the saved execution state (Op_K_getline/Op_newfile).
+ * This is needed to prevent multiple execution of any END rules:
+ * gawk 'BEGINFILE { exit(1) } \
+ * END { while (getline > 0); }' in1 in2
+ */
+
+ (void) pop_exec_state(& currule, & source, NULL);
+ }
+
+ pop_stack(); /* empty stack, don't leak memory */
+
+ /* Jump to either the first END block instruction
+ * or to Op_atexit.
+ */
+
+ if (currule == END)
+ ni = pc->target_atexit;
+ else
+ ni = pc->target_end;
+ JUMPTO(ni);
+
+ case Op_K_next:
+ if (currule != Rule)
+ fatal(_("`next' cannot be called from a `%s' rule"), ruletab[currule]);
+
+ pop_stack();
+ JUMPTO(pc->target_jmp); /* Op_get_record, read next record */
+
+ case Op_pop:
+ r = POP_SCALAR();
+ DEREF(r);
+ break;
+
+ case Op_line_range:
+ if (pc->triggered) /* evaluate right expression */
+ JUMPTO(pc->target_jmp);
+ /* else
+ evaluate left expression */
+ break;
+
+ case Op_cond_pair:
+ {
+ int result;
+ INSTRUCTION *ip;
+
+ t1 = TOP_SCALAR(); /* from right hand side expression */
+ di = (eval_condition(t1) != 0);
+ DEREF(t1);
+
+ ip = pc->line_range; /* Op_line_range */
+
+ if (! ip->triggered && di) {
+ /* not already triggered and left expression is TRUE */
+ decr_sp();
+ ip->triggered = TRUE;
+ JUMPTO(ip->target_jmp); /* evaluate right expression */
+ }
+
+ result = ip->triggered || di;
+ ip->triggered ^= di; /* update triggered flag */
+ r = node_Boolean[result]; /* final value of condition pair */
+ UPREF(r);
+ REPLACE(r);
+ JUMPTO(pc->target_jmp);
+ }
+
+ case Op_exec_count:
+ if (do_profile)
+ pc->exec_count++;
+ break;
+
+ case Op_no_op:
+ case Op_K_do:
+ case Op_K_while:
+ case Op_K_for:
+ case Op_K_arrayfor:
+ case Op_K_switch:
+ case Op_K_default:
+ case Op_K_if:
+ case Op_K_else:
+ case Op_cond_exp:
+ break;
+
+ default:
+ fatal(_("Sorry, don't know how to interpret `%s'"), opcode2str(pc->opcode));
+ }
+
+ JUMPTO(pc->nexti);
+
+/* } forever */
+
+ /* not reached */
+ return 0;
+
+#undef mk_sub
+#undef JUMPTO
+}
+
diff --git a/io.c b/io.c
index 4b7976f1..25f32e21 100644
--- a/io.c
+++ b/io.c
@@ -206,10 +206,18 @@ static int get_a_record(char **out, IOBUF *iop, int *errcode);
static void free_rp(struct redirect *rp);
static int inetfile(const char *str, int *length, int *family);
+static NODE *in_PROCINFO(const char *pidx1, const char *pidx2, NODE **full_idx);
+static long get_read_timeout(IOBUF *iop);
+static ssize_t read_with_timeout(int fd, char *buf, size_t size);
+
#if defined(HAVE_POPEN_H)
#include "popen.h"
#endif
+static int read_can_timeout = FALSE;
+static long read_timeout;
+static long read_default_timeout;
+
static struct redirect *red_head = NULL;
static NODE *RS = NULL;
static Regexp *RS_re_yes_case;
@@ -225,6 +233,33 @@ extern NODE *ARGIND_node;
extern NODE *ERRNO_node;
extern NODE **fields_arr;
+
+void
+init_io()
+{
+ long tmout;
+
+ /*
+ * N.B.: all these hacks are to minimize the effect
+ * on programs that do not care about timeout.
+ */
+
+ /* Parse the env. variable only once */
+ tmout = getenv_long("GAWK_READ_TIMEOUT");
+ if (tmout > 0) {
+ read_default_timeout = tmout;
+ read_can_timeout = TRUE;
+ }
+
+ /*
+ * PROCINFO entries for timeout are dynamic;
+ * We can't be any more specific than this.
+ */
+ if (PROCINFO_node != NULL)
+ read_can_timeout = TRUE;
+}
+
+
#if defined(__DJGPP__) || defined(__MINGW32__) || defined(__EMX__) || defined(__CYGWIN__)
/* binmode --- convert BINMODE to string for fopen */
@@ -376,6 +411,7 @@ nextfile(IOBUF **curfile, int skipping)
fname = "-";
iop = *curfile = iop_alloc(fileno(stdin), fname, &mybuf, FALSE);
iop->flag |= IOP_NOFREE_OBJ;
+
if (iop->fd == INVALID_HANDLE) {
errcode = errno;
errno = 0;
@@ -445,7 +481,7 @@ remap_std_file(int oldfd)
int ret = -1;
/*
- * Give OS-specific routines in gawkmisc.c chance to interpret
+ * Give OS-specific routines in gawkmisc.c a chance to interpret
* "/dev/null" as appropriate for their platforms.
*/
newfd = os_devopen("/dev/null", O_RDWR);
@@ -618,9 +654,8 @@ redirect(NODE *redir_exp, int redirtype, int *errflg)
fatal(_("expression for `%s' redirection has null string value"),
what);
- if (do_lint && (STREQN(str, "0", redir_exp->stlen)
- || STREQN(str, "1", redir_exp->stlen))
- )
+ if (do_lint && (strncmp(str, "0", redir_exp->stlen) == 0
+ || strncmp(str, "1", redir_exp->stlen) == 0))
lintwarn(_("filename `%s' for `%s' redirection may be result of logical expression"),
str, what);
@@ -631,7 +666,7 @@ redirect(NODE *redir_exp, int redirtype, int *errflg)
#ifdef HAVE_SOCKETS
if (inetfile(str, & len, NULL)) {
tflag |= RED_SOCKET;
- if (STREQN(str + len, "tcp/", 4))
+ if (strncmp(str + len, "tcp/", 4) == 0)
tflag |= RED_TCP; /* use shutdown when closing */
}
#endif /* HAVE_SOCKETS */
@@ -1378,7 +1413,7 @@ devopen(const char *name, const char *mode)
flag = str2mode(mode);
- if (STREQ(name, "-"))
+ if (strcmp(name, "-") == 0)
return fileno(stdin);
openfd = INVALID_HANDLE;
@@ -1391,16 +1426,16 @@ devopen(const char *name, const char *mode)
return openfd;
}
- if (STREQN(name, "/dev/", 5)) {
+ if (strncmp(name, "/dev/", 5) == 0) {
cp = (char *) name + 5;
- if (STREQ(cp, "stdin") && (flag & O_ACCMODE) == O_RDONLY)
+ if (strcmp(cp, "stdin") == 0 && (flag & O_ACCMODE) == O_RDONLY)
openfd = fileno(stdin);
- else if (STREQ(cp, "stdout") && (flag & O_ACCMODE) == O_WRONLY)
+ else if (strcmp(cp, "stdout") == 0 && (flag & O_ACCMODE) == O_WRONLY)
openfd = fileno(stdout);
- else if (STREQ(cp, "stderr") && (flag & O_ACCMODE) == O_WRONLY)
+ else if (strcmp(cp, "stderr") == 0 && (flag & O_ACCMODE) == O_WRONLY)
openfd = fileno(stderr);
- else if (STREQN(cp, "fd/", 3)) {
+ else if (strncmp(cp, "fd/", 3) == 0) {
struct stat sbuf;
cp += 3;
@@ -1423,9 +1458,9 @@ devopen(const char *name, const char *mode)
cp = (char *) name + len;
/* which protocol? */
- if (STREQN(cp, "tcp/", 4))
+ if (strncmp(cp, "tcp/", 4) == 0)
protocol = SOCK_STREAM;
- else if (STREQN(cp, "udp/", 4))
+ else if (strncmp(cp, "udp/", 4) == 0)
protocol = SOCK_DGRAM;
else {
protocol = SOCK_STREAM; /* shut up the compiler */
@@ -1594,7 +1629,7 @@ two_way_open(const char *str, struct redirect *rp)
}
#endif /* HAVE_SOCKETS */
-#ifdef HAVE_TERMIOS_H
+#if defined(HAVE_TERMIOS_H) && ! defined(ZOS_USS)
/* case 2: use ptys for two-way communications to child */
if (! no_ptys && pty_vs_pipe(str)) {
static int initialized = FALSE;
@@ -1809,7 +1844,7 @@ two_way_open(const char *str, struct redirect *rp)
first_pty_letter = '\0'; /* reset for next command */
return TRUE;
}
-#endif /* HAVE_TERMIOS_H */
+#endif /* defined(HAVE_TERMIOS_H) && ! defined(ZOS_USS) */
use_pipes:
#ifndef PIPES_SIMULATED /* real pipes */
@@ -2341,6 +2376,30 @@ init_awkpath(char *path)
#undef INC_PATH
}
+/* get_cwd -- get current working directory */
+
+static char *
+get_cwd ()
+{
+#define BSIZE 100
+ char *buf;
+ size_t bsize = BSIZE;
+
+ emalloc(buf, char *, bsize * sizeof(char), "get_cwd");
+ while (TRUE) {
+ if (getcwd(buf, bsize) == buf)
+ return buf;
+ if (errno != ERANGE) {
+ efree(buf);
+ return NULL;
+ }
+ bsize *= 2;
+ erealloc(buf, char *, bsize * sizeof(char), "get_cwd");
+ }
+#undef BSIZE
+}
+
+
/* do_find_source --- search $AWKPATH for file, return NULL if not found */
static char *
@@ -2362,10 +2421,16 @@ do_find_source(const char *src, struct stat *stb, int *errcode)
return NULL;
}
- /* try current directory before path search */
+ /* try current directory before $AWKPATH search */
if (stat(src, stb) == 0) {
- emalloc(path, char *, strlen(src) + 1, "do_find_source");
- strcpy(path, src);
+ path = get_cwd();
+ if (path == NULL) {
+ *errcode = errno;
+ return NULL;
+ }
+ erealloc(path, char *, strlen(path) + strlen(src) + 2, "do_find_source");
+ strcat(path, "/");
+ strcat(path, src);
return path;
}
@@ -2374,7 +2439,8 @@ do_find_source(const char *src, struct stat *stb, int *errcode)
emalloc(path, char *, max_pathlen + strlen(src) + 1, "do_find_source");
for (i = 0; awkpath[i] != NULL; i++) {
- if (STREQ(awkpath[i], "./") || STREQ(awkpath[i], ".")) {
+ if (strcmp(awkpath[i], "./") == 0 || strcmp(awkpath[i], ".") == 0) {
+ /* FIXME: already tried CWD above; Why do it again ? */
*path = '\0';
} else
strcpy(path, awkpath[i]);
@@ -2392,7 +2458,7 @@ do_find_source(const char *src, struct stat *stb, int *errcode)
/* find_source --- find source file with default file extension handling */
char *
-find_source(const char *src, struct stat *stb, int *errcode)
+find_source(const char *src, struct stat *stb, int *errcode, int is_extlib)
{
char *path;
@@ -2401,10 +2467,36 @@ find_source(const char *src, struct stat *stb, int *errcode)
return NULL;
path = do_find_source(src, stb, errcode);
+ if (path == NULL && is_extlib) {
+ char *file_ext;
+ int save_errno;
+ size_t src_len;
+ size_t suffix_len;
+
+#define EXTLIB_SUFFIX ".so"
+ src_len = strlen(src);
+ suffix_len = strlen(EXTLIB_SUFFIX);
+
+ /* check if already has the SUFFIX */
+ if (src_len >= suffix_len && strcmp(& src[src_len - suffix_len], EXTLIB_SUFFIX) == 0)
+ return NULL;
+
+ /* append EXTLIB_SUFFIX and try again */
+ save_errno = errno;
+ emalloc(file_ext, char *, src_len + suffix_len + 1, "find_source");
+ sprintf(file_ext, "%s%s", src, EXTLIB_SUFFIX);
+ path = do_find_source(file_ext, stb, errcode);
+ efree(file_ext);
+ if (path == NULL)
+ errno = save_errno;
+ return path;
+#undef EXTLIB_SUFFIX
+ }
+
#ifdef DEFAULT_FILETYPE
if (! do_traditional && path == NULL) {
char *file_awk;
- int save = errno;
+ int save_errno = errno;
#ifdef VMS
int vms_save = vaxc$errno;
#endif
@@ -2416,7 +2508,7 @@ find_source(const char *src, struct stat *stb, int *errcode)
path = do_find_source(file_awk, stb, errcode);
efree(file_awk);
if (path == NULL) {
- errno = save;
+ errno = save_errno;
#ifdef VMS
vaxc$errno = vms_save;
#endif
@@ -2427,6 +2519,7 @@ find_source(const char *src, struct stat *stb, int *errcode)
return path;
}
+
/* srcopen --- open source file */
int
@@ -2497,22 +2590,21 @@ iop_alloc(int fd, const char *name, IOBUF *iop, int do_openhooks)
iop_malloced = TRUE;
}
memset(iop, '\0', sizeof(IOBUF));
- iop->flag = 0;
iop->fd = fd;
iop->name = name;
+ iop->read_func = ( ssize_t(*)() ) read;
- if (do_openhooks)
+ if (do_openhooks) {
find_open_hook(iop);
- else if (iop->fd == INVALID_HANDLE)
+ /* tried to find open hook and could not */
+ if (iop->fd == INVALID_HANDLE) {
+ if (iop_malloced)
+ efree(iop);
+ return NULL;
+ }
+ } else if (iop->fd == INVALID_HANDLE)
return iop;
- /* test reached if tried to find open hook and could not */
- if (iop->fd == INVALID_HANDLE) {
- if (iop_malloced)
- efree(iop);
- return NULL;
- }
-
if (os_isatty(iop->fd))
iop->flag |= IOP_IS_TTY;
iop->readsize = iop->size = optimal_bufsize(iop->fd, & sbuf);
@@ -2926,12 +3018,15 @@ get_a_record(char **out, /* pointer to pointer to data */
if (at_eof(iop) && no_data_left(iop))
return EOF;
+ if (read_can_timeout)
+ read_timeout = get_read_timeout(iop);
+
if (iop->get_record != NULL)
return (*iop->get_record)(out, iop, errcode);
/* <fill initial buffer>= */
if (has_no_data(iop) || no_data_left(iop)) {
- iop->count = read(iop->fd, iop->buf, iop->readsize);
+ iop->count = iop->read_func(iop->fd, iop->buf, iop->readsize);
if (iop->count == 0) {
iop->flag |= IOP_AT_EOF;
return EOF;
@@ -2997,7 +3092,7 @@ get_a_record(char **out, /* pointer to pointer to data */
amt_to_read = min(amt_to_read, SSIZE_MAX);
#endif
- iop->count = read(iop->fd, iop->dataend, amt_to_read);
+ iop->count = iop->read_func(iop->fd, iop->dataend, amt_to_read);
if (iop->count == -1) {
*errcode = errno;
iop->flag |= IOP_AT_EOF;
@@ -3135,6 +3230,7 @@ set_FS:
set_FS();
}
+
/* pty_vs_pipe --- return true if should use pty instead of pipes for `|&' */
/*
@@ -3145,26 +3241,11 @@ static int
pty_vs_pipe(const char *command)
{
#ifdef HAVE_TERMIOS_H
- char *full_index;
- size_t full_len;
- NODE *val, *sub;
+ NODE *val;
if (PROCINFO_node == NULL)
return FALSE;
-
- full_len = strlen(command)
- + SUBSEP_node->var_value->stlen
- + 3 /* strlen("pty") */
- + 1; /* string terminator */
- emalloc(full_index, char *, full_len, "pty_vs_pipe");
- sprintf(full_index, "%s%.*spty", command,
- (int) SUBSEP_node->var_value->stlen, SUBSEP_node->var_value->stptr);
-
- sub = make_string(full_index, strlen(full_index));
- val = in_array(PROCINFO_node, sub);
- unref(sub);
- efree(full_index);
-
+ val = in_PROCINFO(command, "pty", NULL);
if (val) {
if (val->flags & MAYBE_NUM)
(void) force_number(val);
@@ -3210,19 +3291,19 @@ inetfile(const char *str, int *length, int *family)
{
int ret = FALSE;
- if (STREQN(str, "/inet/", 6)) {
+ if (strncmp(str, "/inet/", 6) == 0) {
ret = TRUE;
if (length != NULL)
*length = 6;
if (family != NULL)
*family = AF_UNSPEC;
- } else if (STREQN(str, "/inet4/", 7)) {
+ } else if (strncmp(str, "/inet4/", 7) == 0) {
ret = TRUE;
if (length != NULL)
*length = 7;
if (family != NULL)
*family = AF_INET;
- } else if (STREQN(str, "/inet6/", 7)) {
+ } else if (strncmp(str, "/inet6/", 7) == 0) {
ret = TRUE;
if (length != NULL)
*length = 7;
@@ -3235,3 +3316,115 @@ inetfile(const char *str, int *length, int *family)
return ret;
}
+
+/*
+ * in_PROCINFO --- return value for a PROCINFO element with
+ * SUBSEP seperated indices.
+ */
+
+static NODE *
+in_PROCINFO(const char *pidx1, const char *pidx2, NODE **full_idx)
+{
+ char *str;
+ size_t str_len;
+ NODE *r, *sub = NULL;
+ NODE *subsep = SUBSEP_node->var_value;
+
+ /* full_idx is in+out parameter */
+
+ if (full_idx)
+ sub = *full_idx;
+
+ str_len = strlen(pidx1) + subsep->stlen + strlen(pidx2);
+ if (sub == NULL) {
+ emalloc(str, char *, str_len + 1, "in_PROCINFO");
+ sub = make_str_node(str, str_len, ALREADY_MALLOCED);
+ if (full_idx)
+ *full_idx = sub;
+ } else if (str_len != sub->stlen) {
+ /* *full_idx != NULL */
+
+ assert(sub->valref == 1);
+ erealloc(sub->stptr, char *, str_len + 1, "in_PROCINFO");
+ sub->stlen = str_len;
+ }
+
+ sprintf(sub->stptr, "%s%.*s%s", pidx1, (int)subsep->stlen,
+ subsep->stptr, pidx2);
+ r = in_array(PROCINFO_node, sub);
+ if (! full_idx)
+ unref(sub);
+ return r;
+}
+
+
+/* get_read_timeout --- get timeout in milliseconds for reading */
+
+static long
+get_read_timeout(IOBUF *iop)
+{
+ long tmout = 0;
+
+ if (PROCINFO_node != NULL) {
+ const char *name = iop->name;
+ NODE *val = NULL;
+ static NODE *full_idx = NULL;
+ static const char *last_name = NULL;
+
+ /*
+ * Do not re-construct the full index when last redirection
+ * string is the same as the current; "efficiency_hack++".
+ */
+ if (full_idx == NULL || strcmp(name, last_name) != 0) {
+ val = in_PROCINFO(name, "READ_TIMEOUT", & full_idx);
+ if (last_name != NULL)
+ efree(last_name);
+ last_name = estrdup(name, strlen(name));
+ } else /* use cached full index */
+ val = in_array(PROCINFO_node, full_idx);
+
+ if (val != NULL)
+ tmout = (long) force_number(val);
+ } else
+ tmout = read_default_timeout; /* initialized from env. variable in init_io() */
+
+ iop->read_func = tmout > 0 ? read_with_timeout : ( ssize_t(*)() ) read;
+ return tmout;
+}
+
+/*
+ * read_with_timeout --- read with a timeout, return failure
+ * if no data is available within the timeout period.
+ */
+
+static ssize_t
+read_with_timeout(int fd, char *buf, size_t size)
+{
+ fd_set readfds;
+ struct timeval tv;
+
+ tv.tv_sec = read_timeout / 1000;
+ tv.tv_usec = 1000 * (read_timeout - 1000 * tv.tv_sec);
+
+ FD_ZERO(& readfds);
+ FD_SET(fd, & readfds);
+
+ errno = 0;
+ if (select(fd + 1, & readfds, NULL, NULL, & tv) < 0)
+ return -1;
+
+ if (FD_ISSET(fd, & readfds))
+ return read(fd, buf, size);
+ /* else
+ timed out */
+
+ /* Set a meaningful errno */
+#ifdef ETIMEDOUT
+ errno = ETIMEDOUT;
+#else
+ errno = EAGAIN;
+#endif
+ return -1;
+}
+
+
diff --git a/main.c b/main.c
index 6b24a80b..8899db59 100644
--- a/main.c
+++ b/main.c
@@ -58,6 +58,9 @@ static void init_groupset(void);
static void save_argv(int, char **);
+extern int debug_prog(INSTRUCTION *pc); /* debug.c */
+
+
/* These nodes store all the special variables AWK uses */
NODE *ARGC_node, *ARGIND_node, *ARGV_node, *BINMODE_node, *CONVFMT_node;
NODE *ENVIRON_node, *ERRNO_node, *FIELDWIDTHS_node, *FILENAME_node;
@@ -130,7 +133,7 @@ static int disallow_var_assigns = FALSE; /* true for --exec */
static void add_preassign(enum assign_type type, char *val);
int do_flags = FALSE;
-int do_optimize = TRUE; /* apply default optimizations */
+int do_optimize = TRUE; /* apply default optimizations */
static int do_nostalgia = FALSE; /* provide a blast from the past */
static int do_binary = FALSE; /* hands off my data! */
@@ -140,7 +143,7 @@ int use_lc_numeric = FALSE; /* obey locale for decimal point */
int gawk_mb_cur_max; /* MB_CUR_MAX value, see comment in main() */
#endif
-FILE *output_fp; /* default output for debugger */
+FILE *output_fp; /* default gawk output, can be redirected in the debugger */
int output_is_tty = FALSE; /* control flushing of output */
/* default format for strftime(), available via PROCINFO */
@@ -155,26 +158,24 @@ int ngroups; /* size of said set */
void (*lintfunc)(const char *mesg, ...) = warning;
-/*
- * Note: reserve -D for future use, to merge dgawk into gawk.
- * Note: reserve -l for future use, for xgawk's -l option.
- */
static const struct option optab[] = {
{ "traditional", no_argument, NULL, 'c' },
{ "lint", optional_argument, NULL, 'L' },
{ "lint-old", no_argument, NULL, 't' },
{ "optimize", no_argument, NULL, 'O' },
{ "posix", no_argument, NULL, 'P' },
- { "command", required_argument, NULL, 'R' },
{ "nostalgia", no_argument, & do_nostalgia, 1 },
{ "gen-pot", no_argument, NULL, 'g' },
{ "non-decimal-data", no_argument, NULL, 'n' },
+ { "pretty-print", optional_argument, NULL, 'o' },
{ "profile", optional_argument, NULL, 'p' },
+ { "debug", optional_argument, NULL, 'D' },
{ "copyright", no_argument, NULL, 'C' },
{ "field-separator", required_argument, NULL, 'F' },
{ "file", required_argument, NULL, 'f' },
{ "re-interval", no_argument, NULL, 'r' },
{ "source", required_argument, NULL, 'e' },
+ { "load", required_argument, NULL, 'l' },
{ "dump-variables", optional_argument, NULL, 'd' },
{ "assign", required_argument, NULL, 'v' },
{ "version", no_argument, NULL, 'V' },
@@ -197,16 +198,17 @@ main(int argc, char **argv)
{
/*
* The + on the front tells GNU getopt not to rearrange argv.
- * Note: reserve -D for future use, to merge dgawk into gawk.
* Note: reserve -l for future use, for xgawk's -l option.
*/
- const char *optlist = "+F:f:v:W;m:bcCd::e:E:gh:L:nNOp::PrR:StVY";
+ const char *optlist = "+F:f:v:W;m:bcCd::D::e:E:gh:l:L:nNo::Op::PrStVY";
int stopped_early = FALSE;
int old_optind;
int i;
int c;
char *scan, *src;
char *extra_stack;
+ int have_srcfile = FALSE;
+ SRCFILE *s;
/* do these checks early */
if (getenv("TIDYMEM") != NULL)
@@ -369,6 +371,12 @@ main(int argc, char **argv)
varfile = optarg;
break;
+ case 'D':
+ do_flags |= DO_DEBUG;
+ if (optarg != NULL && optarg[0] != '\0')
+ command_file = optarg;
+ break;
+
case 'e':
if (optarg[0] == '\0')
warning(_("empty argument to `-e/--source' ignored"));
@@ -385,6 +393,10 @@ main(int argc, char **argv)
usage(EXIT_SUCCESS, stdout);
break;
+ case 'l':
+ (void) add_srcfile(SRC_EXTLIB, optarg, srcfiles, NULL, NULL);
+ break;
+
case 'L':
#ifndef NO_LINT
do_flags |= DO_LINT_ALL;
@@ -420,7 +432,10 @@ main(int argc, char **argv)
break;
case 'p':
- do_flags |= DO_PROFILING;
+ do_flags |= DO_PROFILE;
+ /* fall through */
+ case 'o':
+ do_flags |= DO_PRETTY_PRINT;
if (optarg != NULL)
set_prof_file(optarg);
else
@@ -457,20 +472,13 @@ main(int argc, char **argv)
break;
case 'Y':
- case 'R':
#if defined(YYDEBUG) || defined(GAWKDEBUG)
if (c == 'Y') {
yydebug = 2;
break;
}
#endif
- if (c == 'R' && which_gawk == exe_debugging) {
- if (optarg[0] != '\0')
- command_file = optarg;
- break;
- }
- /* if not debugging or dgawk, fall through */
-
+ /* if not debugging, fall through */
case '?':
default:
/*
@@ -550,13 +558,6 @@ out:
}
#endif
- /*
- * Force profiling if this is pgawk.
- * Don't bother if the command line already set profiling up.
- */
- if (! do_profiling)
- init_profiling(& do_flags, DEFAULT_PROFILE);
-
/* load group set */
init_groupset();
@@ -572,7 +573,7 @@ out:
*/
resetup();
- (void) grow_stack();
+ init_interpret();
/* Set up the special variables */
init_vars();
@@ -607,8 +608,17 @@ out:
#endif
if (os_isatty(fileno(stdout)))
output_is_tty = TRUE;
+
+ /* load extension libs */
+ for (s = srcfiles->next; s != srcfiles; s = s->next) {
+ if (s->stype == SRC_EXTLIB)
+ (void) load_ext(s->fullpath, "dlload", NULL);
+ else
+ have_srcfile++;
+ }
+
/* No -f or --source options, use next arg */
- if (srcfiles->next == srcfiles) {
+ if (! have_srcfile) {
if (optind > argc - 1 || stopped_early) /* no args left or no program */
usage(EXIT_FAILURE, stderr);
(void) add_srcfile(SRC_CMDLINE, argv[optind], srcfiles, NULL, NULL);
@@ -628,7 +638,7 @@ out:
setlocale(LC_NUMERIC, "C");
#endif
/* Read in the program */
- if (parse_program(&code_block) != 0)
+ if (parse_program(& code_block) != 0)
exit(EXIT_FAILURE);
if (do_intl)
@@ -640,7 +650,8 @@ out:
if (do_lint && code_block->nexti->opcode == Op_atexit)
lintwarn(_("no program text at all!"));
- init_profiling_signals();
+ if (do_profile)
+ init_profiling_signals();
#if defined(LC_NUMERIC)
/*
@@ -661,11 +672,16 @@ out:
if (use_lc_numeric)
setlocale(LC_NUMERIC, "");
#endif
-
+
+ init_io();
output_fp = stdout;
- interpret(code_block);
- if (do_profiling) {
+ if (do_debug)
+ debug_prog(code_block);
+ else
+ interpret(code_block);
+
+ if (do_pretty_print) {
dump_prog(code_block);
dump_funcs();
}
@@ -718,8 +734,7 @@ usage(int exitval, FILE *fp)
/* Not factoring out common stuff makes it easier to translate. */
fprintf(fp, _("Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n"),
myname);
- if (which_gawk != exe_debugging)
- fprintf(fp, _("Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n"),
+ fprintf(fp, _("Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n"),
myname, quote, quote);
/* GNU long options info. This is too many options. */
@@ -733,19 +748,20 @@ usage(int exitval, FILE *fp)
fputs(_("\t-c\t\t\t--traditional\n"), fp);
fputs(_("\t-C\t\t\t--copyright\n"), fp);
fputs(_("\t-d[file]\t\t--dump-variables[=file]\n"), fp);
+ fputs(_("\t-D[file]\t\t--debug[=file]\n"), fp);
fputs(_("\t-e 'program-text'\t--source='program-text'\n"), fp);
fputs(_("\t-E file\t\t\t--exec=file\n"), fp);
fputs(_("\t-g\t\t\t--gen-pot\n"), fp);
fputs(_("\t-h\t\t\t--help\n"), fp);
+ fputs(_("\t-l library\t\t--load=library\n"), fp);
fputs(_("\t-L [fatal]\t\t--lint[=fatal]\n"), fp);
fputs(_("\t-n\t\t\t--non-decimal-data\n"), fp);
fputs(_("\t-N\t\t\t--use-lc-numeric\n"), fp);
+ fputs(_("\t-o[file]\t\t--pretty-print[=file]\n"), fp);
fputs(_("\t-O\t\t\t--optimize\n"), fp);
fputs(_("\t-p[file]\t\t--profile[=file]\n"), fp);
fputs(_("\t-P\t\t\t--posix\n"), fp);
fputs(_("\t-r\t\t\t--re-interval\n"), fp);
- if (which_gawk == exe_debugging)
- fputs(_("\t-R file\t\t\t--command=file\n"), fp);
fputs(_("\t-S\t\t\t--sandbox\n"), fp);
fputs(_("\t-t\t\t\t--lint-old\n"), fp);
fputs(_("\t-V\t\t\t--version\n"), fp);
diff --git a/mbsupport.h b/mbsupport.h
index 6008da77..f647d788 100644
--- a/mbsupport.h
+++ b/mbsupport.h
@@ -40,6 +40,7 @@
#if defined(HAVE_ISWCTYPE) \
&& defined(HAVE_LOCALE_H) \
+ && (defined(HAVE_BTOWC) || defined(ZOS_USS)) \
&& defined(HAVE_MBRLEN) \
&& defined(HAVE_MBRTOWC) \
&& defined(HAVE_WCHAR_H) \
@@ -67,4 +68,25 @@
#if ! MBS_SUPPORT
# undef MB_CUR_MAX
# define MB_CUR_MAX 1
+
+/* All this glop is for dfa.c. Bleah. */
+
+#ifndef DJGPP
+#define wchar_t char
+#endif
+
+#define wctype_t int
+#define wint_t int
+#define mbstate_t int
+#define WEOF EOF
+#define towupper toupper
+#define towlower tolower
+#define btowc(x) (x)
+#define iswalnum isalnum
+#define iswalpha isalpha
+#define iswupper isupper
+
+extern wctype_t wctype(const char *name);
+extern int iswctype(wint_t wc, wctype_t desc);
+extern int wcscoll(const wchar_t *ws1, const wchar_t *ws2);
#endif
diff --git a/missing_d/ChangeLog b/missing_d/ChangeLog
index 8aaeb418..4a06aa60 100644
--- a/missing_d/ChangeLog
+++ b/missing_d/ChangeLog
@@ -1,3 +1,11 @@
+2011-11-02 Pat Rankin <r.pat.rankin@gmail.com>
+
+ * wcmisc.c: Make code be conditional upon corresponding !HAVE_WCxxx.
+
+2011-11-01 Arnold D. Robbins <arnold@skeeve.com>
+
+ * wcmisc.c: New file.
+
2011-06-23 Arnold D. Robbins <arnold@skeeve.com>
* ChangeLog.0: Rotated ChangeLog into this file.
diff --git a/missing_d/wcmisc.c b/missing_d/wcmisc.c
new file mode 100644
index 00000000..d2b7aa08
--- /dev/null
+++ b/missing_d/wcmisc.c
@@ -0,0 +1,100 @@
+/* wcmisc.c - replace wcXXXX routines
+ Copyright (C) 2011 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc.,
+ 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA */
+
+#if !defined(HAVE_WCTYPE) || !defined(HAVE_ISWCTYPE)
+static const char *classes[] = {
+ "<dummy>",
+ "alnum",
+ "alpha",
+ "blank",
+ "cntrl",
+ "digit",
+ "graph",
+ "lower",
+ "print",
+ "punct",
+ "space",
+ "upper",
+ "xdigit",
+ NULL
+};
+#endif
+
+#ifndef HAVE_ISWCTYPE
+static int is_blank (int c)
+{
+ return (c == ' ' || c == '\t');
+}
+#endif
+
+#ifndef HAVE_WCTYPE
+wctype_t wctype(const char *name)
+{
+ int i;
+
+ for (i = 1; classes[i] != NULL; i++)
+ if (strcmp(name, classes[i]) == 0)
+ return i;
+
+ return 0;
+}
+#endif
+
+#ifndef HAVE_ISWCTYPE
+int iswctype(wint_t wc, wctype_t desc)
+{
+ int j = sizeof(classes) / sizeof(classes[0]);
+
+ if (desc >= j || desc == 0)
+ return 0;
+
+ switch (desc) {
+ case 1: return isalnum(wc);
+ case 2: return isalpha(wc);
+ case 3: return is_blank(wc);
+ case 4: return iscntrl(wc);
+ case 5: return isdigit(wc);
+ case 6: return isgraph(wc);
+ case 7: return islower(wc);
+ case 8: return isprint(wc);
+ case 9: return ispunct(wc);
+ case 10: return isspace(wc);
+ case 11: return isupper(wc);
+ case 12: return isxdigit(wc);
+ default: return 0;
+ }
+}
+#endif
+
+#ifndef HAVE_WCSCOLL
+int wcscoll(const wchar_t *ws1, const wchar_t *ws2)
+{
+ size_t i;
+
+ for (i = 0; ws1[i] != 0 && ws2[i] != 0; i++) {
+ if (ws1[i] < ws2[i])
+ return -1;
+ else if (ws1[i] > ws2[i])
+ return 1;
+ }
+
+ return (ws1[i] - ws2[i]);
+}
+#endif
+
+/*wcmisc.c*/
diff --git a/msg.c b/msg.c
index 84a4e5cd..10f3837a 100644
--- a/msg.c
+++ b/msg.c
@@ -46,8 +46,6 @@ err(const char *s, const char *emsg, va_list argp)
(void) fflush(output_fp);
me = myname;
- if (STREQN(me, "dgawk", 5))
- me = &myname[1];
(void) fprintf(stderr, "%s: ", me);
#ifdef GAWKDEBUG
if (srcfile != NULL) {
diff --git a/pc/ChangeLog b/pc/ChangeLog
index 9f56a20d..5f287dd8 100644
--- a/pc/ChangeLog
+++ b/pc/ChangeLog
@@ -1,4 +1,27 @@
-2011-10-27 Scott Deifik <scottd.mail@sbcglobal.net>
+2011-12-12 Scott Deifik <scottd.mail@sbcglobal.net>
+
+ * Makefile.tst: Sync with mainline version.
+
+2011-12-06 Scott Deifik <scottd.mail@sbcglobal.net>
+
+ * Makefile.tst: Sync with mainline version.
+ Use testoutcmp.awk script.
+
+2011-12-06 Arnold D. Robbins <arnold@skeeve.com>
+
+ * testoutcmp.awk: Script to replace cmd for DJGPP.
+
+2011-11-01 Scott Deifik <scottd.mail@sbcglobal.net>
+
+ * config.sed: Additional update.
+
+2011-10-29 Eli Zaretskii <eliz@gnu.org>
+
+ * config.sed: Fix some edits, to be consistent with the old
+ config.h file. Make regexps match #undef lines with whitespace
+ at the end of the line. Add forgotten EMX #defines.
+
+2011-10-27 Scott Deifik <scottd.mail@sbcglobal.net>
* Makefile.tst: Sync with mainline version.
diff --git a/pc/Makefile.tst b/pc/Makefile.tst
index e63b8eb5..f14341c8 100644
--- a/pc/Makefile.tst
+++ b/pc/Makefile.tst
@@ -90,6 +90,10 @@ CMP = diff
#CMP = diff -c
#CMP = gcmp
+# cmp replacement program for PC where the error messages aren't
+# exactly the same. Should run even on old awk.
+TESTOUTCMP = $(AWK) -f ../testoutcmp.awk
+
# Set your "cp," "mv," and "mkdir" commands here. Note: DOS's copy must take
# forward slashes.
#CP = cp
@@ -115,6 +119,7 @@ PATH_SEPARATOR = ;
# ============================================================================
srcdir = .
+abs_builddir = .
# Get rid of core files when cleaning and generated .ok file
CLEANFILES = core core.* fmtspcl.ok
@@ -301,7 +306,7 @@ argarray::
.) : ;; \
*) rm -f ./argarray.in ;; \
esac
- @-$(CMP) $(srcdir)/argarray.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
regtest::
@echo 'Some of the output from regtest is very system specific, do not'
@@ -316,44 +321,45 @@ manyfiles::
@$(AWK) 'BEGIN { for (i = 1; i <= 1030; i++) print i, i}' >_$@
@$(AWK) -f $(srcdir)/manyfiles.awk _$@ _$@
@wc -l junk/* | $(AWK) '$$1 != 2' | wc -l | sed "s/ *//g" > _$@
- @rm -rf junk ; $(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+ @rm -rf junk
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
compare::
@echo $@
@$(AWK) -f $(srcdir)/compare.awk 0 1 $(srcdir)/compare.in >_$@
- @-$(CMP) $(srcdir)/compare.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
inftest::
@echo $@
@echo This test is very machine specific...
@echo Expect inftest to fail with DJGPP.
@$(AWK) -f $(srcdir)/inftest.awk | sed "s/inf/Inf/g" >_$@
- @-$(CMP) $(srcdir)/inftest.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
getline2::
@echo $@
@$(AWK) -f $(srcdir)/getline2.awk $(srcdir)/getline2.awk $(srcdir)/getline2.awk >_$@
- @-$(CMP) $(srcdir)/getline2.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
awkpath::
@echo $@
@AWKPATH="$(srcdir)$(PATH_SEPARATOR)$(srcdir)/lib" $(AWK) -f awkpath.awk >_$@
- @-$(CMP) $(srcdir)/awkpath.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
argtest::
@echo $@
@$(AWK) -f $(srcdir)/argtest.awk -x -y abc >_$@
- @-$(CMP) $(srcdir)/argtest.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
badargs::
@echo $@
@-$(AWK) -f 2>&1 | grep -v patchlevel >_$@
- @-$(CMP) $(srcdir)/badargs.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
nonl::
@echo $@
@-AWKPATH=$(srcdir) $(AWK) --lint -f nonl.awk /dev/null >_$@ 2>&1
- @-$(CMP) $(srcdir)/nonl.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
strftime::
@echo This test could fail on slow machines or on a minute boundary,
@@ -370,7 +376,7 @@ strftime::
litoct::
@echo $@
@echo ab | $(AWK) --traditional -f $(srcdir)/litoct.awk >_$@
- @-$(CMP) $(srcdir)/litoct.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
devfd::
@echo $@
@@ -381,13 +387,13 @@ devfd::
fflush::
@echo $@
@$(srcdir)/fflush.sh >_$@
- @-$(CMP) $(srcdir)/fflush.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
tweakfld::
@echo $@
@$(AWK) -f $(srcdir)/tweakfld.awk $(srcdir)/tweakfld.in >_$@
@rm -f errors.cleanup
- @-$(CMP) $(srcdir)/tweakfld.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
mmap8k::
@echo $@
@@ -397,7 +403,7 @@ mmap8k::
tradanch::
@echo $@
@$(AWK) --traditional -f $(srcdir)/tradanch.awk $(srcdir)/tradanch.in >_$@
- @-$(CMP) $(srcdir)/tradanch.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.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.
@@ -413,12 +419,12 @@ strftlng::
@if $(CMP) $(srcdir)/strftlng.ok _$@ >/dev/null 2>&1 ; then : ; else \
TZ=UTC0; export TZ; $(AWK) -f $(srcdir)/strftlng.awk >_$@ ; \
fi
- @-$(CMP) $(srcdir)/strftlng.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
nors::
@echo $@
@echo A B C D E | tr -d '\12\15' | $(AWK) '{ print $$NF }' - $(srcdir)/nors.in > _$@
- @-$(CMP) $(srcdir)/nors.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fmtspcl.ok: fmtspcl.tok
@$(AWK) -v "sd=$(srcdir)" 'BEGIN {pnan = sprintf("%g",sqrt(-1)); nnan = sprintf("%g",-sqrt(-1)); pinf = sprintf("%g",-log(0)); ninf = sprintf("%g",log(0))} {sub(/positive_nan/,pnan); sub(/negative_nan/,nnan); sub(/positive_infinity/,pinf); sub(/negative_infinity/,ninf); sub(/fmtspcl/,(sd"/fmtspcl")); print}' < $(srcdir)/fmtspcl.tok > $@ 2>/dev/null
@@ -432,18 +438,18 @@ fmtspcl: fmtspcl.ok
reint::
@echo $@
@$(AWK) --re-interval -f $(srcdir)/reint.awk $(srcdir)/reint.in >_$@
- @-$(CMP) $(srcdir)/reint.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
pipeio1::
@echo $@
@$(AWK) -f $(srcdir)/pipeio1.awk >_$@
@rm -f test1 test2
- @-$(CMP) $(srcdir)/pipeio1.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
pipeio2::
@echo $@
@$(AWK) -v SRCDIR=$(srcdir) -f $(srcdir)/pipeio2.awk >_$@
- @-$(CMP) $(srcdir)/pipeio2.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
clobber::
@echo $@
@@ -454,7 +460,7 @@ clobber::
arynocls::
@echo $@
@-AWKPATH=$(srcdir) $(AWK) -v INPUT=$(srcdir)/arynocls.in -f arynocls.awk >_$@
- @-$(CMP) $(srcdir)/arynocls.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
getlnbuf::
@echo $@
@@ -498,12 +504,12 @@ inetdayt::
redfilnm::
@echo $@
@$(AWK) -f $(srcdir)/redfilnm.awk srcdir=$(srcdir) $(srcdir)/redfilnm.in >_$@
- @-$(CMP) $(srcdir)/redfilnm.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
leaddig::
@echo $@
@$(AWK) -v x=2E -f $(srcdir)/leaddig.awk >_$@
- @-$(CMP) $(srcdir)/leaddig.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
gsubtst3::
@echo $@
@@ -512,9 +518,9 @@ gsubtst3::
space::
@echo $@
- @echo Expect space to fail with DJGPP.
@$(AWK) -f ' ' $(srcdir)/space.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
- @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+# @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+ @-$(TESTOUTCMP) $(srcdir)/$@.ok _$@ && rm -f _$@
printf0::
@echo $@
@@ -741,7 +747,8 @@ beginfile1::
beginfile2:
@echo $@
@-( cd $(srcdir) && AWK="$(abs_builddir)/$(AWKPROG)" $(srcdir)/$@.sh $(srcdir)/$@.in ) > _$@ 2>&1
- @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+# @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+ @-$(TESTOUTCMP) $(srcdir)/$@.ok _$@ && rm -f _$@
dumpvars::
@echo $@
@@ -1876,6 +1883,7 @@ procinfs:
pty1:
@echo pty1
+ @echo Expect pty1 to fail with DJGPP.
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
diff --git a/pc/config.h b/pc/config.h
index 41fd895a..a9dac512 100644
--- a/pc/config.h
+++ b/pc/config.h
@@ -13,7 +13,7 @@
#define GETGROUPS_T gid_t
/* Define to 1 if the `getpgrp' function requires zero arguments. */
-#undef GETPGRP_VOID
+#define GETPGRP_VOID 1
/* Define to 1 if you have the `alarm' function. */
#define HAVE_ALARM 1
@@ -51,9 +51,7 @@
#undef HAVE_DOPRNT
/* Define to 1 if you have the <fcntl.h> header file. */
-#ifdef __MINGW32__
#define HAVE_FCNTL_H 1
-#endif
/* Define to 1 if you have the `fmod' function. */
#define HAVE_FMOD 1
@@ -131,9 +129,7 @@
#undef HAVE_LIBSIGSEGV
/* Define to 1 if you have the <limits.h> header file. */
-#if defined(DJGPP) || defined(__MINGW32__)
#define HAVE_LIMITS_H 1
-#endif
/* Define to 1 if you have the <locale.h> header file. */
#ifdef __MINGW32__
@@ -298,9 +294,7 @@
#undef HAVE_ST_BLKSIZE
/* Define to 1 if you have the `system' function. */
-#ifdef __MINGW32__
#define HAVE_SYSTEM 1
-#endif
/* Define to 1 if you have the <sys/ioctl.h> header file. */
#undef HAVE_SYS_IOCTL_H
@@ -354,9 +348,7 @@
#define HAVE_TZNAME 1
/* Define to 1 if you have the `tzset' function. */
-#ifdef __MINGW32__
#define HAVE_TZSET 1
-#endif
/* Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>. */
#if defined(DJGPP) || defined(__MINGW32__)
@@ -433,7 +425,7 @@
#define PACKAGE_NAME "GNU Awk"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "GNU Awk 4.0.0c"
+#define PACKAGE_STRING "GNU Awk 4.0.0f"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "gawk"
@@ -442,7 +434,7 @@
#define PACKAGE_URL "http://www.gnu.org/software/gawk/"
/* Define to the version of this package. */
-#define PACKAGE_VERSION "4.0.0c"
+#define PACKAGE_VERSION "4.0.0f"
/* Define to 1 if *printf supports %F format */
#undef PRINTF_HAS_F_FORMAT
@@ -504,7 +496,7 @@
/* Version number of package */
-#define VERSION "4.0.0c"
+#define VERSION "4.0.0f"
/* Number of bits in a file offset, on hosts where this is settable. */
#undef _FILE_OFFSET_BITS
@@ -595,6 +587,11 @@
#define HAVE_POPEN_H 1
#endif
+#if defined(__EMX__)
+#define strcasecmp stricmp
+#define strncasecmp strnicmp
+#endif
+
#if defined(__MINGW32__)
# define WEXITSTATUS(stat_val) ((stat_val) & ~0xC0000000)
#endif
diff --git a/pc/config.sed b/pc/config.sed
index c0fa766a..7fe0f922 100644
--- a/pc/config.sed
+++ b/pc/config.sed
@@ -26,111 +26,110 @@
/configh\.in/a\
/* pc/config.h. Generated automatically by pc/config.sed. */
+s/^#undef GETPGRP_VOID *$/#define GETPGRP_VOID 1/
s/^#undef GETGROUPS_T *$/#define GETGROUPS_T gid_t/
+/^#undef GETPGRP_VOID$/c\
+#ifdef DJGPP\
+#define GETPGRP_VOID 1\
+#endif
s/^#undef HAVE_ALARM *$/#define HAVE_ALARM 1/
s/^#undef HAVE_ATEXIT *$/#define HAVE_ATEXIT 1/
-/^#undef HAVE_BTOWC$/c\
+/^#undef HAVE_BTOWC *$/c\
#ifdef _WIN32\
#define HAVE_BTOWC 1\
#endif
-/^#undef HAVE_DECL_TZNAME$/c\
+/^#undef HAVE_DECL_TZNAME *$/c\
#ifdef __MINGW32__\
#define HAVE_DECL_TZNAME 1\
#endif
-/^#undef HAVE_FCNTL_H$/c\
-#ifdef __MINGW32__\
-#define HAVE_FCNTL_H 1\
-#endif
+s/^#undef HAVE_FCNTL_H *$/#define HAVE_FCNTL_H 1/
s/^#undef HAVE_FMOD *$/#define HAVE_FMOD 1/
-/^#undef HAVE_INTMAX_T$/c\
+/^#undef HAVE_INTMAX_T *$/c\
#ifdef __MINGW32__\
#define HAVE_INTMAX_T 1\
#endif
-/^#undef HAVE_INTTYPES_H$/c\
+/^#undef HAVE_INTTYPES_H *$/c\
#ifdef __MINGW32__\
#define HAVE_INTTYPES_H 1\
#endif
-/^#undef HAVE_INTTYPES_H_WITH_UINTMAX$/c\
+/^#undef HAVE_INTTYPES_H_WITH_UINTMAX *$/c\
#ifdef __MINGW32__\
#define HAVE_INTTYPES_H_WITH_UINTMAX 1\
#endif
-/^#undef HAVE_ISASCII$/c\
+/^#undef HAVE_ISASCII *$/c\
#ifdef __MINGW32__\
#define HAVE_ISASCII 1\
#endif
-/^#undef HAVE_ISWCTYPE$/c\
+/^#undef HAVE_ISWCTYPE *$/c\
#ifdef __MINGW32__\
#define HAVE_ISWCTYPE 1\
#endif
-/^#undef HAVE_ISWLOWER$/c\
+/^#undef HAVE_ISWLOWER *$/c\
#ifdef __MINGW32__\
#define HAVE_ISWLOWER 1\
#endif
-/^#undef HAVE_ISWUPPER$/c\
+/^#undef HAVE_ISWUPPER *$/c\
#ifdef __MINGW32__\
#define HAVE_ISWUPPER 1\
#endif
s/^#undef HAVE_LIBM *$/#define HAVE_LIBM 1/
-/^#undef HAVE_LIMITS_H$/c\
-#if defined(DJGPP) || defined(__MINGW32__)\
-#define HAVE_LIMITS_H 1\
-#endif
-/^#undef HAVE_LOCALE_H$/c\
+s/^#undef HAVE_LIMITS_H *$/#define HAVE_LIMITS_H 1/
+/^#undef HAVE_LOCALE_H *$/c\
#ifdef __MINGW32__\
#define HAVE_LOCALE_H 1\
#endif
-/^#undef HAVE_LONG_LONG$/c\
+/^#undef HAVE_LONG_LONG *$/c\
#ifdef __MINGW32__\
#define HAVE_LONG_LONG 1\
#endif
-/^#undef HAVE_MBRLEN$/c\
+/^#undef HAVE_MBRLEN *$/c\
#ifdef __MINGW32__\
#define HAVE_MBRLEN 1\
#endif
-/^#undef HAVE_MBRTOWC$/c\
+/^#undef HAVE_MBRTOWC *$/c\
#ifdef __MINGW32__\
#define HAVE_MBRTOWC 1\
#endif
s/^#undef HAVE_MEMCMP *$/#define HAVE_MEMCMP 1/
s/^#undef HAVE_MEMCPY *$/#define HAVE_MEMCPY 1/
-/^#undef HAVE_MEMMOVE$/c\
+/^#undef HAVE_MEMMOVE *$/c\
#ifdef __MINGW32__\
#define HAVE_MEMMOVE 1\
#endif
s/^#undef HAVE_MEMSET *$/#define HAVE_MEMSET 1/
-/^#undef HAVE_MKSTEMP$/c\
+/^#undef HAVE_MKSTEMP *$/c\
#ifdef DJGPP\
#define HAVE_MKSTEMP 1\
#endif
s/^#undef HAVE_MKTIME *$/#define HAVE_MKTIME 1/
-/^#undef HAVE_SETENV$/c\
+/^#undef HAVE_SETENV *$/c\
#if defined(__MINGW32__) || defined(__DJGPP__)\
#define HAVE_SETENV 1\
#endif
-/^#undef HAVE_SETLOCALE$/c\
+/^#undef HAVE_SETLOCALE *$/c\
#ifdef __MINGW32__\
#define HAVE_SETLOCALE 1\
#endif
-/^#undef HAVE_SNPRINTF$/c\
+/^#undef HAVE_SNPRINTF *$/c\
#ifdef __MINGW32__\
#define HAVE_SNPRINTF 1\
#endif
s/^#undef HAVE_STDARG_H *$/#define HAVE_STDARG_H 1/
-/^#undef HAVE_STDDEF_H$/c\
+/^#undef HAVE_STDDEF_H *$/c\
#ifdef __GNUC__\
#define HAVE_STDDEF_H 1\
#endif
-/^#undef HAVE_STDINT_H$/c\
+/^#undef HAVE_STDINT_H *$/c\
#ifdef __MINGW32__\
#define HAVE_STDINT_H 1\
#endif
-/^#undef HAVE_STDLIB_H$/c\
+/^#undef HAVE_STDLIB_H *$/c\
#ifdef __MINGW32__\
#define HAVE_STDLIB_H 1\
#endif
s/^#undef HAVE_STRCHR *$/#define HAVE_STRCHR 1/
s/^#undef HAVE_STRERROR *$/#define HAVE_STRERROR 1/
-/^#undef HAVE_STRFTIME$/c\
+/^#undef HAVE_STRFTIME *$/c\
#ifdef __MINGW32__\
/* MinGW uses the replacement from missing_d, to support the %e specifier. */\
#define strftime rpl_strftime\
@@ -139,88 +138,82 @@ s/^#undef HAVE_STRERROR *$/#define HAVE_STRERROR 1/
#endif
s/^#undef HAVE_STRINGIZE *$/#define HAVE_STRINGIZE 1/
s/^#undef HAVE_STRING_H *$/#define HAVE_STRING_H 1/
-/^#undef HAVE_STRNCASECMP$/c\
+/^#undef HAVE_STRNCASECMP *$/c\
#define HAVE_STRNCASECMP 1\
#ifdef __EMX__\
#define strncasecmp strnicmp\
#endif
s/^#undef HAVE_STRTOD *$/#define HAVE_STRTOD 1/
-/^#undef HAVE_STRTOUL$/c\
+/^#undef HAVE_STRTOUL *$/c\
#ifdef __MINGW32__\
#define HAVE_STRTOUL 1\
#endif
-/^#undef HAVE_SYSTEM$/c\
-#ifdef __MINGW32__\
-#define HAVE_SYSTEM 1\
-#endif
-/^#undef HAVE_SYS_PARAM_H$/c\
+s/^#undef HAVE_SYSTEM *$/#define HAVE_SYSTEM 1/
+/^#undef HAVE_SYS_PARAM_H *$/c\
#ifndef __MINGW32__\
#define HAVE_SYS_PARAM_H 1\
#endif
-/^#undef HAVE_SYS_STAT_H$/c\
+/^#undef HAVE_SYS_STAT_H *$/c\
#ifdef __MINGW32__\
#define HAVE_SYS_STAT_H 1\
#endif
-/^#undef HAVE_SYS_TIME_H$/c\
+/^#undef HAVE_SYS_TIME_H *$/c\
#if defined(DJGPP) || defined(__MINGW32__)\
#define HAVE_SYS_TIME_H 1\
#endif
s/^#undef HAVE_SYS_TYPES_H *$/#define HAVE_SYS_TYPES_H 1/
-/^#undef HAVE_TOWLOWER$/c\
+/^#undef HAVE_TOWLOWER *$/c\
#ifdef __MINGW32__\
#define HAVE_TOWLOWER 1\
#endif
-/^#undef HAVE_TOWUPPER$/c\
+/^#undef HAVE_TOWUPPER *$/c\
#ifdef __MINGW32__\
#define HAVE_TOWUPPER 1\
#endif
s/^#undef HAVE_TZNAME *$/#define HAVE_TZNAME 1/
-/^#undef HAVE_TZSET$/c\
-#ifdef __MINGW32__\
-#define HAVE_TZSET 1\
-#endif
-/^#undef HAVE_UINTMAX_T$/c\
+s/^#undef HAVE_TZSET *$/#define HAVE_TZSET 1/
+/^#undef HAVE_UINTMAX_T *$/c\
#if defined(DJGPP) || defined(__MINGW32__)\
#define HAVE_UINTMAX_T 1\
#ifdef DJGPP\
#define uintmax_t unsigned long long\
#endif\
#endif
-/^#undef HAVE_UNISTD_H$/c\
+/^#undef HAVE_UNISTD_H *$/c\
#if defined(DJGPP) || defined(__MINGW32__)\
#define HAVE_UNISTD_H 1\
#endif
s/^#undef HAVE_UNSIGNED_LONG_LONG *$/#define HAVE_UNSIGNED_LONG_LONG 1/
-/^#undef HAVE_USLEEP$/c\
+/^#undef HAVE_USLEEP *$/c\
#if defined(DJGPP) || defined(__MINGW32__)\
#define HAVE_USLEEP 1\
#endif
s/^#undef HAVE_VPRINTF *$/#define HAVE_VPRINTF 1/
-/^#undef HAVE_WCHAR_H$/c\
+/^#undef HAVE_WCHAR_H *$/c\
#ifdef __MINGW32__\
#define HAVE_WCHAR_H 1\
#endif
-/^#undef HAVE_WCRTOMB$/c\
+/^#undef HAVE_WCRTOMB *$/c\
#ifdef __MINGW32__\
#define HAVE_WCRTOMB 1\
#endif
-/^#undef HAVE_WCSCOLL$/c\
+/^#undef HAVE_WCSCOLL *$/c\
#ifdef __MINGW32__\
#define HAVE_WCSCOLL 1\
#endif
-/^#undef HAVE_WCTYPE$/c\
+/^#undef HAVE_WCTYPE *$/c\
#ifdef __MINGW32__\
#define HAVE_WCTYPE 1\
#endif
-/^#undef HAVE_WCTYPE_H$/c\
+/^#undef HAVE_WCTYPE_H *$/c\
#ifdef __MINGW32__\
#define HAVE_WCTYPE_H 1\
#endif
-/^#undef HAVE_WCTYPE_T$/c\
+/^#undef HAVE_WCTYPE_T *$/c\
#ifdef __MINGW32__\
#define HAVE_WCTYPE_T 1\
#endif
-/^#undef HAVE_WINT_T$/c\
+/^#undef HAVE_WINT_T *$/c\
#ifdef __MINGW32__\
#define HAVE_WINT_T 1\
#endif
@@ -231,31 +224,31 @@ s/^#undef RETSIGTYPE *$/#define RETSIGTYPE void/
#if defined(DJGPP) || defined(__MINGW32__)\
#include <limits.h>\
#endif
-/^#undef SIZEOF_UNSIGNED_INT$/c\
+/^#undef SIZEOF_UNSIGNED_INT *$/c\
#if UINT_MAX == 65536\
#define SIZEOF_UNSIGNED_INT 2\
#elif UINT_MAX == 4294967295U\
#define SIZEOF_UNSIGNED_INT 4\
#endif
-/^#undef SIZEOF_UNSIGNED_LONG$/c\
+/^#undef SIZEOF_UNSIGNED_LONG *$/c\
#if ULONG_MAX == 4294967295UL\
#define SIZEOF_UNSIGNED_LONG 4\
#endif
s/^#undef STDC_HEADERS *$/#define STDC_HEADERS 1/
s/^#undef TIME_WITH_SYS_TIME *$/#define TIME_WITH_SYS_TIME 1/
-/^#undef inline$/c\
+/^#undef inline *$/c\
#ifdef __GNUC__\
#define inline __inline__\
#endif
-/^#undef intmax_t$/c\
+/^#undef intmax_t *$/c\
#ifdef DJGPP\
#define intmax_t long long\
#endif
-/^#undef restrict$/c\
+/^#undef restrict *$/c\
#ifdef DJGPP\
#define restrict\
#endif
-/^#undef uintmax_t$/c\
+/^#undef uintmax_t *$/c\
#ifdef DJGPP\
#define uintmax_t unsigned long long\
#endif
@@ -274,6 +267,11 @@ $a\
#define HAVE_POPEN_H 1\
#endif\
\
+#if defined(__EMX__)\
+#define strcasecmp stricmp\
+#define strncasecmp strnicmp\
+#endif\
+\
#if defined(__MINGW32__)\
# define WEXITSTATUS(stat_val) ((stat_val) & ~0xC0000000)\
#endif
diff --git a/pc/testoutcmp.awk b/pc/testoutcmp.awk
new file mode 100644
index 00000000..ff190155
--- /dev/null
+++ b/pc/testoutcmp.awk
@@ -0,0 +1,38 @@
+# cmp replacement program for PC where the error messages aren't
+# exactly the same. should run even on old awk
+
+{
+ if (FNR == NR)
+ file = 0
+ else
+ file = 1
+ gsub(/\r/, "", $0)
+ lines[file, FNR] = $0
+}
+
+END {
+ if (NR/2 != FNR) {
+ printf("testoutcmp: warning: files are not of equal length!\n") > "/dev/stderr"
+ exit 1
+ }
+
+ for (i = 1; i <= FNR; i++) {
+ good = lines[0, i]
+ actual = lines[1, i]
+ if (good == actual)
+ continue
+
+ l = length(good)
+ if (substr(good, l, 1) == ")")
+ l--
+ if (substr(good, 1, l) == substr(actual, 1, l))
+ continue
+ else {
+ printf("%s and %s are not equal\n", ARGV[1],
+ ARGV[2]) > "/dev/stderr"
+ exit 1
+ }
+ }
+
+ exit 0
+}
diff --git a/po/ast.gmo b/po/ast.gmo
deleted file mode 100644
index 7c2ac4e2..00000000
--- a/po/ast.gmo
+++ /dev/null
Binary files differ
diff --git a/po/ca.gmo b/po/ca.gmo
deleted file mode 100644
index 426541dc..00000000
--- a/po/ca.gmo
+++ /dev/null
Binary files differ
diff --git a/po/da.gmo b/po/da.gmo
index 6685bdb7..0270b5ce 100644
--- a/po/da.gmo
+++ b/po/da.gmo
Binary files differ
diff --git a/po/da.po b/po/da.po
index 33c60c39..bb9d3b9d 100644
--- a/po/da.po
+++ b/po/da.po
@@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gawk 3.1.83\n"
"Report-Msgid-Bugs-To: arnold@skeeve.com\n"
-"POT-Creation-Date: 2011-10-24 05:57+0200\n"
+"POT-Creation-Date: 2011-11-14 21:46+0200\n"
"PO-Revision-Date: 2011-05-22 10:37+0200\n"
"Last-Translator: Keld Simonsen <keld@keldix.com>\n"
"Language-Team: Danish <dansk@dansk-gruppen.dk>\n"
@@ -46,7 +46,7 @@ msgid "attempt to use scalar `%s' as an array"
msgstr "forsøg på at bruge skalar '%s' som et array"
#: array.c:302 array.c:707 builtin.c:84 builtin.c:1384 builtin.c:1426
-#: builtin.c:1439 builtin.c:1856 builtin.c:1868 eval.c:1135 eval.c:1139
+#: builtin.c:1439 builtin.c:1858 builtin.c:1870 eval.c:1135 eval.c:1139
#: eval.c:1495 eval.c:1812
#, c-format
msgid "attempt to use array `%s' in a scalar context"
@@ -760,205 +760,205 @@ msgstr ""
"substr: længden %g ved startindeks %g overskrider længden af første argument "
"(%lu)"
-#: builtin.c:1655
+#: builtin.c:1656
msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type"
msgstr "strftime: formatværdi i PROCINFO[\"strftime\"] har numerisk type"
-#: builtin.c:1678
+#: builtin.c:1679
msgid "strftime: received non-numeric second argument"
msgstr "strftime: fik et ikke-numerisk andet argument"
-#: builtin.c:1681
+#: builtin.c:1682
msgid "strftime: second argument less than 0 or too big for time_t"
msgstr ""
-#: builtin.c:1687
+#: builtin.c:1689
msgid "strftime: received non-string first argument"
msgstr "strftime: fik et første argument som ikke er en streng"
-#: builtin.c:1693
+#: builtin.c:1695
msgid "strftime: received empty format string"
msgstr "strftime: fik en tom formatstreng"
-#: builtin.c:1759
+#: builtin.c:1761
msgid "mktime: received non-string argument"
msgstr "mktime: fik et argument som ikke er en streng"
-#: builtin.c:1776
+#: builtin.c:1778
msgid "mktime: at least one of the values is out of the default range"
msgstr "mktime: mindst én af værdierne er udenfor standardområdet"
-#: builtin.c:1811
+#: builtin.c:1813
msgid "'system' function not allowed in sandbox mode"
msgstr "'system'-funktion ikke tilladt i sandkasse-tilstand"
-#: builtin.c:1816
+#: builtin.c:1818
msgid "system: received non-string argument"
msgstr "system: fik et argument som ikke er en streng"
-#: builtin.c:1871 eval.c:1159 eval.c:1790 eval.c:1803
+#: builtin.c:1873 eval.c:1159 eval.c:1790 eval.c:1803
#, c-format
msgid "reference to uninitialized variable `%s'"
msgstr "reference til ikke-initieret variabel '%s'"
-#: builtin.c:1938
+#: builtin.c:1940
#, c-format
msgid "reference to uninitialized field `$%d'"
msgstr "reference til ikke-initieret felt '$%d'"
-#: builtin.c:2025
+#: builtin.c:2027
msgid "tolower: received non-string argument"
msgstr "tolower: fik et argument som ikke er en streng"
-#: builtin.c:2059
+#: builtin.c:2061
msgid "toupper: received non-string argument"
msgstr "toupper: fik et argument som ikke er en streng"
-#: builtin.c:2095
+#: builtin.c:2097
msgid "atan2: received non-numeric first argument"
msgstr "atan2: fik et ikke-numerisk første argument"
-#: builtin.c:2097
+#: builtin.c:2099
msgid "atan2: received non-numeric second argument"
msgstr "atan2: fik et ikke-numerisk andet argument"
-#: builtin.c:2116
+#: builtin.c:2118
msgid "sin: received non-numeric argument"
msgstr "sin: fik et ikke-numerisk argument"
-#: builtin.c:2132
+#: builtin.c:2134
msgid "cos: received non-numeric argument"
msgstr "cos: fik et ikke-numerisk argument"
-#: builtin.c:2185
+#: builtin.c:2187
msgid "srand: received non-numeric argument"
msgstr "srand: fik et ikke-numerisk argument"
-#: builtin.c:2216
+#: builtin.c:2218
msgid "match: third argument is not an array"
msgstr "match: tredje argument er ikke et array"
-#: builtin.c:2480
+#: builtin.c:2482
msgid "gensub: third argument of 0 treated as 1"
msgstr "gensub: 0 i tredje argument behandlet som 1"
-#: builtin.c:2773
+#: builtin.c:2775
msgid "lshift: received non-numeric first argument"
msgstr "lshift: fik et ikke-numerisk første argument"
-#: builtin.c:2775
+#: builtin.c:2777
msgid "lshift: received non-numeric second argument"
msgstr "lshift: fik et ikke-numerisk andet argument"
-#: builtin.c:2781
+#: builtin.c:2783
#, 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:2783
+#: builtin.c:2785
#, c-format
msgid "lshift(%lf, %lf): fractional values will be truncated"
msgstr "lshift(%lf, %lf): kommatalsværdier vil blive trunkeret"
-#: builtin.c:2785
+#: builtin.c:2787
#, 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:2810
+#: builtin.c:2812
msgid "rshift: received non-numeric first argument"
msgstr "rshift: fik et ikke-numerisk første argument"
-#: builtin.c:2812
+#: builtin.c:2814
msgid "rshift: received non-numeric second argument"
msgstr "rshift: fik et ikke-numerisk andet argument"
-#: builtin.c:2818
+#: builtin.c:2820
#, 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:2820
+#: builtin.c:2822
#, c-format
msgid "rshift(%lf, %lf): fractional values will be truncated"
msgstr "rshift(%lf, %lf): kommatalsværdier vil blive trunkeret"
-#: builtin.c:2822
+#: builtin.c:2824
#, 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:2847
+#: builtin.c:2849
msgid "and: received non-numeric first argument"
msgstr "and: fik et ikke-numerisk første argument"
-#: builtin.c:2849
+#: builtin.c:2851
msgid "and: received non-numeric second argument"
msgstr "and: fik et ikke-numerisk andet argument"
-#: builtin.c:2855
+#: builtin.c:2857
#, 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:2857
+#: builtin.c:2859
#, c-format
msgid "and(%lf, %lf): fractional values will be truncated"
msgstr "and(%lf, %lf): kommatalsværdier vil blive trunkeret"
-#: builtin.c:2882
+#: builtin.c:2884
msgid "or: received non-numeric first argument"
msgstr "or: fik et ikke-numerisk første argument"
-#: builtin.c:2884
+#: builtin.c:2886
msgid "or: received non-numeric second argument"
msgstr "or: fik et ikke-numerisk andet argument"
-#: builtin.c:2890
+#: builtin.c:2892
#, 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:2892
+#: builtin.c:2894
#, c-format
msgid "or(%lf, %lf): fractional values will be truncated"
msgstr "or(%lf, %lf): kommatalsværdier vil blive trunkeret"
-#: builtin.c:2920
+#: builtin.c:2922
msgid "xor: received non-numeric first argument"
msgstr "xor: fik et ikke-numerisk første argument"
-#: builtin.c:2922
+#: builtin.c:2924
msgid "xor: received non-numeric second argument"
msgstr "xor: fik et ikke-numerisk andet argument"
-#: builtin.c:2928
+#: builtin.c:2930
#, 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:2930
+#: builtin.c:2932
#, c-format
msgid "xor(%lf, %lf): fractional values will be truncated"
msgstr "xor(%lf, %lf): kommatalsværdier vil blive trunkeret"
-#: builtin.c:2954 builtin.c:2960
+#: builtin.c:2956 builtin.c:2962
msgid "compl: received non-numeric argument"
msgstr "compl: fik et ikke-numerisk argument"
-#: builtin.c:2962
+#: builtin.c:2964
#, c-format
msgid "compl(%lf): negative value will give strange results"
msgstr "compl(%lf): negative værdier vil give mærkelige resultater"
-#: builtin.c:2964
+#: builtin.c:2966
#, c-format
msgid "compl(%lf): fractional value will be truncated"
msgstr "compl(%lf): kommatalsværdier vil blive trunkeret"
-#: builtin.c:3133
+#: builtin.c:3135
#, c-format
msgid "dcgettext: `%s' is not a valid locale category"
msgstr "dcgettext: '%s' er ikke en gyldig lokalitetskategori"
diff --git a/po/de.gmo b/po/de.gmo
index f95537b8..f0682785 100644
--- a/po/de.gmo
+++ b/po/de.gmo
Binary files differ
diff --git a/po/de.po b/po/de.po
index 3500bf2d..2c1c6265 100644
--- a/po/de.po
+++ b/po/de.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gawk 4.0.0\n"
"Report-Msgid-Bugs-To: arnold@skeeve.com\n"
-"POT-Creation-Date: 2011-10-24 05:57+0200\n"
+"POT-Creation-Date: 2011-11-14 21:46+0200\n"
"PO-Revision-Date: 2011-09-27 16:38+0200\n"
"Last-Translator: Philipp Thomas <pth@suse.de>\n"
"Language-Team: German <translation-team-de@lists.sourceforge.net>\n"
@@ -42,7 +42,7 @@ msgid "attempt to use scalar `%s' as an array"
msgstr "Es wird versucht, den Skalar »%s« als Array zu verwenden"
#: array.c:302 array.c:707 builtin.c:84 builtin.c:1384 builtin.c:1426
-#: builtin.c:1439 builtin.c:1856 builtin.c:1868 eval.c:1135 eval.c:1139
+#: builtin.c:1439 builtin.c:1858 builtin.c:1870 eval.c:1135 eval.c:1139
#: eval.c:1495 eval.c:1812
#, c-format
msgid "attempt to use array `%s' in a scalar context"
@@ -778,210 +778,210 @@ msgstr ""
"substr: Länge %g am Start-Wert %g überschreitet die Länge des ersten "
"Arguments (%lu)"
-#: builtin.c:1655
+#: builtin.c:1656
msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type"
msgstr "strftime: Formatwert in PROCINFO[\"strftime\"] ist numerischen Typs"
-#: builtin.c:1678
+#: builtin.c:1679
msgid "strftime: received non-numeric second argument"
msgstr "strftime: Das zweite Argument ist keine Zahl"
-#: builtin.c:1681
+#: builtin.c:1682
msgid "strftime: second argument less than 0 or too big for time_t"
msgstr ""
-#: builtin.c:1687
+#: builtin.c:1689
msgid "strftime: received non-string first argument"
msgstr "strftime: Das erste Argument ist kein String"
-#: builtin.c:1693
+#: builtin.c:1695
msgid "strftime: received empty format string"
msgstr "strftime: Der Format-String ist leer"
-#: builtin.c:1759
+#: builtin.c:1761
msgid "mktime: received non-string argument"
msgstr "mktime: Das Argument ist kein String"
-#: builtin.c:1776
+#: builtin.c:1778
msgid "mktime: at least one of the values is out of the default range"
msgstr "mktime: mindestens einer der Werte ist außerhalb des normalen Bereichs"
-#: builtin.c:1811
+#: builtin.c:1813
msgid "'system' function not allowed in sandbox mode"
msgstr "Die Funktion »system« ist im Sandbox-Modus nicht erlaubt"
-#: builtin.c:1816
+#: builtin.c:1818
msgid "system: received non-string argument"
msgstr "system: Das Argument ist kein String"
-#: builtin.c:1871 eval.c:1159 eval.c:1790 eval.c:1803
+#: builtin.c:1873 eval.c:1159 eval.c:1790 eval.c:1803
#, c-format
msgid "reference to uninitialized variable `%s'"
msgstr "Referenz auf die nicht initialisierte Variable »%s«"
-#: builtin.c:1938
+#: builtin.c:1940
#, c-format
msgid "reference to uninitialized field `$%d'"
msgstr "Referenz auf das nicht initialisierte Feld »$%d«"
-#: builtin.c:2025
+#: builtin.c:2027
msgid "tolower: received non-string argument"
msgstr "tolower: das Argument ist kein String"
-#: builtin.c:2059
+#: builtin.c:2061
msgid "toupper: received non-string argument"
msgstr "toupper: das Argument ist kein String"
-#: builtin.c:2095
+#: builtin.c:2097
msgid "atan2: received non-numeric first argument"
msgstr "atan2: das erste Argument ist keine Zahl"
-#: builtin.c:2097
+#: builtin.c:2099
msgid "atan2: received non-numeric second argument"
msgstr "atan2: das zweite Argument ist keine Zahl"
-#: builtin.c:2116
+#: builtin.c:2118
msgid "sin: received non-numeric argument"
msgstr "sin: das Argument ist keine Zahl"
-#: builtin.c:2132
+#: builtin.c:2134
msgid "cos: received non-numeric argument"
msgstr "cos: das Argument ist keine Zahl"
-#: builtin.c:2185
+#: builtin.c:2187
msgid "srand: received non-numeric argument"
msgstr "srand: das Argument ist keine Zahl"
-#: builtin.c:2216
+#: builtin.c:2218
msgid "match: third argument is not an array"
msgstr "match: das dritte Argument ist kein Array"
-#: builtin.c:2480
+#: builtin.c:2482
msgid "gensub: third argument of 0 treated as 1"
msgstr "gensub: 0 als drittes Argument wird als 1 interpretiert"
-#: builtin.c:2773
+#: builtin.c:2775
msgid "lshift: received non-numeric first argument"
msgstr "lshift: das erste Argument ist keine Zahl"
-#: builtin.c:2775
+#: builtin.c:2777
msgid "lshift: received non-numeric second argument"
msgstr "lshift: das zweite Argument ist keine Zahl"
-#: builtin.c:2781
+#: builtin.c:2783
#, c-format
msgid "lshift(%lf, %lf): negative values will give strange results"
msgstr ""
"lshift(%lf, %lf): Negative Werte werden zu merkwürdigen Ergebnissen führen"
-#: builtin.c:2783
+#: builtin.c:2785
#, c-format
msgid "lshift(%lf, %lf): fractional values will be truncated"
msgstr "lshift(%lf, %lf): Dezimalteil wird abgeschnitten"
-#: builtin.c:2785
+#: builtin.c:2787
#, c-format
msgid "lshift(%lf, %lf): too large shift value will give strange results"
msgstr ""
"lshift(%lf, %lf): Zu große Shift-Werte werden zu merkwürdigen Ergebnissen "
"führen"
-#: builtin.c:2810
+#: builtin.c:2812
msgid "rshift: received non-numeric first argument"
msgstr "rshift: das erste Argument ist keine Zahl"
-#: builtin.c:2812
+#: builtin.c:2814
msgid "rshift: received non-numeric second argument"
msgstr "rshift: das zweite Argument ist keine Zahl"
-#: builtin.c:2818
+#: builtin.c:2820
#, c-format
msgid "rshift(%lf, %lf): negative values will give strange results"
msgstr ""
"rshift (%lf, %lf): Negative Werte werden zu merkwürdigen Ergebnissen führen"
-#: builtin.c:2820
+#: builtin.c:2822
#, c-format
msgid "rshift(%lf, %lf): fractional values will be truncated"
msgstr "rshift(%lf, %lf): Dezimalteil wird abgeschnitten"
-#: builtin.c:2822
+#: builtin.c:2824
#, c-format
msgid "rshift(%lf, %lf): too large shift value will give strange results"
msgstr ""
"rshift(%lf, %lf): Zu große Shift-Werte werden zu merkwürdigen Ergebnissen "
"führen"
-#: builtin.c:2847
+#: builtin.c:2849
msgid "and: received non-numeric first argument"
msgstr "and: das erste Argument ist keine Zahl"
-#: builtin.c:2849
+#: builtin.c:2851
msgid "and: received non-numeric second argument"
msgstr "and: das zweite Argument ist keine Zahl"
-#: builtin.c:2855
+#: builtin.c:2857
#, c-format
msgid "and(%lf, %lf): negative values will give strange results"
msgstr ""
"and(%lf, %lf): Negative Werte werden zu merkwürdigen Ergebnissen führen"
-#: builtin.c:2857
+#: builtin.c:2859
#, c-format
msgid "and(%lf, %lf): fractional values will be truncated"
msgstr "and(%lf, %lf): Dezimalteil wird abgeschnitten"
-#: builtin.c:2882
+#: builtin.c:2884
msgid "or: received non-numeric first argument"
msgstr "or: das erste Argument ist keine Zahl"
-#: builtin.c:2884
+#: builtin.c:2886
msgid "or: received non-numeric second argument"
msgstr "or: das zweite Argument ist keine Zahl"
-#: builtin.c:2890
+#: builtin.c:2892
#, c-format
msgid "or(%lf, %lf): negative values will give strange results"
msgstr "or(%lf, %lf): Negative Werte werden zu merkwürdigen Ergebnissen führen"
-#: builtin.c:2892
+#: builtin.c:2894
#, c-format
msgid "or(%lf, %lf): fractional values will be truncated"
msgstr "or(%lf, %lf): Dezimalteil wird abgeschnitten"
-#: builtin.c:2920
+#: builtin.c:2922
msgid "xor: received non-numeric first argument"
msgstr "xor: das erste Argument ist keine Zahl"
-#: builtin.c:2922
+#: builtin.c:2924
msgid "xor: received non-numeric second argument"
msgstr "xor: das zweite Argument ist keine Zahl"
-#: builtin.c:2928
+#: builtin.c:2930
#, c-format
msgid "xor(%lf, %lf): negative values will give strange results"
msgstr "xor(%lf, %lf: Negative Werte werden zu merkwürdigen Ergebnissen führen"
-#: builtin.c:2930
+#: builtin.c:2932
#, c-format
msgid "xor(%lf, %lf): fractional values will be truncated"
msgstr "xor(%lf, %lf): Dezimalteil wird abgeschnitten"
-#: builtin.c:2954 builtin.c:2960
+#: builtin.c:2956 builtin.c:2962
msgid "compl: received non-numeric argument"
msgstr "compl: das erste Argument ist keine Zahl"
-#: builtin.c:2962
+#: builtin.c:2964
#, c-format
msgid "compl(%lf): negative value will give strange results"
msgstr "compl(%lf): Negativer Wert wird zu merkwürdigen Ergebnissen führen"
-#: builtin.c:2964
+#: builtin.c:2966
#, c-format
msgid "compl(%lf): fractional value will be truncated"
msgstr "compl(%lf): Dezimalteil wird abgeschnitten"
-#: builtin.c:3133
+#: builtin.c:3135
#, c-format
msgid "dcgettext: `%s' is not a valid locale category"
msgstr "dcgettext: »%s« ist keine gültige Locale-Kategorie"
diff --git a/po/es.gmo b/po/es.gmo
index e395377a..7df5fab8 100644
--- a/po/es.gmo
+++ b/po/es.gmo
Binary files differ
diff --git a/po/es.po b/po/es.po
index 676e7a8b..fd28a8a8 100644
--- a/po/es.po
+++ b/po/es.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gawk 4.0.0\n"
"Report-Msgid-Bugs-To: arnold@skeeve.com\n"
-"POT-Creation-Date: 2011-10-24 05:57+0200\n"
+"POT-Creation-Date: 2011-11-14 21:46+0200\n"
"PO-Revision-Date: 2011-08-14 12:02-0500\n"
"Last-Translator: Cristian Othón Martínez Vera <cfuga@cfuga.mx>\n"
"Language-Team: Spanish <es@li.org>\n"
@@ -41,7 +41,7 @@ msgid "attempt to use scalar `%s' as an array"
msgstr "se intentó usar el escalar `%s' como una matriz"
#: array.c:302 array.c:707 builtin.c:84 builtin.c:1384 builtin.c:1426
-#: builtin.c:1439 builtin.c:1856 builtin.c:1868 eval.c:1135 eval.c:1139
+#: builtin.c:1439 builtin.c:1858 builtin.c:1870 eval.c:1135 eval.c:1139
#: eval.c:1495 eval.c:1812
#, c-format
msgid "attempt to use array `%s' in a scalar context"
@@ -776,209 +776,209 @@ msgstr ""
"substr: la cadena %g en el índice de inicio %g excede la longitud del primer "
"argumento (%lu)"
-#: builtin.c:1655
+#: builtin.c:1656
msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type"
msgstr ""
"strftime: el valor de formato en PROCINFO[\"strftime\"] tiene tipo numérico"
-#: builtin.c:1678
+#: builtin.c:1679
msgid "strftime: received non-numeric second argument"
msgstr "strftime: el segundo argumento recibido no es númerico"
-#: builtin.c:1681
+#: builtin.c:1682
msgid "strftime: second argument less than 0 or too big for time_t"
msgstr ""
-#: builtin.c:1687
+#: builtin.c:1689
msgid "strftime: received non-string first argument"
msgstr "strftime: el primer argumento recibido no es una cadena"
-#: builtin.c:1693
+#: builtin.c:1695
msgid "strftime: received empty format string"
msgstr "strftime: se recibió una cadena de formato vacía"
-#: builtin.c:1759
+#: builtin.c:1761
msgid "mktime: received non-string argument"
msgstr "mktime: se recibió un argumento que no es una cadena"
-#: builtin.c:1776
+#: builtin.c:1778
msgid "mktime: at least one of the values is out of the default range"
msgstr ""
"mktime: por lo menos uno de los valores está fuera del rango por defecto"
-#: builtin.c:1811
+#: builtin.c:1813
msgid "'system' function not allowed in sandbox mode"
msgstr "no se permite la función 'system' en modo sandbox"
-#: builtin.c:1816
+#: builtin.c:1818
msgid "system: received non-string argument"
msgstr "system: se recibió un argumento que no es una cadena"
-#: builtin.c:1871 eval.c:1159 eval.c:1790 eval.c:1803
+#: builtin.c:1873 eval.c:1159 eval.c:1790 eval.c:1803
#, c-format
msgid "reference to uninitialized variable `%s'"
msgstr "referencia a la variable sin inicializar `%s'"
-#: builtin.c:1938
+#: builtin.c:1940
#, c-format
msgid "reference to uninitialized field `$%d'"
msgstr "referencia al campo sin inicializar `$%d'"
-#: builtin.c:2025
+#: builtin.c:2027
msgid "tolower: received non-string argument"
msgstr "tolower: se recibió un argumento que no es una cadena"
-#: builtin.c:2059
+#: builtin.c:2061
msgid "toupper: received non-string argument"
msgstr "toupper: se recibió un argumento que no es una cadena"
-#: builtin.c:2095
+#: builtin.c:2097
msgid "atan2: received non-numeric first argument"
msgstr "atan2: el primer argumento recibido no es númerico"
-#: builtin.c:2097
+#: builtin.c:2099
msgid "atan2: received non-numeric second argument"
msgstr "atan2: el segundo argumento recibido no es númerico"
-#: builtin.c:2116
+#: builtin.c:2118
msgid "sin: received non-numeric argument"
msgstr "sin: se recibió un argumento que no es númerico"
-#: builtin.c:2132
+#: builtin.c:2134
msgid "cos: received non-numeric argument"
msgstr "cos: se recibió un argumento que no es númerico"
-#: builtin.c:2185
+#: builtin.c:2187
msgid "srand: received non-numeric argument"
msgstr "srand: se recibió un argumento que no es númerico"
-#: builtin.c:2216
+#: builtin.c:2218
msgid "match: third argument is not an array"
msgstr "match: el tercer argumento no es una matriz"
-#: builtin.c:2480
+#: builtin.c:2482
msgid "gensub: third argument of 0 treated as 1"
msgstr "gensub: el tercer argumento de 0 se trata como 1"
-#: builtin.c:2773
+#: builtin.c:2775
msgid "lshift: received non-numeric first argument"
msgstr "lshift: el primer argumento recibido no es númerico"
-#: builtin.c:2775
+#: builtin.c:2777
msgid "lshift: received non-numeric second argument"
msgstr "lshift: el segundo argumento recibido no es númerico"
-#: builtin.c:2781
+#: builtin.c:2783
#, 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:2783
+#: builtin.c:2785
#, c-format
msgid "lshift(%lf, %lf): fractional values will be truncated"
msgstr "lshift(%lf, %lf): los valores fraccionarios se truncarán"
-#: builtin.c:2785
+#: builtin.c:2787
#, 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:2810
+#: builtin.c:2812
msgid "rshift: received non-numeric first argument"
msgstr "rshift: el primer argumento recibido no es númerico"
-#: builtin.c:2812
+#: builtin.c:2814
msgid "rshift: received non-numeric second argument"
msgstr "rshift: el segundo argumento recibido no es númerico"
-#: builtin.c:2818
+#: builtin.c:2820
#, 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:2820
+#: builtin.c:2822
#, c-format
msgid "rshift(%lf, %lf): fractional values will be truncated"
msgstr "rshift(%lf, %lf): los valores fraccionarios serán truncados"
-#: builtin.c:2822
+#: builtin.c:2824
#, 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:2847
+#: builtin.c:2849
msgid "and: received non-numeric first argument"
msgstr "and: el primer argumento recibido no es númerico"
-#: builtin.c:2849
+#: builtin.c:2851
msgid "and: received non-numeric second argument"
msgstr "and: el segundo argumento recibido no es númerico"
-#: builtin.c:2855
+#: builtin.c:2857
#, 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:2857
+#: builtin.c:2859
#, c-format
msgid "and(%lf, %lf): fractional values will be truncated"
msgstr "and(%lf, %lf): los valores fraccionarios serán truncados"
-#: builtin.c:2882
+#: builtin.c:2884
msgid "or: received non-numeric first argument"
msgstr "or: el primer argumento recibido no es númerico"
-#: builtin.c:2884
+#: builtin.c:2886
msgid "or: received non-numeric second argument"
msgstr "or: el segundo argumento recibido no es númerico"
-#: builtin.c:2890
+#: builtin.c:2892
#, 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:2892
+#: builtin.c:2894
#, c-format
msgid "or(%lf, %lf): fractional values will be truncated"
msgstr "or(%lf, %lf): los valores fraccionarios serán truncados"
-#: builtin.c:2920
+#: builtin.c:2922
msgid "xor: received non-numeric first argument"
msgstr "xor: el primer argumento recibido no es númerico"
-#: builtin.c:2922
+#: builtin.c:2924
msgid "xor: received non-numeric second argument"
msgstr "xor: el segundo argumento recibido no es númerico"
-#: builtin.c:2928
+#: builtin.c:2930
#, 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:2930
+#: builtin.c:2932
#, c-format
msgid "xor(%lf, %lf): fractional values will be truncated"
msgstr "xor(%lf, %lf): los valores fraccionarios se truncarán"
-#: builtin.c:2954 builtin.c:2960
+#: builtin.c:2956 builtin.c:2962
msgid "compl: received non-numeric argument"
msgstr "compl: se recibió un argumento que no es númerico"
-#: builtin.c:2962
+#: builtin.c:2964
#, c-format
msgid "compl(%lf): negative value will give strange results"
msgstr "compl(%lf): el valor negativo dará resultados extraños"
-#: builtin.c:2964
+#: builtin.c:2966
#, c-format
msgid "compl(%lf): fractional value will be truncated"
msgstr "compl(%lf): el valor fraccionario se truncará"
-#: builtin.c:3133
+#: builtin.c:3135
#, c-format
msgid "dcgettext: `%s' is not a valid locale category"
msgstr "dcgettext: `%s' no es una categoría local válida"
diff --git a/po/fi.gmo b/po/fi.gmo
index df538bcf..abe20e1a 100644
--- a/po/fi.gmo
+++ b/po/fi.gmo
Binary files differ
diff --git a/po/fi.po b/po/fi.po
index 442a7322..c698f564 100644
--- a/po/fi.po
+++ b/po/fi.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gawk 4.0.0\n"
"Report-Msgid-Bugs-To: arnold@skeeve.com\n"
-"POT-Creation-Date: 2011-10-24 05:57+0200\n"
+"POT-Creation-Date: 2011-11-14 21:46+0200\n"
"PO-Revision-Date: 2011-09-12 12:14+0200\n"
"Last-Translator: Jorma Karvonen <karvonen.jorma@gmail.com>\n"
"Language-Team: Finnish <translation-team-fi@lists.sourceforge.net>\n"
@@ -42,7 +42,7 @@ msgid "attempt to use scalar `%s' as an array"
msgstr "yritettiin käyttää skalaaria â€%s†taulukkona"
#: array.c:302 array.c:707 builtin.c:84 builtin.c:1384 builtin.c:1426
-#: builtin.c:1439 builtin.c:1856 builtin.c:1868 eval.c:1135 eval.c:1139
+#: builtin.c:1439 builtin.c:1858 builtin.c:1870 eval.c:1135 eval.c:1139
#: eval.c:1495 eval.c:1812
#, c-format
msgid "attempt to use array `%s' in a scalar context"
@@ -763,204 +763,204 @@ msgstr ""
"substr: pituus %g alkuindeksissä %g ylittää ensimmäisen argumentin pituuden "
"(%lu)"
-#: builtin.c:1655
+#: builtin.c:1656
msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type"
msgstr ""
"strftime: muotoarvolla kohteessa PROCINFO[\"strftime\"] on numerotyyppi"
-#: builtin.c:1678
+#: builtin.c:1679
msgid "strftime: received non-numeric second argument"
msgstr "strftime: toinen vastaanotettu argumentti ei ole numeerinen"
-#: builtin.c:1681
+#: builtin.c:1682
msgid "strftime: second argument less than 0 or too big for time_t"
msgstr ""
-#: builtin.c:1687
+#: builtin.c:1689
msgid "strftime: received non-string first argument"
msgstr "strftime: ensimmäinen vastaanotettu argumentti ei ole merkkijono"
-#: builtin.c:1693
+#: builtin.c:1695
msgid "strftime: received empty format string"
msgstr "strftime: vastaanotettu tyhjä muotomerkkijono"
-#: builtin.c:1759
+#: builtin.c:1761
msgid "mktime: received non-string argument"
msgstr "mktime: vastaanotettu argumentti ei ole merkkijono"
-#: builtin.c:1776
+#: builtin.c:1778
msgid "mktime: at least one of the values is out of the default range"
msgstr "mktime: vähintään yksi arvoista on oletuslukualueen ulkopuolella"
-#: builtin.c:1811
+#: builtin.c:1813
msgid "'system' function not allowed in sandbox mode"
msgstr "â€systemâ€-funktio ei ole sallittu hiekkalaatikkotilassa"
-#: builtin.c:1816
+#: builtin.c:1818
msgid "system: received non-string argument"
msgstr "system: vastaanotettu argumentti ei ole merkkijono"
-#: builtin.c:1871 eval.c:1159 eval.c:1790 eval.c:1803
+#: builtin.c:1873 eval.c:1159 eval.c:1790 eval.c:1803
#, c-format
msgid "reference to uninitialized variable `%s'"
msgstr "viite alustamattomaan muuttujaan â€%sâ€"
-#: builtin.c:1938
+#: builtin.c:1940
#, c-format
msgid "reference to uninitialized field `$%d'"
msgstr "viite alustamattomaan kenttään â€$%dâ€"
-#: builtin.c:2025
+#: builtin.c:2027
msgid "tolower: received non-string argument"
msgstr "tolower: vastaanotettu argumentti ei ole merkkijono"
-#: builtin.c:2059
+#: builtin.c:2061
msgid "toupper: received non-string argument"
msgstr "toupper: vastaanotettu argumentti ei ole merkkijono"
-#: builtin.c:2095
+#: builtin.c:2097
msgid "atan2: received non-numeric first argument"
msgstr "atan2: ensimmäinen vastaanotettu argumentti ei ole numeerinen"
-#: builtin.c:2097
+#: builtin.c:2099
msgid "atan2: received non-numeric second argument"
msgstr "atan2: toinen vastaanotettu argumentti ei ole numeerinen"
-#: builtin.c:2116
+#: builtin.c:2118
msgid "sin: received non-numeric argument"
msgstr "sin: vastaanotettu argumentti ei ole numeerinen"
-#: builtin.c:2132
+#: builtin.c:2134
msgid "cos: received non-numeric argument"
msgstr "cos: vastaanotettu argumentti ei ole numeerinen"
-#: builtin.c:2185
+#: builtin.c:2187
msgid "srand: received non-numeric argument"
msgstr "srand: vastaanotettu argumentti ei ole numeerinen"
-#: builtin.c:2216
+#: builtin.c:2218
msgid "match: third argument is not an array"
msgstr "match: kolmas argumentti ei ole taulukko"
-#: builtin.c:2480
+#: builtin.c:2482
msgid "gensub: third argument of 0 treated as 1"
msgstr "gensub: 0-arvoinen kolmas argumentti käsitellään kuin 1"
-#: builtin.c:2773
+#: builtin.c:2775
msgid "lshift: received non-numeric first argument"
msgstr "lshift: ensimmäinen vastaanotettu argumentti ei ole numeerinen"
-#: builtin.c:2775
+#: builtin.c:2777
msgid "lshift: received non-numeric second argument"
msgstr "lshift: toinen vastaanotettu argumentti ei ole numeerinen"
-#: builtin.c:2781
+#: builtin.c:2783
#, c-format
msgid "lshift(%lf, %lf): negative values will give strange results"
msgstr "lshift(%lf, %lf): negatiiviset arvot antavat outoja tuloksia"
-#: builtin.c:2783
+#: builtin.c:2785
#, c-format
msgid "lshift(%lf, %lf): fractional values will be truncated"
msgstr "lshift(%lf, %lf): jaosarvot typistetään"
-#: builtin.c:2785
+#: builtin.c:2787
#, c-format
msgid "lshift(%lf, %lf): too large shift value will give strange results"
msgstr "lshift(%lf, %lf): liian suuri siirrosarvo antaa outoja tuloksia"
-#: builtin.c:2810
+#: builtin.c:2812
msgid "rshift: received non-numeric first argument"
msgstr "rshift: ensimmäinen vastaanotettu argumentti ei ole numeerinen"
-#: builtin.c:2812
+#: builtin.c:2814
msgid "rshift: received non-numeric second argument"
msgstr "rshift: toinen vastaanotettu argumentti ei ole numeerinen"
-#: builtin.c:2818
+#: builtin.c:2820
#, c-format
msgid "rshift(%lf, %lf): negative values will give strange results"
msgstr "rshift(%lf, %lf): negatiiviset arvot antavat outoja tuloksia"
-#: builtin.c:2820
+#: builtin.c:2822
#, c-format
msgid "rshift(%lf, %lf): fractional values will be truncated"
msgstr "rshift(%lf, %lf): jaosarvot typistetään"
-#: builtin.c:2822
+#: builtin.c:2824
#, c-format
msgid "rshift(%lf, %lf): too large shift value will give strange results"
msgstr "rshift(%lf, %lf): liian suuri siirrosarvo antaa outoja tuloksia"
-#: builtin.c:2847
+#: builtin.c:2849
msgid "and: received non-numeric first argument"
msgstr "and: ensimmäinen vastaanotettu argumentti ei ole numeerinen"
-#: builtin.c:2849
+#: builtin.c:2851
msgid "and: received non-numeric second argument"
msgstr "and: toinen vastaanotettu argumentti ei ole numeerinen"
-#: builtin.c:2855
+#: builtin.c:2857
#, c-format
msgid "and(%lf, %lf): negative values will give strange results"
msgstr "and(%lf, %lf): negatiiviset arvot antavat outoja tuloksia"
-#: builtin.c:2857
+#: builtin.c:2859
#, c-format
msgid "and(%lf, %lf): fractional values will be truncated"
msgstr "and(%lf, %lf): jaosarvot typistetään"
-#: builtin.c:2882
+#: builtin.c:2884
msgid "or: received non-numeric first argument"
msgstr "or: ensimmäinen vastaanotettu argumentti ei ole numeerinen"
-#: builtin.c:2884
+#: builtin.c:2886
msgid "or: received non-numeric second argument"
msgstr "or: toinen vastaanotettu argumentti ei ole numeerinen"
-#: builtin.c:2890
+#: builtin.c:2892
#, c-format
msgid "or(%lf, %lf): negative values will give strange results"
msgstr "or(%lf, %lf): negatiiviset arvot antavat outoja tuloksia"
-#: builtin.c:2892
+#: builtin.c:2894
#, c-format
msgid "or(%lf, %lf): fractional values will be truncated"
msgstr "or(%lf, %lf): jaosarvot typistetään"
-#: builtin.c:2920
+#: builtin.c:2922
msgid "xor: received non-numeric first argument"
msgstr "xor: ensimmäinen vastaanotettu argumentti ei ole numeerinen"
-#: builtin.c:2922
+#: builtin.c:2924
msgid "xor: received non-numeric second argument"
msgstr "xor: toinen vastaanotettu argumentti ei ole numeerinen"
-#: builtin.c:2928
+#: builtin.c:2930
#, c-format
msgid "xor(%lf, %lf): negative values will give strange results"
msgstr "xor(%lf, %lf): negatiiviset arvot antavat outoja tuloksia"
-#: builtin.c:2930
+#: builtin.c:2932
#, c-format
msgid "xor(%lf, %lf): fractional values will be truncated"
msgstr "xor(%lf, %lf): jaosarvot typistetään"
-#: builtin.c:2954 builtin.c:2960
+#: builtin.c:2956 builtin.c:2962
msgid "compl: received non-numeric argument"
msgstr "compl: vastaanotettu argumentti ei ole numeerinen"
-#: builtin.c:2962
+#: builtin.c:2964
#, c-format
msgid "compl(%lf): negative value will give strange results"
msgstr "compl(%lf): negatiiviset arvot antavat outoja tuloksia"
-#: builtin.c:2964
+#: builtin.c:2966
#, c-format
msgid "compl(%lf): fractional value will be truncated"
msgstr "compl(%lf): jaosarvo typistetään"
-#: builtin.c:3133
+#: builtin.c:3135
#, c-format
msgid "dcgettext: `%s' is not a valid locale category"
msgstr "dcgettext: â€%s†ei ole kelvollinen paikallinen kategoria"
diff --git a/po/fr.gmo b/po/fr.gmo
index 000b9a8a..49267fd7 100644
--- a/po/fr.gmo
+++ b/po/fr.gmo
Binary files differ
diff --git a/po/fr.po b/po/fr.po
index a958491d..b43094c4 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gawk 4.0.0\n"
"Report-Msgid-Bugs-To: arnold@skeeve.com\n"
-"POT-Creation-Date: 2011-10-24 05:57+0200\n"
+"POT-Creation-Date: 2011-11-14 21:46+0200\n"
"PO-Revision-Date: 2011-07-16 16:50+0200\n"
"Last-Translator: Jean-Philippe Guérard <jean-philippe.guerard@corbeaunoir."
"org>\n"
@@ -45,7 +45,7 @@ msgid "attempt to use scalar `%s' as an array"
msgstr "tentative d'utiliser le scalaire « %s » comme tableau"
#: array.c:302 array.c:707 builtin.c:84 builtin.c:1384 builtin.c:1426
-#: builtin.c:1439 builtin.c:1856 builtin.c:1868 eval.c:1135 eval.c:1139
+#: builtin.c:1439 builtin.c:1858 builtin.c:1870 eval.c:1135 eval.c:1139
#: eval.c:1495 eval.c:1812
#, c-format
msgid "attempt to use array `%s' in a scalar context"
@@ -767,213 +767,213 @@ msgstr ""
"substr : la longueur %g à partir de %g dépasse la fin du 1er argument (%lu)"
# Exemple : gawk --lint 'BEGIN { PROCINFO["strftime"]=123 ; print strftime() }'
-#: builtin.c:1655
+#: builtin.c:1656
msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type"
msgstr ""
"strftime : la valeur de formatage PROCINFO[\"strftime\"] est de type "
"numérique"
-#: builtin.c:1678
+#: builtin.c:1679
msgid "strftime: received non-numeric second argument"
msgstr "strftime : le second argument n'est pas numérique"
-#: builtin.c:1681
+#: builtin.c:1682
msgid "strftime: second argument less than 0 or too big for time_t"
msgstr ""
-#: builtin.c:1687
+#: builtin.c:1689
msgid "strftime: received non-string first argument"
msgstr "strftim : le premier argument n'est pas une chaîne"
-#: builtin.c:1693
+#: builtin.c:1695
msgid "strftime: received empty format string"
msgstr "strftime : la chaîne de formatage est vide"
-#: builtin.c:1759
+#: builtin.c:1761
msgid "mktime: received non-string argument"
msgstr "mktime : l'argument n'est pas une chaîne"
-#: builtin.c:1776
+#: builtin.c:1778
msgid "mktime: at least one of the values is out of the default range"
msgstr ""
"mktime : au moins l'une des valeurs est en dehors de la plage par défaut"
-#: builtin.c:1811
+#: builtin.c:1813
msgid "'system' function not allowed in sandbox mode"
msgstr "La fonction « system » est interdite en isolement (mode sandbox)"
-#: builtin.c:1816
+#: builtin.c:1818
msgid "system: received non-string argument"
msgstr "system : l'argument n'est pas une chaîne"
-#: builtin.c:1871 eval.c:1159 eval.c:1790 eval.c:1803
+#: builtin.c:1873 eval.c:1159 eval.c:1790 eval.c:1803
#, c-format
msgid "reference to uninitialized variable `%s'"
msgstr "référence à une variable non initialisée « %s »"
-#: builtin.c:1938
+#: builtin.c:1940
#, c-format
msgid "reference to uninitialized field `$%d'"
msgstr "référence à un champ non initialisé « $%d »"
-#: builtin.c:2025
+#: builtin.c:2027
msgid "tolower: received non-string argument"
msgstr "tolower : l'argument n'est pas une chaîne"
-#: builtin.c:2059
+#: builtin.c:2061
msgid "toupper: received non-string argument"
msgstr "toupper : l'argument n'est pas une chaîne"
-#: builtin.c:2095
+#: builtin.c:2097
msgid "atan2: received non-numeric first argument"
msgstr "atan2 : le premier argument n'est pas numérique"
-#: builtin.c:2097
+#: builtin.c:2099
msgid "atan2: received non-numeric second argument"
msgstr "atan2 : le second argument n'est pas numérique"
-#: builtin.c:2116
+#: builtin.c:2118
msgid "sin: received non-numeric argument"
msgstr "sin : l'argument n'est pas numérique"
-#: builtin.c:2132
+#: builtin.c:2134
msgid "cos: received non-numeric argument"
msgstr "cos : l'argument n'est pas numérique"
-#: builtin.c:2185
+#: builtin.c:2187
msgid "srand: received non-numeric argument"
msgstr "srand : l'argument n'est pas numérique"
-#: builtin.c:2216
+#: builtin.c:2218
msgid "match: third argument is not an array"
msgstr "match : le 3e argument n'est pas un tableau"
-#: builtin.c:2480
+#: builtin.c:2482
msgid "gensub: third argument of 0 treated as 1"
msgstr "gensub : le 3e argument vaut 0, il sera traité comme un 1"
-#: builtin.c:2773
+#: builtin.c:2775
msgid "lshift: received non-numeric first argument"
msgstr "lshift : le premier argument n'est pas numérique"
-#: builtin.c:2775
+#: builtin.c:2777
msgid "lshift: received non-numeric second argument"
msgstr "lshift : le second argument reçu n'est pas numérique"
-#: builtin.c:2781
+#: builtin.c:2783
#, c-format
msgid "lshift(%lf, %lf): negative values will give strange results"
msgstr ""
"lshift(%lf, %lf) : les valeurs négatives donneront des résultats inattendus"
-#: builtin.c:2783
+#: builtin.c:2785
#, c-format
msgid "lshift(%lf, %lf): fractional values will be truncated"
msgstr "lshift(%lf, %lf) : les valeurs non entières seront tronquées"
-#: builtin.c:2785
+#: builtin.c:2787
#, c-format
msgid "lshift(%lf, %lf): too large shift value will give strange results"
msgstr ""
"lshift(%lf, %lf) : un décalage trop grand donnera des résultats inattendus"
-#: builtin.c:2810
+#: builtin.c:2812
msgid "rshift: received non-numeric first argument"
msgstr "rshift : le premier argument n'est pas numérique"
-#: builtin.c:2812
+#: builtin.c:2814
msgid "rshift: received non-numeric second argument"
msgstr "rshift : le second argument reçu n'est pas numérique"
-#: builtin.c:2818
+#: builtin.c:2820
#, c-format
msgid "rshift(%lf, %lf): negative values will give strange results"
msgstr ""
"rshift(%lf, %lf) : les valeurs négatives donneront des résultats inattendus"
-#: builtin.c:2820
+#: builtin.c:2822
#, c-format
msgid "rshift(%lf, %lf): fractional values will be truncated"
msgstr "rshift(%lf, %lf) : les valeurs non entières seront tronquées"
-#: builtin.c:2822
+#: builtin.c:2824
#, c-format
msgid "rshift(%lf, %lf): too large shift value will give strange results"
msgstr ""
"rshift(%lf, %lf) : un décalage trop grand donnera des résultats inattendus"
-#: builtin.c:2847
+#: builtin.c:2849
msgid "and: received non-numeric first argument"
msgstr "and : le premier argument n'est pas numérique"
-#: builtin.c:2849
+#: builtin.c:2851
msgid "and: received non-numeric second argument"
msgstr "and : le second argument reçu n'est pas numérique"
-#: builtin.c:2855
+#: builtin.c:2857
#, c-format
msgid "and(%lf, %lf): negative values will give strange results"
msgstr ""
"and(%lf, %lf) : les valeurs négatives donneront des résultats inattendus"
-#: builtin.c:2857
+#: builtin.c:2859
#, c-format
msgid "and(%lf, %lf): fractional values will be truncated"
msgstr "and(%lf, %lf): les valeurs non entières seront tronquées"
-#: builtin.c:2882
+#: builtin.c:2884
msgid "or: received non-numeric first argument"
msgstr "or : le premier argument n'est pas numérique"
-#: builtin.c:2884
+#: builtin.c:2886
msgid "or: received non-numeric second argument"
msgstr "or : le second argument reçu n'est pas numérique"
-#: builtin.c:2890
+#: builtin.c:2892
#, c-format
msgid "or(%lf, %lf): negative values will give strange results"
msgstr ""
"or(%lf, %lf) : les valeurs négatives donneront des résultats inattendus"
-#: builtin.c:2892
+#: builtin.c:2894
#, c-format
msgid "or(%lf, %lf): fractional values will be truncated"
msgstr "or(%lf, %lf) : les valeurs non entières seront tronquées"
-#: builtin.c:2920
+#: builtin.c:2922
msgid "xor: received non-numeric first argument"
msgstr "xor : le premier argument n'est pas numérique"
-#: builtin.c:2922
+#: builtin.c:2924
msgid "xor: received non-numeric second argument"
msgstr "xor : le second argument reçu n'est pas numérique"
-#: builtin.c:2928
+#: builtin.c:2930
#, c-format
msgid "xor(%lf, %lf): negative values will give strange results"
msgstr ""
"xor(%lf, %lf) : les valeurs négatives donneront des résultats inattendus"
-#: builtin.c:2930
+#: builtin.c:2932
#, c-format
msgid "xor(%lf, %lf): fractional values will be truncated"
msgstr "xor(%lf, %lf) : les valeurs non entières seront tronquées"
-#: builtin.c:2954 builtin.c:2960
+#: builtin.c:2956 builtin.c:2962
msgid "compl: received non-numeric argument"
msgstr "compl : l'argument n'est pas numérique"
-#: builtin.c:2962
+#: builtin.c:2964
#, c-format
msgid "compl(%lf): negative value will give strange results"
msgstr "compl(%lf) : les valeurs négatives donneront des résultats inattendus"
-#: builtin.c:2964
+#: builtin.c:2966
#, c-format
msgid "compl(%lf): fractional value will be truncated"
msgstr "compl(%lf) : les valeurs non entières seront tronquées"
-#: builtin.c:3133
+#: builtin.c:3135
#, c-format
msgid "dcgettext: `%s' is not a valid locale category"
msgstr "dcgettext : « %s » n'est pas dans un catégorie valide de la locale"
diff --git a/po/ga.gmo b/po/ga.gmo
deleted file mode 100644
index 21141c51..00000000
--- a/po/ga.gmo
+++ /dev/null
Binary files differ
diff --git a/po/gawk.pot b/po/gawk.pot
index 290ff817..aa30ff3c 100644
--- a/po/gawk.pot
+++ b/po/gawk.pot
@@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: gawk 4.0.0c\n"
+"Project-Id-Version: gawk 4.0.0e\n"
"Report-Msgid-Bugs-To: arnold@skeeve.com\n"
-"POT-Creation-Date: 2011-10-24 05:57+0200\n"
+"POT-Creation-Date: 2011-11-14 21:46+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -42,7 +42,7 @@ msgid "attempt to use scalar `%s' as an array"
msgstr ""
#: array.c:302 array.c:707 builtin.c:84 builtin.c:1384 builtin.c:1426
-#: builtin.c:1439 builtin.c:1856 builtin.c:1868 eval.c:1135 eval.c:1139
+#: builtin.c:1439 builtin.c:1858 builtin.c:1870 eval.c:1135 eval.c:1139
#: eval.c:1495 eval.c:1812
#, c-format
msgid "attempt to use array `%s' in a scalar context"
@@ -734,203 +734,203 @@ msgid ""
"substr: length %g at start index %g exceeds length of first argument (%lu)"
msgstr ""
-#: builtin.c:1655
+#: builtin.c:1656
msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type"
msgstr ""
-#: builtin.c:1678
+#: builtin.c:1679
msgid "strftime: received non-numeric second argument"
msgstr ""
-#: builtin.c:1681
+#: builtin.c:1682
msgid "strftime: second argument less than 0 or too big for time_t"
msgstr ""
-#: builtin.c:1687
+#: builtin.c:1689
msgid "strftime: received non-string first argument"
msgstr ""
-#: builtin.c:1693
+#: builtin.c:1695
msgid "strftime: received empty format string"
msgstr ""
-#: builtin.c:1759
+#: builtin.c:1761
msgid "mktime: received non-string argument"
msgstr ""
-#: builtin.c:1776
+#: builtin.c:1778
msgid "mktime: at least one of the values is out of the default range"
msgstr ""
-#: builtin.c:1811
+#: builtin.c:1813
msgid "'system' function not allowed in sandbox mode"
msgstr ""
-#: builtin.c:1816
+#: builtin.c:1818
msgid "system: received non-string argument"
msgstr ""
-#: builtin.c:1871 eval.c:1159 eval.c:1790 eval.c:1803
+#: builtin.c:1873 eval.c:1159 eval.c:1790 eval.c:1803
#, c-format
msgid "reference to uninitialized variable `%s'"
msgstr ""
-#: builtin.c:1938
+#: builtin.c:1940
#, c-format
msgid "reference to uninitialized field `$%d'"
msgstr ""
-#: builtin.c:2025
+#: builtin.c:2027
msgid "tolower: received non-string argument"
msgstr ""
-#: builtin.c:2059
+#: builtin.c:2061
msgid "toupper: received non-string argument"
msgstr ""
-#: builtin.c:2095
+#: builtin.c:2097
msgid "atan2: received non-numeric first argument"
msgstr ""
-#: builtin.c:2097
+#: builtin.c:2099
msgid "atan2: received non-numeric second argument"
msgstr ""
-#: builtin.c:2116
+#: builtin.c:2118
msgid "sin: received non-numeric argument"
msgstr ""
-#: builtin.c:2132
+#: builtin.c:2134
msgid "cos: received non-numeric argument"
msgstr ""
-#: builtin.c:2185
+#: builtin.c:2187
msgid "srand: received non-numeric argument"
msgstr ""
-#: builtin.c:2216
+#: builtin.c:2218
msgid "match: third argument is not an array"
msgstr ""
-#: builtin.c:2480
+#: builtin.c:2482
msgid "gensub: third argument of 0 treated as 1"
msgstr ""
-#: builtin.c:2773
+#: builtin.c:2775
msgid "lshift: received non-numeric first argument"
msgstr ""
-#: builtin.c:2775
+#: builtin.c:2777
msgid "lshift: received non-numeric second argument"
msgstr ""
-#: builtin.c:2781
+#: builtin.c:2783
#, c-format
msgid "lshift(%lf, %lf): negative values will give strange results"
msgstr ""
-#: builtin.c:2783
+#: builtin.c:2785
#, c-format
msgid "lshift(%lf, %lf): fractional values will be truncated"
msgstr ""
-#: builtin.c:2785
+#: builtin.c:2787
#, c-format
msgid "lshift(%lf, %lf): too large shift value will give strange results"
msgstr ""
-#: builtin.c:2810
+#: builtin.c:2812
msgid "rshift: received non-numeric first argument"
msgstr ""
-#: builtin.c:2812
+#: builtin.c:2814
msgid "rshift: received non-numeric second argument"
msgstr ""
-#: builtin.c:2818
+#: builtin.c:2820
#, c-format
msgid "rshift(%lf, %lf): negative values will give strange results"
msgstr ""
-#: builtin.c:2820
+#: builtin.c:2822
#, c-format
msgid "rshift(%lf, %lf): fractional values will be truncated"
msgstr ""
-#: builtin.c:2822
+#: builtin.c:2824
#, c-format
msgid "rshift(%lf, %lf): too large shift value will give strange results"
msgstr ""
-#: builtin.c:2847
+#: builtin.c:2849
msgid "and: received non-numeric first argument"
msgstr ""
-#: builtin.c:2849
+#: builtin.c:2851
msgid "and: received non-numeric second argument"
msgstr ""
-#: builtin.c:2855
+#: builtin.c:2857
#, c-format
msgid "and(%lf, %lf): negative values will give strange results"
msgstr ""
-#: builtin.c:2857
+#: builtin.c:2859
#, c-format
msgid "and(%lf, %lf): fractional values will be truncated"
msgstr ""
-#: builtin.c:2882
+#: builtin.c:2884
msgid "or: received non-numeric first argument"
msgstr ""
-#: builtin.c:2884
+#: builtin.c:2886
msgid "or: received non-numeric second argument"
msgstr ""
-#: builtin.c:2890
+#: builtin.c:2892
#, c-format
msgid "or(%lf, %lf): negative values will give strange results"
msgstr ""
-#: builtin.c:2892
+#: builtin.c:2894
#, c-format
msgid "or(%lf, %lf): fractional values will be truncated"
msgstr ""
-#: builtin.c:2920
+#: builtin.c:2922
msgid "xor: received non-numeric first argument"
msgstr ""
-#: builtin.c:2922
+#: builtin.c:2924
msgid "xor: received non-numeric second argument"
msgstr ""
-#: builtin.c:2928
+#: builtin.c:2930
#, c-format
msgid "xor(%lf, %lf): negative values will give strange results"
msgstr ""
-#: builtin.c:2930
+#: builtin.c:2932
#, c-format
msgid "xor(%lf, %lf): fractional values will be truncated"
msgstr ""
-#: builtin.c:2954 builtin.c:2960
+#: builtin.c:2956 builtin.c:2962
msgid "compl: received non-numeric argument"
msgstr ""
-#: builtin.c:2962
+#: builtin.c:2964
#, c-format
msgid "compl(%lf): negative value will give strange results"
msgstr ""
-#: builtin.c:2964
+#: builtin.c:2966
#, c-format
msgid "compl(%lf): fractional value will be truncated"
msgstr ""
-#: builtin.c:3133
+#: builtin.c:3135
#, c-format
msgid "dcgettext: `%s' is not a valid locale category"
msgstr ""
diff --git a/po/he.gmo b/po/he.gmo
deleted file mode 100644
index b9cb6d3c..00000000
--- a/po/he.gmo
+++ /dev/null
Binary files differ
diff --git a/po/id.gmo b/po/id.gmo
deleted file mode 100644
index 272d5f8c..00000000
--- a/po/id.gmo
+++ /dev/null
Binary files differ
diff --git a/po/it.gmo b/po/it.gmo
index ac3fa30d..597024e7 100644
--- a/po/it.gmo
+++ b/po/it.gmo
Binary files differ
diff --git a/po/it.po b/po/it.po
index a2005288..4fd09749 100644
--- a/po/it.po
+++ b/po/it.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gawk 3.1.81\n"
"Report-Msgid-Bugs-To: arnold@skeeve.com\n"
-"POT-Creation-Date: 2011-10-24 05:57+0200\n"
+"POT-Creation-Date: 2011-11-14 21:46+0200\n"
"PO-Revision-Date: 2011-03-19 16:52+0100\n"
"Last-Translator: Antonio Colombo <azc100@gmail.com>\n"
"Language-Team: Italian <it@li.org>\n"
@@ -40,7 +40,7 @@ msgid "attempt to use scalar `%s' as an array"
msgstr "tentativo di usare scalare '%s' come vettore"
#: array.c:302 array.c:707 builtin.c:84 builtin.c:1384 builtin.c:1426
-#: builtin.c:1439 builtin.c:1856 builtin.c:1868 eval.c:1135 eval.c:1139
+#: builtin.c:1439 builtin.c:1858 builtin.c:1870 eval.c:1135 eval.c:1139
#: eval.c:1495 eval.c:1812
#, c-format
msgid "attempt to use array `%s' in a scalar context"
@@ -758,204 +758,204 @@ msgstr ""
"substr: lunghezza %g all'indice di partenza %g supera la lunghezza del primo "
"argomento (%lu)"
-#: builtin.c:1655
+#: builtin.c:1656
msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type"
msgstr ""
"strftime: il valore del 'format' in PROCINFO[\"strftime\"] è di tipo numerico"
-#: builtin.c:1678
+#: builtin.c:1679
msgid "strftime: received non-numeric second argument"
msgstr "strftime: il secondo argomento non è numerico"
-#: builtin.c:1681
+#: builtin.c:1682
msgid "strftime: second argument less than 0 or too big for time_t"
msgstr ""
-#: builtin.c:1687
+#: builtin.c:1689
msgid "strftime: received non-string first argument"
msgstr "strftime: il primo argomento non è una stringa"
-#: builtin.c:1693
+#: builtin.c:1695
msgid "strftime: received empty format string"
msgstr "strftime: 'format' è una stringa nulla"
-#: builtin.c:1759
+#: builtin.c:1761
msgid "mktime: received non-string argument"
msgstr "mktime: l'argomento non è una stringa"
-#: builtin.c:1776
+#: builtin.c:1778
msgid "mktime: at least one of the values is out of the default range"
msgstr "mktime: almeno un valore è fuori dall'intervallo di default"
-#: builtin.c:1811
+#: builtin.c:1813
msgid "'system' function not allowed in sandbox mode"
msgstr "la funzione 'system' non è permessa in modo 'sandbox'"
-#: builtin.c:1816
+#: builtin.c:1818
msgid "system: received non-string argument"
msgstr "system: l'argomento non è una stringa"
-#: builtin.c:1871 eval.c:1159 eval.c:1790 eval.c:1803
+#: builtin.c:1873 eval.c:1159 eval.c:1790 eval.c:1803
#, c-format
msgid "reference to uninitialized variable `%s'"
msgstr "riferimento a variabile non inizializzata `%s'"
-#: builtin.c:1938
+#: builtin.c:1940
#, c-format
msgid "reference to uninitialized field `$%d'"
msgstr "riferimento a variabile non inizializzata `$%d'"
-#: builtin.c:2025
+#: builtin.c:2027
msgid "tolower: received non-string argument"
msgstr "tolower: l'argomento non è una stringa"
-#: builtin.c:2059
+#: builtin.c:2061
msgid "toupper: received non-string argument"
msgstr "toupper: l'argomento non è una stringa"
-#: builtin.c:2095
+#: builtin.c:2097
msgid "atan2: received non-numeric first argument"
msgstr "atan2: il primo argomento non è numerico"
-#: builtin.c:2097
+#: builtin.c:2099
msgid "atan2: received non-numeric second argument"
msgstr "atan2: il secondo argomento non è numerico"
-#: builtin.c:2116
+#: builtin.c:2118
msgid "sin: received non-numeric argument"
msgstr "sin: l'argomento non è numerico"
-#: builtin.c:2132
+#: builtin.c:2134
msgid "cos: received non-numeric argument"
msgstr "cos: l'argomento non è numerico"
-#: builtin.c:2185
+#: builtin.c:2187
msgid "srand: received non-numeric argument"
msgstr "srand: l'argomento non è numerico"
-#: builtin.c:2216
+#: builtin.c:2218
msgid "match: third argument is not an array"
msgstr "match: il terzo argomento non è un vettore"
-#: builtin.c:2480
+#: builtin.c:2482
msgid "gensub: third argument of 0 treated as 1"
msgstr "gensub: il terzo argomento è 0, trattato come 1"
-#: builtin.c:2773
+#: builtin.c:2775
msgid "lshift: received non-numeric first argument"
msgstr "lshift: il primo argomento non è numerico"
-#: builtin.c:2775
+#: builtin.c:2777
msgid "lshift: received non-numeric second argument"
msgstr "lshift: il secondo argomento non è numerico"
-#: builtin.c:2781
+#: builtin.c:2783
#, c-format
msgid "lshift(%lf, %lf): negative values will give strange results"
msgstr "lshift(%lf, %lf): valori negativi daranno risultati strani"
-#: builtin.c:2783
+#: builtin.c:2785
#, c-format
msgid "lshift(%lf, %lf): fractional values will be truncated"
msgstr "lshift(%lf, %lf): valori con decimali verranno troncati"
-#: builtin.c:2785
+#: builtin.c:2787
#, 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:2810
+#: builtin.c:2812
msgid "rshift: received non-numeric first argument"
msgstr "rshift: il primo argomento non è numerico"
-#: builtin.c:2812
+#: builtin.c:2814
msgid "rshift: received non-numeric second argument"
msgstr "rshift: il secondo argomento non è numerico"
-#: builtin.c:2818
+#: builtin.c:2820
#, c-format
msgid "rshift(%lf, %lf): negative values will give strange results"
msgstr "rshift(%lf, %lf): valori negativi daranno risultati strani"
-#: builtin.c:2820
+#: builtin.c:2822
#, c-format
msgid "rshift(%lf, %lf): fractional values will be truncated"
msgstr "rshift(%lf, %lf): valori con decimali verranno troncati"
-#: builtin.c:2822
+#: builtin.c:2824
#, 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:2847
+#: builtin.c:2849
msgid "and: received non-numeric first argument"
msgstr "and: il primo argomento non è numerico"
-#: builtin.c:2849
+#: builtin.c:2851
msgid "and: received non-numeric second argument"
msgstr "and: il secondo argomento non è numerico"
-#: builtin.c:2855
+#: builtin.c:2857
#, c-format
msgid "and(%lf, %lf): negative values will give strange results"
msgstr "and(%lf, %lf): valori negativi daranno risultati strani"
-#: builtin.c:2857
+#: builtin.c:2859
#, c-format
msgid "and(%lf, %lf): fractional values will be truncated"
msgstr "and(%lf, %lf): valori con decimali verranno troncati"
-#: builtin.c:2882
+#: builtin.c:2884
msgid "or: received non-numeric first argument"
msgstr "or: il primo argomento non è numerico"
-#: builtin.c:2884
+#: builtin.c:2886
msgid "or: received non-numeric second argument"
msgstr "or: il secondo argomento non è numerico"
-#: builtin.c:2890
+#: builtin.c:2892
#, c-format
msgid "or(%lf, %lf): negative values will give strange results"
msgstr "or(%lf, %lf): valori negativi daranno risultati strani"
-#: builtin.c:2892
+#: builtin.c:2894
#, c-format
msgid "or(%lf, %lf): fractional values will be truncated"
msgstr "or(%lf, %lf): valori con decimali verranno troncati"
-#: builtin.c:2920
+#: builtin.c:2922
msgid "xor: received non-numeric first argument"
msgstr "xor: il primo argomento non è numerico"
-#: builtin.c:2922
+#: builtin.c:2924
msgid "xor: received non-numeric second argument"
msgstr "xor: il secondo argomento non è numerico"
-#: builtin.c:2928
+#: builtin.c:2930
#, c-format
msgid "xor(%lf, %lf): negative values will give strange results"
msgstr "xor(%lf, %lf): valori negativi daranno risultati strani"
-#: builtin.c:2930
+#: builtin.c:2932
#, c-format
msgid "xor(%lf, %lf): fractional values will be truncated"
msgstr "xor(%lf, %lf): valori con decimali verranno troncati"
-#: builtin.c:2954 builtin.c:2960
+#: builtin.c:2956 builtin.c:2962
msgid "compl: received non-numeric argument"
msgstr "compl: l'argomento non è numerico"
-#: builtin.c:2962
+#: builtin.c:2964
#, c-format
msgid "compl(%lf): negative value will give strange results"
msgstr "compl(%lf): valore negativo darà risultati strani"
-#: builtin.c:2964
+#: builtin.c:2966
#, c-format
msgid "compl(%lf): fractional value will be truncated"
msgstr "compl(%lf): valore con decimali verrà troncato"
-#: builtin.c:3133
+#: builtin.c:3135
#, c-format
msgid "dcgettext: `%s' is not a valid locale category"
msgstr "dcgettext: `%s' non è una categoria 'locale' valida"
diff --git a/po/ja.gmo b/po/ja.gmo
index f00953e0..c349e1b7 100644
--- a/po/ja.gmo
+++ b/po/ja.gmo
Binary files differ
diff --git a/po/ja.po b/po/ja.po
index c78d3215..19c654f5 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gawk 4.0.0\n"
"Report-Msgid-Bugs-To: arnold@skeeve.com\n"
-"POT-Creation-Date: 2011-10-24 05:57+0200\n"
+"POT-Creation-Date: 2011-11-14 21:46+0200\n"
"PO-Revision-Date: 2011-07-17 08:28+0900\n"
"Last-Translator: Yasuaki Taniguchi <yasuakit@gmail.com>\n"
"Language-Team: Japanese <translation-team-ja@lists.sourceforge.net>\n"
@@ -43,7 +43,7 @@ msgid "attempt to use scalar `%s' as an array"
msgstr "スカラー `%s' ã‚’é…列ã¨ã—ã¦ä½¿ç”¨ã™ã‚‹è©¦ã¿ã§ã™"
#: array.c:302 array.c:707 builtin.c:84 builtin.c:1384 builtin.c:1426
-#: builtin.c:1439 builtin.c:1856 builtin.c:1868 eval.c:1135 eval.c:1139
+#: builtin.c:1439 builtin.c:1858 builtin.c:1870 eval.c:1135 eval.c:1139
#: eval.c:1495 eval.c:1812
#, c-format
msgid "attempt to use array `%s' in a scalar context"
@@ -750,203 +750,203 @@ msgstr ""
"substr: 開始インデックス %2$g ã‹ã‚‰ã®é•·ã• %1$g ã¯ç¬¬ä¸€å¼•æ•°ã®é•·ã•ã‚’è¶…ãˆã¦ã„ã¾ã™ "
"(%3$lu)"
-#: builtin.c:1655
+#: builtin.c:1656
msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type"
msgstr "strftime: PROCINFO[\"strftime\"] ã®æ›¸å¼ã®å€¤ã¯æ•°å€¤åž‹ã§ã™"
-#: builtin.c:1678
+#: builtin.c:1679
msgid "strftime: received non-numeric second argument"
msgstr "strftime: éžæ•°å€¤ã®ç¬¬äºŒå¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ"
-#: builtin.c:1681
+#: builtin.c:1682
msgid "strftime: second argument less than 0 or too big for time_t"
msgstr ""
-#: builtin.c:1687
+#: builtin.c:1689
msgid "strftime: received non-string first argument"
msgstr "strftime: éžæ–‡å­—列ã®ç¬¬ä¸€å¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ"
-#: builtin.c:1693
+#: builtin.c:1695
msgid "strftime: received empty format string"
msgstr "strftime: ç©ºã®æ›¸å¼æ–‡å­—列をå—ã‘å–りã¾ã—ãŸ"
-#: builtin.c:1759
+#: builtin.c:1761
msgid "mktime: received non-string argument"
msgstr "mktime: éžæ–‡å­—列引数をå—ã‘å–りã¾ã—ãŸ"
-#: builtin.c:1776
+#: builtin.c:1778
msgid "mktime: at least one of the values is out of the default range"
msgstr "mktime: 一ã¤ä»¥ä¸Šã®å€¤ãŒãƒ‡ãƒ•ォルトã®ç¯„囲を超ãˆã¦ã„ã¾ã™"
-#: builtin.c:1811
+#: builtin.c:1813
msgid "'system' function not allowed in sandbox mode"
msgstr "サンドボックスモードã§ã¯ 'system' 関数ã¯è¨±å¯ã•れã¦ã„ã¾ã›ã‚“"
-#: builtin.c:1816
+#: builtin.c:1818
msgid "system: received non-string argument"
msgstr "system: 文字列ã§ã¯ç„¡ã„引数をå—ã‘å–りã¾ã—ãŸ"
-#: builtin.c:1871 eval.c:1159 eval.c:1790 eval.c:1803
+#: builtin.c:1873 eval.c:1159 eval.c:1790 eval.c:1803
#, c-format
msgid "reference to uninitialized variable `%s'"
msgstr "åˆæœŸåŒ–ã•れã¦ã„ãªã„変数 `%s' ã¸ã®å‚ç…§ã§ã™"
-#: builtin.c:1938
+#: builtin.c:1940
#, c-format
msgid "reference to uninitialized field `$%d'"
msgstr "åˆæœŸåŒ–ã•れã¦ã„ãªã„フィールド `$%d' ã¸ã®å‚ç…§ã§ã™"
-#: builtin.c:2025
+#: builtin.c:2027
msgid "tolower: received non-string argument"
msgstr "tolower: éžæ–‡å­—列引数をå—ã‘å–りã¾ã—ãŸ"
-#: builtin.c:2059
+#: builtin.c:2061
msgid "toupper: received non-string argument"
msgstr "toupper: éžæ–‡å­—列引数をå—ã‘å–りã¾ã—ãŸ"
-#: builtin.c:2095
+#: builtin.c:2097
msgid "atan2: received non-numeric first argument"
msgstr "atan2: éžæ•°å€¤ã®ç¬¬ä¸€å¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ"
-#: builtin.c:2097
+#: builtin.c:2099
msgid "atan2: received non-numeric second argument"
msgstr "atan2: éžæ•°å€¤ã®ç¬¬äºŒå¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ"
-#: builtin.c:2116
+#: builtin.c:2118
msgid "sin: received non-numeric argument"
msgstr "sin: éžæ•°å€¤ã®å¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ"
-#: builtin.c:2132
+#: builtin.c:2134
msgid "cos: received non-numeric argument"
msgstr "cos: éžæ•°å€¤ã®å¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ"
-#: builtin.c:2185
+#: builtin.c:2187
msgid "srand: received non-numeric argument"
msgstr "srand: éžæ•°å€¤ã®å¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ"
-#: builtin.c:2216
+#: builtin.c:2218
msgid "match: third argument is not an array"
msgstr "match: 第三引数ãŒé…列ã§ã¯ã‚りã¾ã›ã‚“"
-#: builtin.c:2480
+#: builtin.c:2482
msgid "gensub: third argument of 0 treated as 1"
msgstr "gensub: 第三引数㌠0 ã§ã™ã€‚1 を代ã‚りã«ä½¿ç”¨ã—ã¾ã™"
-#: builtin.c:2773
+#: builtin.c:2775
msgid "lshift: received non-numeric first argument"
msgstr "lshift: éžæ•°å€¤ã®ç¬¬ä¸€å¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ"
-#: builtin.c:2775
+#: builtin.c:2777
msgid "lshift: received non-numeric second argument"
msgstr "lshift: éžæ•°å€¤ã®ç¬¬äºŒå¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ"
-#: builtin.c:2781
+#: builtin.c:2783
#, c-format
msgid "lshift(%lf, %lf): negative values will give strange results"
msgstr "lshift(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™"
-#: builtin.c:2783
+#: builtin.c:2785
#, c-format
msgid "lshift(%lf, %lf): fractional values will be truncated"
msgstr "lshift(%lf, %lf): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™"
-#: builtin.c:2785
+#: builtin.c:2787
#, c-format
msgid "lshift(%lf, %lf): too large shift value will give strange results"
msgstr "lshift(%lf, %lf): シフト値ãŒå¤§ãéŽãŽã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™"
-#: builtin.c:2810
+#: builtin.c:2812
msgid "rshift: received non-numeric first argument"
msgstr "rshift: éžæ•°å€¤ã®ç¬¬ä¸€å¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ"
-#: builtin.c:2812
+#: builtin.c:2814
msgid "rshift: received non-numeric second argument"
msgstr "rshift: éžæ•°å€¤ã®ç¬¬äºŒå¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ"
-#: builtin.c:2818
+#: builtin.c:2820
#, c-format
msgid "rshift(%lf, %lf): negative values will give strange results"
msgstr "rshift(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™"
-#: builtin.c:2820
+#: builtin.c:2822
#, c-format
msgid "rshift(%lf, %lf): fractional values will be truncated"
msgstr "rshift(%lf, %lf): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™"
-#: builtin.c:2822
+#: builtin.c:2824
#, c-format
msgid "rshift(%lf, %lf): too large shift value will give strange results"
msgstr "rshift(%lf, %lf): シフト値ãŒå¤§ãéŽãŽã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™"
-#: builtin.c:2847
+#: builtin.c:2849
msgid "and: received non-numeric first argument"
msgstr "and: éžæ•°å€¤ã®ç¬¬ä¸€å¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ"
-#: builtin.c:2849
+#: builtin.c:2851
msgid "and: received non-numeric second argument"
msgstr "and: éžæ•°å€¤ã®ç¬¬äºŒå¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ"
-#: builtin.c:2855
+#: builtin.c:2857
#, c-format
msgid "and(%lf, %lf): negative values will give strange results"
msgstr "and(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™"
-#: builtin.c:2857
+#: builtin.c:2859
#, c-format
msgid "and(%lf, %lf): fractional values will be truncated"
msgstr "and(%lf, %lf): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™"
-#: builtin.c:2882
+#: builtin.c:2884
msgid "or: received non-numeric first argument"
msgstr "or: éžæ•°å€¤ã®ç¬¬ä¸€å¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ"
-#: builtin.c:2884
+#: builtin.c:2886
msgid "or: received non-numeric second argument"
msgstr "or: éžæ•°å€¤ã®ç¬¬äºŒå¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ"
-#: builtin.c:2890
+#: builtin.c:2892
#, c-format
msgid "or(%lf, %lf): negative values will give strange results"
msgstr "or(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™"
-#: builtin.c:2892
+#: builtin.c:2894
#, c-format
msgid "or(%lf, %lf): fractional values will be truncated"
msgstr "or(%lf, %lf): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™"
-#: builtin.c:2920
+#: builtin.c:2922
msgid "xor: received non-numeric first argument"
msgstr "xor: éžæ•°å€¤ã®ç¬¬ä¸€å¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ"
-#: builtin.c:2922
+#: builtin.c:2924
msgid "xor: received non-numeric second argument"
msgstr "xor: éžæ•°å€¤ã®ç¬¬äºŒå¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ"
-#: builtin.c:2928
+#: builtin.c:2930
#, c-format
msgid "xor(%lf, %lf): negative values will give strange results"
msgstr "xor(%lf, %lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™"
-#: builtin.c:2930
+#: builtin.c:2932
#, c-format
msgid "xor(%lf, %lf): fractional values will be truncated"
msgstr "xor(%lf, %lf): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™"
-#: builtin.c:2954 builtin.c:2960
+#: builtin.c:2956 builtin.c:2962
msgid "compl: received non-numeric argument"
msgstr "compl: éžæ•°å€¤ã®å¼•æ•°ã‚’å—ã‘å–りã¾ã—ãŸ"
-#: builtin.c:2962
+#: builtin.c:2964
#, c-format
msgid "compl(%lf): negative value will give strange results"
msgstr "compl(%lf): è² ã®æ•°å€¤ã‚’使用ã™ã‚‹ã¨ç•°å¸¸ãªçµæžœã«ãªã‚Šã¾ã™"
-#: builtin.c:2964
+#: builtin.c:2966
#, c-format
msgid "compl(%lf): fractional value will be truncated"
msgstr "compl(%lf): å°æ•°ç‚¹ä»¥ä¸‹ã¯åˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™"
-#: builtin.c:3133
+#: builtin.c:3135
#, c-format
msgid "dcgettext: `%s' is not a valid locale category"
msgstr "dcgettext: `%s' ã¯ç„¡åйãªãƒ­ã‚±ãƒ¼ãƒ«åŒºåˆ†ã§ã™"
diff --git a/po/nl.gmo b/po/nl.gmo
index 0fd9c46d..52f492d6 100644
--- a/po/nl.gmo
+++ b/po/nl.gmo
Binary files differ
diff --git a/po/nl.po b/po/nl.po
index 641a6bee..ecb41655 100644
--- a/po/nl.po
+++ b/po/nl.po
@@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gawk 4.0.0\n"
"Report-Msgid-Bugs-To: arnold@skeeve.com\n"
-"POT-Creation-Date: 2011-10-24 05:57+0200\n"
+"POT-Creation-Date: 2011-11-14 21:46+0200\n"
"PO-Revision-Date: 2011-07-17 21:44+0200\n"
"Last-Translator: Benno Schulenberg <benno@vertaalt.nl>\n"
"Language-Team: Dutch <vertaling@vrijschrift.org>\n"
@@ -46,7 +46,7 @@ msgid "attempt to use scalar `%s' as an array"
msgstr "scalair '%s' wordt gebruikt als array"
#: array.c:302 array.c:707 builtin.c:84 builtin.c:1384 builtin.c:1426
-#: builtin.c:1439 builtin.c:1856 builtin.c:1868 eval.c:1135 eval.c:1139
+#: builtin.c:1439 builtin.c:1858 builtin.c:1870 eval.c:1135 eval.c:1139
#: eval.c:1495 eval.c:1812
#, c-format
msgid "attempt to use array `%s' in a scalar context"
@@ -759,203 +759,203 @@ msgstr ""
"substr: lengte %g bij startindex %g is groter dan de lengte van het eerste "
"argument (%lu)"
-#: builtin.c:1655
+#: builtin.c:1656
msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type"
msgstr "strftime: opmaakwaarde in PROCINFO[\"strftime\"] is numeriek"
-#: builtin.c:1678
+#: builtin.c:1679
msgid "strftime: received non-numeric second argument"
msgstr "strftime: tweede argument is geen getal"
-#: builtin.c:1681
+#: builtin.c:1682
msgid "strftime: second argument less than 0 or too big for time_t"
msgstr ""
-#: builtin.c:1687
+#: builtin.c:1689
msgid "strftime: received non-string first argument"
msgstr "strftime: eerste argument is geen string"
-#: builtin.c:1693
+#: builtin.c:1695
msgid "strftime: received empty format string"
msgstr "strftime: opmaakstring is leeg"
-#: builtin.c:1759
+#: builtin.c:1761
msgid "mktime: received non-string argument"
msgstr "mktime: argument is geen string"
-#: builtin.c:1776
+#: builtin.c:1778
msgid "mktime: at least one of the values is out of the default range"
msgstr "mktime: minstens één van waarden valt buiten het standaardbereik"
-#: builtin.c:1811
+#: builtin.c:1813
msgid "'system' function not allowed in sandbox mode"
msgstr "'system'-functie is niet toegestaan in sandbox-modus"
-#: builtin.c:1816
+#: builtin.c:1818
msgid "system: received non-string argument"
msgstr "system: argument is geen string"
-#: builtin.c:1871 eval.c:1159 eval.c:1790 eval.c:1803
+#: builtin.c:1873 eval.c:1159 eval.c:1790 eval.c:1803
#, c-format
msgid "reference to uninitialized variable `%s'"
msgstr "verwijzing naar ongeïnitialiseerde variabele '%s'"
-#: builtin.c:1938
+#: builtin.c:1940
#, c-format
msgid "reference to uninitialized field `$%d'"
msgstr "verwijzing naar ongeïnitialiseerd veld '$%d'"
-#: builtin.c:2025
+#: builtin.c:2027
msgid "tolower: received non-string argument"
msgstr "tolower: argument is geen string"
-#: builtin.c:2059
+#: builtin.c:2061
msgid "toupper: received non-string argument"
msgstr "toupper: argument is geen string"
-#: builtin.c:2095
+#: builtin.c:2097
msgid "atan2: received non-numeric first argument"
msgstr "atan2: eerste argument is geen getal"
-#: builtin.c:2097
+#: builtin.c:2099
msgid "atan2: received non-numeric second argument"
msgstr "atan2: tweede argument is geen getal"
-#: builtin.c:2116
+#: builtin.c:2118
msgid "sin: received non-numeric argument"
msgstr "sin: argument is geen getal"
-#: builtin.c:2132
+#: builtin.c:2134
msgid "cos: received non-numeric argument"
msgstr "cos: argument is geen getal"
-#: builtin.c:2185
+#: builtin.c:2187
msgid "srand: received non-numeric argument"
msgstr "srand: argument is geen getal"
-#: builtin.c:2216
+#: builtin.c:2218
msgid "match: third argument is not an array"
msgstr "match: derde argument is geen array"
-#: builtin.c:2480
+#: builtin.c:2482
msgid "gensub: third argument of 0 treated as 1"
msgstr "gensub: derde argument is 0; wordt beschouwd als 1"
-#: builtin.c:2773
+#: builtin.c:2775
msgid "lshift: received non-numeric first argument"
msgstr "lshift: eerste argument is geen getal"
-#: builtin.c:2775
+#: builtin.c:2777
msgid "lshift: received non-numeric second argument"
msgstr "lshift: tweede argument is geen getal"
-#: builtin.c:2781
+#: builtin.c:2783
#, c-format
msgid "lshift(%lf, %lf): negative values will give strange results"
msgstr "lshift(%lf, %lf): negatieve waarden geven rare resultaten"
-#: builtin.c:2783
+#: builtin.c:2785
#, c-format
msgid "lshift(%lf, %lf): fractional values will be truncated"
msgstr "lshift(%lf, %lf): cijfers na de komma worden afgekapt"
-#: builtin.c:2785
+#: builtin.c:2787
#, c-format
msgid "lshift(%lf, %lf): too large shift value will give strange results"
msgstr "lshift(%lf, %lf): te grote opschuifwaarden geven rare resultaten"
-#: builtin.c:2810
+#: builtin.c:2812
msgid "rshift: received non-numeric first argument"
msgstr "rshift: eerste argument is geen getal"
-#: builtin.c:2812
+#: builtin.c:2814
msgid "rshift: received non-numeric second argument"
msgstr "rshift: tweede argument is geen getal"
-#: builtin.c:2818
+#: builtin.c:2820
#, c-format
msgid "rshift(%lf, %lf): negative values will give strange results"
msgstr "rshift(%lf, %lf): negatieve waarden geven rare resultaten"
-#: builtin.c:2820
+#: builtin.c:2822
#, c-format
msgid "rshift(%lf, %lf): fractional values will be truncated"
msgstr "rshift(%lf, %lf): cijfers na de komma worden afgekapt"
-#: builtin.c:2822
+#: builtin.c:2824
#, c-format
msgid "rshift(%lf, %lf): too large shift value will give strange results"
msgstr "rshift(%lf, %lf): te grote opschuifwaarden geven rare resultaten"
-#: builtin.c:2847
+#: builtin.c:2849
msgid "and: received non-numeric first argument"
msgstr "and: eerste argument is geen getal"
-#: builtin.c:2849
+#: builtin.c:2851
msgid "and: received non-numeric second argument"
msgstr "and: tweede argument is geen getal"
-#: builtin.c:2855
+#: builtin.c:2857
#, c-format
msgid "and(%lf, %lf): negative values will give strange results"
msgstr "and(%lf, %lf): negatieve waarden geven rare resultaten"
-#: builtin.c:2857
+#: builtin.c:2859
#, c-format
msgid "and(%lf, %lf): fractional values will be truncated"
msgstr "and(%lf, %lf): cijfers na de komma worden afgekapt"
-#: builtin.c:2882
+#: builtin.c:2884
msgid "or: received non-numeric first argument"
msgstr "or: eerste argument is geen getal"
-#: builtin.c:2884
+#: builtin.c:2886
msgid "or: received non-numeric second argument"
msgstr "or: tweede argument is geen getal"
-#: builtin.c:2890
+#: builtin.c:2892
#, c-format
msgid "or(%lf, %lf): negative values will give strange results"
msgstr "or(%lf, %lf): negatieve waarden geven rare resultaten"
-#: builtin.c:2892
+#: builtin.c:2894
#, c-format
msgid "or(%lf, %lf): fractional values will be truncated"
msgstr "or(%lf, %lf): cijfers na de komma worden afgekapt"
-#: builtin.c:2920
+#: builtin.c:2922
msgid "xor: received non-numeric first argument"
msgstr "xor: eerste argument is geen getal"
-#: builtin.c:2922
+#: builtin.c:2924
msgid "xor: received non-numeric second argument"
msgstr "xor: tweede argument is geen getal"
-#: builtin.c:2928
+#: builtin.c:2930
#, c-format
msgid "xor(%lf, %lf): negative values will give strange results"
msgstr "xor(%lf, %lf): negatieve waarden geven rare resultaten"
-#: builtin.c:2930
+#: builtin.c:2932
#, c-format
msgid "xor(%lf, %lf): fractional values will be truncated"
msgstr "xor(%lf, %lf): cijfers na de komma worden afgekapt"
-#: builtin.c:2954 builtin.c:2960
+#: builtin.c:2956 builtin.c:2962
msgid "compl: received non-numeric argument"
msgstr "compl: argument is geen getal"
-#: builtin.c:2962
+#: builtin.c:2964
#, c-format
msgid "compl(%lf): negative value will give strange results"
msgstr "compl(%lf): negatieve waarden geven rare resultaten"
-#: builtin.c:2964
+#: builtin.c:2966
#, c-format
msgid "compl(%lf): fractional value will be truncated"
msgstr "compl(%lf): cijfers na de komma worden afgekapt"
-#: builtin.c:3133
+#: builtin.c:3135
#, c-format
msgid "dcgettext: `%s' is not a valid locale category"
msgstr "dcgettext: '%s' is geen geldige taalregio-deelcategorie"
diff --git a/po/pl.gmo b/po/pl.gmo
index c90a7959..f0b2f7c1 100644
--- a/po/pl.gmo
+++ b/po/pl.gmo
Binary files differ
diff --git a/po/pl.po b/po/pl.po
index 33f5543f..68aedb4f 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gawk 3.1.81\n"
"Report-Msgid-Bugs-To: arnold@skeeve.com\n"
-"POT-Creation-Date: 2011-10-24 05:57+0200\n"
+"POT-Creation-Date: 2011-11-14 21:46+0200\n"
"PO-Revision-Date: 2011-05-14 11:41-0400\n"
"Last-Translator: Wojciech Polak <polak@gnu.org>\n"
"Language-Team: Polish <translation-team-pl@lists.sourceforge.net>\n"
@@ -45,7 +45,7 @@ msgid "attempt to use scalar `%s' as an array"
msgstr "próba użycia skalaru `%s' jako tablicy"
#: array.c:302 array.c:707 builtin.c:84 builtin.c:1384 builtin.c:1426
-#: builtin.c:1439 builtin.c:1856 builtin.c:1868 eval.c:1135 eval.c:1139
+#: builtin.c:1439 builtin.c:1858 builtin.c:1870 eval.c:1135 eval.c:1139
#: eval.c:1495 eval.c:1812
#, c-format
msgid "attempt to use array `%s' in a scalar context"
@@ -772,206 +772,206 @@ msgstr ""
"substr: długość %g zaczynając od %g przekracza długość pierwszego argumentu "
"(%lu)"
-#: builtin.c:1655
+#: builtin.c:1656
msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type"
msgstr ""
"strftime: wartość formatu w PROCINFO[\"strftime\"] posiada typ numeryczny"
-#: builtin.c:1678
+#: builtin.c:1679
msgid "strftime: received non-numeric second argument"
msgstr "strftime: otrzymano drugi argument, który nie jest liczbą"
-#: builtin.c:1681
+#: builtin.c:1682
msgid "strftime: second argument less than 0 or too big for time_t"
msgstr ""
-#: builtin.c:1687
+#: builtin.c:1689
msgid "strftime: received non-string first argument"
msgstr "strftime: otrzymano pierwszy argument, który nie jest łańcuchem"
-#: builtin.c:1693
+#: builtin.c:1695
msgid "strftime: received empty format string"
msgstr "strftime: otrzymano pusty łańcuch formatujący"
-#: builtin.c:1759
+#: builtin.c:1761
msgid "mktime: received non-string argument"
msgstr "mktime: otrzymano argument, który nie jest łańcuchem"
-#: builtin.c:1776
+#: builtin.c:1778
msgid "mktime: at least one of the values is out of the default range"
msgstr "mktime: przynajmniej jedna z wartości jest poza domyślnym zakresem"
-#: builtin.c:1811
+#: builtin.c:1813
msgid "'system' function not allowed in sandbox mode"
msgstr "funkcja 'system' nie jest dozwolona w trybie piaskownicy"
-#: builtin.c:1816
+#: builtin.c:1818
msgid "system: received non-string argument"
msgstr "system: otrzymano argument, który nie jest łańcuchem"
-#: builtin.c:1871 eval.c:1159 eval.c:1790 eval.c:1803
+#: builtin.c:1873 eval.c:1159 eval.c:1790 eval.c:1803
#, c-format
msgid "reference to uninitialized variable `%s'"
msgstr "odwołanie do niezainicjowanej zmiennej `%s'"
-#: builtin.c:1938
+#: builtin.c:1940
#, c-format
msgid "reference to uninitialized field `$%d'"
msgstr "odwołanie do niezainicjowanego pola `$%d'"
-#: builtin.c:2025
+#: builtin.c:2027
msgid "tolower: received non-string argument"
msgstr "tolower: otrzymano argument, który nie jest łańcuchem"
-#: builtin.c:2059
+#: builtin.c:2061
msgid "toupper: received non-string argument"
msgstr "toupper: otrzymano argument, który nie jest łańcuchem"
-#: builtin.c:2095
+#: builtin.c:2097
msgid "atan2: received non-numeric first argument"
msgstr "atan2: otrzymano pierwszy argument, który nie jest liczbą"
-#: builtin.c:2097
+#: builtin.c:2099
msgid "atan2: received non-numeric second argument"
msgstr "atan2: otrzymano drugi argument, który nie jest liczbą"
-#: builtin.c:2116
+#: builtin.c:2118
msgid "sin: received non-numeric argument"
msgstr "sin: otrzymano argument, który nie jest liczbą"
-#: builtin.c:2132
+#: builtin.c:2134
msgid "cos: received non-numeric argument"
msgstr "cos: otrzymano argument, który nie jest liczbą"
-#: builtin.c:2185
+#: builtin.c:2187
msgid "srand: received non-numeric argument"
msgstr "srand: otrzymano argument, który nie jest liczbą"
-#: builtin.c:2216
+#: builtin.c:2218
msgid "match: third argument is not an array"
msgstr "match: otrzymano trzeci argument, który nie jest tablicą"
-#: builtin.c:2480
+#: builtin.c:2482
msgid "gensub: third argument of 0 treated as 1"
msgstr "gensub: trzeci argument 0 potraktowany jako 1"
-#: builtin.c:2773
+#: builtin.c:2775
msgid "lshift: received non-numeric first argument"
msgstr "lshift: otrzymano pierwszy argument, który nie jest liczbą"
-#: builtin.c:2775
+#: builtin.c:2777
msgid "lshift: received non-numeric second argument"
msgstr "lshift: otrzymano drugi argument, który nie jest liczbą"
-#: builtin.c:2781
+#: builtin.c:2783
#, c-format
msgid "lshift(%lf, %lf): negative values will give strange results"
msgstr "lshift(%lf, %lf): ujemne wartości spowodują dziwne wyniki"
-#: builtin.c:2783
+#: builtin.c:2785
#, c-format
msgid "lshift(%lf, %lf): fractional values will be truncated"
msgstr "lshift(%lf, %lf): ułamkowe wartości zostaną obcięte"
-#: builtin.c:2785
+#: builtin.c:2787
#, c-format
msgid "lshift(%lf, %lf): too large shift value will give strange results"
msgstr ""
"lshift(%lf, %lf): zbyt duża wartość przesunięcia spowoduje dziwne wyniki"
-#: builtin.c:2810
+#: builtin.c:2812
msgid "rshift: received non-numeric first argument"
msgstr "rshift: otrzymano pierwszy argument, który nie jest liczbą"
-#: builtin.c:2812
+#: builtin.c:2814
msgid "rshift: received non-numeric second argument"
msgstr "rshift: otrzymano drugi argument, który nie jest liczbą"
-#: builtin.c:2818
+#: builtin.c:2820
#, c-format
msgid "rshift(%lf, %lf): negative values will give strange results"
msgstr "rshift(%lf, %lf): ujemne wartości spowodują dziwne wyniki"
-#: builtin.c:2820
+#: builtin.c:2822
#, c-format
msgid "rshift(%lf, %lf): fractional values will be truncated"
msgstr "rshift(%lf, %lf): ułamkowe wartości zostaną obcięte"
-#: builtin.c:2822
+#: builtin.c:2824
#, c-format
msgid "rshift(%lf, %lf): too large shift value will give strange results"
msgstr ""
"rshift(%lf, %lf): zbyt duża wartość przesunięcia spowoduje dziwne wyniki"
-#: builtin.c:2847
+#: builtin.c:2849
msgid "and: received non-numeric first argument"
msgstr "and: otrzymano pierwszy argument, który nie jest liczbą"
-#: builtin.c:2849
+#: builtin.c:2851
msgid "and: received non-numeric second argument"
msgstr "and: otrzymano drugi argument, który nie jest liczbą"
-#: builtin.c:2855
+#: builtin.c:2857
#, c-format
msgid "and(%lf, %lf): negative values will give strange results"
msgstr "and(%lf, %lf): ujemne wartości spowodują dziwne wyniki"
-#: builtin.c:2857
+#: builtin.c:2859
#, c-format
msgid "and(%lf, %lf): fractional values will be truncated"
msgstr "and(%lf, %lf): ułamkowe wartości zostaną obcięte"
-#: builtin.c:2882
+#: builtin.c:2884
msgid "or: received non-numeric first argument"
msgstr "or: otrzymano pierwszy argument, który nie jest liczbą"
-#: builtin.c:2884
+#: builtin.c:2886
msgid "or: received non-numeric second argument"
msgstr "or: otrzymano drugi argument, który nie jest liczbą"
-#: builtin.c:2890
+#: builtin.c:2892
#, c-format
msgid "or(%lf, %lf): negative values will give strange results"
msgstr "or(%lf, %lf): ujemne wartości spowodują dziwne wyniki"
-#: builtin.c:2892
+#: builtin.c:2894
#, c-format
msgid "or(%lf, %lf): fractional values will be truncated"
msgstr "or(%lf, %lf): ułamkowe wartości zostaną obcięte"
-#: builtin.c:2920
+#: builtin.c:2922
msgid "xor: received non-numeric first argument"
msgstr "xor: otrzymano pierwszy argument, który nie jest liczbą"
-#: builtin.c:2922
+#: builtin.c:2924
msgid "xor: received non-numeric second argument"
msgstr "xor: otrzymano drugi argument, który nie jest liczbą"
-#: builtin.c:2928
+#: builtin.c:2930
#, c-format
msgid "xor(%lf, %lf): negative values will give strange results"
msgstr "xor(%lf, %lf): ujemne wartości spowodują dziwne wyniki"
-#: builtin.c:2930
+#: builtin.c:2932
#, c-format
msgid "xor(%lf, %lf): fractional values will be truncated"
msgstr "xor(%lf, %lf): ułamkowe wartości zostaną obcięte"
-#: builtin.c:2954 builtin.c:2960
+#: builtin.c:2956 builtin.c:2962
msgid "compl: received non-numeric argument"
msgstr "compl: otrzymano argument, który nie jest liczbą"
-#: builtin.c:2962
+#: builtin.c:2964
#, c-format
msgid "compl(%lf): negative value will give strange results"
msgstr "compl(%lf): ujemne wartości spowodują dziwne wyniki"
-#: builtin.c:2964
+#: builtin.c:2966
#, c-format
msgid "compl(%lf): fractional value will be truncated"
msgstr "compl(%lf): ułamkowe wartości zostaną obcięte"
-#: builtin.c:3133
+#: builtin.c:3135
#, c-format
msgid "dcgettext: `%s' is not a valid locale category"
msgstr "dcgettext: `%s' nie jest prawidłową kategorią lokalizacji"
diff --git a/po/pt_BR.gmo b/po/pt_BR.gmo
deleted file mode 100644
index 4cbc6792..00000000
--- a/po/pt_BR.gmo
+++ /dev/null
Binary files differ
diff --git a/po/ro.gmo b/po/ro.gmo
deleted file mode 100644
index e3534b89..00000000
--- a/po/ro.gmo
+++ /dev/null
Binary files differ
diff --git a/po/rw.gmo b/po/rw.gmo
deleted file mode 100644
index a08f9183..00000000
--- a/po/rw.gmo
+++ /dev/null
Binary files differ
diff --git a/po/sv.gmo b/po/sv.gmo
index 0878d1e0..79e809be 100644
--- a/po/sv.gmo
+++ b/po/sv.gmo
Binary files differ
diff --git a/po/sv.po b/po/sv.po
index 5a9f0161..874798c8 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gawk 4.0.0\n"
"Report-Msgid-Bugs-To: arnold@skeeve.com\n"
-"POT-Creation-Date: 2011-10-24 05:57+0200\n"
+"POT-Creation-Date: 2011-11-14 21:46+0200\n"
"PO-Revision-Date: 2011-07-16 15:20+0200\n"
"Last-Translator: Göran Uddeborg <goeran@uddeborg.se>\n"
"Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
@@ -44,7 +44,7 @@ msgid "attempt to use scalar `%s' as an array"
msgstr "försök att använda skalären \"%s\" som en vektor"
#: array.c:302 array.c:707 builtin.c:84 builtin.c:1384 builtin.c:1426
-#: builtin.c:1439 builtin.c:1856 builtin.c:1868 eval.c:1135 eval.c:1139
+#: builtin.c:1439 builtin.c:1858 builtin.c:1870 eval.c:1135 eval.c:1139
#: eval.c:1495 eval.c:1812
#, c-format
msgid "attempt to use array `%s' in a scalar context"
@@ -765,203 +765,203 @@ msgstr ""
"substr: längden %g vid startindex %g överskrider det första argumentets "
"längd (%lu)"
-#: builtin.c:1655
+#: builtin.c:1656
msgid "strftime: format value in PROCINFO[\"strftime\"] has numeric type"
msgstr "strftime: formatvärde i PROCINFO[\"strftime\"] har numerisk typ"
-#: builtin.c:1678
+#: builtin.c:1679
msgid "strftime: received non-numeric second argument"
msgstr "strftime: fick ett ickenumeriskt andra argument"
-#: builtin.c:1681
+#: builtin.c:1682
msgid "strftime: second argument less than 0 or too big for time_t"
msgstr ""
-#: builtin.c:1687
+#: builtin.c:1689
msgid "strftime: received non-string first argument"
msgstr "strftime: fick ett första argument som inte är en sträng"
-#: builtin.c:1693
+#: builtin.c:1695
msgid "strftime: received empty format string"
msgstr "strftime: fick en tom formatsträng"
-#: builtin.c:1759
+#: builtin.c:1761
msgid "mktime: received non-string argument"
msgstr "mktime: fick ett argument som inte är en sträng"
-#: builtin.c:1776
+#: builtin.c:1778
msgid "mktime: at least one of the values is out of the default range"
msgstr "mktime: åtminstone ett av värdena är utanför standardintervallet"
-#: builtin.c:1811
+#: builtin.c:1813
msgid "'system' function not allowed in sandbox mode"
msgstr "funktionen \"system\" är inte tillåten i sandlådeläge"
-#: builtin.c:1816
+#: builtin.c:1818
msgid "system: received non-string argument"
msgstr "system: fick ett argument som inte är en sträng"
-#: builtin.c:1871 eval.c:1159 eval.c:1790 eval.c:1803
+#: builtin.c:1873 eval.c:1159 eval.c:1790 eval.c:1803
#, c-format
msgid "reference to uninitialized variable `%s'"
msgstr "referens till icke initierad variabel \"%s\""
-#: builtin.c:1938
+#: builtin.c:1940
#, c-format
msgid "reference to uninitialized field `$%d'"
msgstr "referens till icke initierat fält \"$%d\""
-#: builtin.c:2025
+#: builtin.c:2027
msgid "tolower: received non-string argument"
msgstr "tolower: fick ett argument som inte är en sträng"
-#: builtin.c:2059
+#: builtin.c:2061
msgid "toupper: received non-string argument"
msgstr "toupper: fick ett argument som inte är en sträng"
-#: builtin.c:2095
+#: builtin.c:2097
msgid "atan2: received non-numeric first argument"
msgstr "atan2: fick ett ickenumeriskt första argument"
-#: builtin.c:2097
+#: builtin.c:2099
msgid "atan2: received non-numeric second argument"
msgstr "atan2: fick ett ickenumeriskt andra argument"
-#: builtin.c:2116
+#: builtin.c:2118
msgid "sin: received non-numeric argument"
msgstr "sin: fick ett ickenumeriskt argument"
-#: builtin.c:2132
+#: builtin.c:2134
msgid "cos: received non-numeric argument"
msgstr "cos: fick ett ickenumeriskt argument"
-#: builtin.c:2185
+#: builtin.c:2187
msgid "srand: received non-numeric argument"
msgstr "srand: fick ett ickenumeriskt argument"
-#: builtin.c:2216
+#: builtin.c:2218
msgid "match: third argument is not an array"
msgstr "match: tredje argumentet är inte en vektor"
-#: builtin.c:2480
+#: builtin.c:2482
msgid "gensub: third argument of 0 treated as 1"
msgstr "gensub: nollan i tredje argumentet behandlad som en etta"
-#: builtin.c:2773
+#: builtin.c:2775
msgid "lshift: received non-numeric first argument"
msgstr "lshift: fick ett ickenumeriskt första argument"
-#: builtin.c:2775
+#: builtin.c:2777
msgid "lshift: received non-numeric second argument"
msgstr "lshift: fick ett ickenumeriskt andra argument"
-#: builtin.c:2781
+#: builtin.c:2783
#, 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:2783
+#: builtin.c:2785
#, c-format
msgid "lshift(%lf, %lf): fractional values will be truncated"
msgstr "lshift(%lf, %lf): flyttalsvärden kommer trunkeras"
-#: builtin.c:2785
+#: builtin.c:2787
#, 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:2810
+#: builtin.c:2812
msgid "rshift: received non-numeric first argument"
msgstr "rshift: fick ett ickenumeriskt första argument"
-#: builtin.c:2812
+#: builtin.c:2814
msgid "rshift: received non-numeric second argument"
msgstr "rshift: fick ett ickenumeriskt andra argument"
-#: builtin.c:2818
+#: builtin.c:2820
#, 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:2820
+#: builtin.c:2822
#, c-format
msgid "rshift(%lf, %lf): fractional values will be truncated"
msgstr "rshift(%lf, %lf): flyttalsvärden kommer trunkeras"
-#: builtin.c:2822
+#: builtin.c:2824
#, 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:2847
+#: builtin.c:2849
msgid "and: received non-numeric first argument"
msgstr "and: fick ett ickenumeriskt första argument"
-#: builtin.c:2849
+#: builtin.c:2851
msgid "and: received non-numeric second argument"
msgstr "and: fick ett ickenumeriskt andra argument"
-#: builtin.c:2855
+#: builtin.c:2857
#, 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:2857
+#: builtin.c:2859
#, c-format
msgid "and(%lf, %lf): fractional values will be truncated"
msgstr "and(%lf, %lf): flyttalsvärden kommer trunkeras"
-#: builtin.c:2882
+#: builtin.c:2884
msgid "or: received non-numeric first argument"
msgstr "or: fick ett ickenumeriskt första argument"
-#: builtin.c:2884
+#: builtin.c:2886
msgid "or: received non-numeric second argument"
msgstr "or: fick ett ickenumeriskt andra argument"
-#: builtin.c:2890
+#: builtin.c:2892
#, 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:2892
+#: builtin.c:2894
#, c-format
msgid "or(%lf, %lf): fractional values will be truncated"
msgstr "or(%lf, %lf): flyttalsvärden kommer trunkeras"
-#: builtin.c:2920
+#: builtin.c:2922
msgid "xor: received non-numeric first argument"
msgstr "xor: fick ett ickenumeriskt första argument"
-#: builtin.c:2922
+#: builtin.c:2924
msgid "xor: received non-numeric second argument"
msgstr "xor: fick ett ickenumeriskt andra argument"
-#: builtin.c:2928
+#: builtin.c:2930
#, 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:2930
+#: builtin.c:2932
#, c-format
msgid "xor(%lf, %lf): fractional values will be truncated"
msgstr "xor(%lf, %lf): flyttalsvärden kommer trunkeras"
-#: builtin.c:2954 builtin.c:2960
+#: builtin.c:2956 builtin.c:2962
msgid "compl: received non-numeric argument"
msgstr "compl: fick ett ickenumeriskt argument"
-#: builtin.c:2962
+#: builtin.c:2964
#, c-format
msgid "compl(%lf): negative value will give strange results"
msgstr "compl(%lf): negativa värden kommer ge konstiga resultat"
-#: builtin.c:2964
+#: builtin.c:2966
#, c-format
msgid "compl(%lf): fractional value will be truncated"
msgstr "compl(%lf): flyttalsvärden kommer trunkeras"
-#: builtin.c:3133
+#: builtin.c:3135
#, c-format
msgid "dcgettext: `%s' is not a valid locale category"
msgstr "dcgettext: \"%s\" är inte en giltig lokalkategori"
diff --git a/po/tr.gmo b/po/tr.gmo
deleted file mode 100644
index 146da41d..00000000
--- a/po/tr.gmo
+++ /dev/null
Binary files differ
diff --git a/po/vi.gmo b/po/vi.gmo
deleted file mode 100644
index e3a5e619..00000000
--- a/po/vi.gmo
+++ /dev/null
Binary files differ
diff --git a/po/zh_CN.gmo b/po/zh_CN.gmo
deleted file mode 100644
index 7ed096c3..00000000
--- a/po/zh_CN.gmo
+++ /dev/null
Binary files differ
diff --git a/profile.c b/profile.c
index 5c581e8e..6d9db06e 100644
--- a/profile.c
+++ b/profile.c
@@ -43,10 +43,9 @@ const char *redir2str(int redirtype);
#define DONT_FREE 1
#define CAN_FREE 2
-#ifdef PROFILING
+
static RETSIGTYPE dump_and_exit(int signum) ATTRIBUTE_NORETURN;
static RETSIGTYPE just_dump(int signum);
-#endif
/* pretty printing related functions and variables */
@@ -59,20 +58,7 @@ static long indent_level = 0;
#define SPACEOVER 0
-/* init_profiling --- do needed initializations, see also main.c */
-
-void
-init_profiling(int *flag ATTRIBUTE_UNUSED, const char *def_file ATTRIBUTE_UNUSED)
-{
-#ifdef PROFILING
- if (*flag == FALSE) {
- *flag |= DO_PROFILING;
- set_prof_file(def_file);
- }
-#endif
-}
-
-/* set_prof_file --- set the output file for profiling */
+/* set_prof_file --- set the output file for profiling or pretty-printing */
void
set_prof_file(const char *file)
@@ -87,12 +73,11 @@ set_prof_file(const char *file)
}
}
-/* init_profiling_signals --- set up signal handling for pgawk */
+/* init_profiling_signals --- set up signal handling for gawk --profile */
void
init_profiling_signals()
{
-#ifdef PROFILING
#ifdef __DJGPP__
signal(SIGINT, dump_and_exit);
signal(SIGQUIT, just_dump);
@@ -104,7 +89,6 @@ init_profiling_signals()
signal(SIGUSR1, just_dump);
#endif
#endif /* !__DJGPP__ */
-#endif /* PROFILING */
}
/* indent --- print out enough tabs */
@@ -214,10 +198,10 @@ pprint(INSTRUCTION *startp, INSTRUCTION *endp, int in_for_header)
fprintf(prof_fp, "%s {", t1->pp_str);
pp_free(t1);
ip = (pc + 1)->firsti;
-#ifdef PROFILING
- if (ip->exec_count > 0)
+
+ if (do_profile && ip->exec_count > 0)
fprintf(prof_fp, " # %ld", ip->exec_count);
-#endif
+
fprintf(prof_fp, "\n");
} else {
fprintf(prof_fp, "{\n");
@@ -917,7 +901,7 @@ pp_string_fp(Func_print print_func, FILE *fp, const char *in_str,
efree(s);
}
-#ifdef PROFILING
+
/* just_dump --- dump the profile and function stack and keep going */
static RETSIGTYPE
@@ -941,7 +925,6 @@ dump_and_exit(int signum)
exit(EXIT_FAILURE);
}
-#endif
/* dump_prog --- dump the program */
@@ -1368,8 +1351,8 @@ redir2str(int redirtype)
" >> ", /* redirect_append */
" | ", /* redirect_pipe */
" | ", /* redirect_pipein */
- " < " /* redirect_input */
- " |& " /* redirect_twoway */
+ " < ", /* redirect_input */
+ " |& ", /* redirect_twoway */
};
if (redirtype < 0 || redirtype > redirect_twoway)
diff --git a/profile_p.c b/profile_p.c
deleted file mode 100644
index 97edd367..00000000
--- a/profile_p.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * profile_p.c - compile profile.c with profiling turned on.
- */
-
-/*
- * Copyright (C) 2001 the Free Software Foundation, Inc.
- *
- * This file is part of GAWK, the GNU implementation of the
- * AWK Programming Language.
- *
- * GAWK is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#define PROFILING 1
-#include "profile.c"
diff --git a/regex_internal.h b/regex_internal.h
index b5dc7b46..5fcab48a 100644
--- a/regex_internal.h
+++ b/regex_internal.h
@@ -27,16 +27,18 @@
#include <stdlib.h>
#include <string.h>
+#include "mbsupport.h" /* gawk */
+
#if defined HAVE_LANGINFO_H || defined HAVE_LANGINFO_CODESET || defined _LIBC
# include <langinfo.h>
#endif
#if defined HAVE_LOCALE_H || defined _LIBC
# include <locale.h>
#endif
-#if defined HAVE_WCHAR_H || defined _LIBC
+#if MBS_SUPPORT && (defined HAVE_WCHAR_H || defined _LIBC)
# include <wchar.h>
#endif /* HAVE_WCHAR_H || _LIBC */
-#if defined HAVE_WCTYPE_H || defined _LIBC
+#if MBS_SUPPORT && (defined HAVE_WCTYPE_H || defined _LIBC)
# include <wctype.h>
#endif /* HAVE_WCTYPE_H || _LIBC */
#if defined HAVE_STDBOOL_H || defined _LIBC
@@ -108,8 +110,6 @@ is_blank (int c)
# define SIZE_MAX ((size_t) -1)
#endif
-#include "mbsupport.h" /* gawk */
-
#if MBS_SUPPORT || _LIBC
# define RE_ENABLE_I18N
#endif
diff --git a/regexec.c b/regexec.c
index 97fcba00..dcd325c4 100644
--- a/regexec.c
+++ b/regexec.c
@@ -3963,18 +3963,10 @@ check_node_accept_bytes (const re_dfa_t *dfa, int node_idx,
# endif /* _LIBC */
{
/* match with range expression? */
-#if __GNUC__ >= 2
- wchar_t cmp_buf[] = {L'\0', L'\0', wc, L'\0', L'\0', L'\0'};
-#else
- wchar_t cmp_buf[] = {L'\0', L'\0', L'\0', L'\0', L'\0', L'\0'};
- cmp_buf[2] = wc;
-#endif
for (i = 0; i < cset->nranges; ++i)
{
- cmp_buf[0] = cset->range_starts[i];
- cmp_buf[4] = cset->range_ends[i];
- if (wcscoll (cmp_buf, cmp_buf + 2) <= 0
- && wcscoll (cmp_buf + 2, cmp_buf + 4) <= 0)
+ if (cset->range_starts[i] <= wc
+ && wc <= cset->range_ends[i])
{
match_len = char_len;
goto check_node_accept_bytes_match;
diff --git a/replace.c b/replace.c
index d2dcbbcc..d1c05ad6 100644
--- a/replace.c
+++ b/replace.c
@@ -111,3 +111,7 @@
#ifndef HAVE_STRCOLL
#include "missing_d/strcoll.c"
#endif
+
+#if ! MBS_SUPPORT
+#include "missing_d/wcmisc.c"
+#endif
diff --git a/str_array.c b/str_array.c
index 8fb6ba8a..7ce617ed 100644
--- a/str_array.c
+++ b/str_array.c
@@ -191,7 +191,8 @@ str_exists(NODE *symbol, NODE *subs)
unsigned long hash1;
size_t code1;
- assert(symbol->table_size > 0);
+ if (symbol->table_size == 0)
+ return NULL;
subs = force_string(subs);
hash1 = hash(subs->stptr, subs->stlen, (unsigned long) symbol->array_size, & code1);
@@ -242,7 +243,8 @@ str_remove(NODE *symbol, NODE *subs)
NODE *s2;
size_t s1_len;
- assert(symbol->table_size > 0);
+ if (symbol->table_size == 0)
+ return NULL;
s2 = force_string(subs);
hash1 = hash(s2->stptr, s2->stlen, (unsigned long) symbol->array_size, NULL);
@@ -358,7 +360,8 @@ str_list(NODE *symbol, NODE *t)
unsigned long num_elems, list_size, i, k = 0;
int elem_size = 1;
- assert(symbol->table_size > 0);
+ if (symbol->table_size == 0)
+ return NULL;
if ((t->flags & (AINDEX|AVALUE)) == (AINDEX|AVALUE))
elem_size = 2;
@@ -443,7 +446,7 @@ str_dump(NODE *symbol, NODE *ndump)
fprintf(output_fp, "flags: %s\n", flags2str(symbol->flags));
}
indent(indent_level);
- fprintf(output_fp, "STR_CHAIN_MAX: %lu\n", STR_CHAIN_MAX);
+ fprintf(output_fp, "STR_CHAIN_MAX: %lu\n", (unsigned long) STR_CHAIN_MAX);
indent(indent_level);
fprintf(output_fp, "array_size: %lu\n", (unsigned long) symbol->array_size);
indent(indent_level);
@@ -681,9 +684,9 @@ str_option(NODE *opt, NODE *val)
tmp = force_string(opt);
(void) force_number(val);
- if (STREQ(tmp->stptr, "STR_CHAIN_MAX")) {
+ if (strcmp(tmp->stptr, "STR_CHAIN_MAX") == 0) {
newval = (int) val->numbr;
- if (newval > 0)
+ if (newval > 0)
STR_CHAIN_MAX = newval;
} else
ret = NULL;
diff --git a/test/ChangeLog b/test/ChangeLog
index 05a74f87..c16e5ecf 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,16 @@
+2011-12-26 John Haque <j.eh@mchsi.com>
+
+ * badargs.ok: Adjust for new and changed command line options.
+
+2011-12-26 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (rri1): New test.
+ * rri1.awk, rri1.in, rri1.ok: New files.
+
+2011-12-06 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am: Rationalize the $(CMP) lines wherever possible.
+
2011-10-24 Arnold D. Robbins <arnold@skeeve.com>
* beginfile2.sh: Use `...` instead of $(...) for broken systems
diff --git a/test/Makefile.am b/test/Makefile.am
index 450fc35d..943dbd9f 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -626,6 +626,9 @@ EXTRA_DIST = \
resplit.awk \
resplit.in \
resplit.ok \
+ rri1.awk \
+ rri1.in \
+ rri1.ok \
rs.awk \
rs.in \
rs.ok \
@@ -804,6 +807,7 @@ BASIC_TESTS = \
paramres paramtyp parse1 parsefld parseme pcntplus posix2008sub \
prdupval prec printf0 printf1 prmarscl prmreuse prt1eval prtoeval \
rand range1 rebt8b1 redfilnm regeq regrange reindops reparse resplit \
+ rri1 \
rs rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 rstest3 rstest4 \
rstest5 rswhite scalar sclforin sclifin sortempty splitargv \
splitarr splitdef splitvar splitwht strcat1 strnum1 strtod subamp \
@@ -977,7 +981,7 @@ argarray::
.) : ;; \
*) rm -f ./argarray.in ;; \
esac
- @-$(CMP) $(srcdir)/argarray.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
regtest::
@echo 'Some of the output from regtest is very system specific, do not'
@@ -992,43 +996,44 @@ manyfiles::
@$(AWK) 'BEGIN { for (i = 1; i <= 1030; i++) print i, i}' >_$@
@$(AWK) -f $(srcdir)/manyfiles.awk _$@ _$@
@wc -l junk/* | $(AWK) '$$1 != 2' | wc -l | sed "s/ *//g" > _$@
- @rm -rf junk ; $(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+ @rm -rf junk
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
compare::
@echo $@
@$(AWK) -f $(srcdir)/compare.awk 0 1 $(srcdir)/compare.in >_$@
- @-$(CMP) $(srcdir)/compare.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
inftest::
@echo $@
@echo This test is very machine specific...
@$(AWK) -f $(srcdir)/inftest.awk | sed "s/inf/Inf/g" >_$@
- @-$(CMP) $(srcdir)/inftest.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
getline2::
@echo $@
@$(AWK) -f $(srcdir)/getline2.awk $(srcdir)/getline2.awk $(srcdir)/getline2.awk >_$@
- @-$(CMP) $(srcdir)/getline2.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
awkpath::
@echo $@
@AWKPATH="$(srcdir)$(PATH_SEPARATOR)$(srcdir)/lib" $(AWK) -f awkpath.awk >_$@
- @-$(CMP) $(srcdir)/awkpath.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
argtest::
@echo $@
@$(AWK) -f $(srcdir)/argtest.awk -x -y abc >_$@
- @-$(CMP) $(srcdir)/argtest.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
badargs::
@echo $@
@-$(AWK) -f 2>&1 | grep -v patchlevel >_$@
- @-$(CMP) $(srcdir)/badargs.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
nonl::
@echo $@
@-AWKPATH=$(srcdir) $(AWK) --lint -f nonl.awk /dev/null >_$@ 2>&1
- @-$(CMP) $(srcdir)/nonl.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
strftime::
@echo This test could fail on slow machines or on a minute boundary,
@@ -1042,7 +1047,7 @@ strftime::
litoct::
@echo $@
@echo ab | $(AWK) --traditional -f $(srcdir)/litoct.awk >_$@
- @-$(CMP) $(srcdir)/litoct.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
devfd::
@echo $@
@@ -1052,13 +1057,13 @@ devfd::
fflush::
@echo $@
@$(srcdir)/fflush.sh >_$@
- @-$(CMP) $(srcdir)/fflush.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
tweakfld::
@echo $@
@$(AWK) -f $(srcdir)/tweakfld.awk $(srcdir)/tweakfld.in >_$@
@rm -f errors.cleanup
- @-$(CMP) $(srcdir)/tweakfld.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
mmap8k::
@echo $@
@@ -1068,7 +1073,7 @@ mmap8k::
tradanch::
@echo $@
@$(AWK) --traditional -f $(srcdir)/tradanch.awk $(srcdir)/tradanch.in >_$@
- @-$(CMP) $(srcdir)/tradanch.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.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.
@@ -1083,12 +1088,12 @@ strftlng::
@if $(CMP) $(srcdir)/strftlng.ok _$@ >/dev/null 2>&1 ; then : ; else \
TZ=UTC0; export TZ; $(AWK) -f $(srcdir)/strftlng.awk >_$@ ; \
fi
- @-$(CMP) $(srcdir)/strftlng.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
nors::
@echo $@
@echo A B C D E | tr -d '\12\15' | $(AWK) '{ print $$NF }' - $(srcdir)/nors.in > _$@
- @-$(CMP) $(srcdir)/nors.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fmtspcl.ok: fmtspcl.tok Makefile
@$(AWK) -v "sd=$(srcdir)" 'BEGIN {pnan = sprintf("%g",sqrt(-1)); nnan = sprintf("%g",-sqrt(-1)); pinf = sprintf("%g",-log(0)); ninf = sprintf("%g",log(0))} {sub(/positive_nan/,pnan); sub(/negative_nan/,nnan); sub(/positive_infinity/,pinf); sub(/negative_infinity/,ninf); sub(/fmtspcl/,(sd"/fmtspcl")); print}' < $(srcdir)/fmtspcl.tok > $@ 2>/dev/null
@@ -1101,18 +1106,18 @@ fmtspcl: fmtspcl.ok
reint::
@echo $@
@$(AWK) --re-interval -f $(srcdir)/reint.awk $(srcdir)/reint.in >_$@
- @-$(CMP) $(srcdir)/reint.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
pipeio1::
@echo $@
@$(AWK) -f $(srcdir)/pipeio1.awk >_$@
@rm -f test1 test2
- @-$(CMP) $(srcdir)/pipeio1.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
pipeio2::
@echo $@
@$(AWK) -v SRCDIR=$(srcdir) -f $(srcdir)/pipeio2.awk >_$@
- @-$(CMP) $(srcdir)/pipeio2.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
clobber::
@echo $@
@@ -1123,7 +1128,7 @@ clobber::
arynocls::
@echo $@
@-AWKPATH=$(srcdir) $(AWK) -v INPUT=$(srcdir)/arynocls.in -f arynocls.awk >_$@
- @-$(CMP) $(srcdir)/arynocls.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
getlnbuf::
@echo $@
@@ -1157,12 +1162,12 @@ inetdayt::
redfilnm::
@echo $@
@$(AWK) -f $(srcdir)/redfilnm.awk srcdir=$(srcdir) $(srcdir)/redfilnm.in >_$@
- @-$(CMP) $(srcdir)/redfilnm.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
leaddig::
@echo $@
@$(AWK) -v x=2E -f $(srcdir)/leaddig.awk >_$@
- @-$(CMP) $(srcdir)/leaddig.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
gsubtst3::
@echo $@
@@ -1402,19 +1407,19 @@ dumpvars::
profile1:
@echo $@
- @$(AWK) --profile=ap-$@.out -f $(srcdir)/xref.awk $(srcdir)/dtdgport.awk > _$@.out1
+ @$(AWK) --pretty-print=ap-$@.out -f $(srcdir)/xref.awk $(srcdir)/dtdgport.awk > _$@.out1
@$(AWK) -f ap-$@.out $(srcdir)/dtdgport.awk > _$@.out2 ; rm ap-$@.out
@cmp _$@.out1 _$@.out2 && rm _$@.out[12] || echo EXIT CODE: $$? >>_$@
profile2:
@echo $@
- @$(PGAWK) --profile=ap-$@.out -v sortcmd=sort -f $(srcdir)/xref.awk $(srcdir)/dtdgport.awk > /dev/null
+ @$(AWK) --profile=ap-$@.out -v sortcmd=sort -f $(srcdir)/xref.awk $(srcdir)/dtdgport.awk > /dev/null
@sed 1,2d < ap-$@.out > _$@; rm ap-$@.out
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
profile3:
@echo $@
- @$(PGAWK) --profile=ap-$@.out -f $(srcdir)/$@.awk > /dev/null
+ @$(AWK) --profile=ap-$@.out -f $(srcdir)/$@.awk > /dev/null
@sed 1,2d < ap-$@.out > _$@; rm ap-$@.out
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
@@ -1433,6 +1438,12 @@ exit:
@-AWK="$(AWKPROG)" $(srcdir)/$@.sh > _$@ 2>&1
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+rri1::
+ @echo $@
+ @[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \
+ AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
# Targets generated for other tests:
include Maketests
diff --git a/test/Makefile.in b/test/Makefile.in
index 91173ea5..a389929a 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -810,6 +810,9 @@ EXTRA_DIST = \
resplit.awk \
resplit.in \
resplit.ok \
+ rri1.awk \
+ rri1.in \
+ rri1.ok \
rs.awk \
rs.in \
rs.ok \
@@ -988,6 +991,7 @@ BASIC_TESTS = \
paramres paramtyp parse1 parsefld parseme pcntplus posix2008sub \
prdupval prec printf0 printf1 prmarscl prmreuse prt1eval prtoeval \
rand range1 rebt8b1 redfilnm regeq regrange reindops reparse resplit \
+ rri1 \
rs rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 rstest3 rstest4 \
rstest5 rswhite scalar sclforin sclifin sortempty splitargv \
splitarr splitdef splitvar splitwht strcat1 strnum1 strtod subamp \
@@ -1327,7 +1331,7 @@ argarray::
.) : ;; \
*) rm -f ./argarray.in ;; \
esac
- @-$(CMP) $(srcdir)/argarray.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
regtest::
@echo 'Some of the output from regtest is very system specific, do not'
@@ -1342,43 +1346,44 @@ manyfiles::
@$(AWK) 'BEGIN { for (i = 1; i <= 1030; i++) print i, i}' >_$@
@$(AWK) -f $(srcdir)/manyfiles.awk _$@ _$@
@wc -l junk/* | $(AWK) '$$1 != 2' | wc -l | sed "s/ *//g" > _$@
- @rm -rf junk ; $(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+ @rm -rf junk
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
compare::
@echo $@
@$(AWK) -f $(srcdir)/compare.awk 0 1 $(srcdir)/compare.in >_$@
- @-$(CMP) $(srcdir)/compare.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
inftest::
@echo $@
@echo This test is very machine specific...
@$(AWK) -f $(srcdir)/inftest.awk | sed "s/inf/Inf/g" >_$@
- @-$(CMP) $(srcdir)/inftest.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
getline2::
@echo $@
@$(AWK) -f $(srcdir)/getline2.awk $(srcdir)/getline2.awk $(srcdir)/getline2.awk >_$@
- @-$(CMP) $(srcdir)/getline2.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
awkpath::
@echo $@
@AWKPATH="$(srcdir)$(PATH_SEPARATOR)$(srcdir)/lib" $(AWK) -f awkpath.awk >_$@
- @-$(CMP) $(srcdir)/awkpath.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
argtest::
@echo $@
@$(AWK) -f $(srcdir)/argtest.awk -x -y abc >_$@
- @-$(CMP) $(srcdir)/argtest.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
badargs::
@echo $@
@-$(AWK) -f 2>&1 | grep -v patchlevel >_$@
- @-$(CMP) $(srcdir)/badargs.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
nonl::
@echo $@
@-AWKPATH=$(srcdir) $(AWK) --lint -f nonl.awk /dev/null >_$@ 2>&1
- @-$(CMP) $(srcdir)/nonl.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
strftime::
@echo This test could fail on slow machines or on a minute boundary,
@@ -1392,7 +1397,7 @@ strftime::
litoct::
@echo $@
@echo ab | $(AWK) --traditional -f $(srcdir)/litoct.awk >_$@
- @-$(CMP) $(srcdir)/litoct.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
devfd::
@echo $@
@@ -1402,13 +1407,13 @@ devfd::
fflush::
@echo $@
@$(srcdir)/fflush.sh >_$@
- @-$(CMP) $(srcdir)/fflush.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
tweakfld::
@echo $@
@$(AWK) -f $(srcdir)/tweakfld.awk $(srcdir)/tweakfld.in >_$@
@rm -f errors.cleanup
- @-$(CMP) $(srcdir)/tweakfld.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
mmap8k::
@echo $@
@@ -1418,7 +1423,7 @@ mmap8k::
tradanch::
@echo $@
@$(AWK) --traditional -f $(srcdir)/tradanch.awk $(srcdir)/tradanch.in >_$@
- @-$(CMP) $(srcdir)/tradanch.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.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.
@@ -1433,12 +1438,12 @@ strftlng::
@if $(CMP) $(srcdir)/strftlng.ok _$@ >/dev/null 2>&1 ; then : ; else \
TZ=UTC0; export TZ; $(AWK) -f $(srcdir)/strftlng.awk >_$@ ; \
fi
- @-$(CMP) $(srcdir)/strftlng.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
nors::
@echo $@
@echo A B C D E | tr -d '\12\15' | $(AWK) '{ print $$NF }' - $(srcdir)/nors.in > _$@
- @-$(CMP) $(srcdir)/nors.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
fmtspcl.ok: fmtspcl.tok Makefile
@$(AWK) -v "sd=$(srcdir)" 'BEGIN {pnan = sprintf("%g",sqrt(-1)); nnan = sprintf("%g",-sqrt(-1)); pinf = sprintf("%g",-log(0)); ninf = sprintf("%g",log(0))} {sub(/positive_nan/,pnan); sub(/negative_nan/,nnan); sub(/positive_infinity/,pinf); sub(/negative_infinity/,ninf); sub(/fmtspcl/,(sd"/fmtspcl")); print}' < $(srcdir)/fmtspcl.tok > $@ 2>/dev/null
@@ -1451,18 +1456,18 @@ fmtspcl: fmtspcl.ok
reint::
@echo $@
@$(AWK) --re-interval -f $(srcdir)/reint.awk $(srcdir)/reint.in >_$@
- @-$(CMP) $(srcdir)/reint.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
pipeio1::
@echo $@
@$(AWK) -f $(srcdir)/pipeio1.awk >_$@
@rm -f test1 test2
- @-$(CMP) $(srcdir)/pipeio1.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
pipeio2::
@echo $@
@$(AWK) -v SRCDIR=$(srcdir) -f $(srcdir)/pipeio2.awk >_$@
- @-$(CMP) $(srcdir)/pipeio2.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
clobber::
@echo $@
@@ -1473,7 +1478,7 @@ clobber::
arynocls::
@echo $@
@-AWKPATH=$(srcdir) $(AWK) -v INPUT=$(srcdir)/arynocls.in -f arynocls.awk >_$@
- @-$(CMP) $(srcdir)/arynocls.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
getlnbuf::
@echo $@
@@ -1507,12 +1512,12 @@ inetdayt::
redfilnm::
@echo $@
@$(AWK) -f $(srcdir)/redfilnm.awk srcdir=$(srcdir) $(srcdir)/redfilnm.in >_$@
- @-$(CMP) $(srcdir)/redfilnm.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
leaddig::
@echo $@
@$(AWK) -v x=2E -f $(srcdir)/leaddig.awk >_$@
- @-$(CMP) $(srcdir)/leaddig.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
gsubtst3::
@echo $@
@@ -1752,19 +1757,19 @@ dumpvars::
profile1:
@echo $@
- @$(AWK) --profile=ap-$@.out -f $(srcdir)/xref.awk $(srcdir)/dtdgport.awk > _$@.out1
+ @$(AWK) --pretty-print=ap-$@.out -f $(srcdir)/xref.awk $(srcdir)/dtdgport.awk > _$@.out1
@$(AWK) -f ap-$@.out $(srcdir)/dtdgport.awk > _$@.out2 ; rm ap-$@.out
@cmp _$@.out1 _$@.out2 && rm _$@.out[12] || echo EXIT CODE: $$? >>_$@
profile2:
@echo $@
- @$(PGAWK) --profile=ap-$@.out -v sortcmd=sort -f $(srcdir)/xref.awk $(srcdir)/dtdgport.awk > /dev/null
+ @$(AWK) --profile=ap-$@.out -v sortcmd=sort -f $(srcdir)/xref.awk $(srcdir)/dtdgport.awk > /dev/null
@sed 1,2d < ap-$@.out > _$@; rm ap-$@.out
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
profile3:
@echo $@
- @$(PGAWK) --profile=ap-$@.out -f $(srcdir)/$@.awk > /dev/null
+ @$(AWK) --profile=ap-$@.out -f $(srcdir)/$@.awk > /dev/null
@sed 1,2d < ap-$@.out > _$@; rm ap-$@.out
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
@@ -1782,6 +1787,12 @@ exit:
@echo $@
@-AWK="$(AWKPROG)" $(srcdir)/$@.sh > _$@ 2>&1
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+rri1::
+ @echo $@
+ @[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \
+ AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
Gt-dummy:
# file Maketests, generated from Makefile.am by the Gentests program
addcomma:
diff --git a/test/badargs.ok b/test/badargs.ok
index 66e67b03..cb140161 100644
--- a/test/badargs.ok
+++ b/test/badargs.ok
@@ -10,13 +10,16 @@ Short options: GNU long options: (extensions)
-c --traditional
-C --copyright
-d[file] --dump-variables[=file]
+ -D[file] --debug[=file]
-e 'program-text' --source='program-text'
-E file --exec=file
-g --gen-pot
-h --help
+ -l library --load=library
-L [fatal] --lint[=fatal]
-n --non-decimal-data
-N --use-lc-numeric
+ -o[file] --pretty-print[=file]
-O --optimize
-p[file] --profile[=file]
-P --posix
diff --git a/test/rri1.awk b/test/rri1.awk
new file mode 100644
index 00000000..889dbdcb
--- /dev/null
+++ b/test/rri1.awk
@@ -0,0 +1 @@
+/[d-f]/
diff --git a/test/rri1.in b/test/rri1.in
new file mode 100644
index 00000000..28b6b408
--- /dev/null
+++ b/test/rri1.in
@@ -0,0 +1 @@
+no match: è
diff --git a/test/rri1.ok b/test/rri1.ok
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/rri1.ok
diff --git a/vms/ChangeLog b/vms/ChangeLog
index 88a4bf88..a39f1125 100644
--- a/vms/ChangeLog
+++ b/vms/ChangeLog
@@ -1,3 +1,25 @@
+2011-12-31 Arnold D. Robbins <arnold@skeeve.com>
+
+ * vms_misc.c: [STREQ, STREQN]: Change use of macros to call
+ strcmp, strncmp, directly.
+
+2011-11-02 Pat Rankin <r.pat.rankin@gmail.com>
+
+ * vms-conf.h (HAVE_SETSID, HAVE_SYS_IOCTL): Add but leave undef'd.
+ (HAVE_ISWCTYPE, HAVE_ISWLOWER, HAVE_ISWUPPER, HAVE_MBRLEN,
+ HAVE_MBRTOWC, HAVE_TOWLOWER, HAVE_TOWUPPER, HAVE_WCHAR_H,
+ HAVE_WCRTOMB, HAVE_WCSCOLL, HAVE_WCTYPE, HAVE_WCTYPE_H,
+ HAVE_WCTYPE_T): Define as 1 since DEC C supports all these.
+
+ * descrip.mms (replace.obj): Add dependencies for missing_d/*.c.
+ * vmstest.com (unix_tests): Fix typo in spelling of rtlen01.
+
+2011-10-30 Pat Rankin <r.pat.rankin@gmail.com>
+
+ * vmstest.com (fpat3, fwtest3, getline5, gsubtst7, gsubtst8,
+ pty1, rtlen, rtlen01, rtlenmb): New tests.
+ (posix2008sub): Revised test.
+
2011-10-25 Anders Wallin <anders_s_wallin@yahoo.se>
* vmstest.com (posix2008sub): Added as specific test in order to
diff --git a/vms/descrip.mms b/vms/descrip.mms
index 967a312e..40b97eb1 100644
--- a/vms/descrip.mms
+++ b/vms/descrip.mms
@@ -48,6 +48,7 @@
# location of various source files, relative to the 'main' directory
VMSDIR = [.vms]
DOCDIR = [.doc]
+MISSNGD = [.missing_d]
MAKEFILE = $(VMSDIR)Descrip.MMS
# debugging &c !'ccflags' is an escape to allow external compile flags
@@ -226,6 +227,13 @@ awkgram.obj : awkgram.c awk.h
dfa.obj : dfa.c dfa.h
regex.obj : regex.c regcomp.c regex_internal.c regexec.c regex.h regex_internal.h
command.obj,debug.obj : cmd.h
+replace.obj : replace.c $(MISSNGD)system.c $(MISSNGD)memcmp.c \
+ $(MISSNGD)memcpy.c $(MISSNGD)memset.c $(MISSNGD)memmove.c \
+ $(MISSNGD)strncasecmp.c $(MISSNGD)strerror.c \
+ $(MISSNGD)strftime.c $(MISSNGD)strchr.c $(MISSNGD)strtod.c \
+ $(MISSNGD)strtoul.c $(MISSNGD)tzset.c $(MISSNGD)mktime.c \
+ $(MISSNGD)snprintf.c $(MISSNGD)getaddrinfo.c $(MISSNGD)usleep.c \
+ $(MISSNGD)setenv.c $(MISSNGD)strcoll.c $(MISSNGD)wcmisc.c
# bison or yacc required
awkgram.c : awkgram.y # foo.y :: yacc => y[_]tab.c, bison => foo_tab.c
diff --git a/vms/vms-conf.h b/vms/vms-conf.h
index cbdc9508..c42118ff 100644
--- a/vms/vms-conf.h
+++ b/vms/vms-conf.h
@@ -128,13 +128,13 @@
#define HAVE_ISASCII 1
/* Define to 1 if you have the `iswctype' function. */
-#undef HAVE_ISWCTYPE
+#define HAVE_ISWCTYPE 1
/* Define to 1 if you have the `iswlower' function. */
-#undef HAVE_ISWLOWER
+#define HAVE_ISWLOWER 1
/* Define to 1 if you have the `iswupper' function. */
-#undef HAVE_ISWUPPER
+#define HAVE_ISWUPPER 1
/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
#undef HAVE_LANGINFO_CODESET
@@ -167,10 +167,10 @@
#undef HAVE_LONG_LONG_INT
/* Define to 1 if you have the `mbrlen' function. */
-#undef HAVE_MBRLEN
+#define HAVE_MBRLEN 1
/* Define to 1 if mbrtowc and mbstate_t are properly declared. */
-#undef HAVE_MBRTOWC
+#define HAVE_MBRTOWC 1
/* Define to 1 if you have the <mcheck.h> header file. */
#undef HAVE_MCHECK_H
@@ -214,6 +214,9 @@
/* Define to 1 if you have the `setlocale' function. */
#undef HAVE_SETLOCALE
+/* Define to 1 if you have the `setsid' function. */
+#undef HAVE_SETSID
+
/* Define to 1 if you have the `snprintf' function. */
#undef HAVE_SNPRINTF
@@ -289,6 +292,9 @@
/* Define to 1 if you have the `system' function. */
#define HAVE_SYSTEM 1
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#undef HAVE_SYS_IOCTL_H
+
/* Define to 1 if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
@@ -322,10 +328,10 @@
#undef HAVE_TM_ZONE
/* Define to 1 if you have the `towlower' function. */
-#undef HAVE_TOWLOWER
+#define HAVE_TOWLOWER 1
/* Define to 1 if you have the `towupper' function. */
-#undef HAVE_TOWUPPER
+#define HAVE_TOWUPPER 1
/* Define to 1 if you don't have `tm_zone' but do have the external array
`tzname'. */
@@ -357,22 +363,22 @@
#define HAVE_VPRINTF 1
/* Define to 1 if you have the <wchar.h> header file. */
-#undef HAVE_WCHAR_H
+#define HAVE_WCHAR_H 1
/* Define to 1 if you have the `wcrtomb' function. */
-#undef HAVE_WCRTOMB
+#define HAVE_WCRTOMB 1
/* Define to 1 if you have the `wcscoll' function. */
-#undef HAVE_WCSCOLL
+#define HAVE_WCSCOLL 1
/* Define to 1 if you have the `wctype' function. */
-#undef HAVE_WCTYPE
+#define HAVE_WCTYPE 1
/* Define to 1 if you have the <wctype.h> header file. */
-#undef HAVE_WCTYPE_H
+#define HAVE_WCTYPE_H 1
/* systems should define this type here */
-#undef HAVE_WCTYPE_T
+#define HAVE_WCTYPE_T 1
/* systems should define this type here */
#undef HAVE_WINT_T
diff --git a/vms/vms_misc.c b/vms/vms_misc.c
index f3650ef4..cd92d7ef 100644
--- a/vms/vms_misc.c
+++ b/vms/vms_misc.c
@@ -98,7 +98,7 @@ vms_open( const char *name, int mode, ... )
{
int result;
- if (STREQN(name, "/dev/", 5)) {
+ if (strncmp(name, "/dev/", 5) == 0) {
/* (this used to be handled in vms_devopen(), but that is only
called when opening files for output; we want it for input too) */
if (strcmp(name + 5, "null") == 0) /* /dev/null -> NL: */
@@ -307,7 +307,7 @@ VMS_fstat (fd, statbuf)
if (result == 0 /* GAWK addition; fixup /dev/null flags */
&& (statbuf->st_mode & S_IFREG)
- && STREQ(statbuf->st_dev, "_NLA0:"))
+ && strcmp(statbuf->st_dev, "_NLA0:") == 0)
{
statbuf->st_mode &= ~S_IFREG;
statbuf->st_mode |= S_IFCHR;
@@ -354,7 +354,7 @@ VMS_stat (name, statbuf)
if (result == 0 /* GAWK addition; fixup /dev/null flags */
&& (statbuf->st_mode & S_IFREG)
- && STREQ(statbuf->st_dev, "_NLA0:"))
+ && strcmp(statbuf->st_dev, "_NLA0:") == 0)
{
statbuf->st_mode &= ~S_IFREG;
statbuf->st_mode |= S_IFCHR;
diff --git a/vms/vmstest.com b/vms/vmstest.com
index d4d3d8a9..146053e1 100644
--- a/vms/vmstest.com
+++ b/vms/vmstest.com
@@ -47,15 +47,17 @@ $ list = "msg addcomma anchgsub argarray arrayparm arrayref" -
+ " clobber closebad clsflnam compare compare2 concat1"
$ gosub list_of_tests
$ list = "concat2 concat3 concat4 convfmt datanonl defref" -
- + " delargv delarprm delarpm2 delfunc dynlj eofsplit exitval1" -
- + " dfastress" -
+ + " delargv delarprm delarpm2 delfunc dfastress dynlj" -
+ + " eofsplit exitval1" -
+ " exitval2 fcall_exit fcall_exit2 fldchg fldchgnf" -
+ " fnamedat fnarray fnarray2 fnaryscl fnasgnm fnmisc" -
+ " fordel forref forsimp fsbs fsspcoln fsrs fstabplus" -
- + " funsemnl funsmnam funstack getline getline2 getline3"
+ + " funsemnl funsmnam funstack getline getline2 getline3" -
+ + " getline4"
$ gosub list_of_tests
$ list = "getlnbuf getnr2tb getnr2tm gsubasgn gsubtest" -
- + " gsubtst2 gsubtst3 gsubtst4 gsubtst5 gsubtst6 hex" -
+ + " gsubtst2 gsubtst3 gsubtst4 gsubtst5 gsubtst6" -
+ + " gsubtst7 gsubtst8 hex" -
+ " hsprint inputred intest intprec iobug1" -
+ " leaddig leadnl litoct longsub longwrds"-
+ " manglprm math membug1 messages minusstr mmap8k" -
@@ -87,7 +89,7 @@ $
$unix:
$unix_tests: echo "unix_tests..."
$ list = "fflush getlnhd localenl pid pipeio1 pipeio2" -
- + " poundbang space strftlng"
+ + " poundbang rtlen rtlen01 space strftlng"
$ gosub list_of_tests
$ return
$
@@ -96,7 +98,8 @@ $gawk_ext: echo "gawk_ext... (gawk.extensions)"
$ list = "aadelete1 aadelete2 aarray1 aasort aasorti" -
+ " argtest arraysort backw badargs beginfile1 binmode1" -
+ " clos1way delsub devfd devfd1 devfd2 dumpvars exit" -
- + " fieldwdth fpat1 fpat2 fpatnull funlen fsfwfs fwtest fwtest2" -
+ + " fieldwdth fpat1 fpat2 fpat3 fpatnull funlen fsfwfs" -
+ + " fwtest fwtest2 fwtest3" -
+ " gensub gensub2 getlndir gnuops2 gnuops3 gnureops" -
+ " icasefs icasers igncdym igncfs ignrcase ignrcas2"
$ gosub list_of_tests
@@ -104,7 +107,7 @@ $ list = "indirectcall lint lintold lintwarn match1" -
+ " match2 match3 manyfiles mbprintf3 mbstr1" -
+ " nastyparm next nondec" -
+ " nondec2 patsplit posix profile1 procinfs printfbad1" -
- + " printfbad2 regx8bit rebuf reint reint2 rsstart1" -
+ + " printfbad2 pty1 regx8bit rebuf reint reint2 rsstart1" -
+ " rsstart2 rsstart3 rstest6 shadow sortfor sortu" -
+ " splitarg4 strtonum strftime switch2"
$ gosub list_of_tests
@@ -121,7 +124,7 @@ $charset_tests: echo "charset_tests..."
$ ! without i18n kit, VMS only supports the C locale
$ ! and several of these fail
$ list = "asort asorti fmttest fnarydel fnparydl lc_num1 mbfw1" -
- + " mbprintf1 mbprintf2 rebt8b2 sort1 sprintfc"
+ + " mbprintf1 mbprintf2 rebt8b2 rtlenmb sort1 sprintfc"
$ gosub list_of_tests
$ return
$
@@ -194,6 +197,7 @@ $fldchgnf:
$fmttest:
$fordel:
$fpat1:
+$fpat3:
$fpatnull:
$fsfwfs:
$fsrs:
@@ -201,14 +205,18 @@ $funlen:
$funstack:
$fwtest:
$fwtest2:
+$fwtest3:
$gensub:
$getline3:
+$getline4:
$getnr2tb:
$getnr2tm:
$gsubtest:
$gsubtst2:
$gsubtst4:
$gsubtst5:
+$gsubtst7:
+$gsubtst8:
$hex:
$icasers:
$igncfs:
@@ -363,7 +371,8 @@ $ gawk -f printlang.awk
$ return
$
$poundbang:
-$ echo "poundbang: not supported"
+$pty1:
+$ echo "''test': not supported"
$ return
$
$messages: echo "messages"
@@ -1077,16 +1086,12 @@ $ igncascmp space.ok _space.tmp
$ if $status then rm _space.tmp;
$ return
$
-$posix2008sub: echo "posix2008sub"
-$ gawk --posix -f posix2008sub.awk >_posix2008sub.tmp
-$ cmp posix2008sub.ok _posix2008sub.tmp
-$ if $status then  rm _posix2008sub.tmp;
-$ return
-$
-$printf0: echo "printf0"
-$ gawk --posix -f printf0.awk >_printf0.tmp
-$ cmp printf0.ok _printf0.tmp
-$ if $status then rm _printf0.tmp;
+$posix2008sub:
+$printf0:
+$ echo "''test'"
+$ gawk --posix -f 'test'.awk >_'test'.tmp
+$ cmp 'test'.ok _'test'.tmp
+$ if $status then rm _'test'.tmp;
$ return
$
$rsnulbig: echo "rsnulbig"
@@ -1201,6 +1206,50 @@ $ cmp rsstart3.ok _rsstart3.tmp
$ if $status then rm _rsstart3.tmp;
$ return
$
+$rtlen:
+$rtlen01:
+$rtlenmb:
+$ echo "''test'"
+$ if .not.pipeok
+$ then echo "Without the PIPE command, ''test' can't be run."
+$ On warning then return
+$ pipe echo "With PIPE, ''test' will finish quickly."
+$ On warning then $
+$ pipeok = 1
+$ endif
+$ f = "''test'.ok"
+$ if test.eqs."rtlen" .or. test.eqs."rtlenmb"
+$ then
+$ if test.eqs."rtlenmb" then GAWKLOCALE = "en_US.UTF-8"
+$ pipe -
+ gawk -- "BEGIN {printf ""0\n\n\n1\n\n\n\n\n2\n\n""; exit}" | -
+ gawk -- "BEGIN {RS=""""}; {print length(RT)}" >_'test'.tmp
+$ if test.eqs."rtlenmb" then delet_/Symbol/Local GAWKLOCALE
+$ if test.eqs."rtlenmb" then f = "rtlen.ok"
+$ else
+$ call/Output=_rtlen01.tmp do__rtlen01
+$ ! first test yields 1 instead of 0 due to forced newline
+$ gawk -- "FNR==1 {sub(""1"",""0"")}; {print}" _rtlen01.tmp >_rtlen01.too
+$ rm _rtlen01.tmp;
+$ mv _rtlen01.too _rtlen01.tmp
+$ endif
+$ cmp 'f' _'test'.tmp
+$ if $status then rm _'test'.tmp;
+$ return
+$
+$do__rtlen01: subroutine
+$ gawk = gawk !PIPE won't propagate local symbols from outer procedure
+$ pipe -
+ gawk -- "BEGIN {printf ""0""; exit}" | -
+ gawk -- "BEGIN {RS=""""}; {print length(RT)}"
+$ pipe -
+ gawk -- "BEGIN {printf ""0\n""; exit}" | -
+ gawk -- "BEGIN {RS=""""}; {print length(RT)}"
+$ pipe -
+ gawk -- "BEGIN {printf ""0\n\n""; exit}" | -
+ gawk -- "BEGIN {RS=""""}; {print length(RT)}"
+$ endsubroutine !do__rtlen01
+$
$nondec2: echo "nondec2"
$ gawk --non-decimal-data -v "a=0x1" -f nondec2.awk >_nondec2.tmp
$ cmp nondec2.ok _nondec2.tmp