aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuergen Kahrs <Juergen.Kahrs@googlemail.com>2014-07-18 14:26:09 +0200
committerJuergen Kahrs <Juergen.Kahrs@googlemail.com>2014-07-18 14:26:09 +0200
commita3789a72120e0e35d4db309215f87695a256b033 (patch)
tree86dc93b31b8a83fa8662f6f827df658a85796048
parent88cdccf6bceb2078895fec825f0b776487197c78 (diff)
parentdf2eaea6a92c7d89d604d0a4e885d064678ce3ed (diff)
downloadegawk-a3789a72120e0e35d4db309215f87695a256b033.tar.gz
egawk-a3789a72120e0e35d4db309215f87695a256b033.tar.bz2
egawk-a3789a72120e0e35d4db309215f87695a256b033.zip
Merge remote-tracking branch 'origin/master' into cmake
-rw-r--r--ChangeLog38
-rw-r--r--NEWS9
-rw-r--r--TODO27
-rw-r--r--awk.h2
-rw-r--r--awkgram.c130
-rw-r--r--awkgram.y130
-rw-r--r--awklib/Makefile.am11
-rw-r--r--awklib/Makefile.in105
-rw-r--r--builtin.c68
-rw-r--r--doc/ChangeLog21
-rw-r--r--doc/Makefile.am14
-rw-r--r--doc/Makefile.in14
-rw-r--r--doc/awkcard.in3
-rw-r--r--doc/gawk.119
-rw-r--r--doc/gawk.info1312
-rw-r--r--doc/gawk.texi122
-rw-r--r--doc/gawktexi.in122
-rw-r--r--main.c5
-rw-r--r--mpfr.c87
-rw-r--r--test/ChangeLog11
-rw-r--r--test/Makefile.am19
-rw-r--r--test/Makefile.in19
-rw-r--r--test/printhuge.awk3
-rw-r--r--test/printhuge.ok1
24 files changed, 1357 insertions, 935 deletions
diff --git a/ChangeLog b/ChangeLog
index 14202f52..3fb8bb98 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,41 @@
+2014-07-10 Arnold D. Robbins <arnold@skeeve.com>
+
+ New `div()' function to do integer division and remainder;
+ mainly useful for use with GMP integers. Thanks to
+ Katie Wasserman <katie@wass.net> for the suggestion.
+
+ * awk.h (do_div, do_mpfr_div): Declare new functions.
+ * builtin.c (do_div): New function.
+ * mpfr.c (do_mpfr_div): New function.
+ * awkgram.y (tokentab): New entry.
+ (snode): Add check for do_div/do_mpfr_div to make 3rd arg
+ be an array.
+ * NEWS: Updated.
+ * TODO: Updated.
+
+2014-07-10 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awkgram.y (check_for_bad): New routine to do the fatal message,
+ with smarter checking.
+ (nextc): Call it as appropriate.
+
+ * builtin.c (format_tree): Add check for bad returns from mbrlen
+ to avoid trying to malloc (size_t) -1 bytes. Thanks to
+ mail.green.fox@gmail.com for the bug report.
+
+2014-07-03 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awkgram.y (nextc): Add bool check_for_bad parameter to check
+ for bad characters in the source program.
+ (yylex): Adjust calls.
+
+2014-06-24 Arnold D. Robbins <arnold@skeeve.com>
+
+ * main.c (main): The --pretty-print option no longer runs the
+ program. This removes the need for the GAWK_NO_PP_RUN environment var.
+ * NEWS: Updated.
+ * TODO: Updated.
+
2014-06-22 Paul Eggert <eggert@penguin.cs.ucla.edu>
Bring in from GNULIB:
diff --git a/NEWS b/NEWS
index 8984e856..c2cf63ac 100644
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,15 @@ Changes from 4.1.x to 4.2.0
get the same series of numbers each time you call rand() repeatedly,
but this will be a different series than previously.
+3. The --pretty-print option no longer runs the program too.
+
+4. The igawk script and igawk.1 man page are no longer installed by
+ `make install'. They have been obsolete since gawk 4.0.0.
+
+5. Gawk now has a `div()' function to perform integer division; this is
+ primarily useful for the -M option to avoid MPFR division when all
+ values involved are integers.
+
Changes from 4.1.1 to 4.1.2
---------------------------
diff --git a/TODO b/TODO
index a4764946..35b327bc 100644
--- a/TODO
+++ b/TODO
@@ -1,4 +1,4 @@
-Thu Apr 17 11:31:24 IDT 2014
+Wed Jun 25 22:28:05 IDT 2014
============================
There were too many files tracking different thoughts and ideas for
@@ -19,9 +19,6 @@ TODO
Minor Cleanups and Code Improvements
------------------------------------
- Nuke installing the igawk script and the igawk.1 man page. Just
- remove them from the dist.
-
Review the bash source script for working with shared libraries in
order to nuke the use of libtool. [ Partially started in the
nolibtool branch. ]
@@ -42,15 +39,12 @@ Minor Cleanups and Code Improvements
Recheck if gnulib regex can be dropped in
- Fully synchronize whitespaces tests (for \s, \S in Unicode
+ Fully synchronize whitespace tests (for \s, \S in Unicode
environment) with those of GNU grep.
Minor New Features
------------------
- Add a div() function to do integer division result. Needed
- esp for MPFR with large ints.
-
Enhance extension/fork.c waitpid to allow the caller to specify
the options. And add an optional array argument to wait and
waitpid in which to return exit status information.
@@ -60,10 +54,6 @@ Minor New Features
Make it possible to put print/printf + redirections into
an expression.
- Have pretty printing not run the program and nuke the
- undocumented GAWK_NO_PP_RUN env var. Requires test suite
- adjustments.
-
? Add an optional base to strtonum, allowing 2-36.
? Optional third argument for index indicating where to start the
@@ -94,9 +84,6 @@ Major New Features
Consider a typeof() function that returns a string (scalar, array,
regexp).
- Fix the early chapters in the doc with more up-to-date examples.
- No-one uses Bulletin Board Systems anymore.
-
Add ability to do decimal arithmetic.
Rework management of array index storage. (Partially DONE.)
@@ -127,12 +114,12 @@ Things To Think About That May Never Happen
https://github.com/emeryberger/DieHard
Implement namespaces. Arnold suggested the following in an email:
- - Extend the definition of an 'identifier' to include "." as a valid character
- although an identifier can't start with it.
+ - Extend the definition of an 'identifier' to include "." as a valid
+ character although an identifier can't start with it.
- Extension libraries install functions and global variables with names
that have a "." in them: XML.parse(), XML.name, whatever.
- - Awk code can read/write such variables and call such functions, but they
- cannot define such functions
+ - Awk code can read/write such variables and call such functions,
+ but they cannot define such functions
function XML.foo() { .. } # error
or create a variable with such a name if it doesn't exist. This would
be a run-time error, not a parse-time error.
@@ -142,8 +129,10 @@ Things To Think About That May Never Happen
to be very important.
Include a sample rpm spec file in a new packaging subdirectory.
+ (Really needed?)
Patch lexer for @include and @load to make quotes optional.
+ (Really needed?)
? Have strftime() pay attention to the value of ENVIRON["TZ"]
diff --git a/awk.h b/awk.h
index 9255b45b..cb9f8091 100644
--- a/awk.h
+++ b/awk.h
@@ -1419,6 +1419,7 @@ extern AWKNUM nondec2awknum(char *str, size_t len);
extern NODE *do_dcgettext(int nargs);
extern NODE *do_dcngettext(int nargs);
extern NODE *do_bindtextdomain(int nargs);
+extern NODE *do_div(int nargs);
#if MBS_SUPPORT
extern int strncasecmpmbs(const unsigned char *,
const unsigned char *, size_t);
@@ -1555,6 +1556,7 @@ extern NODE *do_mpfr_and(int);
extern NODE *do_mpfr_atan2(int);
extern NODE *do_mpfr_compl(int);
extern NODE *do_mpfr_cos(int);
+extern NODE *do_mpfr_div(int);
extern NODE *do_mpfr_exp(int);
extern NODE *do_mpfr_int(int);
extern NODE *do_mpfr_log(int);
diff --git a/awkgram.c b/awkgram.c
index b36816c9..28776494 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -4199,6 +4199,7 @@ static const struct token tokentab[] = {
{"dcngettext", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2)|A(3)|A(4)|A(5), do_dcngettext, 0},
{"default", Op_K_default, LEX_DEFAULT, GAWKX, 0, 0},
{"delete", Op_K_delete, LEX_DELETE, NOT_OLD, 0, 0},
+{"div", Op_builtin, LEX_BUILTIN, GAWKX|A(3), do_div, MPF(div)},
{"do", Op_K_do, LEX_DO, NOT_OLD|BREAK|CONTINUE, 0, 0},
{"else", Op_K_else, LEX_ELSE, 0, 0, 0},
{"eval", Op_symbol, LEX_EVAL, 0, 0, 0},
@@ -5130,12 +5131,40 @@ tokexpand()
return tok;
}
+/* check_bad_char --- fatal if c isn't allowed in gawk source code */
+
+/*
+ * The error message was inspired by someone who decided to put
+ * a physical \0 byte into the source code to see what would
+ * happen and then filed a bug report about it. Sigh.
+ */
+
+static void
+check_bad_char(int c)
+{
+ /* allow escapes. needed for autoconf. bleah. */
+ switch (c) {
+ case '\a':
+ case '\b':
+ case '\f':
+ case '\n':
+ case '\r':
+ case '\t':
+ return;
+ default:
+ break;
+ }
+
+ if (iscntrl(c) && ! isspace(c))
+ fatal(_("PEBKAC error: invalid character '\\%03o' in source code"), c);
+}
+
/* nextc --- get the next input character */
#if MBS_SUPPORT
static int
-nextc(void)
+nextc(bool check_for_bad)
{
if (gawk_mb_cur_max > 1) {
again:
@@ -5186,14 +5215,19 @@ again:
0 : work_ring_idx + 1;
cur_char_ring[work_ring_idx] = 0;
}
+ if (check_for_bad)
+ check_bad_char(*lexptr);
return (int) (unsigned char) *lexptr++;
} else {
do {
if (lexeof)
return END_FILE;
- if (lexptr && lexptr < lexend)
- return ((int) (unsigned char) *lexptr++);
+ if (lexptr && lexptr < lexend) {
+ if (check_for_bad)
+ check_bad_char(*lexptr);
+ return ((int) (unsigned char) *lexptr++);
+ }
} while (get_src_buf());
return END_SRC;
}
@@ -5202,13 +5236,16 @@ again:
#else /* MBS_SUPPORT */
int
-nextc()
+nextc(bool check_for_bad)
{
do {
if (lexeof)
return END_FILE;
- if (lexptr && lexptr < lexend)
+ if (lexptr && lexptr < lexend) {
+ if (check_for_bad)
+ check_bad_char(*lexptr);
return ((int) (unsigned char) *lexptr++);
+ }
} while (get_src_buf());
return END_SRC;
}
@@ -5237,13 +5274,13 @@ allow_newline(void)
int c;
for (;;) {
- c = nextc();
+ c = nextc(true);
if (c == END_FILE) {
pushback();
break;
}
if (c == '#') {
- while ((c = nextc()) != '\n' && c != END_FILE)
+ while ((c = nextc(false)) != '\n' && c != END_FILE)
continue;
if (c == END_FILE) {
pushback();
@@ -5315,7 +5352,7 @@ yylex(void)
if (lasttok == LEX_EOF) /* error earlier in current source, must give up !! */
return 0;
- c = nextc();
+ c = nextc(true);
if (c == END_SRC)
return 0;
if (c == END_FILE)
@@ -5357,12 +5394,12 @@ yylex(void)
want_regexp = false;
tok = tokstart;
for (;;) {
- c = nextc();
+ c = nextc(true);
if (gawk_mb_cur_max == 1 || nextc_is_1stbyte) switch (c) {
case '[':
/* one day check for `.' and `=' too */
- if (nextc() == ':' || in_brack == 0)
+ if (nextc(true) == ':' || in_brack == 0)
in_brack++;
pushback();
break;
@@ -5376,7 +5413,7 @@ yylex(void)
in_brack--;
break;
case '\\':
- if ((c = nextc()) == END_FILE) {
+ if ((c = nextc(true)) == END_FILE) {
pushback();
yyerror(_("unterminated regexp ends with `\\' at end of file"));
goto end_regexp; /* kludge */
@@ -5396,7 +5433,7 @@ end_regexp:
yylval = GET_INSTRUCTION(Op_token);
yylval->lextok = estrdup(tokstart, tok - tokstart);
if (do_lint) {
- int peek = nextc();
+ int peek = nextc(true);
pushback();
if (peek == 'i' || peek == 's') {
@@ -5426,7 +5463,7 @@ end_regexp:
retry:
/* skipping \r is a hack, but windows is just too pervasive. sigh. */
- while ((c = nextc()) == ' ' || c == '\t' || c == '\r')
+ while ((c = nextc(true)) == ' ' || c == '\t' || c == '\r')
continue;
lexeme = lexptr ? lexptr - 1 : lexptr;
@@ -5448,7 +5485,7 @@ retry:
return lasttok = NEWLINE;
case '#': /* it's a comment */
- while ((c = nextc()) != '\n') {
+ while ((c = nextc(false)) != '\n') {
if (c == END_FILE)
return lasttok = NEWLINE_EOF;
}
@@ -5468,7 +5505,7 @@ retry:
*/
if (! do_traditional) {
/* strip trailing white-space and/or comment */
- while ((c = nextc()) == ' ' || c == '\t' || c == '\r')
+ while ((c = nextc(true)) == ' ' || c == '\t' || c == '\r')
continue;
if (c == '#') {
static bool warned = false;
@@ -5478,16 +5515,16 @@ retry:
lintwarn(
_("use of `\\ #...' line continuation is not portable"));
}
- while ((c = nextc()) != '\n')
+ while ((c = nextc(false)) != '\n')
if (c == END_FILE)
break;
}
pushback();
}
#endif /* RELAXED_CONTINUATION */
- c = nextc();
+ c = nextc(true);
if (c == '\r') /* allow MS-DOS files. bleah */
- c = nextc();
+ c = nextc(true);
if (c == '\n') {
sourceline++;
goto retry;
@@ -5526,7 +5563,7 @@ retry:
case '[':
return lasttok = c;
case ']':
- c = nextc();
+ c = nextc(true);
pushback();
if (c == '[') {
yylval = GET_INSTRUCTION(Op_sub_array);
@@ -5538,7 +5575,7 @@ retry:
return ']';
case '*':
- if ((c = nextc()) == '=') {
+ if ((c = nextc(true)) == '=') {
yylval = GET_INSTRUCTION(Op_assign_times);
return lasttok = ASSIGNOP;
} else if (do_posix) {
@@ -5549,7 +5586,7 @@ retry:
/* make ** and **= aliases for ^ and ^= */
static bool did_warn_op = false, did_warn_assgn = false;
- if (nextc() == '=') {
+ if (nextc(true) == '=') {
if (! did_warn_assgn) {
did_warn_assgn = true;
if (do_lint)
@@ -5577,7 +5614,7 @@ retry:
return lasttok = '*';
case '/':
- if (nextc() == '=') {
+ if (nextc(true) == '=') {
pushback();
return lasttok = SLASH_BEFORE_EQUAL;
}
@@ -5586,7 +5623,7 @@ retry:
return lasttok = '/';
case '%':
- if (nextc() == '=') {
+ if (nextc(true) == '=') {
yylval = GET_INSTRUCTION(Op_assign_mod);
return lasttok = ASSIGNOP;
}
@@ -5598,7 +5635,7 @@ retry:
{
static bool did_warn_op = false, did_warn_assgn = false;
- if (nextc() == '=') {
+ if (nextc(true) == '=') {
if (do_lint_old && ! did_warn_assgn) {
did_warn_assgn = true;
warning(_("operator `^=' is not supported in old awk"));
@@ -5616,7 +5653,7 @@ retry:
}
case '+':
- if ((c = nextc()) == '=') {
+ if ((c = nextc(true)) == '=') {
yylval = GET_INSTRUCTION(Op_assign_plus);
return lasttok = ASSIGNOP;
}
@@ -5629,7 +5666,7 @@ retry:
return lasttok = '+';
case '!':
- if ((c = nextc()) == '=') {
+ if ((c = nextc(true)) == '=') {
yylval = GET_INSTRUCTION(Op_notequal);
return lasttok = RELOP;
}
@@ -5642,7 +5679,7 @@ retry:
return lasttok = '!';
case '<':
- if (nextc() == '=') {
+ if (nextc(true) == '=') {
yylval = GET_INSTRUCTION(Op_leq);
return lasttok = RELOP;
}
@@ -5651,7 +5688,7 @@ retry:
return lasttok = '<';
case '=':
- if (nextc() == '=') {
+ if (nextc(true) == '=') {
yylval = GET_INSTRUCTION(Op_equal);
return lasttok = RELOP;
}
@@ -5660,7 +5697,7 @@ retry:
return lasttok = ASSIGN;
case '>':
- if ((c = nextc()) == '=') {
+ if ((c = nextc(true)) == '=') {
yylval = GET_INSTRUCTION(Op_geq);
return lasttok = RELOP;
} else if (c == '>') {
@@ -5699,7 +5736,7 @@ retry:
case '"':
string:
esc_seen = false;
- while ((c = nextc()) != '"') {
+ while ((c = nextc(true)) != '"') {
if (c == '\n') {
pushback();
yyerror(_("unterminated string"));
@@ -5707,7 +5744,7 @@ retry:
}
if ((gawk_mb_cur_max == 1 || nextc_is_1stbyte) &&
c == '\\') {
- c = nextc();
+ c = nextc(true);
if (c == '\n') {
sourceline++;
continue;
@@ -5741,7 +5778,7 @@ retry:
return lasttok = YSTRING;
case '-':
- if ((c = nextc()) == '=') {
+ if ((c = nextc(true)) == '=') {
yylval = GET_INSTRUCTION(Op_assign_minus);
return lasttok = ASSIGNOP;
}
@@ -5754,7 +5791,7 @@ retry:
return lasttok = '-';
case '.':
- c = nextc();
+ c = nextc(true);
pushback();
if (! isdigit(c))
return lasttok = '.';
@@ -5782,7 +5819,7 @@ retry:
if (do_traditional)
goto done;
if (tok == tokstart + 2) {
- int peek = nextc();
+ int peek = nextc(true);
if (isxdigit(peek)) {
inhex = true;
@@ -5810,8 +5847,8 @@ retry:
break;
}
seen_e = true;
- if ((c = nextc()) == '-' || c == '+') {
- int c2 = nextc();
+ if ((c = nextc(true)) == '-' || c == '+') {
+ int c2 = nextc(true);
if (isdigit(c2)) {
tokadd(c);
@@ -5858,7 +5895,7 @@ retry:
}
if (gotnumber)
break;
- c = nextc();
+ c = nextc(true);
}
pushback();
@@ -5907,7 +5944,7 @@ retry:
return lasttok = YNUMBER;
case '&':
- if ((c = nextc()) == '&') {
+ if ((c = nextc(true)) == '&') {
yylval = GET_INSTRUCTION(Op_and);
allow_newline();
return lasttok = LEX_AND;
@@ -5917,7 +5954,7 @@ retry:
return lasttok = '&';
case '|':
- if ((c = nextc()) == '|') {
+ if ((c = nextc(true)) == '|') {
yylval = GET_INSTRUCTION(Op_or);
allow_newline();
return lasttok = LEX_OR;
@@ -5958,7 +5995,7 @@ retry:
* occasions where the interactions are funny.
*/
if (! do_traditional && c == '_' && lasttok != '$') {
- if ((c = nextc()) == '"') {
+ if ((c = nextc(true)) == '"') {
intlstr = true;
goto string;
}
@@ -5970,7 +6007,7 @@ retry:
tok = tokstart;
while (c != END_FILE && is_identchar(c)) {
tokadd(c);
- c = nextc();
+ c = nextc(true);
}
tokadd('\0');
pushback();
@@ -6208,7 +6245,7 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
}
#ifdef HAVE_MPFR
- /* N.B.: There isn't any special processing for an alternate function below */
+ /* N.B.: If necessary, add special processing for alternate builtin, below */
if (do_mpfr && tokentab[idx].ptr2)
r->builtin = tokentab[idx].ptr2;
else
@@ -6237,6 +6274,15 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
arg = subn->nexti;
if (arg->nexti == arg->lasti && arg->nexti->opcode == Op_push)
arg->nexti->opcode = Op_push_arg; /* argument may be array */
+ } else if (r->builtin == do_div
+#ifdef HAVE_MPFR
+ || r->builtin == MPF(div)
+#endif
+ ) {
+ arg = subn->nexti->lasti->nexti->lasti->nexti; /* 3rd arg list */
+ ip = arg->lasti;
+ if (ip->opcode == Op_push)
+ ip->opcode = Op_push_array;
} else if (r->builtin == do_match) {
static bool warned = false;
diff --git a/awkgram.y b/awkgram.y
index 906e6c8b..9e4f82b3 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -1860,6 +1860,7 @@ static const struct token tokentab[] = {
{"dcngettext", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2)|A(3)|A(4)|A(5), do_dcngettext, 0},
{"default", Op_K_default, LEX_DEFAULT, GAWKX, 0, 0},
{"delete", Op_K_delete, LEX_DELETE, NOT_OLD, 0, 0},
+{"div", Op_builtin, LEX_BUILTIN, GAWKX|A(3), do_div, MPF(div)},
{"do", Op_K_do, LEX_DO, NOT_OLD|BREAK|CONTINUE, 0, 0},
{"else", Op_K_else, LEX_ELSE, 0, 0, 0},
{"eval", Op_symbol, LEX_EVAL, 0, 0, 0},
@@ -2791,12 +2792,40 @@ tokexpand()
return tok;
}
+/* check_bad_char --- fatal if c isn't allowed in gawk source code */
+
+/*
+ * The error message was inspired by someone who decided to put
+ * a physical \0 byte into the source code to see what would
+ * happen and then filed a bug report about it. Sigh.
+ */
+
+static void
+check_bad_char(int c)
+{
+ /* allow escapes. needed for autoconf. bleah. */
+ switch (c) {
+ case '\a':
+ case '\b':
+ case '\f':
+ case '\n':
+ case '\r':
+ case '\t':
+ return;
+ default:
+ break;
+ }
+
+ if (iscntrl(c) && ! isspace(c))
+ fatal(_("PEBKAC error: invalid character '\\%03o' in source code"), c);
+}
+
/* nextc --- get the next input character */
#if MBS_SUPPORT
static int
-nextc(void)
+nextc(bool check_for_bad)
{
if (gawk_mb_cur_max > 1) {
again:
@@ -2847,14 +2876,19 @@ again:
0 : work_ring_idx + 1;
cur_char_ring[work_ring_idx] = 0;
}
+ if (check_for_bad)
+ check_bad_char(*lexptr);
return (int) (unsigned char) *lexptr++;
} else {
do {
if (lexeof)
return END_FILE;
- if (lexptr && lexptr < lexend)
- return ((int) (unsigned char) *lexptr++);
+ if (lexptr && lexptr < lexend) {
+ if (check_for_bad)
+ check_bad_char(*lexptr);
+ return ((int) (unsigned char) *lexptr++);
+ }
} while (get_src_buf());
return END_SRC;
}
@@ -2863,13 +2897,16 @@ again:
#else /* MBS_SUPPORT */
int
-nextc()
+nextc(bool check_for_bad)
{
do {
if (lexeof)
return END_FILE;
- if (lexptr && lexptr < lexend)
+ if (lexptr && lexptr < lexend) {
+ if (check_for_bad)
+ check_bad_char(*lexptr);
return ((int) (unsigned char) *lexptr++);
+ }
} while (get_src_buf());
return END_SRC;
}
@@ -2898,13 +2935,13 @@ allow_newline(void)
int c;
for (;;) {
- c = nextc();
+ c = nextc(true);
if (c == END_FILE) {
pushback();
break;
}
if (c == '#') {
- while ((c = nextc()) != '\n' && c != END_FILE)
+ while ((c = nextc(false)) != '\n' && c != END_FILE)
continue;
if (c == END_FILE) {
pushback();
@@ -2976,7 +3013,7 @@ yylex(void)
if (lasttok == LEX_EOF) /* error earlier in current source, must give up !! */
return 0;
- c = nextc();
+ c = nextc(true);
if (c == END_SRC)
return 0;
if (c == END_FILE)
@@ -3018,12 +3055,12 @@ yylex(void)
want_regexp = false;
tok = tokstart;
for (;;) {
- c = nextc();
+ c = nextc(true);
if (gawk_mb_cur_max == 1 || nextc_is_1stbyte) switch (c) {
case '[':
/* one day check for `.' and `=' too */
- if (nextc() == ':' || in_brack == 0)
+ if (nextc(true) == ':' || in_brack == 0)
in_brack++;
pushback();
break;
@@ -3037,7 +3074,7 @@ yylex(void)
in_brack--;
break;
case '\\':
- if ((c = nextc()) == END_FILE) {
+ if ((c = nextc(true)) == END_FILE) {
pushback();
yyerror(_("unterminated regexp ends with `\\' at end of file"));
goto end_regexp; /* kludge */
@@ -3057,7 +3094,7 @@ end_regexp:
yylval = GET_INSTRUCTION(Op_token);
yylval->lextok = estrdup(tokstart, tok - tokstart);
if (do_lint) {
- int peek = nextc();
+ int peek = nextc(true);
pushback();
if (peek == 'i' || peek == 's') {
@@ -3087,7 +3124,7 @@ end_regexp:
retry:
/* skipping \r is a hack, but windows is just too pervasive. sigh. */
- while ((c = nextc()) == ' ' || c == '\t' || c == '\r')
+ while ((c = nextc(true)) == ' ' || c == '\t' || c == '\r')
continue;
lexeme = lexptr ? lexptr - 1 : lexptr;
@@ -3109,7 +3146,7 @@ retry:
return lasttok = NEWLINE;
case '#': /* it's a comment */
- while ((c = nextc()) != '\n') {
+ while ((c = nextc(false)) != '\n') {
if (c == END_FILE)
return lasttok = NEWLINE_EOF;
}
@@ -3129,7 +3166,7 @@ retry:
*/
if (! do_traditional) {
/* strip trailing white-space and/or comment */
- while ((c = nextc()) == ' ' || c == '\t' || c == '\r')
+ while ((c = nextc(true)) == ' ' || c == '\t' || c == '\r')
continue;
if (c == '#') {
static bool warned = false;
@@ -3139,16 +3176,16 @@ retry:
lintwarn(
_("use of `\\ #...' line continuation is not portable"));
}
- while ((c = nextc()) != '\n')
+ while ((c = nextc(false)) != '\n')
if (c == END_FILE)
break;
}
pushback();
}
#endif /* RELAXED_CONTINUATION */
- c = nextc();
+ c = nextc(true);
if (c == '\r') /* allow MS-DOS files. bleah */
- c = nextc();
+ c = nextc(true);
if (c == '\n') {
sourceline++;
goto retry;
@@ -3187,7 +3224,7 @@ retry:
case '[':
return lasttok = c;
case ']':
- c = nextc();
+ c = nextc(true);
pushback();
if (c == '[') {
yylval = GET_INSTRUCTION(Op_sub_array);
@@ -3199,7 +3236,7 @@ retry:
return ']';
case '*':
- if ((c = nextc()) == '=') {
+ if ((c = nextc(true)) == '=') {
yylval = GET_INSTRUCTION(Op_assign_times);
return lasttok = ASSIGNOP;
} else if (do_posix) {
@@ -3210,7 +3247,7 @@ retry:
/* make ** and **= aliases for ^ and ^= */
static bool did_warn_op = false, did_warn_assgn = false;
- if (nextc() == '=') {
+ if (nextc(true) == '=') {
if (! did_warn_assgn) {
did_warn_assgn = true;
if (do_lint)
@@ -3238,7 +3275,7 @@ retry:
return lasttok = '*';
case '/':
- if (nextc() == '=') {
+ if (nextc(true) == '=') {
pushback();
return lasttok = SLASH_BEFORE_EQUAL;
}
@@ -3247,7 +3284,7 @@ retry:
return lasttok = '/';
case '%':
- if (nextc() == '=') {
+ if (nextc(true) == '=') {
yylval = GET_INSTRUCTION(Op_assign_mod);
return lasttok = ASSIGNOP;
}
@@ -3259,7 +3296,7 @@ retry:
{
static bool did_warn_op = false, did_warn_assgn = false;
- if (nextc() == '=') {
+ if (nextc(true) == '=') {
if (do_lint_old && ! did_warn_assgn) {
did_warn_assgn = true;
warning(_("operator `^=' is not supported in old awk"));
@@ -3277,7 +3314,7 @@ retry:
}
case '+':
- if ((c = nextc()) == '=') {
+ if ((c = nextc(true)) == '=') {
yylval = GET_INSTRUCTION(Op_assign_plus);
return lasttok = ASSIGNOP;
}
@@ -3290,7 +3327,7 @@ retry:
return lasttok = '+';
case '!':
- if ((c = nextc()) == '=') {
+ if ((c = nextc(true)) == '=') {
yylval = GET_INSTRUCTION(Op_notequal);
return lasttok = RELOP;
}
@@ -3303,7 +3340,7 @@ retry:
return lasttok = '!';
case '<':
- if (nextc() == '=') {
+ if (nextc(true) == '=') {
yylval = GET_INSTRUCTION(Op_leq);
return lasttok = RELOP;
}
@@ -3312,7 +3349,7 @@ retry:
return lasttok = '<';
case '=':
- if (nextc() == '=') {
+ if (nextc(true) == '=') {
yylval = GET_INSTRUCTION(Op_equal);
return lasttok = RELOP;
}
@@ -3321,7 +3358,7 @@ retry:
return lasttok = ASSIGN;
case '>':
- if ((c = nextc()) == '=') {
+ if ((c = nextc(true)) == '=') {
yylval = GET_INSTRUCTION(Op_geq);
return lasttok = RELOP;
} else if (c == '>') {
@@ -3360,7 +3397,7 @@ retry:
case '"':
string:
esc_seen = false;
- while ((c = nextc()) != '"') {
+ while ((c = nextc(true)) != '"') {
if (c == '\n') {
pushback();
yyerror(_("unterminated string"));
@@ -3368,7 +3405,7 @@ retry:
}
if ((gawk_mb_cur_max == 1 || nextc_is_1stbyte) &&
c == '\\') {
- c = nextc();
+ c = nextc(true);
if (c == '\n') {
sourceline++;
continue;
@@ -3402,7 +3439,7 @@ retry:
return lasttok = YSTRING;
case '-':
- if ((c = nextc()) == '=') {
+ if ((c = nextc(true)) == '=') {
yylval = GET_INSTRUCTION(Op_assign_minus);
return lasttok = ASSIGNOP;
}
@@ -3415,7 +3452,7 @@ retry:
return lasttok = '-';
case '.':
- c = nextc();
+ c = nextc(true);
pushback();
if (! isdigit(c))
return lasttok = '.';
@@ -3443,7 +3480,7 @@ retry:
if (do_traditional)
goto done;
if (tok == tokstart + 2) {
- int peek = nextc();
+ int peek = nextc(true);
if (isxdigit(peek)) {
inhex = true;
@@ -3471,8 +3508,8 @@ retry:
break;
}
seen_e = true;
- if ((c = nextc()) == '-' || c == '+') {
- int c2 = nextc();
+ if ((c = nextc(true)) == '-' || c == '+') {
+ int c2 = nextc(true);
if (isdigit(c2)) {
tokadd(c);
@@ -3519,7 +3556,7 @@ retry:
}
if (gotnumber)
break;
- c = nextc();
+ c = nextc(true);
}
pushback();
@@ -3568,7 +3605,7 @@ retry:
return lasttok = YNUMBER;
case '&':
- if ((c = nextc()) == '&') {
+ if ((c = nextc(true)) == '&') {
yylval = GET_INSTRUCTION(Op_and);
allow_newline();
return lasttok = LEX_AND;
@@ -3578,7 +3615,7 @@ retry:
return lasttok = '&';
case '|':
- if ((c = nextc()) == '|') {
+ if ((c = nextc(true)) == '|') {
yylval = GET_INSTRUCTION(Op_or);
allow_newline();
return lasttok = LEX_OR;
@@ -3619,7 +3656,7 @@ retry:
* occasions where the interactions are funny.
*/
if (! do_traditional && c == '_' && lasttok != '$') {
- if ((c = nextc()) == '"') {
+ if ((c = nextc(true)) == '"') {
intlstr = true;
goto string;
}
@@ -3631,7 +3668,7 @@ retry:
tok = tokstart;
while (c != END_FILE && is_identchar(c)) {
tokadd(c);
- c = nextc();
+ c = nextc(true);
}
tokadd('\0');
pushback();
@@ -3869,7 +3906,7 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
}
#ifdef HAVE_MPFR
- /* N.B.: There isn't any special processing for an alternate function below */
+ /* N.B.: If necessary, add special processing for alternate builtin, below */
if (do_mpfr && tokentab[idx].ptr2)
r->builtin = tokentab[idx].ptr2;
else
@@ -3898,6 +3935,15 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
arg = subn->nexti;
if (arg->nexti == arg->lasti && arg->nexti->opcode == Op_push)
arg->nexti->opcode = Op_push_arg; /* argument may be array */
+ } else if (r->builtin == do_div
+#ifdef HAVE_MPFR
+ || r->builtin == MPF(div)
+#endif
+ ) {
+ arg = subn->nexti->lasti->nexti->lasti->nexti; /* 3rd arg list */
+ ip = arg->lasti;
+ if (ip->opcode == Op_push)
+ ip->opcode = Op_push_array;
} else if (r->builtin == do_match) {
static bool warned = false;
diff --git a/awklib/Makefile.am b/awklib/Makefile.am
index 6ffbea81..87ee96b8 100644
--- a/awklib/Makefile.am
+++ b/awklib/Makefile.am
@@ -39,13 +39,12 @@ AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir)
pkgdatadir = $(datadir)/awk
pkglibexecdir = $(libexecdir)/awk
-bin_SCRIPTS = igawk
pkglibexec_PROGRAMS = pwcat grcat
AUXAWK = passwd.awk group.awk
nodist_grcat_SOURCES = grcat.c
nodist_pwcat_SOURCES = pwcat.c
-all: $(srcdir)/stamp-eg $(AUXPROGS) igawk $(AUXAWK)
+all: $(srcdir)/stamp-eg $(AUXPROGS) $(AUXAWK)
install-exec-hook: $(AUXAWK)
$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
@@ -57,10 +56,9 @@ install-exec-hook: $(AUXAWK)
# pkglibexecdir and pkgdatadir are removed in the top level Makefile's uninstall
uninstall-local:
rm -fr $(DESTDIR)$(pkglibexecdir)/* $(DESTDIR)$(pkgdatadir)/*
- rm -f $(DESTDIR)$(bindir)/igawk
clean-local:
- rm -f $(AUXAWK) igawk *.exe
+ rm -f $(AUXAWK) *.exe
rm -fr eg.old
rm -fr grcat.dSYM pwcat.dSYM
@@ -72,7 +70,7 @@ $(srcdir)/stamp-eg: $(srcdir)/../doc/gawk.texi $(srcdir)/../doc/gawkinet.texi
@echo 'some makes are stupid and will not check a directory' > $(srcdir)/stamp-eg
@echo 'against a file, so this file is a place holder. gack.' >> $(srcdir)/stamp-eg
-$(srcdir)/eg/lib/pwcat.c $(srcdir)/eg/lib/grcat.c $(srcdir)/eg/prog/igawk.sh \
+$(srcdir)/eg/lib/pwcat.c $(srcdir)/eg/lib/grcat.c \
$(srcdir)/eg/lib/passwdawk.in $(srcdir)/eg/lib/groupawk.in: stamp-eg; @:
pwcat$(EXEEXT): $(srcdir)/eg/lib/pwcat.c
@@ -81,9 +79,6 @@ pwcat$(EXEEXT): $(srcdir)/eg/lib/pwcat.c
grcat$(EXEEXT): $(srcdir)/eg/lib/grcat.c
$(COMPILE) $(srcdir)/eg/lib/grcat.c $(LDFLAGS) -o $@
-igawk: $(srcdir)/eg/prog/igawk.sh
- cp $(srcdir)/eg/prog/igawk.sh $@ ; chmod 755 $@
-
passwd.awk: $(srcdir)/eg/lib/passwdawk.in
sed 's;/usr/local/libexec/awk;$(pkglibexecdir);' < $(srcdir)/eg/lib/passwdawk.in > passwd.awk
diff --git a/awklib/Makefile.in b/awklib/Makefile.in
index d32ae04a..38124fad 100644
--- a/awklib/Makefile.in
+++ b/awklib/Makefile.in
@@ -37,7 +37,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#
-
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__make_running_with_option = \
@@ -122,7 +121,7 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
-am__installdirs = "$(DESTDIR)$(pkglibexecdir)" "$(DESTDIR)$(bindir)"
+am__installdirs = "$(DESTDIR)$(pkglibexecdir)"
PROGRAMS = $(pkglibexec_PROGRAMS)
nodist_grcat_OBJECTS = grcat.$(OBJEXT)
grcat_OBJECTS = $(nodist_grcat_OBJECTS)
@@ -130,34 +129,6 @@ grcat_LDADD = $(LDADD)
nodist_pwcat_OBJECTS = pwcat.$(OBJEXT)
pwcat_OBJECTS = $(nodist_pwcat_OBJECTS)
pwcat_LDADD = $(LDADD)
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
- $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
- *) f=$$p;; \
- esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
- srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
- for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
- for p in $$list; do echo "$$p $$p"; done | \
- sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
- $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
- if (++n[$$2] == $(am__install_max)) \
- { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
- END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
- sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
- sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
- test -z "$$files" \
- || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
- || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
- $(am__cd) "$$dir" && rm -f $$files; }; \
- }
-SCRIPTS = $(bin_SCRIPTS)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
@@ -349,7 +320,6 @@ EXTRA_DIST = ChangeLog ChangeLog.0 extract.awk eg $(srcdir)/stamp-eg
# Get config.h from the build directory and custom.h from the source directory.
AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir)
-bin_SCRIPTS = igawk
AUXAWK = passwd.awk group.awk
nodist_grcat_SOURCES = grcat.c
nodist_pwcat_SOURCES = pwcat.c
@@ -429,41 +399,6 @@ uninstall-pkglibexecPROGRAMS:
clean-pkglibexecPROGRAMS:
-test -z "$(pkglibexec_PROGRAMS)" || rm -f $(pkglibexec_PROGRAMS)
-install-binSCRIPTS: $(bin_SCRIPTS)
- @$(NORMAL_INSTALL)
- @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
- done | \
- sed -e 'p;s,.*/,,;n' \
- -e 'h;s|.*|.|' \
- -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
- $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
- { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
- if ($$2 == $$4) { files[d] = files[d] " " $$1; \
- if (++n[d] == $(am__install_max)) { \
- print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
- else { print "f", d "/" $$4, $$1 } } \
- END { for (d in files) print "f", d, files[d] }' | \
- while read type dir files; do \
- if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
- test -z "$$files" || { \
- echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \
- $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
- } \
- ; done
-
-uninstall-binSCRIPTS:
- @$(NORMAL_UNINSTALL)
- @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \
- files=`for p in $$list; do echo "$$p"; done | \
- sed -e 's,.*/,,;$(transform)'`; \
- dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -572,9 +507,9 @@ distdir: $(DISTFILES)
done
check-am: all-am
check: check-am
-all-am: Makefile $(PROGRAMS) $(SCRIPTS)
+all-am: Makefile $(PROGRAMS)
installdirs:
- for dir in "$(DESTDIR)$(pkglibexecdir)" "$(DESTDIR)$(bindir)"; do \
+ for dir in "$(DESTDIR)$(pkglibexecdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
@@ -636,7 +571,7 @@ install-dvi: install-dvi-am
install-dvi-am:
-install-exec-am: install-binSCRIPTS install-pkglibexecPROGRAMS
+install-exec-am: install-pkglibexecPROGRAMS
@$(NORMAL_INSTALL)
$(MAKE) $(AM_MAKEFLAGS) install-exec-hook
install-html: install-html-am
@@ -676,8 +611,7 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-binSCRIPTS uninstall-local \
- uninstall-pkglibexecPROGRAMS
+uninstall-am: uninstall-local uninstall-pkglibexecPROGRAMS
.MAKE: install-am install-exec-am install-strip
@@ -685,20 +619,19 @@ uninstall-am: uninstall-binSCRIPTS uninstall-local \
clean-local clean-pkglibexecPROGRAMS cscopelist-am ctags \
ctags-am distclean distclean-compile distclean-generic \
distclean-tags distdir dvi dvi-am html html-am info info-am \
- install install-am install-binSCRIPTS install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-exec-hook install-html install-html-am \
- install-info install-info-am install-man install-pdf \
- install-pdf-am install-pkglibexecPROGRAMS install-ps \
- install-ps-am install-strip installcheck installcheck-am \
- installdirs maintainer-clean maintainer-clean-generic \
- mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
- ps ps-am tags tags-am uninstall uninstall-am \
- uninstall-binSCRIPTS uninstall-local \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-exec-hook \
+ install-html install-html-am install-info install-info-am \
+ install-man install-pdf install-pdf-am \
+ install-pkglibexecPROGRAMS install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
+ tags tags-am uninstall uninstall-am uninstall-local \
uninstall-pkglibexecPROGRAMS
-all: $(srcdir)/stamp-eg $(AUXPROGS) igawk $(AUXAWK)
+all: $(srcdir)/stamp-eg $(AUXPROGS) $(AUXAWK)
install-exec-hook: $(AUXAWK)
$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
@@ -710,10 +643,9 @@ install-exec-hook: $(AUXAWK)
# pkglibexecdir and pkgdatadir are removed in the top level Makefile's uninstall
uninstall-local:
rm -fr $(DESTDIR)$(pkglibexecdir)/* $(DESTDIR)$(pkgdatadir)/*
- rm -f $(DESTDIR)$(bindir)/igawk
clean-local:
- rm -f $(AUXAWK) igawk *.exe
+ rm -f $(AUXAWK) *.exe
rm -fr eg.old
rm -fr grcat.dSYM pwcat.dSYM
@@ -725,7 +657,7 @@ $(srcdir)/stamp-eg: $(srcdir)/../doc/gawk.texi $(srcdir)/../doc/gawkinet.texi
@echo 'some makes are stupid and will not check a directory' > $(srcdir)/stamp-eg
@echo 'against a file, so this file is a place holder. gack.' >> $(srcdir)/stamp-eg
-$(srcdir)/eg/lib/pwcat.c $(srcdir)/eg/lib/grcat.c $(srcdir)/eg/prog/igawk.sh \
+$(srcdir)/eg/lib/pwcat.c $(srcdir)/eg/lib/grcat.c \
$(srcdir)/eg/lib/passwdawk.in $(srcdir)/eg/lib/groupawk.in: stamp-eg; @:
pwcat$(EXEEXT): $(srcdir)/eg/lib/pwcat.c
@@ -734,9 +666,6 @@ pwcat$(EXEEXT): $(srcdir)/eg/lib/pwcat.c
grcat$(EXEEXT): $(srcdir)/eg/lib/grcat.c
$(COMPILE) $(srcdir)/eg/lib/grcat.c $(LDFLAGS) -o $@
-igawk: $(srcdir)/eg/prog/igawk.sh
- cp $(srcdir)/eg/prog/igawk.sh $@ ; chmod 755 $@
-
passwd.awk: $(srcdir)/eg/lib/passwdawk.in
sed 's;/usr/local/libexec/awk;$(pkglibexecdir);' < $(srcdir)/eg/lib/passwdawk.in > passwd.awk
diff --git a/builtin.c b/builtin.c
index 54f52350..6f8aeb36 100644
--- a/builtin.c
+++ b/builtin.c
@@ -1112,7 +1112,7 @@ out0:
memset(& state, 0, sizeof(state));
count = mbrlen(cp, arg->stlen, & state);
- if (count > 0) {
+ if (count != (size_t) -1 && count != (size_t) -2 && count > 0) {
prec = count;
/* may need to increase fw so that padding happens, see pr_tail code */
if (fw > 0)
@@ -3612,6 +3612,72 @@ do_bindtextdomain(int nargs)
return make_string(the_result, strlen(the_result));
}
+/* do_div --- do integer division, return quotient and remainder in dest array */
+
+/*
+ * We define the semantics as:
+ * numerator = int(numerator)
+ * denominator = int(denonmator)
+ * quotient = int(numerator / denomator)
+ * remainder = int(numerator % denomator)
+ */
+
+NODE *
+do_div(int nargs)
+{
+ NODE *numerator, *denominator, *result;
+ double num, denom, quotient, remainder;
+ NODE *sub, **lhs;
+
+ result = POP_PARAM();
+ if (result->type != Node_var_array)
+ fatal(_("div: third argument is not an array"));
+ assoc_clear(result);
+
+ denominator = POP_SCALAR();
+ numerator = POP_SCALAR();
+
+ if (do_lint) {
+ if ((numerator->flags & (NUMCUR|NUMBER)) == 0)
+ lintwarn(_("div: received non-numeric first argument"));
+ if ((denominator->flags & (NUMCUR|NUMBER)) == 0)
+ lintwarn(_("div: received non-numeric second argument"));
+ }
+
+ (void) force_number(numerator);
+ (void) force_number(denominator);
+ num = double_to_int(get_number_d(numerator));
+ denom = double_to_int(get_number_d(denominator));
+
+ if (denom == 0.0)
+ fatal(_("div: division by zero attempted"));
+
+ quotient = double_to_int(num / denom);
+ /*
+ * FIXME: This code is duplicated, factor it out to a
+ * separate function.
+ */
+#ifdef HAVE_FMOD
+ remainder = fmod(num, denom);
+#else /* ! HAVE_FMOD */
+ (void) modf(num / denom, & remainder);
+ remainder = num - remainder * denom;
+#endif /* ! HAVE_FMOD */
+ remainder = double_to_int(remainder);
+
+ sub = make_string("quotient", 8);
+ lhs = assoc_lookup(result, sub);
+ unref(*lhs);
+ *lhs = make_number((AWKNUM) quotient);
+
+ sub = make_string("remainder", 9);
+ lhs = assoc_lookup(result, sub);
+ unref(*lhs);
+ *lhs = make_number((AWKNUM) remainder);
+
+ return make_number((AWKNUM) 0.0);
+}
+
/* mbc_byte_count --- return number of bytes for corresponding numchars multibyte characters */
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 5e7d4808..f69e401d 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,24 @@
+2014-07-10 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in (Numeric Functions): Document new `div()' function.
+ (Arbitrary Precision Integers): Document raison d'etre for div().
+ * gawk.1, awkcard.in: Document `div()'.
+
+2014-07-04 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in (Bracket Expressions): Add a note about how to
+ match ASCII characters. Thanks to Hermann Peifer.
+
+2014-06-25 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in: Update permissions on copyright page per
+ latest maintain.texi. Add GPL to print version of book.
+
+2014-06-24 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in: Document that --pretty-print no longer runs the
+ program. Remove mention of GAWK_NO_PP_RUN env var.
+
2014-06-22 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in: Typo fixes and minor corrections.
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 86321bbc..8a0442a7 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -26,7 +26,7 @@
info_TEXINFOS = gawk.texi gawkinet.texi
-man_MANS = gawk.1 igawk.1
+man_MANS = gawk.1
EXTRA_DIST = ChangeLog ChangeLog.0 README.card ad.block setter.outline \
awkcard.in awkforai.txt texinfo.tex cardfonts \
@@ -50,7 +50,7 @@ EXTRA_DIST = ChangeLog ChangeLog.0 README.card ad.block setter.outline \
bc_notes
# Get rid of generated files when cleaning
-CLEANFILES = *.ps *.html *.dvi *~ awkcard.nc awkcard.tr gawk.pdf gawkinet.pdf awkcard.pdf gawk.1.pdf igawk.1.pdf
+CLEANFILES = *.ps *.html *.dvi *~ awkcard.nc awkcard.tr gawk.pdf gawkinet.pdf awkcard.pdf gawk.1.pdf
MAKEINFO = @MAKEINFO@ --no-split --force
@@ -75,9 +75,9 @@ AWKCARD = awkcard.ps
gawk.texi: $(srcdir)/gawktexi.in $(srcdir)/sidebar.awk
awk -f $(srcdir)/sidebar.awk < $(srcdir)/gawktexi.in > gawk.texi
-postscript: gawk.ps gawkinet.ps gawk.1.ps igawk.1.ps $(AWKCARD)
+postscript: gawk.ps gawkinet.ps gawk.1.ps $(AWKCARD)
-pdf: postscript gawk.pdf gawkinet.pdf awkcard.pdf gawk.1.pdf igawk.1.pdf
+pdf: postscript gawk.pdf gawkinet.pdf awkcard.pdf gawk.1.pdf
gawk.ps: gawk.dvi
TEXINPUTS=$(srcdir): dvips -o gawk.ps gawk.dvi
@@ -91,12 +91,6 @@ gawk.1.ps: gawk.1
gawk.1.pdf: gawk.1.ps
ps2pdf gawk.1.ps gawk.1.pdf
-igawk.1.ps: igawk.1
- -groff -man $(srcdir)/igawk.1 > igawk.1.ps
-
-igawk.1.pdf: igawk.1.ps
- ps2pdf igawk.1.ps igawk.1.pdf
-
awkcard.tr: awkcard.in
sed 's:SRCDIR:$(srcdir):' < $(srcdir)/awkcard.in > awkcard.tr
diff --git a/doc/Makefile.in b/doc/Makefile.in
index abaf5601..d89beffd 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -341,7 +341,7 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
info_TEXINFOS = gawk.texi gawkinet.texi
-man_MANS = gawk.1 igawk.1
+man_MANS = gawk.1
EXTRA_DIST = ChangeLog ChangeLog.0 README.card ad.block setter.outline \
awkcard.in awkforai.txt texinfo.tex cardfonts \
api-figure1.eps api-figure1.fig api-figure1.pdf \
@@ -365,7 +365,7 @@ EXTRA_DIST = ChangeLog ChangeLog.0 README.card ad.block setter.outline \
# Get rid of generated files when cleaning
-CLEANFILES = *.ps *.html *.dvi *~ awkcard.nc awkcard.tr gawk.pdf gawkinet.pdf awkcard.pdf gawk.1.pdf igawk.1.pdf
+CLEANFILES = *.ps *.html *.dvi *~ awkcard.nc awkcard.tr gawk.pdf gawkinet.pdf awkcard.pdf gawk.1.pdf
TROFF = groff -t -Tps -U
SEDME = sed -e "s/^level0 restore/level0 restore flashme 100 72 moveto (Copyright `date '+%m-%d-%y %T'`, FSF, Inc. (all)) show/" \
-e "s/^\/level0 save def/\/level0 save def 30 -48 translate/"
@@ -869,9 +869,9 @@ uninstall-man: uninstall-man1
gawk.texi: $(srcdir)/gawktexi.in $(srcdir)/sidebar.awk
awk -f $(srcdir)/sidebar.awk < $(srcdir)/gawktexi.in > gawk.texi
-postscript: gawk.ps gawkinet.ps gawk.1.ps igawk.1.ps $(AWKCARD)
+postscript: gawk.ps gawkinet.ps gawk.1.ps $(AWKCARD)
-pdf: postscript gawk.pdf gawkinet.pdf awkcard.pdf gawk.1.pdf igawk.1.pdf
+pdf: postscript gawk.pdf gawkinet.pdf awkcard.pdf gawk.1.pdf
gawk.ps: gawk.dvi
TEXINPUTS=$(srcdir): dvips -o gawk.ps gawk.dvi
@@ -885,12 +885,6 @@ gawk.1.ps: gawk.1
gawk.1.pdf: gawk.1.ps
ps2pdf gawk.1.ps gawk.1.pdf
-igawk.1.ps: igawk.1
- -groff -man $(srcdir)/igawk.1 > igawk.1.ps
-
-igawk.1.pdf: igawk.1.ps
- ps2pdf igawk.1.ps igawk.1.pdf
-
awkcard.tr: awkcard.in
sed 's:SRCDIR:$(srcdir):' < $(srcdir)/awkcard.in > awkcard.tr
diff --git a/doc/awkcard.in b/doc/awkcard.in
index ca28f0a7..556bdc1e 100644
--- a/doc/awkcard.in
+++ b/doc/awkcard.in
@@ -1609,6 +1609,9 @@ expand;
l lw(2i).
\*(CD\*(FCatan2(\*(FIy\*(FC, \*(FIx\*(FC)\*(FR The arctangent of \*(FIy/x\fP in radians.
\*(FCcos(\*(FIexpr\*(FC)\*(FR The cosine of \*(FIexpr\fP, which is in radians.
+\*(CB\*(FCdiv(\*(FIn\*(FR\*(FC,\*(FI d\*(FR\*(FC,\*(FI res\*(FR\*(FC)\*(FR T{
+Return the result of integer division in \*(FIres\*(FR.\*(CD
+T}
\*(FCexp(\*(FIexpr\*(FC)\*(FR The exponential function (\*(FIe \*(FC^ \*(FIx\*(FR).
\*(FCint(\*(FIexpr\*(FC)\*(FR Truncate to integer.
\*(FClog(\*(FIexpr\*(FC)\*(FR The natural logarithm function (base \*(FIe\^\*(FR).
diff --git a/doc/gawk.1 b/doc/gawk.1
index e3275e87..d5756f08 100644
--- a/doc/gawk.1
+++ b/doc/gawk.1
@@ -13,7 +13,7 @@
. if \w'\(rq' .ds rq "\(rq
. \}
.\}
-.TH GAWK 1 "Apr 17 2014" "Free Software Foundation" "Utility Commands"
+.TH GAWK 1 "Jul 10 2014" "Free Software Foundation" "Utility Commands"
.SH NAME
gawk \- pattern scanning and processing language
.SH SYNOPSIS
@@ -2629,6 +2629,23 @@ Return the cosine of
.IR expr ,
which is in radians.
.TP
+.BI div( num ", " denom ", " result )
+Truncate
+.I num
+and
+.I denom
+to integers. Return the quotient of
+.I num
+divided by
+.I denom
+in \fIresult\fB["quotient"]\fR
+and the remainder in
+in \fIresult\fB["remainder"]\fR.
+This is a
+.I gawk
+extension, primarily of value when working with
+arbitrarily large integers.
+.TP
.BI exp( expr )
The exponential function.
.TP
diff --git a/doc/gawk.info b/doc/gawk.info
index 44568736..e7854caf 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -20,16 +20,13 @@ implementation of AWK.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
-Invariant Sections being "GNU General Public License", the Front-Cover
-texts being (a) (see below), and with the Back-Cover Texts being (b)
-(see below). A copy of the license is included in the section entitled
-"GNU Free Documentation License".
+Invariant Sections being "GNU General Public License", with the
+Front-Cover Texts being "A GNU Manual", and with the Back-Cover Texts
+as in (a) below. A copy of the license is included in the section
+entitled "GNU Free Documentation License".
- a. "A GNU Manual"
-
- b. "You have the freedom to copy and modify this GNU manual. Buying
- copies from the FSF supports it in developing GNU and promoting
- software freedom."
+ a. The FSF's Back-Cover Text is: "You have the freedom to copy and
+ modify this GNU manual."

File: gawk.info, Node: Top, Next: Foreword, Up: (dir)
@@ -51,16 +48,13 @@ implementation of AWK.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
-Invariant Sections being "GNU General Public License", the Front-Cover
-texts being (a) (see below), and with the Back-Cover Texts being (b)
-(see below). A copy of the license is included in the section entitled
-"GNU Free Documentation License".
-
- a. "A GNU Manual"
+Invariant Sections being "GNU General Public License", with the
+Front-Cover Texts being "A GNU Manual", and with the Back-Cover Texts
+as in (a) below. A copy of the license is included in the section
+entitled "GNU Free Documentation License".
- b. "You have the freedom to copy and modify this GNU manual. Buying
- copies from the FSF supports it in developing GNU and promoting
- software freedom."
+ a. The FSF's Back-Cover Text is: "You have the freedom to copy and
+ modify this GNU manual."
* Menu:
@@ -2569,10 +2563,8 @@ The following list describes options mandated by the POSIX standard:
different file name for the output. No space is allowed between
the `-o' and FILE, if FILE is supplied.
- NOTE: Due to the way `gawk' has evolved, with this option
- your program is still executed. This will change in the next
- major release such that `gawk' will only pretty-print the
- program and not run it.
+ NOTE: In the past, this option would also execute your
+ program. This is no longer the case.
`-O'
`--optimize'
@@ -2956,11 +2948,6 @@ change. The variables are:
supposed to be differences, but occasionally theory and practice
don't coordinate with each other.)
-`GAWK_NO_PP_RUN'
- If this variable exists, then when invoked with the
- `--pretty-print' option, `gawk' skips running the program. This
- variable will not survive into the next major release.
-
`GAWK_STACKSIZE'
This specifies the amount by which `gawk' should grow its internal
evaluation stack, when needed.
@@ -3676,6 +3663,14 @@ set had other alphabetic characters in it, this would not match them.
With the POSIX character classes, you can write `/[[:alnum:]]/' to
match the alphabetic and numeric characters in your character set.
+ Some utilities that match regular expressions provide a non-standard
+`[:ascii:]' character class; `awk' does not. However, you can simulate
+such a construct using `[\x00-\x7F]'. This matches all values
+numerically between zero and 127, which is the defined range of the
+ASCII character set. Use a complemented character list
+(`[^\x00-\x7F]') to match any single-byte characters that are not in
+the ASCII range.
+
Two additional special sequences can appear in bracket expressions.
These apply to non-ASCII character sets, which can have single symbols
(called "collating elements") that are represented with more than one
@@ -11685,6 +11680,20 @@ brackets ([ ]):
`cos(X)'
Return the cosine of X, with X in radians.
+`div(NUMERATOR, DENOMINATOR, RESULT)'
+ Perform integer division, similar to the standard C function of the
+ same name. First, truncate `numerator' and `denominator' to
+ integers. Clear the `result' array, and then set
+ `result["quotient"]' to the result of `numerator / denominator',
+ truncated to an integer, and set `result["remainder"]' to the
+ result of `numerator % denominator', truncated to an integer.
+ This function is primarily intended for use with arbitrary length
+ integers; it avoids creating MPFR arbitrary precision
+ floating-point values (*note Arbitrary Precision Integers::).
+
+ This function is a `gawk' extension. It is not available in
+ compatibility mode (*note Options::).
+
`exp(X)'
Return the exponential of X (`e ^ X') or report an error if X is
out of range. The range of values X can have depends on your
@@ -19641,8 +19650,8 @@ by the `Ctrl-<\>' key.
called this way, `gawk' "pretty prints" the program into `awkprof.out',
without any execution counts.
- NOTE: The `--pretty-print' option still runs your program. This
- will change in the next major release.
+ NOTE: Once upon a time, the `--pretty-print' option would also run
+ your program. This is is no longer the case.

File: gawk.info, Node: Advanced Features Summary, Prev: Profiling, Up: Advanced Features
@@ -22087,6 +22096,29 @@ just use the following:
gawk -M 'BEGIN { n = 13; print n % 2 }'
+ When dividing two arbitrary precision integers with either `/' or
+`%', the result is typically an arbitrary precision floating point
+value (unless the denominator evenly divides into the numerator). In
+order to do integer division or remainder with arbitrary precision
+integers, use the built-in `div()' function (*note Numeric Functions::).
+
+ You can simulate the `div()' function in standard `awk' using this
+user-defined function:
+
+ # div --- do integer division
+
+ function div(numerator, denominator, result, i)
+ {
+ split("", result)
+
+ numerator = int(numerator)
+ denominator = int(denominator)
+ result["quotient"] = int(numerator / denominator)
+ result["remainder"] = int(numerator % denominator)
+
+ return 0.0
+ }
+
---------- Footnotes ----------
(1) Weisstein, Eric W. `Sylvester's Sequence'. From MathWorld--A
@@ -27011,7 +27043,9 @@ 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::. (Since `gawk' can do
+ its own `@include' processing, neither `igawk' nor `igawk.1' are
+ installed.)
`doc/Makefile.in'
The input file used during the configuration process to generate
@@ -27053,11 +27087,10 @@ Various `.c', `.y', and `.h' files
contains a `Makefile.in' file, which `configure' uses to generate
a `Makefile'. `Makefile.am' is used by GNU Automake to create
`Makefile.in'. The library functions from *note Library
- Functions::, and the `igawk' program from *note Igawk Program::,
- are included as ready-to-use files in the `gawk' distribution.
- They are installed as part of the installation process. The rest
- of the programs in this Info file are available in appropriate
- subdirectories of `awklib/eg'.
+ Functions::, are included as ready-to-use files in the `gawk'
+ distribution. They are installed as part of the installation
+ process. The rest of the programs in this Info file are available
+ in appropriate subdirectories of `awklib/eg'.
`extension/*'
The source code, manual pages, and infrastructure files for the
@@ -30990,20 +31023,20 @@ Index
* --include option: Options. (line 159)
* --lint option <1>: Options. (line 185)
* --lint option: Command Line. (line 20)
-* --lint-old option: Options. (line 295)
+* --lint-old option: Options. (line 293)
* --load option: Options. (line 173)
* --non-decimal-data option <1>: Nondecimal Data. (line 6)
* --non-decimal-data option: Options. (line 211)
* --non-decimal-data option, strtonum() function and: Nondecimal Data.
(line 36)
-* --optimize option: Options. (line 237)
-* --posix option: Options. (line 254)
-* --posix option, --traditional option and: Options. (line 273)
+* --optimize option: Options. (line 235)
+* --posix option: Options. (line 252)
+* --posix option, --traditional option and: Options. (line 271)
* --pretty-print option: Options. (line 224)
* --profile option <1>: Profiling. (line 12)
-* --profile option: Options. (line 242)
-* --re-interval option: Options. (line 279)
-* --sandbox option: Options. (line 286)
+* --profile option: Options. (line 240)
+* --re-interval option: Options. (line 277)
+* --sandbox option: Options. (line 284)
* --sandbox option, disabling system() function: I/O Functions.
(line 97)
* --sandbox option, input redirection with getline: Getline. (line 19)
@@ -31011,9 +31044,9 @@ Index
(line 6)
* --source option: Options. (line 117)
* --traditional option: Options. (line 81)
-* --traditional option, --posix option and: Options. (line 273)
+* --traditional option, --posix option and: Options. (line 271)
* --use-lc-numeric option: Options. (line 219)
-* --version option: Options. (line 300)
+* --version option: Options. (line 298)
* --with-whiny-user-strftime configuration option: Additional Configuration Options.
(line 35)
* -b option: Options. (line 68)
@@ -31026,26 +31059,26 @@ Index
* -f option: Options. (line 25)
* -F option: Options. (line 21)
* -f option: Long. (line 12)
-* -F option, -Ft sets FS to TAB: Options. (line 308)
+* -F option, -Ft sets FS to TAB: Options. (line 306)
* -F option, command line: Command Line Field Separator.
(line 6)
-* -f option, multiple uses: Options. (line 313)
+* -f option, multiple uses: Options. (line 311)
* -g option: Options. (line 147)
* -h option: Options. (line 154)
* -i option: Options. (line 159)
-* -L option: Options. (line 295)
+* -L option: Options. (line 293)
* -l option: Options. (line 173)
* -M option: Options. (line 205)
* -N option: Options. (line 219)
* -n option: Options. (line 211)
-* -O option: Options. (line 237)
+* -O option: Options. (line 235)
* -o option: Options. (line 224)
-* -P option: Options. (line 254)
-* -p option: Options. (line 242)
-* -r option: Options. (line 279)
-* -S option: Options. (line 286)
+* -P option: Options. (line 252)
+* -p option: Options. (line 240)
+* -r option: Options. (line 277)
+* -S option: Options. (line 284)
* -v option: Assignment Options. (line 12)
-* -V option: Options. (line 300)
+* -V option: Options. (line 298)
* -v option: Options. (line 32)
* -W option: Options. (line 46)
* . (period), regexp operator: Regexp Operators. (line 44)
@@ -31318,7 +31351,7 @@ Index
* awf (amazingly workable formatter) program: Glossary. (line 24)
* awk debugging, enabling: Options. (line 108)
* awk language, POSIX version: Assignment Ops. (line 137)
-* awk profiling, enabling: Options. (line 242)
+* awk profiling, enabling: Options. (line 240)
* awk programs <1>: Two Rules. (line 6)
* awk programs <2>: Executable Scripts. (line 6)
* awk programs: Getting Started. (line 12)
@@ -31489,13 +31522,13 @@ Index
* bracket expressions, character classes: Bracket Expressions.
(line 30)
* bracket expressions, collating elements: Bracket Expressions.
- (line 69)
+ (line 77)
* bracket expressions, collating symbols: Bracket Expressions.
- (line 76)
+ (line 84)
* bracket expressions, complemented: Regexp Operators. (line 64)
* bracket expressions, equivalence classes: Bracket Expressions.
- (line 82)
-* bracket expressions, non-ASCII: Bracket Expressions. (line 69)
+ (line 90)
+* bracket expressions, non-ASCII: Bracket Expressions. (line 77)
* bracket expressions, range expressions: Bracket Expressions.
(line 6)
* break debugger command: Breakpoint Control. (line 11)
@@ -31613,8 +31646,8 @@ Index
* Close, Diane <1>: Contributors. (line 20)
* Close, Diane: Manual History. (line 41)
* Collado, Manuel: Acknowledgments. (line 60)
-* collating elements: Bracket Expressions. (line 69)
-* collating symbols: Bracket Expressions. (line 76)
+* collating elements: Bracket Expressions. (line 77)
+* collating symbols: Bracket Expressions. (line 84)
* Colombo, Antonio <1>: Contributors. (line 137)
* Colombo, Antonio: Acknowledgments. (line 60)
* columns, aligning: Print Examples. (line 70)
@@ -31725,7 +31758,7 @@ Index
* cosine: Numeric Functions. (line 15)
* counting: Wc Program. (line 6)
* csh utility: Statements/Lines. (line 44)
-* csh utility, POSIXLY_CORRECT environment variable: Options. (line 355)
+* csh utility, POSIXLY_CORRECT environment variable: Options. (line 353)
* csh utility, |& operator, comparison with: Two-way I/O. (line 44)
* ctime() user-defined function: Function Example. (line 73)
* currency symbols, localization: Explaining gettext. (line 104)
@@ -31908,7 +31941,7 @@ Index
* debugger, read commands from a file: Debugger Info. (line 96)
* debugging awk programs: Debugger. (line 6)
* debugging gawk, bug reports: Bugs. (line 9)
-* decimal point character, locale specific: Options. (line 270)
+* decimal point character, locale specific: Options. (line 268)
* decrement operators: Increment Ops. (line 35)
* default keyword: Switch Statement. (line 6)
* Deifik, Scott <1>: Bugs. (line 71)
@@ -32009,6 +32042,7 @@ Index
* display debugger command: Viewing And Changing Data.
(line 8)
* display debugger options: Debugger Info. (line 57)
+* div: Numeric Functions. (line 18)
* division: Arithmetic Ops. (line 44)
* do-while statement: Do Statement. (line 6)
* do-while statement, use of regexps in: Regexp Usage. (line 19)
@@ -32129,10 +32163,10 @@ Index
* exit status, of VMS: VMS Running. (line 29)
* exit the debugger: Miscellaneous Debugger Commands.
(line 99)
-* exp: Numeric Functions. (line 18)
+* exp: Numeric Functions. (line 32)
* expand utility: Very Simple. (line 69)
* Expat XML parser library: gawkextlib. (line 35)
-* exponent: Numeric Functions. (line 18)
+* exponent: Numeric Functions. (line 32)
* expressions: Expressions. (line 6)
* expressions, as patterns: Expression Patterns. (line 6)
* expressions, assignment: Assignment Ops. (line 6)
@@ -32336,7 +32370,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 266)
+* FS variable, as TAB character: Options. (line 264)
* FS variable, changing value of: Field Separators. (line 35)
* FS variable, running awk programs and: Cut Program. (line 68)
* FS variable, setting from command line: Command Line Field Separator.
@@ -32406,7 +32440,7 @@ Index
* gawk, bitwise operations in: Bitwise Functions. (line 39)
* gawk, break statement in: Break Statement. (line 51)
* gawk, built-in variables and: Built-in Variables. (line 14)
-* gawk, character classes and: Bracket Expressions. (line 90)
+* gawk, character classes and: Bracket Expressions. (line 98)
* gawk, coding style in: Adding Code. (line 39)
* gawk, command-line options, and regular expressions: GNU Regexp Operators.
(line 70)
@@ -32426,7 +32460,7 @@ Index
(line 139)
* gawk, ERRNO variable in: Getline. (line 19)
* gawk, escape sequences: Escape Sequences. (line 124)
-* gawk, extensions, disabling: Options. (line 254)
+* gawk, extensions, disabling: Options. (line 252)
* gawk, features, adding: Adding Code. (line 6)
* gawk, features, advanced: Advanced Features. (line 6)
* gawk, field separators and: User-modified. (line 71)
@@ -32487,7 +32521,7 @@ Index
* gawk, TEXTDOMAIN variable in: User-modified. (line 152)
* gawk, timestamps: Time Functions. (line 6)
* gawk, uses for: Preface. (line 36)
-* gawk, versions of, information about, printing: Options. (line 300)
+* gawk, versions of, information about, printing: Options. (line 298)
* gawk, VMS version of: VMS Installation. (line 6)
* gawk, word-boundary operator: GNU Regexp Operators.
(line 63)
@@ -32668,7 +32702,7 @@ Index
* installation, VMS: VMS Installation. (line 6)
* installing gawk: Installation. (line 6)
* instruction tracing, in debugger: Debugger Info. (line 89)
-* int: Numeric Functions. (line 23)
+* int: Numeric Functions. (line 37)
* INT signal (MS-Windows): Profiling. (line 214)
* integer array indices: Numeric Array Subscripts.
(line 31)
@@ -32682,7 +32716,7 @@ Index
(line 13)
* internationalization, localization: User-modified. (line 152)
* internationalization, localization, character classes: Bracket Expressions.
- (line 90)
+ (line 98)
* internationalization, localization, gawk and: Internationalization.
(line 13)
* internationalization, localization, locale categories: Explaining gettext.
@@ -32798,7 +32832,7 @@ Index
* lint checking, empty programs: Command Line. (line 16)
* lint checking, issuing warnings: Options. (line 185)
* lint checking, POSIXLY_CORRECT environment variable: Options.
- (line 340)
+ (line 338)
* lint checking, undefined functions: Pass By Value/Reference.
(line 88)
* LINT variable: User-modified. (line 88)
@@ -32812,14 +32846,14 @@ Index
* loading, extensions: Options. (line 173)
* local variables, in a function: Variable Scope. (line 6)
* locale categories: Explaining gettext. (line 81)
-* locale decimal point character: Options. (line 270)
+* locale decimal point character: Options. (line 268)
* locale, definition of: Locales. (line 6)
* localization: I18N and L10N. (line 6)
* localization, See internationalization, localization: I18N and L10N.
(line 6)
-* log: Numeric Functions. (line 30)
+* log: Numeric Functions. (line 44)
* log files, timestamps in: Time Functions. (line 6)
-* logarithm: Numeric Functions. (line 30)
+* logarithm: Numeric Functions. (line 44)
* logical false/true: Truth Values. (line 6)
* logical operators, See Boolean expressions: Boolean Ops. (line 6)
* login information: Passwd Functions. (line 16)
@@ -32896,7 +32930,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 260)
+* newlines <2>: Options. (line 258)
* newlines: Statements/Lines. (line 6)
* newlines, as field separators: Default Field Splitting.
(line 6)
@@ -33118,7 +33152,7 @@ Index
* portability, NF variable, decrementing: Changing Fields. (line 115)
* portability, operators: Increment Ops. (line 60)
* portability, operators, not in POSIX awk: Precedence. (line 98)
-* portability, POSIXLY_CORRECT environment variable: Options. (line 360)
+* portability, POSIXLY_CORRECT environment variable: Options. (line 358)
* portability, substr() function: String Functions. (line 510)
* portable object files <1>: Translator i18n. (line 6)
* portable object files: Explaining gettext. (line 37)
@@ -33167,11 +33201,11 @@ Index
* POSIX awk, regular expressions and: Regexp Operators. (line 162)
* POSIX awk, timestamps and: Time Functions. (line 6)
* POSIX awk, | I/O operator and: Getline/Pipe. (line 55)
-* POSIX mode: Options. (line 254)
+* POSIX mode: Options. (line 252)
* 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 340)
+* POSIXLY_CORRECT environment variable: Options. (line 338)
* PREC variable: User-modified. (line 124)
* precedence <1>: Precedence. (line 6)
* precedence: Increment Ops. (line 60)
@@ -33276,12 +33310,12 @@ Index
* Rakitzis, Byron: History Sorting. (line 25)
* Ramey, Chet <1>: General Data Types. (line 6)
* Ramey, Chet: Acknowledgments. (line 60)
-* rand: Numeric Functions. (line 34)
+* rand: Numeric Functions. (line 48)
* random numbers, Cliff: Cliff Random Function.
(line 6)
* random numbers, rand()/srand() functions: Numeric Functions.
- (line 34)
-* random numbers, seed of: Numeric Functions. (line 64)
+ (line 48)
+* random numbers, seed of: Numeric Functions. (line 78)
* range expressions (regexps): Bracket Expressions. (line 6)
* range patterns: Ranges. (line 6)
* range patterns, line continuation and: Ranges. (line 65)
@@ -33351,7 +33385,7 @@ Index
(line 59)
* regular expressions, gawk, command-line options: GNU Regexp Operators.
(line 70)
-* regular expressions, interval expressions and: Options. (line 279)
+* regular expressions, interval expressions and: Options. (line 277)
* regular expressions, leftmost longest match: Leftmost Longest.
(line 6)
* regular expressions, operators <1>: Regexp Operators. (line 6)
@@ -33409,7 +33443,7 @@ Index
* Robbins, Miriam <2>: Getline/Pipe. (line 39)
* Robbins, Miriam: Acknowledgments. (line 82)
* Rommel, Kai Uwe: Contributors. (line 42)
-* round to nearest integer: Numeric Functions. (line 23)
+* round to nearest integer: Numeric Functions. (line 37)
* round() user-defined function: Round Function. (line 16)
* rounding numbers: Round Function. (line 6)
* ROUNDMODE variable: User-modified. (line 128)
@@ -33432,7 +33466,7 @@ Index
(line 68)
* sample debugging session: Sample Debugging Session.
(line 6)
-* sandbox mode: Options. (line 286)
+* sandbox mode: Options. (line 284)
* save debugger options: Debugger Info. (line 84)
* scalar or array: Type Functions. (line 11)
* scalar values: Basic Data Typing. (line 13)
@@ -33459,7 +33493,7 @@ Index
* sed utility <2>: Simple Sed. (line 6)
* sed utility: Field Splitting Summary.
(line 46)
-* seeding random number generator: Numeric Functions. (line 64)
+* seeding random number generator: Numeric Functions. (line 78)
* semicolon (;), AWKPATH variable and: PC Using. (line 10)
* semicolon (;), separating statements in actions <1>: Statements.
(line 10)
@@ -33561,8 +33595,8 @@ Index
* SIGUSR1 signal, for dynamic profiling: Profiling. (line 188)
* silent debugger command: Debugger Execution Control.
(line 10)
-* sin: Numeric Functions. (line 75)
-* sine: Numeric Functions. (line 75)
+* sin: Numeric Functions. (line 89)
+* sine: Numeric Functions. (line 89)
* single quote ('): One-shot. (line 15)
* single quote (') in gawk command lines: Long. (line 33)
* single quote ('), in shell commands: Quoting. (line 48)
@@ -33612,10 +33646,10 @@ Index
* sprintf() function, OFMT variable and: User-modified. (line 114)
* sprintf() function, print/printf statements and: Round Function.
(line 6)
-* sqrt: Numeric Functions. (line 78)
+* sqrt: Numeric Functions. (line 92)
* square brackets ([]), regexp operator: Regexp Operators. (line 56)
-* square root: Numeric Functions. (line 78)
-* srand: Numeric Functions. (line 82)
+* square root: Numeric Functions. (line 92)
+* srand: Numeric Functions. (line 96)
* stack frame: Debugging Terms. (line 10)
* Stallman, Richard <1>: Glossary. (line 296)
* Stallman, Richard <2>: Contributors. (line 23)
@@ -33904,7 +33938,7 @@ Index
* whitespace, as field separators: Default Field Splitting.
(line 6)
* whitespace, functions, calling: Calling Built-in. (line 10)
-* whitespace, newlines as: Options. (line 260)
+* whitespace, newlines as: Options. (line 258)
* Williams, Kent: Contributors. (line 34)
* Woehlke, Matthew: Contributors. (line 79)
* Woods, John: Contributors. (line 27)
@@ -33956,553 +33990,553 @@ Index

Tag Table:
-Node: Top1292
-Node: Foreword42034
-Node: Preface46379
-Ref: Preface-Footnote-149526
-Ref: Preface-Footnote-249633
-Node: History49865
-Node: Names52239
-Ref: Names-Footnote-153703
-Node: This Manual53776
-Ref: This Manual-Footnote-159555
-Node: Conventions59655
-Node: Manual History61811
-Ref: Manual History-Footnote-165250
-Ref: Manual History-Footnote-265291
-Node: How To Contribute65365
-Node: Acknowledgments66604
-Node: Getting Started70900
-Node: Running gawk73334
-Node: One-shot74524
-Node: Read Terminal75749
-Ref: Read Terminal-Footnote-177399
-Ref: Read Terminal-Footnote-277675
-Node: Long77846
-Node: Executable Scripts79222
-Ref: Executable Scripts-Footnote-181055
-Ref: Executable Scripts-Footnote-281157
-Node: Comments81704
-Node: Quoting84177
-Node: DOS Quoting89493
-Node: Sample Data Files90168
-Node: Very Simple92683
-Node: Two Rules97321
-Node: More Complex99215
-Ref: More Complex-Footnote-1102147
-Node: Statements/Lines102232
-Ref: Statements/Lines-Footnote-1106688
-Node: Other Features106953
-Node: When107881
-Node: Intro Summary110051
-Node: Invoking Gawk110817
-Node: Command Line112332
-Node: Options113123
-Ref: Options-Footnote-1128952
-Node: Other Arguments128977
-Node: Naming Standard Input131639
-Node: Environment Variables132733
-Node: AWKPATH Variable133291
-Ref: AWKPATH Variable-Footnote-1136163
-Ref: AWKPATH Variable-Footnote-2136208
-Node: AWKLIBPATH Variable136468
-Node: Other Environment Variables137227
-Node: Exit Status140882
-Node: Include Files141557
-Node: Loading Shared Libraries145135
-Node: Obsolete146519
-Node: Undocumented147216
-Node: Invoking Summary147483
-Node: Regexp149063
-Node: Regexp Usage150513
-Node: Escape Sequences152546
-Node: Regexp Operators158213
-Ref: Regexp Operators-Footnote-1165693
-Ref: Regexp Operators-Footnote-2165840
-Node: Bracket Expressions165938
-Ref: table-char-classes167828
-Node: GNU Regexp Operators170351
-Node: Case-sensitivity174074
-Ref: Case-sensitivity-Footnote-1176966
-Ref: Case-sensitivity-Footnote-2177201
-Node: Leftmost Longest177309
-Node: Computed Regexps178510
-Node: Regexp Summary181882
-Node: Reading Files183353
-Node: Records185445
-Node: awk split records186188
-Node: gawk split records191046
-Ref: gawk split records-Footnote-1195567
-Node: Fields195604
-Ref: Fields-Footnote-1198568
-Node: Nonconstant Fields198654
-Ref: Nonconstant Fields-Footnote-1200884
-Node: Changing Fields201086
-Node: Field Separators207040
-Node: Default Field Splitting209742
-Node: Regexp Field Splitting210859
-Node: Single Character Fields214200
-Node: Command Line Field Separator215259
-Node: Full Line Fields218601
-Ref: Full Line Fields-Footnote-1219109
-Node: Field Splitting Summary219155
-Ref: Field Splitting Summary-Footnote-1222254
-Node: Constant Size222355
-Node: Splitting By Content226962
-Ref: Splitting By Content-Footnote-1230712
-Node: Multiple Line230752
-Ref: Multiple Line-Footnote-1236608
-Node: Getline236787
-Node: Plain Getline239003
-Node: Getline/Variable241098
-Node: Getline/File242245
-Node: Getline/Variable/File243629
-Ref: Getline/Variable/File-Footnote-1245228
-Node: Getline/Pipe245315
-Node: Getline/Variable/Pipe248014
-Node: Getline/Coprocess249121
-Node: Getline/Variable/Coprocess250373
-Node: Getline Notes251110
-Node: Getline Summary253914
-Ref: table-getline-variants254322
-Node: Read Timeout255234
-Ref: Read Timeout-Footnote-1259061
-Node: Command line directories259119
-Node: Input Summary260023
-Node: Input Exercises263160
-Node: Printing263893
-Node: Print265615
-Node: Print Examples266956
-Node: Output Separators269735
-Node: OFMT271751
-Node: Printf273109
-Node: Basic Printf274015
-Node: Control Letters275554
-Node: Format Modifiers279406
-Node: Printf Examples285433
-Node: Redirection287897
-Node: Special Files294869
-Node: Special FD295400
-Ref: Special FD-Footnote-1299024
-Node: Special Network299098
-Node: Special Caveats299948
-Node: Close Files And Pipes300744
-Ref: Close Files And Pipes-Footnote-1307905
-Ref: Close Files And Pipes-Footnote-2308053
-Node: Output Summary308203
-Node: Output exercises309200
-Node: Expressions309880
-Node: Values311065
-Node: Constants311741
-Node: Scalar Constants312421
-Ref: Scalar Constants-Footnote-1313280
-Node: Nondecimal-numbers313530
-Node: Regexp Constants316530
-Node: Using Constant Regexps317005
-Node: Variables320075
-Node: Using Variables320730
-Node: Assignment Options322454
-Node: Conversion324329
-Node: Strings And Numbers324853
-Ref: Strings And Numbers-Footnote-1327915
-Node: Locale influences conversions328024
-Ref: table-locale-affects330741
-Node: All Operators331329
-Node: Arithmetic Ops331959
-Node: Concatenation334464
-Ref: Concatenation-Footnote-1337260
-Node: Assignment Ops337380
-Ref: table-assign-ops342363
-Node: Increment Ops343680
-Node: Truth Values and Conditions347118
-Node: Truth Values348201
-Node: Typing and Comparison349250
-Node: Variable Typing350043
-Ref: Variable Typing-Footnote-1353943
-Node: Comparison Operators354065
-Ref: table-relational-ops354475
-Node: POSIX String Comparison358025
-Ref: POSIX String Comparison-Footnote-1359109
-Node: Boolean Ops359247
-Ref: Boolean Ops-Footnote-1363317
-Node: Conditional Exp363408
-Node: Function Calls365135
-Node: Precedence369015
-Node: Locales372684
-Node: Expressions Summary374315
-Node: Patterns and Actions376856
-Node: Pattern Overview377972
-Node: Regexp Patterns379649
-Node: Expression Patterns380192
-Node: Ranges383973
-Node: BEGIN/END387079
-Node: Using BEGIN/END387841
-Ref: Using BEGIN/END-Footnote-1390577
-Node: I/O And BEGIN/END390683
-Node: BEGINFILE/ENDFILE392968
-Node: Empty395899
-Node: Using Shell Variables396216
-Node: Action Overview398499
-Node: Statements400826
-Node: If Statement402674
-Node: While Statement404172
-Node: Do Statement406216
-Node: For Statement407372
-Node: Switch Statement410524
-Node: Break Statement412627
-Node: Continue Statement414682
-Node: Next Statement416475
-Node: Nextfile Statement418865
-Node: Exit Statement421520
-Node: Built-in Variables423924
-Node: User-modified425051
-Ref: User-modified-Footnote-1432740
-Node: Auto-set432802
-Ref: Auto-set-Footnote-1445721
-Ref: Auto-set-Footnote-2445926
-Node: ARGC and ARGV445982
-Node: Pattern Action Summary449836
-Node: Arrays452059
-Node: Array Basics453608
-Node: Array Intro454434
-Ref: figure-array-elements456407
-Node: Reference to Elements458814
-Node: Assigning Elements461087
-Node: Array Example461578
-Node: Scanning an Array463310
-Node: Controlling Scanning466325
-Ref: Controlling Scanning-Footnote-1471498
-Node: Delete471814
-Ref: Delete-Footnote-1474579
-Node: Numeric Array Subscripts474636
-Node: Uninitialized Subscripts476819
-Node: Multidimensional478444
-Node: Multiscanning481537
-Node: Arrays of Arrays483126
-Node: Arrays Summary487789
-Node: Functions489894
-Node: Built-in490767
-Node: Calling Built-in491845
-Node: Numeric Functions493833
-Ref: Numeric Functions-Footnote-1497667
-Ref: Numeric Functions-Footnote-2498024
-Ref: Numeric Functions-Footnote-3498072
-Node: String Functions498341
-Ref: String Functions-Footnote-1521352
-Ref: String Functions-Footnote-2521481
-Ref: String Functions-Footnote-3521729
-Node: Gory Details521816
-Ref: table-sub-escapes523485
-Ref: table-sub-posix-92524839
-Ref: table-sub-proposed526190
-Ref: table-posix-sub527544
-Ref: table-gensub-escapes529089
-Ref: Gory Details-Footnote-1530265
-Ref: Gory Details-Footnote-2530316
-Node: I/O Functions530467
-Ref: I/O Functions-Footnote-1537590
-Node: Time Functions537737
-Ref: Time Functions-Footnote-1548201
-Ref: Time Functions-Footnote-2548269
-Ref: Time Functions-Footnote-3548427
-Ref: Time Functions-Footnote-4548538
-Ref: Time Functions-Footnote-5548650
-Ref: Time Functions-Footnote-6548877
-Node: Bitwise Functions549143
-Ref: table-bitwise-ops549705
-Ref: Bitwise Functions-Footnote-1553950
-Node: Type Functions554134
-Node: I18N Functions555276
-Node: User-defined556921
-Node: Definition Syntax557725
-Ref: Definition Syntax-Footnote-1562904
-Node: Function Example562973
-Ref: Function Example-Footnote-1565617
-Node: Function Caveats565639
-Node: Calling A Function566157
-Node: Variable Scope567112
-Node: Pass By Value/Reference570100
-Node: Return Statement573608
-Node: Dynamic Typing576592
-Node: Indirect Calls577521
-Node: Functions Summary587234
-Node: Library Functions589773
-Ref: Library Functions-Footnote-1593391
-Ref: Library Functions-Footnote-2593534
-Node: Library Names593705
-Ref: Library Names-Footnote-1597178
-Ref: Library Names-Footnote-2597398
-Node: General Functions597484
-Node: Strtonum Function598512
-Node: Assert Function601292
-Node: Round Function604618
-Node: Cliff Random Function606159
-Node: Ordinal Functions607175
-Ref: Ordinal Functions-Footnote-1610252
-Ref: Ordinal Functions-Footnote-2610504
-Node: Join Function610715
-Ref: Join Function-Footnote-1612486
-Node: Getlocaltime Function612686
-Node: Readfile Function616422
-Node: Data File Management618261
-Node: Filetrans Function618893
-Node: Rewind Function622962
-Node: File Checking624349
-Ref: File Checking-Footnote-1625481
-Node: Empty Files625682
-Node: Ignoring Assigns627661
-Node: Getopt Function629215
-Ref: Getopt Function-Footnote-1640518
-Node: Passwd Functions640721
-Ref: Passwd Functions-Footnote-1649700
-Node: Group Functions649788
-Ref: Group Functions-Footnote-1657729
-Node: Walking Arrays657942
-Node: Library Functions Summary659545
-Node: Library exercises660933
-Node: Sample Programs662213
-Node: Running Examples662983
-Node: Clones663711
-Node: Cut Program664935
-Node: Egrep Program674803
-Ref: Egrep Program-Footnote-1682774
-Node: Id Program682884
-Node: Split Program686548
-Ref: Split Program-Footnote-1690086
-Node: Tee Program690214
-Node: Uniq Program693021
-Node: Wc Program700451
-Ref: Wc Program-Footnote-1704716
-Node: Miscellaneous Programs704808
-Node: Dupword Program706021
-Node: Alarm Program708052
-Node: Translate Program712866
-Ref: Translate Program-Footnote-1717257
-Ref: Translate Program-Footnote-2717527
-Node: Labels Program717661
-Ref: Labels Program-Footnote-1721032
-Node: Word Sorting721116
-Node: History Sorting725159
-Node: Extract Program726995
-Node: Simple Sed734531
-Node: Igawk Program737593
-Ref: Igawk Program-Footnote-1751904
-Ref: Igawk Program-Footnote-2752105
-Node: Anagram Program752243
-Node: Signature Program755311
-Node: Programs Summary756558
-Node: Programs Exercises757773
-Node: Advanced Features761424
-Node: Nondecimal Data763372
-Node: Array Sorting764949
-Node: Controlling Array Traversal765646
-Node: Array Sorting Functions773926
-Ref: Array Sorting Functions-Footnote-1777833
-Node: Two-way I/O778027
-Ref: Two-way I/O-Footnote-1783543
-Node: TCP/IP Networking783625
-Node: Profiling786469
-Node: Advanced Features Summary794011
-Node: Internationalization795875
-Node: I18N and L10N797355
-Node: Explaining gettext798041
-Ref: Explaining gettext-Footnote-1803181
-Ref: Explaining gettext-Footnote-2803365
-Node: Programmer i18n803530
-Node: Translator i18n807755
-Node: String Extraction808549
-Ref: String Extraction-Footnote-1809510
-Node: Printf Ordering809596
-Ref: Printf Ordering-Footnote-1812378
-Node: I18N Portability812442
-Ref: I18N Portability-Footnote-1814891
-Node: I18N Example814954
-Ref: I18N Example-Footnote-1817676
-Node: Gawk I18N817748
-Node: I18N Summary818386
-Node: Debugger819725
-Node: Debugging820747
-Node: Debugging Concepts821188
-Node: Debugging Terms823044
-Node: Awk Debugging825641
-Node: Sample Debugging Session826533
-Node: Debugger Invocation827053
-Node: Finding The Bug828386
-Node: List of Debugger Commands834868
-Node: Breakpoint Control836200
-Node: Debugger Execution Control839864
-Node: Viewing And Changing Data843224
-Node: Execution Stack846582
-Node: Debugger Info848095
-Node: Miscellaneous Debugger Commands852089
-Node: Readline Support857273
-Node: Limitations858165
-Node: Debugging Summary860439
-Node: Arbitrary Precision Arithmetic861603
-Node: Computer Arithmetic862932
-Ref: Computer Arithmetic-Footnote-1867319
-Node: Math Definitions867376
-Ref: table-ieee-formats870260
-Node: MPFR features870764
-Node: FP Math Caution872406
-Ref: FP Math Caution-Footnote-1873447
-Node: Inexactness of computations873816
-Node: Inexact representation874764
-Node: Comparing FP Values876119
-Node: Errors accumulate877083
-Node: Getting Accuracy878516
-Node: Try To Round881175
-Node: Setting precision882074
-Ref: table-predefined-precision-strings882756
-Node: Setting the rounding mode884549
-Ref: table-gawk-rounding-modes884913
-Ref: Setting the rounding mode-Footnote-1888367
-Node: Arbitrary Precision Integers888546
-Ref: Arbitrary Precision Integers-Footnote-1891549
-Node: POSIX Floating Point Problems891698
-Ref: POSIX Floating Point Problems-Footnote-1895574
-Node: Floating point summary895612
-Node: Dynamic Extensions897829
-Node: Extension Intro899381
-Node: Plugin License900646
-Node: Extension Mechanism Outline901331
-Ref: figure-load-extension901755
-Ref: figure-load-new-function903240
-Ref: figure-call-new-function904242
-Node: Extension API Description906226
-Node: Extension API Functions Introduction907676
-Node: General Data Types912541
-Ref: General Data Types-Footnote-1918234
-Node: Requesting Values918533
-Ref: table-value-types-returned919270
-Node: Memory Allocation Functions920228
-Ref: Memory Allocation Functions-Footnote-1922975
-Node: Constructor Functions923071
-Node: Registration Functions924829
-Node: Extension Functions925514
-Node: Exit Callback Functions927816
-Node: Extension Version String929065
-Node: Input Parsers929715
-Node: Output Wrappers939518
-Node: Two-way processors944034
-Node: Printing Messages946238
-Ref: Printing Messages-Footnote-1947315
-Node: Updating `ERRNO'947467
-Node: Accessing Parameters948206
-Node: Symbol Table Access949436
-Node: Symbol table by name949950
-Node: Symbol table by cookie951926
-Ref: Symbol table by cookie-Footnote-1956059
-Node: Cached values956122
-Ref: Cached values-Footnote-1959626
-Node: Array Manipulation959717
-Ref: Array Manipulation-Footnote-1960815
-Node: Array Data Types960854
-Ref: Array Data Types-Footnote-1963557
-Node: Array Functions963649
-Node: Flattening Arrays967523
-Node: Creating Arrays974375
-Node: Extension API Variables979106
-Node: Extension Versioning979742
-Node: Extension API Informational Variables981643
-Node: Extension API Boilerplate982729
-Node: Finding Extensions986533
-Node: Extension Example987093
-Node: Internal File Description987823
-Node: Internal File Ops991914
-Ref: Internal File Ops-Footnote-11003346
-Node: Using Internal File Ops1003486
-Ref: Using Internal File Ops-Footnote-11005833
-Node: Extension Samples1006101
-Node: Extension Sample File Functions1007625
-Node: Extension Sample Fnmatch1015193
-Node: Extension Sample Fork1016675
-Node: Extension Sample Inplace1017888
-Node: Extension Sample Ord1019563
-Node: Extension Sample Readdir1020399
-Ref: table-readdir-file-types1021255
-Node: Extension Sample Revout1022054
-Node: Extension Sample Rev2way1022645
-Node: Extension Sample Read write array1023386
-Node: Extension Sample Readfile1025265
-Node: Extension Sample API Tests1026365
-Node: Extension Sample Time1026890
-Node: gawkextlib1028205
-Node: Extension summary1031018
-Node: Extension Exercises1034711
-Node: Language History1035433
-Node: V7/SVR3.11037076
-Node: SVR41039396
-Node: POSIX1040838
-Node: BTL1042224
-Node: POSIX/GNU1042958
-Node: Feature History1048557
-Node: Common Extensions1061687
-Node: Ranges and Locales1062999
-Ref: Ranges and Locales-Footnote-11067616
-Ref: Ranges and Locales-Footnote-21067643
-Ref: Ranges and Locales-Footnote-31067877
-Node: Contributors1068098
-Node: History summary1073523
-Node: Installation1074892
-Node: Gawk Distribution1075843
-Node: Getting1076327
-Node: Extracting1077151
-Node: Distribution contents1078793
-Node: Unix Installation1084510
-Node: Quick Installation1085127
-Node: Additional Configuration Options1087569
-Node: Configuration Philosophy1089307
-Node: Non-Unix Installation1091658
-Node: PC Installation1092116
-Node: PC Binary Installation1093427
-Node: PC Compiling1095275
-Ref: PC Compiling-Footnote-11098274
-Node: PC Testing1098379
-Node: PC Using1099555
-Node: Cygwin1103713
-Node: MSYS1104522
-Node: VMS Installation1105036
-Node: VMS Compilation1105832
-Ref: VMS Compilation-Footnote-11107054
-Node: VMS Dynamic Extensions1107112
-Node: VMS Installation Details1108485
-Node: VMS Running1110737
-Node: VMS GNV1113571
-Node: VMS Old Gawk1114294
-Node: Bugs1114764
-Node: Other Versions1118768
-Node: Installation summary1125023
-Node: Notes1126079
-Node: Compatibility Mode1126944
-Node: Additions1127726
-Node: Accessing The Source1128651
-Node: Adding Code1130087
-Node: New Ports1136265
-Node: Derived Files1140746
-Ref: Derived Files-Footnote-11145827
-Ref: Derived Files-Footnote-21145861
-Ref: Derived Files-Footnote-31146457
-Node: Future Extensions1146571
-Node: Implementation Limitations1147177
-Node: Extension Design1148425
-Node: Old Extension Problems1149579
-Ref: Old Extension Problems-Footnote-11151096
-Node: Extension New Mechanism Goals1151153
-Ref: Extension New Mechanism Goals-Footnote-11154513
-Node: Extension Other Design Decisions1154702
-Node: Extension Future Growth1156808
-Node: Old Extension Mechanism1157644
-Node: Notes summary1159406
-Node: Basic Concepts1160592
-Node: Basic High Level1161273
-Ref: figure-general-flow1161545
-Ref: figure-process-flow1162144
-Ref: Basic High Level-Footnote-11165373
-Node: Basic Data Typing1165558
-Node: Glossary1168886
-Node: Copying1194038
-Node: GNU Free Documentation License1231594
-Node: Index1256730
+Node: Top1204
+Node: Foreword41858
+Node: Preface46203
+Ref: Preface-Footnote-149350
+Ref: Preface-Footnote-249457
+Node: History49689
+Node: Names52063
+Ref: Names-Footnote-153527
+Node: This Manual53600
+Ref: This Manual-Footnote-159379
+Node: Conventions59479
+Node: Manual History61635
+Ref: Manual History-Footnote-165074
+Ref: Manual History-Footnote-265115
+Node: How To Contribute65189
+Node: Acknowledgments66428
+Node: Getting Started70724
+Node: Running gawk73158
+Node: One-shot74348
+Node: Read Terminal75573
+Ref: Read Terminal-Footnote-177223
+Ref: Read Terminal-Footnote-277499
+Node: Long77670
+Node: Executable Scripts79046
+Ref: Executable Scripts-Footnote-180879
+Ref: Executable Scripts-Footnote-280981
+Node: Comments81528
+Node: Quoting84001
+Node: DOS Quoting89317
+Node: Sample Data Files89992
+Node: Very Simple92507
+Node: Two Rules97145
+Node: More Complex99039
+Ref: More Complex-Footnote-1101971
+Node: Statements/Lines102056
+Ref: Statements/Lines-Footnote-1106512
+Node: Other Features106777
+Node: When107705
+Node: Intro Summary109875
+Node: Invoking Gawk110641
+Node: Command Line112156
+Node: Options112947
+Ref: Options-Footnote-1128647
+Node: Other Arguments128672
+Node: Naming Standard Input131334
+Node: Environment Variables132428
+Node: AWKPATH Variable132986
+Ref: AWKPATH Variable-Footnote-1135858
+Ref: AWKPATH Variable-Footnote-2135903
+Node: AWKLIBPATH Variable136163
+Node: Other Environment Variables136922
+Node: Exit Status140372
+Node: Include Files141047
+Node: Loading Shared Libraries144625
+Node: Obsolete146009
+Node: Undocumented146706
+Node: Invoking Summary146973
+Node: Regexp148553
+Node: Regexp Usage150003
+Node: Escape Sequences152036
+Node: Regexp Operators157703
+Ref: Regexp Operators-Footnote-1165183
+Ref: Regexp Operators-Footnote-2165330
+Node: Bracket Expressions165428
+Ref: table-char-classes167318
+Node: GNU Regexp Operators170258
+Node: Case-sensitivity173981
+Ref: Case-sensitivity-Footnote-1176873
+Ref: Case-sensitivity-Footnote-2177108
+Node: Leftmost Longest177216
+Node: Computed Regexps178417
+Node: Regexp Summary181789
+Node: Reading Files183260
+Node: Records185352
+Node: awk split records186095
+Node: gawk split records190953
+Ref: gawk split records-Footnote-1195474
+Node: Fields195511
+Ref: Fields-Footnote-1198475
+Node: Nonconstant Fields198561
+Ref: Nonconstant Fields-Footnote-1200791
+Node: Changing Fields200993
+Node: Field Separators206947
+Node: Default Field Splitting209649
+Node: Regexp Field Splitting210766
+Node: Single Character Fields214107
+Node: Command Line Field Separator215166
+Node: Full Line Fields218508
+Ref: Full Line Fields-Footnote-1219016
+Node: Field Splitting Summary219062
+Ref: Field Splitting Summary-Footnote-1222161
+Node: Constant Size222262
+Node: Splitting By Content226869
+Ref: Splitting By Content-Footnote-1230619
+Node: Multiple Line230659
+Ref: Multiple Line-Footnote-1236515
+Node: Getline236694
+Node: Plain Getline238910
+Node: Getline/Variable241005
+Node: Getline/File242152
+Node: Getline/Variable/File243536
+Ref: Getline/Variable/File-Footnote-1245135
+Node: Getline/Pipe245222
+Node: Getline/Variable/Pipe247921
+Node: Getline/Coprocess249028
+Node: Getline/Variable/Coprocess250280
+Node: Getline Notes251017
+Node: Getline Summary253821
+Ref: table-getline-variants254229
+Node: Read Timeout255141
+Ref: Read Timeout-Footnote-1258968
+Node: Command line directories259026
+Node: Input Summary259930
+Node: Input Exercises263067
+Node: Printing263800
+Node: Print265522
+Node: Print Examples266863
+Node: Output Separators269642
+Node: OFMT271658
+Node: Printf273016
+Node: Basic Printf273922
+Node: Control Letters275461
+Node: Format Modifiers279313
+Node: Printf Examples285340
+Node: Redirection287804
+Node: Special Files294776
+Node: Special FD295307
+Ref: Special FD-Footnote-1298931
+Node: Special Network299005
+Node: Special Caveats299855
+Node: Close Files And Pipes300651
+Ref: Close Files And Pipes-Footnote-1307812
+Ref: Close Files And Pipes-Footnote-2307960
+Node: Output Summary308110
+Node: Output exercises309107
+Node: Expressions309787
+Node: Values310972
+Node: Constants311648
+Node: Scalar Constants312328
+Ref: Scalar Constants-Footnote-1313187
+Node: Nondecimal-numbers313437
+Node: Regexp Constants316437
+Node: Using Constant Regexps316912
+Node: Variables319982
+Node: Using Variables320637
+Node: Assignment Options322361
+Node: Conversion324236
+Node: Strings And Numbers324760
+Ref: Strings And Numbers-Footnote-1327822
+Node: Locale influences conversions327931
+Ref: table-locale-affects330648
+Node: All Operators331236
+Node: Arithmetic Ops331866
+Node: Concatenation334371
+Ref: Concatenation-Footnote-1337167
+Node: Assignment Ops337287
+Ref: table-assign-ops342270
+Node: Increment Ops343587
+Node: Truth Values and Conditions347025
+Node: Truth Values348108
+Node: Typing and Comparison349157
+Node: Variable Typing349950
+Ref: Variable Typing-Footnote-1353850
+Node: Comparison Operators353972
+Ref: table-relational-ops354382
+Node: POSIX String Comparison357932
+Ref: POSIX String Comparison-Footnote-1359016
+Node: Boolean Ops359154
+Ref: Boolean Ops-Footnote-1363224
+Node: Conditional Exp363315
+Node: Function Calls365042
+Node: Precedence368922
+Node: Locales372591
+Node: Expressions Summary374222
+Node: Patterns and Actions376763
+Node: Pattern Overview377879
+Node: Regexp Patterns379556
+Node: Expression Patterns380099
+Node: Ranges383880
+Node: BEGIN/END386986
+Node: Using BEGIN/END387748
+Ref: Using BEGIN/END-Footnote-1390484
+Node: I/O And BEGIN/END390590
+Node: BEGINFILE/ENDFILE392875
+Node: Empty395806
+Node: Using Shell Variables396123
+Node: Action Overview398406
+Node: Statements400733
+Node: If Statement402581
+Node: While Statement404079
+Node: Do Statement406123
+Node: For Statement407279
+Node: Switch Statement410431
+Node: Break Statement412534
+Node: Continue Statement414589
+Node: Next Statement416382
+Node: Nextfile Statement418772
+Node: Exit Statement421427
+Node: Built-in Variables423831
+Node: User-modified424958
+Ref: User-modified-Footnote-1432647
+Node: Auto-set432709
+Ref: Auto-set-Footnote-1445628
+Ref: Auto-set-Footnote-2445833
+Node: ARGC and ARGV445889
+Node: Pattern Action Summary449743
+Node: Arrays451966
+Node: Array Basics453515
+Node: Array Intro454341
+Ref: figure-array-elements456314
+Node: Reference to Elements458721
+Node: Assigning Elements460994
+Node: Array Example461485
+Node: Scanning an Array463217
+Node: Controlling Scanning466232
+Ref: Controlling Scanning-Footnote-1471405
+Node: Delete471721
+Ref: Delete-Footnote-1474486
+Node: Numeric Array Subscripts474543
+Node: Uninitialized Subscripts476726
+Node: Multidimensional478351
+Node: Multiscanning481444
+Node: Arrays of Arrays483033
+Node: Arrays Summary487696
+Node: Functions489801
+Node: Built-in490674
+Node: Calling Built-in491752
+Node: Numeric Functions493740
+Ref: Numeric Functions-Footnote-1498318
+Ref: Numeric Functions-Footnote-2498675
+Ref: Numeric Functions-Footnote-3498723
+Node: String Functions498992
+Ref: String Functions-Footnote-1522003
+Ref: String Functions-Footnote-2522132
+Ref: String Functions-Footnote-3522380
+Node: Gory Details522467
+Ref: table-sub-escapes524136
+Ref: table-sub-posix-92525490
+Ref: table-sub-proposed526841
+Ref: table-posix-sub528195
+Ref: table-gensub-escapes529740
+Ref: Gory Details-Footnote-1530916
+Ref: Gory Details-Footnote-2530967
+Node: I/O Functions531118
+Ref: I/O Functions-Footnote-1538241
+Node: Time Functions538388
+Ref: Time Functions-Footnote-1548852
+Ref: Time Functions-Footnote-2548920
+Ref: Time Functions-Footnote-3549078
+Ref: Time Functions-Footnote-4549189
+Ref: Time Functions-Footnote-5549301
+Ref: Time Functions-Footnote-6549528
+Node: Bitwise Functions549794
+Ref: table-bitwise-ops550356
+Ref: Bitwise Functions-Footnote-1554601
+Node: Type Functions554785
+Node: I18N Functions555927
+Node: User-defined557572
+Node: Definition Syntax558376
+Ref: Definition Syntax-Footnote-1563555
+Node: Function Example563624
+Ref: Function Example-Footnote-1566268
+Node: Function Caveats566290
+Node: Calling A Function566808
+Node: Variable Scope567763
+Node: Pass By Value/Reference570751
+Node: Return Statement574259
+Node: Dynamic Typing577243
+Node: Indirect Calls578172
+Node: Functions Summary587885
+Node: Library Functions590424
+Ref: Library Functions-Footnote-1594042
+Ref: Library Functions-Footnote-2594185
+Node: Library Names594356
+Ref: Library Names-Footnote-1597829
+Ref: Library Names-Footnote-2598049
+Node: General Functions598135
+Node: Strtonum Function599163
+Node: Assert Function601943
+Node: Round Function605269
+Node: Cliff Random Function606810
+Node: Ordinal Functions607826
+Ref: Ordinal Functions-Footnote-1610903
+Ref: Ordinal Functions-Footnote-2611155
+Node: Join Function611366
+Ref: Join Function-Footnote-1613137
+Node: Getlocaltime Function613337
+Node: Readfile Function617073
+Node: Data File Management618912
+Node: Filetrans Function619544
+Node: Rewind Function623613
+Node: File Checking625000
+Ref: File Checking-Footnote-1626132
+Node: Empty Files626333
+Node: Ignoring Assigns628312
+Node: Getopt Function629866
+Ref: Getopt Function-Footnote-1641169
+Node: Passwd Functions641372
+Ref: Passwd Functions-Footnote-1650351
+Node: Group Functions650439
+Ref: Group Functions-Footnote-1658380
+Node: Walking Arrays658593
+Node: Library Functions Summary660196
+Node: Library exercises661584
+Node: Sample Programs662864
+Node: Running Examples663634
+Node: Clones664362
+Node: Cut Program665586
+Node: Egrep Program675454
+Ref: Egrep Program-Footnote-1683425
+Node: Id Program683535
+Node: Split Program687199
+Ref: Split Program-Footnote-1690737
+Node: Tee Program690865
+Node: Uniq Program693672
+Node: Wc Program701102
+Ref: Wc Program-Footnote-1705367
+Node: Miscellaneous Programs705459
+Node: Dupword Program706672
+Node: Alarm Program708703
+Node: Translate Program713517
+Ref: Translate Program-Footnote-1717908
+Ref: Translate Program-Footnote-2718178
+Node: Labels Program718312
+Ref: Labels Program-Footnote-1721683
+Node: Word Sorting721767
+Node: History Sorting725810
+Node: Extract Program727646
+Node: Simple Sed735182
+Node: Igawk Program738244
+Ref: Igawk Program-Footnote-1752555
+Ref: Igawk Program-Footnote-2752756
+Node: Anagram Program752894
+Node: Signature Program755962
+Node: Programs Summary757209
+Node: Programs Exercises758424
+Node: Advanced Features762075
+Node: Nondecimal Data764023
+Node: Array Sorting765600
+Node: Controlling Array Traversal766297
+Node: Array Sorting Functions774577
+Ref: Array Sorting Functions-Footnote-1778484
+Node: Two-way I/O778678
+Ref: Two-way I/O-Footnote-1784194
+Node: TCP/IP Networking784276
+Node: Profiling787120
+Node: Advanced Features Summary794671
+Node: Internationalization796535
+Node: I18N and L10N798015
+Node: Explaining gettext798701
+Ref: Explaining gettext-Footnote-1803841
+Ref: Explaining gettext-Footnote-2804025
+Node: Programmer i18n804190
+Node: Translator i18n808415
+Node: String Extraction809209
+Ref: String Extraction-Footnote-1810170
+Node: Printf Ordering810256
+Ref: Printf Ordering-Footnote-1813038
+Node: I18N Portability813102
+Ref: I18N Portability-Footnote-1815551
+Node: I18N Example815614
+Ref: I18N Example-Footnote-1818336
+Node: Gawk I18N818408
+Node: I18N Summary819046
+Node: Debugger820385
+Node: Debugging821407
+Node: Debugging Concepts821848
+Node: Debugging Terms823704
+Node: Awk Debugging826301
+Node: Sample Debugging Session827193
+Node: Debugger Invocation827713
+Node: Finding The Bug829046
+Node: List of Debugger Commands835528
+Node: Breakpoint Control836860
+Node: Debugger Execution Control840524
+Node: Viewing And Changing Data843884
+Node: Execution Stack847242
+Node: Debugger Info848755
+Node: Miscellaneous Debugger Commands852749
+Node: Readline Support857933
+Node: Limitations858825
+Node: Debugging Summary861099
+Node: Arbitrary Precision Arithmetic862263
+Node: Computer Arithmetic863592
+Ref: Computer Arithmetic-Footnote-1867979
+Node: Math Definitions868036
+Ref: table-ieee-formats870920
+Node: MPFR features871424
+Node: FP Math Caution873066
+Ref: FP Math Caution-Footnote-1874107
+Node: Inexactness of computations874476
+Node: Inexact representation875424
+Node: Comparing FP Values876779
+Node: Errors accumulate877743
+Node: Getting Accuracy879176
+Node: Try To Round881835
+Node: Setting precision882734
+Ref: table-predefined-precision-strings883416
+Node: Setting the rounding mode885209
+Ref: table-gawk-rounding-modes885573
+Ref: Setting the rounding mode-Footnote-1889027
+Node: Arbitrary Precision Integers889206
+Ref: Arbitrary Precision Integers-Footnote-1893001
+Node: POSIX Floating Point Problems893150
+Ref: POSIX Floating Point Problems-Footnote-1897026
+Node: Floating point summary897064
+Node: Dynamic Extensions899281
+Node: Extension Intro900833
+Node: Plugin License902098
+Node: Extension Mechanism Outline902783
+Ref: figure-load-extension903207
+Ref: figure-load-new-function904692
+Ref: figure-call-new-function905694
+Node: Extension API Description907678
+Node: Extension API Functions Introduction909128
+Node: General Data Types913993
+Ref: General Data Types-Footnote-1919686
+Node: Requesting Values919985
+Ref: table-value-types-returned920722
+Node: Memory Allocation Functions921680
+Ref: Memory Allocation Functions-Footnote-1924427
+Node: Constructor Functions924523
+Node: Registration Functions926281
+Node: Extension Functions926966
+Node: Exit Callback Functions929268
+Node: Extension Version String930517
+Node: Input Parsers931167
+Node: Output Wrappers940970
+Node: Two-way processors945486
+Node: Printing Messages947690
+Ref: Printing Messages-Footnote-1948767
+Node: Updating `ERRNO'948919
+Node: Accessing Parameters949658
+Node: Symbol Table Access950888
+Node: Symbol table by name951402
+Node: Symbol table by cookie953378
+Ref: Symbol table by cookie-Footnote-1957511
+Node: Cached values957574
+Ref: Cached values-Footnote-1961078
+Node: Array Manipulation961169
+Ref: Array Manipulation-Footnote-1962267
+Node: Array Data Types962306
+Ref: Array Data Types-Footnote-1965009
+Node: Array Functions965101
+Node: Flattening Arrays968975
+Node: Creating Arrays975827
+Node: Extension API Variables980558
+Node: Extension Versioning981194
+Node: Extension API Informational Variables983095
+Node: Extension API Boilerplate984181
+Node: Finding Extensions987985
+Node: Extension Example988545
+Node: Internal File Description989275
+Node: Internal File Ops993366
+Ref: Internal File Ops-Footnote-11004798
+Node: Using Internal File Ops1004938
+Ref: Using Internal File Ops-Footnote-11007285
+Node: Extension Samples1007553
+Node: Extension Sample File Functions1009077
+Node: Extension Sample Fnmatch1016645
+Node: Extension Sample Fork1018127
+Node: Extension Sample Inplace1019340
+Node: Extension Sample Ord1021015
+Node: Extension Sample Readdir1021851
+Ref: table-readdir-file-types1022707
+Node: Extension Sample Revout1023506
+Node: Extension Sample Rev2way1024097
+Node: Extension Sample Read write array1024838
+Node: Extension Sample Readfile1026717
+Node: Extension Sample API Tests1027817
+Node: Extension Sample Time1028342
+Node: gawkextlib1029657
+Node: Extension summary1032470
+Node: Extension Exercises1036163
+Node: Language History1036885
+Node: V7/SVR3.11038528
+Node: SVR41040848
+Node: POSIX1042290
+Node: BTL1043676
+Node: POSIX/GNU1044410
+Node: Feature History1050009
+Node: Common Extensions1063139
+Node: Ranges and Locales1064451
+Ref: Ranges and Locales-Footnote-11069068
+Ref: Ranges and Locales-Footnote-21069095
+Ref: Ranges and Locales-Footnote-31069329
+Node: Contributors1069550
+Node: History summary1074975
+Node: Installation1076344
+Node: Gawk Distribution1077295
+Node: Getting1077779
+Node: Extracting1078603
+Node: Distribution contents1080245
+Node: Unix Installation1086015
+Node: Quick Installation1086632
+Node: Additional Configuration Options1089074
+Node: Configuration Philosophy1090812
+Node: Non-Unix Installation1093163
+Node: PC Installation1093621
+Node: PC Binary Installation1094932
+Node: PC Compiling1096780
+Ref: PC Compiling-Footnote-11099779
+Node: PC Testing1099884
+Node: PC Using1101060
+Node: Cygwin1105218
+Node: MSYS1106027
+Node: VMS Installation1106541
+Node: VMS Compilation1107337
+Ref: VMS Compilation-Footnote-11108559
+Node: VMS Dynamic Extensions1108617
+Node: VMS Installation Details1109990
+Node: VMS Running1112242
+Node: VMS GNV1115076
+Node: VMS Old Gawk1115799
+Node: Bugs1116269
+Node: Other Versions1120273
+Node: Installation summary1126528
+Node: Notes1127584
+Node: Compatibility Mode1128449
+Node: Additions1129231
+Node: Accessing The Source1130156
+Node: Adding Code1131592
+Node: New Ports1137770
+Node: Derived Files1142251
+Ref: Derived Files-Footnote-11147332
+Ref: Derived Files-Footnote-21147366
+Ref: Derived Files-Footnote-31147962
+Node: Future Extensions1148076
+Node: Implementation Limitations1148682
+Node: Extension Design1149930
+Node: Old Extension Problems1151084
+Ref: Old Extension Problems-Footnote-11152601
+Node: Extension New Mechanism Goals1152658
+Ref: Extension New Mechanism Goals-Footnote-11156018
+Node: Extension Other Design Decisions1156207
+Node: Extension Future Growth1158313
+Node: Old Extension Mechanism1159149
+Node: Notes summary1160911
+Node: Basic Concepts1162097
+Node: Basic High Level1162778
+Ref: figure-general-flow1163050
+Ref: figure-process-flow1163649
+Ref: Basic High Level-Footnote-11166878
+Node: Basic Data Typing1167063
+Node: Glossary1170391
+Node: Copying1195543
+Node: GNU Free Documentation License1233099
+Node: Index1258235

End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index f8fc1269..d6db2018 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -51,7 +51,7 @@
@c applies to and all the info about who's publishing this edition
@c These apply across the board.
-@set UPDATE-MONTH June, 2014
+@set UPDATE-MONTH July, 2014
@set VERSION 4.1
@set PATCHLEVEL 1
@@ -286,19 +286,24 @@ implementation of AWK.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
-Invariant Sections being ``GNU General Public License'', the Front-Cover
-texts being (a) (see below), and with the Back-Cover Texts being (b)
-(see below). A copy of the license is included in the section entitled
+Invariant Sections being ``GNU General Public License'', with the
+Front-Cover Texts being ``A GNU Manual'', and with the Back-Cover Texts
+as in (a) below.
+@ifclear FOR_PRINT
+A copy of the license is included in the section entitled
``GNU Free Documentation License''.
+@end ifclear
+@ifset FOR_PRINT
+A copy of the license
+may be found on the Internet at
+@uref{http://www.gnu.org/software/gawk/manual/html_node/GNU-Free-Documentation-License.html,
+the GNU Project's web site}.
+@end ifset
@enumerate a
@item
-``A GNU Manual''
-
-@item
-``You have the freedom to
-copy and modify this GNU manual. Buying copies from the FSF
-supports it in developing GNU and promoting software freedom.''
+The FSF's Back-Cover Text is: ``You have the freedom to
+copy and modify this GNU manual.''
@end enumerate
@end copying
@@ -1605,7 +1610,8 @@ the @command{gawk} source code and this @value{DOCUMENT}, respectively.
It contains the following appendices:
@end ifclear
@ifset FOR_PRINT
-Part IV provides the following appendices:
+Part IV provides the following appendices,
+including the GNU General Public License:
@end ifset
@ref{Language History},
@@ -1622,6 +1628,10 @@ in @command{gawk} and where to get other freely
available @command{awk} implementations.
@ifset FOR_PRINT
+
+@ref{Copying},
+presents the license that covers the @command{gawk} source code.
+
The version of this @value{DOCUMENT} distributed with @command{gawk}
contains additional appendices and other end material.
To save space, we have omitted them from the
@@ -1644,10 +1654,9 @@ defines most, if not all, the significant terms used
throughout the @value{DOCUMENT}. If you find terms that you aren't familiar with,
try looking them up here.
-@uref{http://www.gnu.org/software/gawk/manual/html_node/Copying.html, The GNU GPL} and
-@uref{http://www.gnu.org/software/gawk/manual/html_node/GNU-Free-Documentation-License.html, the GNU FDL}
-are the licenses that cover the @command{gawk} source code
-and this @value{DOCUMENT}, respectively.
+@uref{http://www.gnu.org/software/gawk/manual/html_node/GNU-Free-Documentation-License.html,
+The GNU FDL}
+is the license that covers this @value{DOCUMENT}.
@end ifset
@ifclear FOR_PRINT
@@ -3849,10 +3858,8 @@ No space is allowed between the @option{-o} and @var{file}, if
@var{file} is supplied.
@quotation NOTE
-Due to the way @command{gawk} has evolved, with this option
-your program is still executed. This will change in the
-next major release such that @command{gawk} will only
-pretty-print the program and not run it.
+In the past, this option would also execute your program.
+This is no longer the case.
@end quotation
@item @option{-O}
@@ -4338,11 +4345,6 @@ two regexp matchers that @command{gawk} uses internally. (There aren't
supposed to be differences, but occasionally theory and practice don't
coordinate with each other.)
-@item GAWK_NO_PP_RUN
-If this variable exists, then when invoked with the @option{--pretty-print}
-option, @command{gawk} skips running the program. This variable will
-not survive into the next major release.
-
@item GAWK_STACKSIZE
This specifies the amount by which @command{gawk} should grow its
internal evaluation stack, when needed.
@@ -5448,6 +5450,17 @@ With the POSIX character classes, you can write
@code{/[[:alnum:]]/} to match the alphabetic
and numeric characters in your character set.
+@c Thanks to
+@c Date: Tue, 01 Jul 2014 07:39:51 +0200
+@c From: Hermann Peifer <peifer@gmx.eu>
+Some utilities that match regular expressions provide a non-standard
+@code{[:ascii:]} character class; @command{awk} does not. However, you
+can simulate such a construct using @code{[\x00-\x7F]}. This matches
+all values numerically between zero and 127, which is the defined
+range of the ASCII character set. Use a complemented character list
+(@code{[^\x00-\x7F]}) to match any single-byte characters that are not
+in the ASCII range.
+
@cindex bracket expressions, collating elements
@cindex bracket expressions, non-ASCII
@cindex collating elements
@@ -16601,6 +16614,22 @@ You can use @samp{pi = atan2(0, -1)} to retrieve the value of
@cindex cosine
Return the cosine of @var{x}, with @var{x} in radians.
+@item @code{div(@var{numerator}, @var{denominator}, @var{result})}
+@cindexawkfunc{div}
+@cindex div
+Perform integer division, similar to the standard C function of the
+same name. First, truncate @code{numerator} and @code{denominator}
+to integers. Clear the @code{result} array, and then set
+@code{result["quotient"]} to the result of @samp{numerator / denominator},
+truncated to an integer, and set @code{result["remainder"]} to the result
+of @samp{numerator % denominator}, truncated to an integer.
+This function is primarily intended for use with arbitrary length
+integers; it avoids creating MPFR arbitrary precision floating-point
+values (@pxref{Arbitrary Precision Integers}).
+
+This function is a @code{gawk} extension. It is not available in
+compatibility mode (@pxref{Options}).
+
@item @code{exp(@var{x})}
@cindexawkfunc{exp}
@cindex exponent
@@ -27510,8 +27539,8 @@ When called this way, @command{gawk} ``pretty prints'' the program into
@file{awkprof.out}, without any execution counts.
@quotation NOTE
-The @option{--pretty-print} option still runs your program.
-This will change in the next major release.
+Once upon a time, the @option{--pretty-print} option would also run
+your program. This is is no longer the case.
@end quotation
@c ENDOFRANGE awkp
@c ENDOFRANGE proawk
@@ -30510,6 +30539,32 @@ to just use the following:
gawk -M 'BEGIN @{ n = 13; print n % 2 @}'
@end example
+When dividing two arbitrary precision integers with either
+@samp{/} or @samp{%}, the result is typically an arbitrary
+precision floating point value (unless the denominator evenly
+divides into the numerator). In order to do integer division
+or remainder with arbitrary precision integers, use the built-in
+@code{div()} function (@pxref{Numeric Functions}).
+
+You can simulate the @code{div()} function in standard @command{awk}
+using this user-defined function:
+
+@example
+# div --- do integer division
+
+function div(numerator, denominator, result, i)
+@{
+ split("", result)
+
+ numerator = int(numerator)
+ denominator = int(denominator)
+ result["quotient"] = int(numerator / denominator)
+ result["remainder"] = int(numerator % denominator)
+
+ return 0.0
+@}
+@end example
+
@node POSIX Floating Point Problems
@section Standards Versus Existing Practice
@@ -34680,13 +34735,14 @@ Write a wrapper script that provides an interface similar to
@ifdocbook
@ifclear FOR_PRINT
-Part IV contains the appendixes (including the two licenses that cover
+Part IV contains the appendices (including the two licenses that cover
the @command{gawk} source code and this @value{DOCUMENT}, respectively)
and the Glossary:
@end ifclear
@ifset FOR_PRINT
-Part IV contains two appendixes:
+Part IV contains two appendices and the license that
+covers the @command{gawk} source code:
@end ifset
@itemize @value{BULLET}
@@ -34705,10 +34761,12 @@ Part IV contains two appendixes:
@item
@ref{Glossary}.
+@end ifclear
@item
@ref{Copying}.
+@ifclear FOR_PRINT
@item
@ref{GNU Free Documentation License}.
@end ifclear
@@ -36600,6 +36658,8 @@ The generated Info file for
The @command{troff} source for a manual page describing the @command{igawk}
program presented in
@ref{Igawk Program}.
+(Since @command{gawk} can do its own @code{@@include} processing,
+neither @command{igawk} nor @file{igawk.1} are installed.)
@item doc/Makefile.in
The input file used during the configuration process to generate the
@@ -36644,8 +36704,6 @@ source file for this @value{DOCUMENT}. It also contains a @file{Makefile.in} fil
@file{Makefile.am} is used by GNU Automake to create @file{Makefile.in}.
The library functions from
@ref{Library Functions},
-and the @command{igawk} program from
-@ref{Igawk Program},
are included as ready-to-use files in the @command{gawk} distribution.
They are installed as part of the installation process.
The rest of the programs in this @value{DOCUMENT} are available in appropriate
@@ -39981,6 +40039,8 @@ A sequence of space, TAB, or newline characters occurring inside an input
record or a string.
@end table
+@end ifclear
+
@c The GNU General Public License.
@node Copying
@unnumbered GNU General Public License
@@ -40710,7 +40770,7 @@ applications with the library. If this is what you want to do, use
the GNU Lesser General Public License instead of this License. But
first, please read @url{http://www.gnu.org/philosophy/why-not-lgpl.html}.
-
+@ifclear FOR_PRINT
@c The GNU Free Documentation License.
@node GNU Free Documentation License
@unnumbered GNU Free Documentation License
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index 00d544b4..2d749e48 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -46,7 +46,7 @@
@c applies to and all the info about who's publishing this edition
@c These apply across the board.
-@set UPDATE-MONTH June, 2014
+@set UPDATE-MONTH July, 2014
@set VERSION 4.1
@set PATCHLEVEL 1
@@ -281,19 +281,24 @@ implementation of AWK.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
-Invariant Sections being ``GNU General Public License'', the Front-Cover
-texts being (a) (see below), and with the Back-Cover Texts being (b)
-(see below). A copy of the license is included in the section entitled
+Invariant Sections being ``GNU General Public License'', with the
+Front-Cover Texts being ``A GNU Manual'', and with the Back-Cover Texts
+as in (a) below.
+@ifclear FOR_PRINT
+A copy of the license is included in the section entitled
``GNU Free Documentation License''.
+@end ifclear
+@ifset FOR_PRINT
+A copy of the license
+may be found on the Internet at
+@uref{http://www.gnu.org/software/gawk/manual/html_node/GNU-Free-Documentation-License.html,
+the GNU Project's web site}.
+@end ifset
@enumerate a
@item
-``A GNU Manual''
-
-@item
-``You have the freedom to
-copy and modify this GNU manual. Buying copies from the FSF
-supports it in developing GNU and promoting software freedom.''
+The FSF's Back-Cover Text is: ``You have the freedom to
+copy and modify this GNU manual.''
@end enumerate
@end copying
@@ -1572,7 +1577,8 @@ the @command{gawk} source code and this @value{DOCUMENT}, respectively.
It contains the following appendices:
@end ifclear
@ifset FOR_PRINT
-Part IV provides the following appendices:
+Part IV provides the following appendices,
+including the GNU General Public License:
@end ifset
@ref{Language History},
@@ -1589,6 +1595,10 @@ in @command{gawk} and where to get other freely
available @command{awk} implementations.
@ifset FOR_PRINT
+
+@ref{Copying},
+presents the license that covers the @command{gawk} source code.
+
The version of this @value{DOCUMENT} distributed with @command{gawk}
contains additional appendices and other end material.
To save space, we have omitted them from the
@@ -1611,10 +1621,9 @@ defines most, if not all, the significant terms used
throughout the @value{DOCUMENT}. If you find terms that you aren't familiar with,
try looking them up here.
-@uref{http://www.gnu.org/software/gawk/manual/html_node/Copying.html, The GNU GPL} and
-@uref{http://www.gnu.org/software/gawk/manual/html_node/GNU-Free-Documentation-License.html, the GNU FDL}
-are the licenses that cover the @command{gawk} source code
-and this @value{DOCUMENT}, respectively.
+@uref{http://www.gnu.org/software/gawk/manual/html_node/GNU-Free-Documentation-License.html,
+The GNU FDL}
+is the license that covers this @value{DOCUMENT}.
@end ifset
@ifclear FOR_PRINT
@@ -3777,10 +3786,8 @@ No space is allowed between the @option{-o} and @var{file}, if
@var{file} is supplied.
@quotation NOTE
-Due to the way @command{gawk} has evolved, with this option
-your program is still executed. This will change in the
-next major release such that @command{gawk} will only
-pretty-print the program and not run it.
+In the past, this option would also execute your program.
+This is no longer the case.
@end quotation
@item @option{-O}
@@ -4266,11 +4273,6 @@ two regexp matchers that @command{gawk} uses internally. (There aren't
supposed to be differences, but occasionally theory and practice don't
coordinate with each other.)
-@item GAWK_NO_PP_RUN
-If this variable exists, then when invoked with the @option{--pretty-print}
-option, @command{gawk} skips running the program. This variable will
-not survive into the next major release.
-
@item GAWK_STACKSIZE
This specifies the amount by which @command{gawk} should grow its
internal evaluation stack, when needed.
@@ -5293,6 +5295,17 @@ With the POSIX character classes, you can write
@code{/[[:alnum:]]/} to match the alphabetic
and numeric characters in your character set.
+@c Thanks to
+@c Date: Tue, 01 Jul 2014 07:39:51 +0200
+@c From: Hermann Peifer <peifer@gmx.eu>
+Some utilities that match regular expressions provide a non-standard
+@code{[:ascii:]} character class; @command{awk} does not. However, you
+can simulate such a construct using @code{[\x00-\x7F]}. This matches
+all values numerically between zero and 127, which is the defined
+range of the ASCII character set. Use a complemented character list
+(@code{[^\x00-\x7F]}) to match any single-byte characters that are not
+in the ASCII range.
+
@cindex bracket expressions, collating elements
@cindex bracket expressions, non-ASCII
@cindex collating elements
@@ -15906,6 +15919,22 @@ You can use @samp{pi = atan2(0, -1)} to retrieve the value of
@cindex cosine
Return the cosine of @var{x}, with @var{x} in radians.
+@item @code{div(@var{numerator}, @var{denominator}, @var{result})}
+@cindexawkfunc{div}
+@cindex div
+Perform integer division, similar to the standard C function of the
+same name. First, truncate @code{numerator} and @code{denominator}
+to integers. Clear the @code{result} array, and then set
+@code{result["quotient"]} to the result of @samp{numerator / denominator},
+truncated to an integer, and set @code{result["remainder"]} to the result
+of @samp{numerator % denominator}, truncated to an integer.
+This function is primarily intended for use with arbitrary length
+integers; it avoids creating MPFR arbitrary precision floating-point
+values (@pxref{Arbitrary Precision Integers}).
+
+This function is a @code{gawk} extension. It is not available in
+compatibility mode (@pxref{Options}).
+
@item @code{exp(@var{x})}
@cindexawkfunc{exp}
@cindex exponent
@@ -26625,8 +26654,8 @@ When called this way, @command{gawk} ``pretty prints'' the program into
@file{awkprof.out}, without any execution counts.
@quotation NOTE
-The @option{--pretty-print} option still runs your program.
-This will change in the next major release.
+Once upon a time, the @option{--pretty-print} option would also run
+your program. This is is no longer the case.
@end quotation
@c ENDOFRANGE awkp
@c ENDOFRANGE proawk
@@ -29625,6 +29654,32 @@ to just use the following:
gawk -M 'BEGIN @{ n = 13; print n % 2 @}'
@end example
+When dividing two arbitrary precision integers with either
+@samp{/} or @samp{%}, the result is typically an arbitrary
+precision floating point value (unless the denominator evenly
+divides into the numerator). In order to do integer division
+or remainder with arbitrary precision integers, use the built-in
+@code{div()} function (@pxref{Numeric Functions}).
+
+You can simulate the @code{div()} function in standard @command{awk}
+using this user-defined function:
+
+@example
+# div --- do integer division
+
+function div(numerator, denominator, result, i)
+@{
+ split("", result)
+
+ numerator = int(numerator)
+ denominator = int(denominator)
+ result["quotient"] = int(numerator / denominator)
+ result["remainder"] = int(numerator % denominator)
+
+ return 0.0
+@}
+@end example
+
@node POSIX Floating Point Problems
@section Standards Versus Existing Practice
@@ -33795,13 +33850,14 @@ Write a wrapper script that provides an interface similar to
@ifdocbook
@ifclear FOR_PRINT
-Part IV contains the appendixes (including the two licenses that cover
+Part IV contains the appendices (including the two licenses that cover
the @command{gawk} source code and this @value{DOCUMENT}, respectively)
and the Glossary:
@end ifclear
@ifset FOR_PRINT
-Part IV contains two appendixes:
+Part IV contains two appendices and the license that
+covers the @command{gawk} source code:
@end ifset
@itemize @value{BULLET}
@@ -33820,10 +33876,12 @@ Part IV contains two appendixes:
@item
@ref{Glossary}.
+@end ifclear
@item
@ref{Copying}.
+@ifclear FOR_PRINT
@item
@ref{GNU Free Documentation License}.
@end ifclear
@@ -35715,6 +35773,8 @@ The generated Info file for
The @command{troff} source for a manual page describing the @command{igawk}
program presented in
@ref{Igawk Program}.
+(Since @command{gawk} can do its own @code{@@include} processing,
+neither @command{igawk} nor @file{igawk.1} are installed.)
@item doc/Makefile.in
The input file used during the configuration process to generate the
@@ -35759,8 +35819,6 @@ source file for this @value{DOCUMENT}. It also contains a @file{Makefile.in} fil
@file{Makefile.am} is used by GNU Automake to create @file{Makefile.in}.
The library functions from
@ref{Library Functions},
-and the @command{igawk} program from
-@ref{Igawk Program},
are included as ready-to-use files in the @command{gawk} distribution.
They are installed as part of the installation process.
The rest of the programs in this @value{DOCUMENT} are available in appropriate
@@ -39096,6 +39154,8 @@ A sequence of space, TAB, or newline characters occurring inside an input
record or a string.
@end table
+@end ifclear
+
@c The GNU General Public License.
@node Copying
@unnumbered GNU General Public License
@@ -39825,7 +39885,7 @@ applications with the library. If this is what you want to do, use
the GNU Lesser General Public License instead of this License. But
first, please read @url{http://www.gnu.org/philosophy/why-not-lgpl.html}.
-
+@ifclear FOR_PRINT
@c The GNU Free Documentation License.
@node GNU Free Documentation License
@unnumbered GNU Free Documentation License
diff --git a/main.c b/main.c
index c6fef2f1..901bfea5 100644
--- a/main.c
+++ b/main.c
@@ -739,9 +739,8 @@ out:
if (do_debug)
debug_prog(code_block);
- else if (do_pretty_print && ! do_debug && getenv("GAWK_NO_PP_RUN") != NULL)
- /* hack to run pretty printer only. need a better solution */
- ;
+ else if (do_pretty_print && ! do_profile)
+ ; /* run pretty printer only. */
else
interpret(code_block);
diff --git a/mpfr.c b/mpfr.c
index 393a2b1a..e9c9d154 100644
--- a/mpfr.c
+++ b/mpfr.c
@@ -1166,6 +1166,93 @@ do_mpfr_srand(int nargs)
return res;
}
+/* do_mpfr_div --- do integer division, return quotient and remainder in dest array */
+
+/*
+ * We define the semantics as:
+ * numerator = int(numerator)
+ * denominator = int(denonmator)
+ * quotient = int(numerator / denomator)
+ * remainder = int(numerator % denomator)
+ */
+
+NODE *
+do_mpfr_div(int nargs)
+{
+ NODE *numerator, *denominator, *result;
+ NODE *num, *denom;
+ NODE *quotient, *remainder;
+ NODE *sub, **lhs;
+
+ result = POP_PARAM();
+ if (result->type != Node_var_array)
+ fatal(_("div: third argument is not an array"));
+ assoc_clear(result);
+
+ denominator = POP_SCALAR();
+ numerator = POP_SCALAR();
+
+ if (do_lint) {
+ if ((numerator->flags & (NUMCUR|NUMBER)) == 0)
+ lintwarn(_("div: received non-numeric first argument"));
+ if ((denominator->flags & (NUMCUR|NUMBER)) == 0)
+ lintwarn(_("div: received non-numeric second argument"));
+ }
+
+ (void) force_number(numerator);
+ (void) force_number(denominator);
+
+ /* convert numerator and denominator to integer */
+ if (is_mpg_integer(numerator)) {
+ num = mpg_integer();
+ mpz_set(num->mpg_i, numerator->mpg_i);
+ } else {
+ if (! mpfr_number_p(numerator->mpg_numbr)) {
+ /* [+-]inf or NaN */
+ return numerator;
+ }
+
+ num = mpg_integer();
+ mpfr_get_z(num->mpg_i, numerator->mpg_numbr, MPFR_RNDZ);
+ }
+
+ if (is_mpg_integer(denominator)) {
+ denom = mpg_integer();
+ mpz_set(denom->mpg_i, denominator->mpg_i);
+ } else {
+ if (! mpfr_number_p(denominator->mpg_numbr)) {
+ /* [+-]inf or NaN */
+ return denominator;
+ }
+
+ denom = mpg_integer();
+ mpfr_get_z(denom->mpg_i, denominator->mpg_numbr, MPFR_RNDZ);
+ }
+
+ if (mpz_sgn(denom->mpg_i) == 0)
+ fatal(_("div: division by zero attempted"));
+
+ quotient = mpg_integer();
+ remainder = mpg_integer();
+
+ /* do the division */
+ mpz_tdiv_qr(quotient->mpg_i, remainder->mpg_i, num->mpg_i, denom->mpg_i);
+ unref(num);
+ unref(denom);
+
+ sub = make_string("quotient", 8);
+ lhs = assoc_lookup(result, sub);
+ unref(*lhs);
+ *lhs = quotient;
+
+ sub = make_string("remainder", 9);
+ lhs = assoc_lookup(result, sub);
+ unref(*lhs);
+ *lhs = remainder;
+
+ return make_number((AWKNUM) 0.0);
+}
+
/*
* mpg_tofloat --- convert an arbitrary-precision integer operand to
* a float without loss of precision. It is assumed that the
diff --git a/test/ChangeLog b/test/ChangeLog
index a337603b..cc921277 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,14 @@
+2014-07-10 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (printhuge): New test.
+ * printhuge.awk, printhuge.ok: New files.
+ Test from mail.green.fox@gmail.com.
+
+2014-06-24 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (profile1, profile4, profile5): Adjust for change to
+ --pretty-print option.
+
2014-06-19 Michael Forney <forney@google.com>
* Makefile.am (poundbang): Fix relative path of AWKPROG.
diff --git a/test/Makefile.am b/test/Makefile.am
index 13069084..d4ef501c 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -682,6 +682,8 @@ EXTRA_DIST = \
printfbad3.awk \
printfbad3.ok \
printfloat.awk \
+ printhuge.awk \
+ printhuge.ok \
printlang.awk \
prmarscl.awk \
prmarscl.ok \
@@ -1008,7 +1010,7 @@ GAWK_EXT_TESTS = \
lint lintold lintwarn \
manyfiles match1 match2 match3 mbstr1 \
nastyparm next nondec nondec2 \
- patsplit posix printfbad1 printfbad2 printfbad3 procinfs \
+ patsplit posix printfbad1 printfbad2 printfbad3 printhuge procinfs \
profile1 profile2 profile3 profile4 profile5 pty1 \
rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \
rsstart2 rsstart3 rstest6 shadow sortfor sortu split_after_fpat \
@@ -1659,10 +1661,11 @@ dumpvars::
profile1:
@echo $@
- @$(AWK) --pretty-print=ap-$@.out -f "$(srcdir)"/xref.awk "$(srcdir)"/dtdgport.awk > _$@.out1
+ @$(AWK) -f "$(srcdir)"/xref.awk "$(srcdir)"/dtdgport.awk > _$@.out1
+ @$(AWK) --pretty-print=ap-$@.out -f "$(srcdir)"/xref.awk
@$(AWK) -f ap-$@.out "$(srcdir)"/dtdgport.awk > _$@.out2 ; rm ap-$@.out
@$(CMP) _$@.out1 _$@.out2 && rm _$@.out[12] || { echo EXIT CODE: $$? >>_$@ ; \
- cp "$(srcdir)"/dtdgport.awk > $@.ok ; }
+ cp "$(srcdir)"/dtdgport.awk $@.ok ; }
profile2:
@@ -1679,13 +1682,13 @@ profile3:
profile4:
@echo $@
- @GAWK_NO_PP_RUN=1 $(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk > /dev/null
+ @$(AWK) --pretty-print=ap-$@.out -f "$(srcdir)"/$@.awk > /dev/null
@sed 1,2d < ap-$@.out > _$@; rm ap-$@.out
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
profile5:
@echo $@
- @GAWK_NO_PP_RUN=1 $(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk > /dev/null
+ @$(AWK) --pretty-print=ap-$@.out -f "$(srcdir)"/$@.awk > /dev/null
@sed 1,2d < ap-$@.out > _$@; rm ap-$@.out
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
@@ -1947,6 +1950,12 @@ dbugeval::
@$(AWK) --debug -f /dev/null < "$(srcdir)"/$@.in > _$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+printhuge::
+ @echo $@
+ @[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \
+ AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 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 2632334b..449ff46b 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -928,6 +928,8 @@ EXTRA_DIST = \
printfbad3.awk \
printfbad3.ok \
printfloat.awk \
+ printhuge.awk \
+ printhuge.ok \
printlang.awk \
prmarscl.awk \
prmarscl.ok \
@@ -1253,7 +1255,7 @@ GAWK_EXT_TESTS = \
lint lintold lintwarn \
manyfiles match1 match2 match3 mbstr1 \
nastyparm next nondec nondec2 \
- patsplit posix printfbad1 printfbad2 printfbad3 procinfs \
+ patsplit posix printfbad1 printfbad2 printfbad3 printhuge procinfs \
profile1 profile2 profile3 profile4 profile5 pty1 \
rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \
rsstart2 rsstart3 rstest6 shadow sortfor sortu split_after_fpat \
@@ -2084,10 +2086,11 @@ dumpvars::
profile1:
@echo $@
- @$(AWK) --pretty-print=ap-$@.out -f "$(srcdir)"/xref.awk "$(srcdir)"/dtdgport.awk > _$@.out1
+ @$(AWK) -f "$(srcdir)"/xref.awk "$(srcdir)"/dtdgport.awk > _$@.out1
+ @$(AWK) --pretty-print=ap-$@.out -f "$(srcdir)"/xref.awk
@$(AWK) -f ap-$@.out "$(srcdir)"/dtdgport.awk > _$@.out2 ; rm ap-$@.out
@$(CMP) _$@.out1 _$@.out2 && rm _$@.out[12] || { echo EXIT CODE: $$? >>_$@ ; \
- cp "$(srcdir)"/dtdgport.awk > $@.ok ; }
+ cp "$(srcdir)"/dtdgport.awk $@.ok ; }
profile2:
@echo $@
@@ -2103,13 +2106,13 @@ profile3:
profile4:
@echo $@
- @GAWK_NO_PP_RUN=1 $(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk > /dev/null
+ @$(AWK) --pretty-print=ap-$@.out -f "$(srcdir)"/$@.awk > /dev/null
@sed 1,2d < ap-$@.out > _$@; rm ap-$@.out
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
profile5:
@echo $@
- @GAWK_NO_PP_RUN=1 $(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk > /dev/null
+ @$(AWK) --pretty-print=ap-$@.out -f "$(srcdir)"/$@.awk > /dev/null
@sed 1,2d < ap-$@.out > _$@; rm ap-$@.out
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
@@ -2369,6 +2372,12 @@ dbugeval::
@echo $@
@$(AWK) --debug -f /dev/null < "$(srcdir)"/$@.in > _$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+printhuge::
+ @echo $@
+ @[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \
+ AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 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/printhuge.awk b/test/printhuge.awk
new file mode 100644
index 00000000..4d4fb7d4
--- /dev/null
+++ b/test/printhuge.awk
@@ -0,0 +1,3 @@
+BEGIN {
+ printf("%c", sprintf("%c", (0xffffff00+255)))
+}
diff --git a/test/printhuge.ok b/test/printhuge.ok
new file mode 100644
index 00000000..ce542efa
--- /dev/null
+++ b/test/printhuge.ok
@@ -0,0 +1 @@
+ÿ \ No newline at end of file