diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2012-08-26 21:49:01 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2012-08-26 21:49:01 +0300 |
commit | 8e34526a147a2e07c08c950b9f28c2e2132b6fd3 (patch) | |
tree | 9e0403805aedaa4e04614930d7f8b3fafe2d07fa | |
parent | 3c09996d7efa635947c357efb3ccc5ed05b1ea31 (diff) | |
parent | 439d946a0e936267f7f478b22d0754e882bf7cf0 (diff) | |
download | egawk-8e34526a147a2e07c08c950b9f28c2e2132b6fd3.tar.gz egawk-8e34526a147a2e07c08c950b9f28c2e2132b6fd3.tar.bz2 egawk-8e34526a147a2e07c08c950b9f28c2e2132b6fd3.zip |
Merge branch 'gawk-4.0-stable'
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | command.c | 405 | ||||
-rw-r--r-- | doc/gawk.info | 1765 | ||||
-rw-r--r-- | test/ChangeLog | 6 | ||||
-rw-r--r-- | test/Makefile.am | 2 | ||||
-rw-r--r-- | test/Makefile.in | 2 | ||||
-rw-r--r-- | test/charasbytes.ok | 4 |
7 files changed, 1066 insertions, 1122 deletions
@@ -30,7 +30,9 @@ Changes from 4.0.1 to 4.1 Changes from 4.0.1 to 4.0.2 --------------------------- -1. Infrastructure upgrades: Autoconf 2.69, Automake 1.12. +1. Infrastructure upgrades: Autoconf 2.69, Automake 1.12,3, bison 2.6.3. + +xx. Various minor bug fixes and documentation updates. Changes from 4.0.0 to 4.0.1 --------------------------- @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 2.5. */ +/* A Bison parser, made by GNU Bison 2.6.2. */ /* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -44,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.5" +#define YYBISON_VERSION "2.6.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -58,8 +58,6 @@ /* Pull parsers. */ #define YYPULL 1 -/* Using locations. */ -#define YYLSP_NEEDED 0 /* Substitute the variable and function names. */ #define yyparse zzparse @@ -70,10 +68,8 @@ #define yydebug zzdebug #define yynerrs zznerrs - /* Copy the first part of user declarations. */ - -/* Line 268 of yacc.c */ +/* Line 336 of yacc.c */ #line 26 "command.y" #include "awk.h" @@ -141,14 +137,16 @@ static void append_cmdarg(CMDARG *arg); static int find_argument(CMDARG *arg); #define YYSTYPE CMDARG * +/* Line 336 of yacc.c */ +#line 142 "command.c" -/* Line 268 of yacc.c */ -#line 147 "command.c" - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif +# ifndef YY_NULL +# if defined __cplusplus && 201103L <= __cplusplus +# define YY_NULL nullptr +# else +# define YY_NULL 0 +# endif +# endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE @@ -158,11 +156,17 @@ static int find_argument(CMDARG *arg); # define YYERROR_VERBOSE 0 #endif -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 +/* In a future release of Bison, this section will be replaced + by #include "". */ +#ifndef ZZ_ +# define ZZ_ +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif +#if YYDEBUG +extern int zzdebug; #endif - /* Tokens. */ #ifndef YYTOKENTYPE @@ -268,7 +272,6 @@ static int find_argument(CMDARG *arg); - #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef int YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 @@ -276,12 +279,28 @@ typedef int YYSTYPE; # define YYSTYPE_IS_DECLARED 1 #endif +extern YYSTYPE zzlval; -/* Copy the second part of user declarations. */ +#ifdef YYPARSE_PARAM +#if defined __STDC__ || defined __cplusplus +int zzparse (void *YYPARSE_PARAM); +#else +int zzparse (); +#endif +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus +int zzparse (void); +#else +int zzparse (); +#endif +#endif /* ! YYPARSE_PARAM */ +#endif /* !ZZ_ */ -/* Line 343 of yacc.c */ -#line 285 "command.c" +/* Copy the second part of user declarations. */ + +/* Line 353 of yacc.c */ +#line 304 "command.c" #ifdef short # undef short @@ -386,6 +405,7 @@ YYID (yyi) # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ + /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif @@ -475,20 +495,20 @@ union yyalloc #endif #if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from FROM to TO. The source and destination do +/* Copy COUNT objects from SRC to DST. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# define YYCOPY(Dst, Src, Count) \ + __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) # else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ +# define YYCOPY(Dst, Src, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (Dst)[yyi] = (Src)[yyi]; \ + } \ while (YYID (0)) # endif # endif @@ -640,7 +660,7 @@ static const yytype_uint16 yyrline[] = }; #endif -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +#if YYDEBUG || YYERROR_VERBOSE || 0 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = @@ -664,7 +684,7 @@ static const char *const yytname[] = "printf_args", "list_args", "integer_range", "opt_integer_list", "integer_list", "exp_list", "subscript", "subscript_list", "variable", "node", "opt_plus_integer", "opt_integer", "plus_integer", "integer", - "nls", 0 + "nls", YY_NULL }; #endif @@ -916,17 +936,18 @@ static const yytype_uint8 yystos[] = #define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (1); \ - goto yybackup; \ - } \ - else \ - { \ +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ @@ -936,32 +957,33 @@ while (YYID (0)) #define YYTERROR 1 #define YYERRCODE 256 - /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. If N is 0, then set CURRENT to the empty location which ends the previous symbol: RHS[0] (always defined). */ -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) #ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (YYID (N)) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (YYID (N)) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ while (YYID (0)) #endif +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) + + /* This macro is provided for backward compatibility. */ @@ -1020,6 +1042,8 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep) YYSTYPE const * const yyvaluep; #endif { + FILE *yyo = yyoutput; + YYUSE (yyo); if (!yyvaluep) return; # ifdef YYPRINT @@ -1266,12 +1290,12 @@ static int yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken) { - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); + YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); YYSIZE_T yysize = yysize0; YYSIZE_T yysize1; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ - const char *yyformat = 0; + const char *yyformat = YY_NULL; /* Arguments of yyformat. */ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Number of reported tokens (one for the "unexpected", one per @@ -1331,7 +1355,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, break; } yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) return 2; @@ -1422,20 +1446,6 @@ yydestruct (yymsg, yytype, yyvaluep) } -/* Prevent warnings from -Wmissing-prototypes. */ -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ /* The lookahead symbol. */ @@ -1480,7 +1490,7 @@ yyparse () `yyss': related to states. `yyvs': related to semantic values. - Refer to the stacks thru separate pointers, to allow yyoverflow + Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ @@ -1534,7 +1544,6 @@ yyparse () The wasted elements are never initialized. */ yyssp = yyss; yyvsp = yyvs; - goto yysetstate; /*------------------------------------------------------------. @@ -1712,8 +1721,7 @@ yyreduce: switch (yyn) { case 3: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 109 "command.y" { cmd_idx = -1; @@ -1732,8 +1740,7 @@ yyreduce: break; case 5: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 128 "command.y" { if (errcount == 0 && cmd_idx >= 0) { @@ -1787,8 +1794,7 @@ yyreduce: break; case 6: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 178 "command.y" { yyerrok; @@ -1796,15 +1802,13 @@ yyreduce: break; case 22: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 212 "command.y" { want_nodeval = true; } break; case 23: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 217 "command.y" { if (errcount == 0) { @@ -1824,8 +1828,7 @@ yyreduce: break; case 24: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 236 "command.y" { (yyval) = append_statement(arg_list, (char *) start_EVAL); @@ -1837,15 +1840,13 @@ yyreduce: break; case 25: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 243 "command.y" { (yyval) = append_statement((yyvsp[(1) - (2)]), lexptr_begin); } break; case 26: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 244 "command.y" { (yyval) = (yyvsp[(3) - (4)]); @@ -1853,8 +1854,7 @@ yyreduce: break; case 27: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 251 "command.y" { arg_list = append_statement((yyvsp[(2) - (3)]), (char *) end_EVAL); @@ -1874,8 +1874,7 @@ yyreduce: break; case 28: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 267 "command.y" { NODE *n; @@ -1890,8 +1889,7 @@ yyreduce: break; case 34: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 286 "command.y" { if (cmdtab[cmd_idx].class == D_FRAME @@ -1901,8 +1899,7 @@ yyreduce: break; case 35: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 292 "command.y" { int idx = find_argument((yyvsp[(2) - (2)])); @@ -1918,50 +1915,43 @@ yyreduce: break; case 38: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 305 "command.y" { want_nodeval = true; } break; case 40: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 306 "command.y" { want_nodeval = true; } break; case 46: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 311 "command.y" { want_nodeval = true; } break; case 49: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 313 "command.y" { want_nodeval = true; } break; case 51: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 314 "command.y" { want_nodeval = true; } break; case 53: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 315 "command.y" { want_nodeval = true; } break; case 57: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 319 "command.y" { if (in_cmd_src((yyvsp[(2) - (2)])->a_string)) @@ -1970,8 +1960,7 @@ yyreduce: break; case 58: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 324 "command.y" { if (! input_from_tty) @@ -1980,8 +1969,7 @@ yyreduce: break; case 59: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 329 "command.y" { int type = 0; @@ -2011,8 +1999,7 @@ yyreduce: break; case 60: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 355 "command.y" { if (! in_commands) @@ -2026,8 +2013,7 @@ yyreduce: break; case 61: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 365 "command.y" { if (! in_commands) @@ -2036,8 +2022,7 @@ yyreduce: break; case 62: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 370 "command.y" { int idx = find_argument((yyvsp[(2) - (2)])); @@ -2053,15 +2038,13 @@ yyreduce: break; case 63: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 381 "command.y" { want_nodeval = true; } break; case 64: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 382 "command.y" { int type; @@ -2073,8 +2056,7 @@ yyreduce: break; case 65: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 390 "command.y" { if (in_commands) { @@ -2089,8 +2071,7 @@ yyreduce: break; case 66: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 404 "command.y" { if ((yyvsp[(1) - (1)]) != NULL) { @@ -2104,43 +2085,37 @@ yyreduce: break; case 68: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 418 "command.y" { (yyval) = NULL; } break; case 69: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 423 "command.y" { (yyval) = NULL; } break; case 74: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 432 "command.y" { (yyval) = NULL; } break; case 75: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 437 "command.y" { (yyval) = NULL; } break; case 77: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 440 "command.y" { (yyval) = NULL; } break; case 78: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 445 "command.y" { NODE *n; @@ -2151,15 +2126,13 @@ yyreduce: break; case 79: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 455 "command.y" { (yyval) = NULL; } break; case 80: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 457 "command.y" { if (find_option((yyvsp[(1) - (1)])->a_string) < 0) @@ -2168,8 +2141,7 @@ yyreduce: break; case 81: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 462 "command.y" { if (find_option((yyvsp[(1) - (3)])->a_string) < 0) @@ -2178,8 +2150,7 @@ yyreduce: break; case 82: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 470 "command.y" { NODE *n; @@ -2196,57 +2167,49 @@ yyreduce: break; case 83: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 486 "command.y" { (yyval) = NULL; } break; case 88: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 495 "command.y" { (yyval) = NULL; } break; case 89: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 496 "command.y" { want_nodeval = true; } break; case 92: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 498 "command.y" { want_nodeval = true; } break; case 95: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 504 "command.y" { (yyval) = NULL; } break; case 97: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 510 "command.y" { (yyval) = NULL; } break; case 99: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 516 "command.y" { (yyval) = NULL; } break; case 104: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 528 "command.y" { int idx = find_argument((yyvsp[(1) - (2)])); @@ -2262,8 +2225,7 @@ yyreduce: break; case 106: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 544 "command.y" { (yyvsp[(2) - (2)])->type = D_array; /* dump all items */ @@ -2272,8 +2234,7 @@ yyreduce: break; case 107: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 549 "command.y" { (yyvsp[(2) - (3)])->type = D_array; @@ -2282,22 +2243,19 @@ yyreduce: break; case 117: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 575 "command.y" { (yyval) = NULL; } break; case 118: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 577 "command.y" { (yyval) = NULL; } break; case 119: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 579 "command.y" { CMDARG *a; @@ -2308,8 +2266,7 @@ yyreduce: break; case 126: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 595 "command.y" { if ((yyvsp[(1) - (3)])->a_int > (yyvsp[(3) - (3)])->a_int) @@ -2322,29 +2279,25 @@ yyreduce: break; case 127: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 607 "command.y" { (yyval) = NULL; } break; case 134: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 621 "command.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 135: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 623 "command.y" { (yyval) = (yyvsp[(1) - (3)]); } break; case 137: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 629 "command.y" { CMDARG *a; @@ -2363,22 +2316,19 @@ yyreduce: break; case 139: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 648 "command.y" { (yyval) = (yyvsp[(1) - (1)]); num_dim = 1; } break; case 140: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 650 "command.y" { (yyval) = (yyvsp[(1) - (2)]); num_dim++; } break; case 142: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 656 "command.y" { NODE *n = (yyvsp[(2) - (2)])->a_node; @@ -2391,8 +2341,7 @@ yyreduce: break; case 143: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 665 "command.y" { /* a_string is array name, a_count is dimension count */ @@ -2403,15 +2352,13 @@ yyreduce: break; case 144: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 675 "command.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 145: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 677 "command.y" { NODE *n = (yyvsp[(2) - (2)])->a_node; @@ -2422,8 +2369,7 @@ yyreduce: break; case 146: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 684 "command.y" { NODE *n = (yyvsp[(2) - (2)])->a_node; @@ -2436,36 +2382,31 @@ yyreduce: break; case 147: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 696 "command.y" { (yyval) = NULL; } break; case 148: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 698 "command.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 149: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 703 "command.y" { (yyval) = NULL; } break; case 150: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 705 "command.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 151: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 710 "command.y" { if ((yyvsp[(1) - (1)])->a_int == 0) @@ -2475,8 +2416,7 @@ yyreduce: break; case 152: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 716 "command.y" { if ((yyvsp[(2) - (2)])->a_int == 0) @@ -2486,22 +2426,19 @@ yyreduce: break; case 153: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 725 "command.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 154: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 727 "command.y" { (yyval) = (yyvsp[(2) - (2)]); } break; case 155: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 729 "command.y" { (yyvsp[(2) - (2)])->a_int = - (yyvsp[(2) - (2)])->a_int; @@ -2510,8 +2447,7 @@ yyreduce: break; case 156: - -/* Line 1806 of yacc.c */ +/* Line 1787 of yacc.c */ #line 737 "command.y" { if (lexptr_begin != NULL) { @@ -2524,9 +2460,8 @@ yyreduce: break; - -/* Line 1806 of yacc.c */ -#line 2542 "command.c" +/* Line 1787 of yacc.c */ +#line 2477 "command.c" default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -2713,7 +2648,7 @@ yyabortlab: yyresult = 1; goto yyreturn; -#if !defined(yyoverflow) || YYERROR_VERBOSE +#if !defined yyoverflow || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ @@ -2755,8 +2690,7 @@ yyreturn: } - -/* Line 2067 of yacc.c */ +/* Line 2048 of yacc.c */ #line 747 "command.y" @@ -3704,4 +3638,3 @@ history_expand_line(char **line) } #endif - diff --git a/doc/gawk.info b/doc/gawk.info index 4c10ab10..797a35a6 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -89,14 +89,14 @@ texts being (a) (see below), and with the Back-Cover Texts being (b) * Functions:: Built-in and user-defined functions. * Internationalization:: Getting `gawk' to speak your language. -* Arbitrary Precision Arithmetic:: Arbitrary precision arithmetic with - `gawk'. * Advanced Features:: Stuff for advanced users, specific to `gawk'. * Library Functions:: A Library of `awk' Functions. * Sample Programs:: Many `awk' programs with complete explanations. * Debugger:: The `gawk' debugger. +* Arbitrary Precision Arithmetic:: Arbitrary precision arithmetic with + `gawk'. * Dynamic Extensions:: Adding new built-in functions to `gawk'. * Language History:: The evolution of the `awk' @@ -361,29 +361,6 @@ texts being (a) (see below), and with the Back-Cover Texts being (b) * I18N Portability:: `awk'-level portability issues. * I18N Example:: A simple i18n example. * Gawk I18N:: `gawk' is also internationalized. -* General Arithmetic:: An introduction to computer arithmetic. -* Floating Point Issues:: Stuff to know about floating-point numbers. -* String Conversion Precision:: The String Value Can Lie. -* Unexpected Results:: Floating Point Numbers Are Not Abstract - Numbers. -* POSIX Floating Point Problems:: Standards Versus Existing Practice. -* Integer Programming:: Effective integer programming. -* Floating-point Programming:: Effective Floating-point Programming. -* Floating-point Representation:: Binary floating-point representation. -* Floating-point Context:: Floating-point context. -* Rounding Mode:: Floating-point rounding mode. -* Gawk and MPFR:: How `gawk' provides - aribitrary-precision arithmetic. -* Arbitrary Precision Floats:: Arbitrary Precision Floating-point - Arithmetic with `gawk'. -* Setting Precision:: Setting the working precision. -* Setting Rounding Mode:: Setting the rounding mode. -* Floating-point Constants:: Representing floating-point constants. -* Changing Precision:: Changing the precision of a number. -* Exact Arithmetic:: Exact arithmetic with floating-point - numbers. -* Arbitrary Precision Integers:: Arbitrary Precision Integer Arithmetic with - `gawk'. * Nondecimal Data:: Allowing nondecimal input data. * Array Sorting:: Facilities for controlling array traversal and sorting arrays. @@ -465,6 +442,29 @@ texts being (a) (see below), and with the Back-Cover Texts being (b) * Miscellaneous Debugger Commands:: Miscellaneous Commands. * Readline Support:: Readline support. * Limitations:: Limitations and future plans. +* General Arithmetic:: An introduction to computer arithmetic. +* Floating Point Issues:: Stuff to know about floating-point numbers. +* String Conversion Precision:: The String Value Can Lie. +* Unexpected Results:: Floating Point Numbers Are Not Abstract + Numbers. +* POSIX Floating Point Problems:: Standards Versus Existing Practice. +* Integer Programming:: Effective integer programming. +* Floating-point Programming:: Effective Floating-point Programming. +* Floating-point Representation:: Binary floating-point representation. +* Floating-point Context:: Floating-point context. +* Rounding Mode:: Floating-point rounding mode. +* Gawk and MPFR:: How `gawk' provides + aribitrary-precision arithmetic. +* Arbitrary Precision Floats:: Arbitrary Precision Floating-point + Arithmetic with `gawk'. +* Setting Precision:: Setting the working precision. +* Setting Rounding Mode:: Setting the rounding mode. +* Floating-point Constants:: Representing floating-point constants. +* Changing Precision:: Changing the precision of a number. +* Exact Arithmetic:: Exact arithmetic with floating-point + numbers. +* Arbitrary Precision Integers:: Arbitrary Precision Integer Arithmetic with + `gawk'. * Plugin License:: A note about licensing. * Sample Library:: A example of new functions. * Internal File Description:: What the new functions will do. @@ -878,6 +878,9 @@ real problems. *note Arbitrary Precision Arithmetic::, describes advanced arithmetic facilities provided by `gawk'. + *note Dynamic Extensions::, describes how to add new variables and +functions to `gawk' by writing extensions in C. + *note Language History::, describes how the `awk' language has evolved since its first release to present. It also describes how `gawk' has acquired features over time. @@ -13180,7 +13183,7 @@ example, in the following case: `gawk' will look up the actual function to call only once. -File: gawk.info, Node: Internationalization, Next: Arbitrary Precision Arithmetic, Prev: Functions, Up: Top +File: gawk.info, Node: Internationalization, Next: Advanced Features, Prev: Functions, Up: Top 10 Internationalization with `gawk' *********************************** @@ -13760,7 +13763,7 @@ writing, the latest version of GNU `gettext' is version 0.18.1 usage messages, warnings, and fatal errors in the local language. -File: gawk.info, Node: Advanced Features, Next: Library Functions, Prev: Arbitrary Precision Arithmetic, Up: Top +File: gawk.info, Node: Advanced Features, Next: Library Functions, Prev: Internationalization, Up: Top 11 Advanced Features of `gawk' ****************************** @@ -18982,7 +18985,7 @@ supplies the following copyright terms: We leave it to you to determine what the program does. -File: gawk.info, Node: Debugger, Next: Dynamic Extensions, Prev: Sample Programs, Up: Top +File: gawk.info, Node: Debugger, Next: Arbitrary Precision Arithmetic, Prev: Sample Programs, Up: Top 14 Debugging `awk' Programs *************************** @@ -20034,402 +20037,9 @@ features may be added, and of course feel free to try to add them yourself! -File: gawk.info, Node: Dynamic Extensions, Next: Language History, Prev: Debugger, Up: Top - -15 Writing Extensions for `gawk' -******************************** - -This chapter is a placeholder, pending a rewrite for the new API. Some -of the old bits remain, since they can be partially reused. - - It is possible to add new built-in functions to `gawk' using -dynamically loaded libraries. This facility is available on systems -(such as GNU/Linux) that support the C `dlopen()' and `dlsym()' -functions. This major node describes how to write and use dynamically -loaded extensions for `gawk'. Experience with programming in C or C++ -is necessary when reading this minor node. - - NOTE: When `--sandbox' is specified, extensions are disabled - (*note Options::. - -* Menu: - -* Plugin License:: A note about licensing. -* Sample Library:: A example of new functions. - - -File: gawk.info, Node: Plugin License, Next: Sample Library, Up: Dynamic Extensions - -15.1 Extension Licensing -======================== - -Every dynamic extension should define the global symbol -`plugin_is_GPL_compatible' to assert that it has been licensed under a -GPL-compatible license. If this symbol does not exist, `gawk' will -emit a fatal error and exit. - - The declared type of the symbol should be `int'. It does not need -to be in any allocated section, though. The code merely asserts that -the symbol exists in the global scope. Something like this is enough: - - int plugin_is_GPL_compatible; - - -File: gawk.info, Node: Sample Library, Prev: Plugin License, Up: Dynamic Extensions - -15.2 Example: Directory and File Operation Built-ins -==================================================== - -Two useful functions that are not in `awk' are `chdir()' (so that an -`awk' program can change its directory) and `stat()' (so that an `awk' -program can gather information about a file). This minor node -implements these functions for `gawk' in an external extension library. - -* Menu: - -* Internal File Description:: What the new functions will do. -* Internal File Ops:: The code for internal file operations. -* Using Internal File Ops:: How to use an external extension. - - -File: gawk.info, Node: Internal File Description, Next: Internal File Ops, Up: Sample Library - -15.2.1 Using `chdir()' and `stat()' ------------------------------------ - -This minor node shows how to use the new functions at the `awk' level -once they've been integrated into the running `gawk' interpreter. -Using `chdir()' is very straightforward. It takes one argument, the new -directory to change to: - - ... - newdir = "/home/arnold/funstuff" - ret = chdir(newdir) - if (ret < 0) { - printf("could not change to %s: %s\n", - newdir, ERRNO) > "/dev/stderr" - exit 1 - } - ... - - The return value is negative if the `chdir' failed, and `ERRNO' -(*note Built-in Variables::) is set to a string indicating the error. - - Using `stat()' is a bit more complicated. The C `stat()' function -fills in a structure that has a fair amount of information. The right -way to model this in `awk' is to fill in an associative array with the -appropriate information: - - file = "/home/arnold/.profile" - fdata[1] = "x" # force `fdata' to be an array - ret = stat(file, fdata) - if (ret < 0) { - printf("could not stat %s: %s\n", - file, ERRNO) > "/dev/stderr" - exit 1 - } - printf("size of %s is %d bytes\n", file, fdata["size"]) - - The `stat()' function always clears the data array, even if the -`stat()' fails. It fills in the following elements: - -`"name"' - The name of the file that was `stat()''ed. - -`"dev"' -`"ino"' - The file's device and inode numbers, respectively. - -`"mode"' - The file's mode, as a numeric value. This includes both the file's - type and its permissions. - -`"nlink"' - The number of hard links (directory entries) the file has. - -`"uid"' -`"gid"' - The numeric user and group ID numbers of the file's owner. - -`"size"' - The size in bytes of the file. - -`"blocks"' - The number of disk blocks the file actually occupies. This may not - be a function of the file's size if the file has holes. - -`"atime"' -`"mtime"' -`"ctime"' - The file's last access, modification, and inode update times, - respectively. These are numeric timestamps, suitable for - formatting with `strftime()' (*note Built-in::). - -`"pmode"' - The file's "printable mode." This is a string representation of - the file's type and permissions, such as what is produced by `ls - -l'--for example, `"drwxr-xr-x"'. - -`"type"' - A printable string representation of the file's type. The value - is one of the following: - - `"blockdev"' - `"chardev"' - The file is a block or character device ("special file"). - - `"directory"' - The file is a directory. - - `"fifo"' - The file is a named-pipe (also known as a FIFO). - - `"file"' - The file is just a regular file. - - `"socket"' - The file is an `AF_UNIX' ("Unix domain") socket in the - filesystem. - - `"symlink"' - The file is a symbolic link. - - Several additional elements may be present depending upon the -operating system and the type of the file. You can test for them in -your `awk' program by using the `in' operator (*note Reference to -Elements::): - -`"blksize"' - The preferred block size for I/O to the file. This field is not - present on all POSIX-like systems in the C `stat' structure. - -`"linkval"' - If the file is a symbolic link, this element is the name of the - file the link points to (i.e., the value of the link). - -`"rdev"' -`"major"' -`"minor"' - If the file is a block or character device file, then these values - represent the numeric device number and the major and minor - components of that number, respectively. - - -File: gawk.info, Node: Internal File Ops, Next: Using Internal File Ops, Prev: Internal File Description, Up: Sample Library - -15.2.2 C Code for `chdir()' and `stat()' ----------------------------------------- - -Here is the C code for these extensions. They were written for -GNU/Linux. The code needs some more work for complete portability to -other POSIX-compliant systems:(1) - - #include "awk.h" - - #include <sys/sysmacros.h> - - int plugin_is_GPL_compatible; - - /* do_chdir --- provide dynamically loaded chdir() builtin for gawk */ - - static NODE * - do_chdir(int nargs) - { - NODE *newdir; - int ret = -1; - - if (do_lint && nargs != 1) - lintwarn("chdir: called with incorrect number of arguments"); - - newdir = get_scalar_argument(0, FALSE); - - The file includes the `"awk.h"' header file for definitions for the -`gawk' internals. It includes `<sys/sysmacros.h>' for access to the -`major()' and `minor'() macros. - - By convention, for an `awk' function `foo', the function that -implements it is called `do_foo'. The function should take a `int' -argument, usually called `nargs', that represents the number of defined -arguments for the function. The `newdir' variable represents the new -directory to change to, retrieved with `get_scalar_argument()'. Note -that the first argument is numbered zero. - - This code actually accomplishes the `chdir()'. It first forces the -argument to be a string and passes the string value to the `chdir()' -system call. If the `chdir()' fails, `ERRNO' is updated. - - (void) force_string(newdir); - ret = chdir(newdir->stptr); - if (ret < 0) - update_ERRNO_int(errno); - - Finally, the function returns the return value to the `awk' level: - - return make_number((AWKNUM) ret); - } - - The `stat()' built-in is more involved. First comes a function that -turns a numeric mode into a printable representation (e.g., 644 becomes -`-rw-r--r--'). This is omitted here for brevity: - - /* format_mode --- turn a stat mode field into something readable */ - - static char * - format_mode(unsigned long fmode) - { - ... - } - - Next comes the `do_stat()' function. It starts with variable -declarations and argument checking: - - /* do_stat --- provide a stat() function for gawk */ - - static NODE * - do_stat(int nargs) - { - NODE *file, *array, *tmp; - struct stat sbuf; - int ret; - NODE **aptr; - char *pmode; /* printable mode */ - char *type = "unknown"; - - if (do_lint && nargs > 2) - lintwarn("stat: called with too many arguments"); - - Then comes the actual work. First, the function gets the arguments. -Then, it always clears the array. The code use `lstat()' (instead of -`stat()') to get the file information, in case the file is a symbolic -link. If there's an error, it sets `ERRNO' and returns: - - /* file is first arg, array to hold results is second */ - file = get_scalar_argument(0, FALSE); - array = get_array_argument(1, FALSE); - - /* empty out the array */ - assoc_clear(array); - - /* lstat the file, if error, set ERRNO and return */ - (void) force_string(file); - ret = lstat(file->stptr, & sbuf); - if (ret < 0) { - update_ERRNO_int(errno); - return make_number((AWKNUM) ret); - } - - Now comes the tedious part: filling in the array. Only a few of the -calls are shown here, since they all follow the same pattern: - - /* fill in the array */ - aptr = assoc_lookup(array, tmp = make_string("name", 4)); - *aptr = dupnode(file); - unref(tmp); - - aptr = assoc_lookup(array, tmp = make_string("mode", 4)); - *aptr = make_number((AWKNUM) sbuf.st_mode); - unref(tmp); - - aptr = assoc_lookup(array, tmp = make_string("pmode", 5)); - pmode = format_mode(sbuf.st_mode); - *aptr = make_string(pmode, strlen(pmode)); - unref(tmp); - - When done, return the `lstat()' return value: - - - return make_number((AWKNUM) ret); - } - - Finally, it's necessary to provide the "glue" that loads the new -function(s) into `gawk'. By convention, each library has a routine -named `dl_load()' that does the job. The simplest way is to use the -`dl_load_func' macro in `gawkapi.h'. - - And that's it! As an exercise, consider adding functions to -implement system calls such as `chown()', `chmod()', and `umask()'. - - ---------- Footnotes ---------- - - (1) This version is edited slightly for presentation. See -`extension/filefuncs.c' in the `gawk' distribution for the complete -version. - - -File: gawk.info, Node: Using Internal File Ops, Prev: Internal File Ops, Up: Sample Library - -15.2.3 Integrating the Extensions ---------------------------------- - -Now that the code is written, it must be possible to add it at runtime -to the running `gawk' interpreter. First, the code must be compiled. -Assuming that the functions are in a file named `filefuncs.c', and IDIR -is the location of the `gawk' include files, the following steps create -a GNU/Linux shared library: +File: gawk.info, Node: Arbitrary Precision Arithmetic, Next: Dynamic Extensions, Prev: Debugger, Up: Top - $ gcc -fPIC -shared -DHAVE_CONFIG_H -c -O -g -IIDIR filefuncs.c - $ ld -o filefuncs.so -shared filefuncs.o - - Once the library exists, it is loaded by calling the `extension()' -built-in function. This function takes two arguments: the name of the -library to load and the name of a function to call when the library is -first loaded. This function adds the new functions to `gawk'. It -returns the value returned by the initialization function within the -shared library: - - # file testff.awk - BEGIN { - extension("./filefuncs.so", "dl_load") - - chdir(".") # no-op - - data[1] = 1 # force `data' to be an array - print "Info for testff.awk" - ret = stat("testff.awk", data) - print "ret =", ret - for (i in data) - printf "data[\"%s\"] = %s\n", i, data[i] - print "testff.awk modified:", - strftime("%m %d %y %H:%M:%S", data["mtime"]) - - print "\nInfo for JUNK" - ret = stat("JUNK", data) - print "ret =", ret - for (i in data) - printf "data[\"%s\"] = %s\n", i, data[i] - print "JUNK modified:", strftime("%m %d %y %H:%M:%S", data["mtime"]) - } - - Here are the results of running the program: - - $ gawk -f testff.awk - -| Info for testff.awk - -| ret = 0 - -| data["size"] = 607 - -| data["ino"] = 14945891 - -| data["name"] = testff.awk - -| data["pmode"] = -rw-rw-r-- - -| data["nlink"] = 1 - -| data["atime"] = 1293993369 - -| data["mtime"] = 1288520752 - -| data["mode"] = 33204 - -| data["blksize"] = 4096 - -| data["dev"] = 2054 - -| data["type"] = file - -| data["gid"] = 500 - -| data["uid"] = 500 - -| data["blocks"] = 8 - -| data["ctime"] = 1290113572 - -| testff.awk modified: 10 31 10 12:25:52 - -| - -| Info for JUNK - -| ret = -1 - -| JUNK modified: 01 01 70 02:00:00 - - -File: gawk.info, Node: Arbitrary Precision Arithmetic, Next: Advanced Features, Prev: Internationalization, Up: Top - -16 Arithmetic and Arbitrary Precision Arithmetic with `gawk' +15 Arithmetic and Arbitrary Precision Arithmetic with `gawk' ************************************************************ There's a credibility gap: We don't know how much of the @@ -20470,7 +20080,7 @@ feature which is specific to `gawk'. File: gawk.info, Node: General Arithmetic, Next: Floating-point Programming, Up: Arbitrary Precision Arithmetic -16.1 A General Description of Computer Arithmetic +15.1 A General Description of Computer Arithmetic ================================================= Within computers, there are two kinds of numeric values: "integers" and @@ -20506,7 +20116,7 @@ precision" floating-point numbers. File: gawk.info, Node: Floating Point Issues, Next: Integer Programming, Up: General Arithmetic -16.1.1 Floating-Point Number Caveats +15.1.1 Floating-Point Number Caveats ------------------------------------ As mentioned earlier, floating-point numbers represent what are called @@ -20532,7 +20142,7 @@ in computer science. File: gawk.info, Node: String Conversion Precision, Next: Unexpected Results, Up: Floating Point Issues -16.1.1.1 The String Value Can Lie +15.1.1.1 The String Value Can Lie ................................. Internally, `awk' keeps both the numeric value (double precision @@ -20584,7 +20194,7 @@ doubt that you need to worry about this. File: gawk.info, Node: Unexpected Results, Next: POSIX Floating Point Problems, Prev: String Conversion Precision, Up: Floating Point Issues -16.1.1.2 Floating Point Numbers Are Not Abstract Numbers +15.1.1.2 Floating Point Numbers Are Not Abstract Numbers ........................................................ Unlike numbers in the abstract sense (such as what you studied in high @@ -20638,7 +20248,7 @@ noted and can affect comparisons. File: gawk.info, Node: POSIX Floating Point Problems, Prev: Unexpected Results, Up: Floating Point Issues -16.1.1.3 Standards Versus Existing Practice +15.1.1.3 Standards Versus Existing Practice ........................................... Historically, `awk' has converted any non-numeric looking string to the @@ -20726,7 +20336,7 @@ as follows: File: gawk.info, Node: Integer Programming, Prev: Floating Point Issues, Up: General Arithmetic -16.1.2 Mixing Integers And Floating-point +15.1.2 Mixing Integers And Floating-point ----------------------------------------- As has been mentioned already, `gawk' ordinarily uses hardware double @@ -20762,7 +20372,7 @@ around on your screen. File: gawk.info, Node: Floating-point Programming, Next: Gawk and MPFR, Prev: General Arithmetic, Up: Arbitrary Precision Arithmetic -16.2 Understanding Floating-point Programming +15.2 Understanding Floating-point Programming ============================================= Numerical programming is an extensive area; if you need to develop @@ -20922,7 +20532,7 @@ more information. File: gawk.info, Node: Floating-point Representation, Next: Floating-point Context, Up: Floating-point Programming -16.2.1 Binary Floating-point Representation +15.2.1 Binary Floating-point Representation ------------------------------------------- Although floating-point representations vary from machine to machine, @@ -20951,7 +20561,7 @@ the first bit is always a one. File: gawk.info, Node: Floating-point Context, Next: Rounding Mode, Prev: Floating-point Representation, Up: Floating-point Programming -16.2.2 Floating-point Context +15.2.2 Floating-point Context ----------------------------- A floating-point "context" defines the environment for arithmetic @@ -20983,7 +20593,7 @@ Single 32 24 -126 +127 Double 64 53 -1022 +1023 Quadruple 128 113 -16382 +16383 -Table 16.1: Basic IEEE Format Context Values +Table 15.1: Basic IEEE Format Context Values NOTE: The precision numbers include the implied leading one that gives them one extra bit of significand. @@ -21007,7 +20617,7 @@ corresponding to 64-bit binary with 53 bits of precision. File: gawk.info, Node: Rounding Mode, Prev: Floating-point Context, Up: Floating-point Programming -16.2.3 Floating-point Rounding Mode +15.2.3 Floating-point Rounding Mode ----------------------------------- The "rounding mode" specifies the behavior for the results of numerical @@ -21025,7 +20635,7 @@ Round toward zero `roundTowardZero' Round to nearest, ties away `roundTiesToAway' from zero -Table 16.2: IEEE 754 Rounding Modes +Table 15.2: IEEE 754 Rounding Modes The default mode `roundTiesToEven' is the most preferred, but the least intuitive. This method does the obvious thing for most values, by @@ -21094,7 +20704,7 @@ to round halfway cases for `printf()'. File: gawk.info, Node: Gawk and MPFR, Next: Arbitrary Precision Floats, Prev: Floating-point Programming, Up: Arbitrary Precision Arithmetic -16.3 `gawk' + MPFR = Powerful Arithmetic +15.3 `gawk' + MPFR = Powerful Arithmetic ======================================== The rest of this major node decsribes how to use the arbitrary precision @@ -21124,7 +20734,7 @@ Auto-set::, for more information. File: gawk.info, Node: Arbitrary Precision Floats, Next: Arbitrary Precision Integers, Prev: Gawk and MPFR, Up: Arbitrary Precision Arithmetic -16.4 Arbitrary Precision Floating-point Arithmetic with `gawk' +15.4 Arbitrary Precision Floating-point Arithmetic with `gawk' ============================================================== `gawk' uses the GNU MPFR library for arbitrary precision floating-point @@ -21177,7 +20787,7 @@ and subnormal numbers are not implemented. File: gawk.info, Node: Setting Precision, Next: Setting Rounding Mode, Up: Arbitrary Precision Floats -16.4.1 Setting the Working Precision +15.4.1 Setting the Working Precision ------------------------------------ `gawk' uses a global working precision; it does not keep track of the @@ -21239,7 +20849,7 @@ issues that occur because numbers are stored internally in binary. File: gawk.info, Node: Setting Rounding Mode, Next: Floating-point Constants, Prev: Setting Precision, Up: Arbitrary Precision Floats -16.4.2 Setting the Rounding Mode +15.4.2 Setting the Rounding Mode -------------------------------- The `ROUNDMODE' variable provides program level control over the @@ -21255,11 +20865,11 @@ Round toward zero `roundTowardZero' `"Z"' or `"z"' Round to nearest, ties away `roundTiesToAway' `"A"' or `"a"' from zero -Table 16.3: `gawk' Rounding Modes +Table 15.3: `gawk' Rounding Modes `ROUNDMODE' has the default value `"N"', which selects the IEEE-754 rounding mode `roundTiesToEven'. Besides the values listed in *note -Table 16.3: table-gawk-rounding-modes, `gawk' also accepts `"A"' to +Table 15.3: table-gawk-rounding-modes, `gawk' also accepts `"A"' to select the IEEE-754 mode `roundTiesToAway' if your version of the MPFR library supports it; otherwise setting `ROUNDMODE' to this value has no effect. *Note Rounding Mode::, for the meanings of the various rounding @@ -21274,7 +20884,7 @@ modes. File: gawk.info, Node: Floating-point Constants, Next: Changing Precision, Prev: Setting Rounding Mode, Up: Arbitrary Precision Floats -16.4.3 Representing Floating-point Constants +15.4.3 Representing Floating-point Constants -------------------------------------------- Be wary of floating-point constants! When reading a floating-point @@ -21304,7 +20914,7 @@ of 53. File: gawk.info, Node: Changing Precision, Next: Exact Arithmetic, Prev: Floating-point Constants, Up: Arbitrary Precision Floats -16.4.4 Changing the Precision of a Number +15.4.4 Changing the Precision of a Number ----------------------------------------- The point is that in any variable-precision package, a decision is @@ -21343,7 +20953,7 @@ Volume 28, pp. 168-173, 2008. File: gawk.info, Node: Exact Arithmetic, Prev: Changing Precision, Up: Arbitrary Precision Floats -16.4.5 Exact Arithmetic with Floating-point Numbers +15.4.5 Exact Arithmetic with Floating-point Numbers --------------------------------------------------- CAUTION: Never depend on the exactness of floating-point @@ -21414,7 +21024,7 @@ hand is often the correct approach in such situations. File: gawk.info, Node: Arbitrary Precision Integers, Prev: Arbitrary Precision Floats, Up: Arbitrary Precision Arithmetic -16.5 Arbitrary Precision Integer Arithmetic with `gawk' +15.5 Arbitrary Precision Integer Arithmetic with `gawk' ======================================================= If the option `--bignum' or `-M' is specified, `gawk' performs all @@ -21489,6 +21099,399 @@ Wolfram Web Resource. `http://mathworld.wolfram.com/SylvestersSequence.html' +File: gawk.info, Node: Dynamic Extensions, Next: Language History, Prev: Arbitrary Precision Arithmetic, Up: Top + +16 Writing Extensions for `gawk' +******************************** + +This chapter is a placeholder, pending a rewrite for the new API. Some +of the old bits remain, since they can be partially reused. + + It is possible to add new built-in functions to `gawk' using +dynamically loaded libraries. This facility is available on systems +(such as GNU/Linux) that support the C `dlopen()' and `dlsym()' +functions. This major node describes how to write and use dynamically +loaded extensions for `gawk'. Experience with programming in C or C++ +is necessary when reading this minor node. + + NOTE: When `--sandbox' is specified, extensions are disabled + (*note Options::. + +* Menu: + +* Plugin License:: A note about licensing. +* Sample Library:: A example of new functions. + + +File: gawk.info, Node: Plugin License, Next: Sample Library, Up: Dynamic Extensions + +16.1 Extension Licensing +======================== + +Every dynamic extension should define the global symbol +`plugin_is_GPL_compatible' to assert that it has been licensed under a +GPL-compatible license. If this symbol does not exist, `gawk' will +emit a fatal error and exit. + + The declared type of the symbol should be `int'. It does not need +to be in any allocated section, though. The code merely asserts that +the symbol exists in the global scope. Something like this is enough: + + int plugin_is_GPL_compatible; + + +File: gawk.info, Node: Sample Library, Prev: Plugin License, Up: Dynamic Extensions + +16.2 Example: Directory and File Operation Built-ins +==================================================== + +Two useful functions that are not in `awk' are `chdir()' (so that an +`awk' program can change its directory) and `stat()' (so that an `awk' +program can gather information about a file). This minor node +implements these functions for `gawk' in an external extension library. + +* Menu: + +* Internal File Description:: What the new functions will do. +* Internal File Ops:: The code for internal file operations. +* Using Internal File Ops:: How to use an external extension. + + +File: gawk.info, Node: Internal File Description, Next: Internal File Ops, Up: Sample Library + +16.2.1 Using `chdir()' and `stat()' +----------------------------------- + +This minor node shows how to use the new functions at the `awk' level +once they've been integrated into the running `gawk' interpreter. +Using `chdir()' is very straightforward. It takes one argument, the new +directory to change to: + + ... + newdir = "/home/arnold/funstuff" + ret = chdir(newdir) + if (ret < 0) { + printf("could not change to %s: %s\n", + newdir, ERRNO) > "/dev/stderr" + exit 1 + } + ... + + The return value is negative if the `chdir' failed, and `ERRNO' +(*note Built-in Variables::) is set to a string indicating the error. + + Using `stat()' is a bit more complicated. The C `stat()' function +fills in a structure that has a fair amount of information. The right +way to model this in `awk' is to fill in an associative array with the +appropriate information: + + file = "/home/arnold/.profile" + fdata[1] = "x" # force `fdata' to be an array + ret = stat(file, fdata) + if (ret < 0) { + printf("could not stat %s: %s\n", + file, ERRNO) > "/dev/stderr" + exit 1 + } + printf("size of %s is %d bytes\n", file, fdata["size"]) + + The `stat()' function always clears the data array, even if the +`stat()' fails. It fills in the following elements: + +`"name"' + The name of the file that was `stat()''ed. + +`"dev"' +`"ino"' + The file's device and inode numbers, respectively. + +`"mode"' + The file's mode, as a numeric value. This includes both the file's + type and its permissions. + +`"nlink"' + The number of hard links (directory entries) the file has. + +`"uid"' +`"gid"' + The numeric user and group ID numbers of the file's owner. + +`"size"' + The size in bytes of the file. + +`"blocks"' + The number of disk blocks the file actually occupies. This may not + be a function of the file's size if the file has holes. + +`"atime"' +`"mtime"' +`"ctime"' + The file's last access, modification, and inode update times, + respectively. These are numeric timestamps, suitable for + formatting with `strftime()' (*note Built-in::). + +`"pmode"' + The file's "printable mode." This is a string representation of + the file's type and permissions, such as what is produced by `ls + -l'--for example, `"drwxr-xr-x"'. + +`"type"' + A printable string representation of the file's type. The value + is one of the following: + + `"blockdev"' + `"chardev"' + The file is a block or character device ("special file"). + + `"directory"' + The file is a directory. + + `"fifo"' + The file is a named-pipe (also known as a FIFO). + + `"file"' + The file is just a regular file. + + `"socket"' + The file is an `AF_UNIX' ("Unix domain") socket in the + filesystem. + + `"symlink"' + The file is a symbolic link. + + Several additional elements may be present depending upon the +operating system and the type of the file. You can test for them in +your `awk' program by using the `in' operator (*note Reference to +Elements::): + +`"blksize"' + The preferred block size for I/O to the file. This field is not + present on all POSIX-like systems in the C `stat' structure. + +`"linkval"' + If the file is a symbolic link, this element is the name of the + file the link points to (i.e., the value of the link). + +`"rdev"' +`"major"' +`"minor"' + If the file is a block or character device file, then these values + represent the numeric device number and the major and minor + components of that number, respectively. + + +File: gawk.info, Node: Internal File Ops, Next: Using Internal File Ops, Prev: Internal File Description, Up: Sample Library + +16.2.2 C Code for `chdir()' and `stat()' +---------------------------------------- + +Here is the C code for these extensions. They were written for +GNU/Linux. The code needs some more work for complete portability to +other POSIX-compliant systems:(1) + + #include "awk.h" + + #include <sys/sysmacros.h> + + int plugin_is_GPL_compatible; + + /* do_chdir --- provide dynamically loaded chdir() builtin for gawk */ + + static NODE * + do_chdir(int nargs) + { + NODE *newdir; + int ret = -1; + + if (do_lint && nargs != 1) + lintwarn("chdir: called with incorrect number of arguments"); + + newdir = get_scalar_argument(0, FALSE); + + The file includes the `"awk.h"' header file for definitions for the +`gawk' internals. It includes `<sys/sysmacros.h>' for access to the +`major()' and `minor'() macros. + + By convention, for an `awk' function `foo', the function that +implements it is called `do_foo'. The function should take a `int' +argument, usually called `nargs', that represents the number of defined +arguments for the function. The `newdir' variable represents the new +directory to change to, retrieved with `get_scalar_argument()'. Note +that the first argument is numbered zero. + + This code actually accomplishes the `chdir()'. It first forces the +argument to be a string and passes the string value to the `chdir()' +system call. If the `chdir()' fails, `ERRNO' is updated. + + (void) force_string(newdir); + ret = chdir(newdir->stptr); + if (ret < 0) + update_ERRNO_int(errno); + + Finally, the function returns the return value to the `awk' level: + + return make_number((AWKNUM) ret); + } + + The `stat()' built-in is more involved. First comes a function that +turns a numeric mode into a printable representation (e.g., 644 becomes +`-rw-r--r--'). This is omitted here for brevity: + + /* format_mode --- turn a stat mode field into something readable */ + + static char * + format_mode(unsigned long fmode) + { + ... + } + + Next comes the `do_stat()' function. It starts with variable +declarations and argument checking: + + /* do_stat --- provide a stat() function for gawk */ + + static NODE * + do_stat(int nargs) + { + NODE *file, *array, *tmp; + struct stat sbuf; + int ret; + NODE **aptr; + char *pmode; /* printable mode */ + char *type = "unknown"; + + if (do_lint && nargs > 2) + lintwarn("stat: called with too many arguments"); + + Then comes the actual work. First, the function gets the arguments. +Then, it always clears the array. The code use `lstat()' (instead of +`stat()') to get the file information, in case the file is a symbolic +link. If there's an error, it sets `ERRNO' and returns: + + /* file is first arg, array to hold results is second */ + file = get_scalar_argument(0, FALSE); + array = get_array_argument(1, FALSE); + + /* empty out the array */ + assoc_clear(array); + + /* lstat the file, if error, set ERRNO and return */ + (void) force_string(file); + ret = lstat(file->stptr, & sbuf); + if (ret < 0) { + update_ERRNO_int(errno); + return make_number((AWKNUM) ret); + } + + Now comes the tedious part: filling in the array. Only a few of the +calls are shown here, since they all follow the same pattern: + + /* fill in the array */ + aptr = assoc_lookup(array, tmp = make_string("name", 4)); + *aptr = dupnode(file); + unref(tmp); + + aptr = assoc_lookup(array, tmp = make_string("mode", 4)); + *aptr = make_number((AWKNUM) sbuf.st_mode); + unref(tmp); + + aptr = assoc_lookup(array, tmp = make_string("pmode", 5)); + pmode = format_mode(sbuf.st_mode); + *aptr = make_string(pmode, strlen(pmode)); + unref(tmp); + + When done, return the `lstat()' return value: + + + return make_number((AWKNUM) ret); + } + + Finally, it's necessary to provide the "glue" that loads the new +function(s) into `gawk'. By convention, each library has a routine +named `dl_load()' that does the job. The simplest way is to use the +`dl_load_func' macro in `gawkapi.h'. + + And that's it! As an exercise, consider adding functions to +implement system calls such as `chown()', `chmod()', and `umask()'. + + ---------- Footnotes ---------- + + (1) This version is edited slightly for presentation. See +`extension/filefuncs.c' in the `gawk' distribution for the complete +version. + + +File: gawk.info, Node: Using Internal File Ops, Prev: Internal File Ops, Up: Sample Library + +16.2.3 Integrating the Extensions +--------------------------------- + +Now that the code is written, it must be possible to add it at runtime +to the running `gawk' interpreter. First, the code must be compiled. +Assuming that the functions are in a file named `filefuncs.c', and IDIR +is the location of the `gawk' include files, the following steps create +a GNU/Linux shared library: + + $ gcc -fPIC -shared -DHAVE_CONFIG_H -c -O -g -IIDIR filefuncs.c + $ ld -o filefuncs.so -shared filefuncs.o + + Once the library exists, it is loaded by calling the `extension()' +built-in function. This function takes two arguments: the name of the +library to load and the name of a function to call when the library is +first loaded. This function adds the new functions to `gawk'. It +returns the value returned by the initialization function within the +shared library: + + # file testff.awk + BEGIN { + extension("./filefuncs.so", "dl_load") + + chdir(".") # no-op + + data[1] = 1 # force `data' to be an array + print "Info for testff.awk" + ret = stat("testff.awk", data) + print "ret =", ret + for (i in data) + printf "data[\"%s\"] = %s\n", i, data[i] + print "testff.awk modified:", + strftime("%m %d %y %H:%M:%S", data["mtime"]) + + print "\nInfo for JUNK" + ret = stat("JUNK", data) + print "ret =", ret + for (i in data) + printf "data[\"%s\"] = %s\n", i, data[i] + print "JUNK modified:", strftime("%m %d %y %H:%M:%S", data["mtime"]) + } + + Here are the results of running the program: + + $ gawk -f testff.awk + -| Info for testff.awk + -| ret = 0 + -| data["size"] = 607 + -| data["ino"] = 14945891 + -| data["name"] = testff.awk + -| data["pmode"] = -rw-rw-r-- + -| data["nlink"] = 1 + -| data["atime"] = 1293993369 + -| data["mtime"] = 1288520752 + -| data["mode"] = 33204 + -| data["blksize"] = 4096 + -| data["dev"] = 2054 + -| data["type"] = file + -| data["gid"] = 500 + -| data["uid"] = 500 + -| data["blocks"] = 8 + -| data["ctime"] = 1290113572 + -| testff.awk modified: 10 31 10 12:25:52 + -| + -| Info for JUNK + -| ret = -1 + -| JUNK modified: 01 01 70 02:00:00 + + File: gawk.info, Node: Language History, Next: Installation, Prev: Dynamic Extensions, Up: Top Appendix A The Evolution of the `awk' Language @@ -28429,441 +28432,441 @@ Node: History39607 Node: Names41998 Ref: Names-Footnote-143475 Node: This Manual43547 -Ref: This Manual-Footnote-148556 -Node: Conventions48656 -Node: Manual History50790 -Ref: Manual History-Footnote-154060 -Ref: Manual History-Footnote-254101 -Node: How To Contribute54175 -Node: Acknowledgments55319 -Node: Getting Started59815 -Node: Running gawk62194 -Node: One-shot63380 -Node: Read Terminal64605 -Ref: Read Terminal-Footnote-166255 -Ref: Read Terminal-Footnote-266531 -Node: Long66702 -Node: Executable Scripts68078 -Ref: Executable Scripts-Footnote-169947 -Ref: Executable Scripts-Footnote-270049 -Node: Comments70596 -Node: Quoting73063 -Node: DOS Quoting77686 -Node: Sample Data Files78361 -Node: Very Simple81393 -Node: Two Rules85992 -Node: More Complex88139 -Ref: More Complex-Footnote-191069 -Node: Statements/Lines91154 -Ref: Statements/Lines-Footnote-195616 -Node: Other Features95881 -Node: When96809 -Node: Invoking Gawk98956 -Node: Command Line100417 -Node: Options101200 -Ref: Options-Footnote-1116598 -Node: Other Arguments116623 -Node: Naming Standard Input119281 -Node: Environment Variables120375 -Node: AWKPATH Variable120933 -Ref: AWKPATH Variable-Footnote-1123691 -Node: AWKLIBPATH Variable123951 -Node: Other Environment Variables124548 -Node: Exit Status127043 -Node: Include Files127718 -Node: Loading Shared Libraries131287 -Node: Obsolete132512 -Node: Undocumented133209 -Node: Regexp133452 -Node: Regexp Usage134841 -Node: Escape Sequences136867 -Node: Regexp Operators142630 -Ref: Regexp Operators-Footnote-1150010 -Ref: Regexp Operators-Footnote-2150157 -Node: Bracket Expressions150255 -Ref: table-char-classes152145 -Node: GNU Regexp Operators154668 -Node: Case-sensitivity158391 -Ref: Case-sensitivity-Footnote-1161359 -Ref: Case-sensitivity-Footnote-2161594 -Node: Leftmost Longest161702 -Node: Computed Regexps162903 -Node: Reading Files166313 -Node: Records168316 -Ref: Records-Footnote-1177240 -Node: Fields177277 -Ref: Fields-Footnote-1180310 -Node: Nonconstant Fields180396 -Node: Changing Fields182598 -Node: Field Separators188579 -Node: Default Field Splitting191208 -Node: Regexp Field Splitting192325 -Node: Single Character Fields195667 -Node: Command Line Field Separator196726 -Node: Field Splitting Summary200167 -Ref: Field Splitting Summary-Footnote-1203359 -Node: Constant Size203460 -Node: Splitting By Content208044 -Ref: Splitting By Content-Footnote-1211770 -Node: Multiple Line211810 -Ref: Multiple Line-Footnote-1217657 -Node: Getline217836 -Node: Plain Getline220052 -Node: Getline/Variable222141 -Node: Getline/File223282 -Node: Getline/Variable/File224604 -Ref: Getline/Variable/File-Footnote-1226203 -Node: Getline/Pipe226290 -Node: Getline/Variable/Pipe228850 -Node: Getline/Coprocess229957 -Node: Getline/Variable/Coprocess231200 -Node: Getline Notes231914 -Node: Getline Summary234701 -Ref: table-getline-variants235109 -Node: Read Timeout235965 -Ref: Read Timeout-Footnote-1239710 -Node: Command line directories239767 -Node: Printing240397 -Node: Print242028 -Node: Print Examples243365 -Node: Output Separators246149 -Node: OFMT247909 -Node: Printf249267 -Node: Basic Printf250173 -Node: Control Letters251712 -Node: Format Modifiers255524 -Node: Printf Examples261533 -Node: Redirection264248 -Node: Special Files271232 -Node: Special FD271765 -Ref: Special FD-Footnote-1275390 -Node: Special Network275464 -Node: Special Caveats276314 -Node: Close Files And Pipes277110 -Ref: Close Files And Pipes-Footnote-1284133 -Ref: Close Files And Pipes-Footnote-2284281 -Node: Expressions284431 -Node: Values285563 -Node: Constants286239 -Node: Scalar Constants286919 -Ref: Scalar Constants-Footnote-1287778 -Node: Nondecimal-numbers287960 -Node: Regexp Constants291019 -Node: Using Constant Regexps291494 -Node: Variables294549 -Node: Using Variables295204 -Node: Assignment Options296928 -Node: Conversion298800 -Ref: table-locale-affects304176 -Ref: Conversion-Footnote-1304800 -Node: All Operators304909 -Node: Arithmetic Ops305539 -Node: Concatenation308044 -Ref: Concatenation-Footnote-1310837 -Node: Assignment Ops310957 -Ref: table-assign-ops315945 -Node: Increment Ops317353 -Node: Truth Values and Conditions320823 -Node: Truth Values321906 -Node: Typing and Comparison322955 -Node: Variable Typing323744 -Ref: Variable Typing-Footnote-1327641 -Node: Comparison Operators327763 -Ref: table-relational-ops328173 -Node: POSIX String Comparison331722 -Ref: POSIX String Comparison-Footnote-1332678 -Node: Boolean Ops332816 -Ref: Boolean Ops-Footnote-1336894 -Node: Conditional Exp336985 -Node: Function Calls338717 -Node: Precedence342311 -Node: Locales345980 -Node: Patterns and Actions347069 -Node: Pattern Overview348123 -Node: Regexp Patterns349792 -Node: Expression Patterns350335 -Node: Ranges354020 -Node: BEGIN/END356986 -Node: Using BEGIN/END357748 -Ref: Using BEGIN/END-Footnote-1360479 -Node: I/O And BEGIN/END360585 -Node: BEGINFILE/ENDFILE362867 -Node: Empty365771 -Node: Using Shell Variables366087 -Node: Action Overview368372 -Node: Statements370729 -Node: If Statement372583 -Node: While Statement374082 -Node: Do Statement376126 -Node: For Statement377282 -Node: Switch Statement380434 -Node: Break Statement382531 -Node: Continue Statement384521 -Node: Next Statement386314 -Node: Nextfile Statement388704 -Node: Exit Statement391249 -Node: Built-in Variables393665 -Node: User-modified394760 -Ref: User-modified-Footnote-1403115 -Node: Auto-set403177 -Ref: Auto-set-Footnote-1413085 -Node: ARGC and ARGV413290 -Node: Arrays417141 -Node: Array Basics418646 -Node: Array Intro419472 -Node: Reference to Elements423790 -Node: Assigning Elements426060 -Node: Array Example426551 -Node: Scanning an Array428283 -Node: Controlling Scanning430597 -Ref: Controlling Scanning-Footnote-1435530 -Node: Delete435846 -Ref: Delete-Footnote-1438281 -Node: Numeric Array Subscripts438338 -Node: Uninitialized Subscripts440521 -Node: Multi-dimensional442149 -Node: Multi-scanning445243 -Node: Arrays of Arrays446834 -Node: Functions451479 -Node: Built-in452301 -Node: Calling Built-in453379 -Node: Numeric Functions455367 -Ref: Numeric Functions-Footnote-1459199 -Ref: Numeric Functions-Footnote-2459556 -Ref: Numeric Functions-Footnote-3459604 -Node: String Functions459873 -Ref: String Functions-Footnote-1483370 -Ref: String Functions-Footnote-2483499 -Ref: String Functions-Footnote-3483747 -Node: Gory Details483834 -Ref: table-sub-escapes485513 -Ref: table-sub-posix-92486867 -Ref: table-sub-proposed488210 -Ref: table-posix-sub489560 -Ref: table-gensub-escapes491106 -Ref: Gory Details-Footnote-1492313 -Ref: Gory Details-Footnote-2492364 -Node: I/O Functions492515 -Ref: I/O Functions-Footnote-1499170 -Node: Time Functions499317 -Ref: Time Functions-Footnote-1510209 -Ref: Time Functions-Footnote-2510277 -Ref: Time Functions-Footnote-3510435 -Ref: Time Functions-Footnote-4510546 -Ref: Time Functions-Footnote-5510658 -Ref: Time Functions-Footnote-6510885 -Node: Bitwise Functions511151 -Ref: table-bitwise-ops511709 -Ref: Bitwise Functions-Footnote-1515930 -Node: Type Functions516114 -Node: I18N Functions516584 -Node: User-defined518211 -Node: Definition Syntax519015 -Ref: Definition Syntax-Footnote-1523925 -Node: Function Example523994 -Node: Function Caveats526588 -Node: Calling A Function527009 -Node: Variable Scope528124 -Node: Pass By Value/Reference530099 -Node: Return Statement533539 -Node: Dynamic Typing536520 -Node: Indirect Calls537255 -Node: Internationalization546940 -Node: I18N and L10N548379 -Node: Explaining gettext549065 -Ref: Explaining gettext-Footnote-1554131 -Ref: Explaining gettext-Footnote-2554315 -Node: Programmer i18n554480 -Node: Translator i18n558680 -Node: String Extraction559473 -Ref: String Extraction-Footnote-1560434 -Node: Printf Ordering560520 -Ref: Printf Ordering-Footnote-1563304 -Node: I18N Portability563368 -Ref: I18N Portability-Footnote-1565817 -Node: I18N Example565880 -Ref: I18N Example-Footnote-1568515 -Node: Gawk I18N568587 -Node: Advanced Features569204 -Node: Nondecimal Data570727 -Node: Array Sorting572310 -Node: Controlling Array Traversal573007 -Node: Array Sorting Functions581244 -Ref: Array Sorting Functions-Footnote-1584918 -Ref: Array Sorting Functions-Footnote-2585011 -Node: Two-way I/O585205 -Ref: Two-way I/O-Footnote-1590637 -Node: TCP/IP Networking590707 -Node: Profiling593551 -Node: Library Functions601005 -Ref: Library Functions-Footnote-1604012 -Node: Library Names604183 -Ref: Library Names-Footnote-1607654 -Ref: Library Names-Footnote-2607874 -Node: General Functions607960 -Node: Strtonum Function608913 -Node: Assert Function611843 -Node: Round Function615169 -Node: Cliff Random Function616712 -Node: Ordinal Functions617728 -Ref: Ordinal Functions-Footnote-1620798 -Ref: Ordinal Functions-Footnote-2621050 -Node: Join Function621259 -Ref: Join Function-Footnote-1623030 -Node: Getlocaltime Function623230 -Node: Data File Management626945 -Node: Filetrans Function627577 -Node: Rewind Function631716 -Node: File Checking633103 -Node: Empty Files634197 -Node: Ignoring Assigns636427 -Node: Getopt Function637980 -Ref: Getopt Function-Footnote-1649284 -Node: Passwd Functions649487 -Ref: Passwd Functions-Footnote-1658462 -Node: Group Functions658550 -Node: Walking Arrays666634 -Node: Sample Programs668203 -Node: Running Examples668868 -Node: Clones669596 -Node: Cut Program670820 -Node: Egrep Program680665 -Ref: Egrep Program-Footnote-1688438 -Node: Id Program688548 -Node: Split Program692164 -Ref: Split Program-Footnote-1695683 -Node: Tee Program695811 -Node: Uniq Program698614 -Node: Wc Program706043 -Ref: Wc Program-Footnote-1710309 -Ref: Wc Program-Footnote-2710509 -Node: Miscellaneous Programs710601 -Node: Dupword Program711789 -Node: Alarm Program713820 -Node: Translate Program718569 -Ref: Translate Program-Footnote-1722956 -Ref: Translate Program-Footnote-2723184 -Node: Labels Program723318 -Ref: Labels Program-Footnote-1726689 -Node: Word Sorting726773 -Node: History Sorting730657 -Node: Extract Program732496 -Ref: Extract Program-Footnote-1739979 -Node: Simple Sed740107 -Node: Igawk Program743169 -Ref: Igawk Program-Footnote-1758326 -Ref: Igawk Program-Footnote-2758527 -Node: Anagram Program758665 -Node: Signature Program761733 -Node: Debugger762833 -Node: Debugging763787 -Node: Debugging Concepts764220 -Node: Debugging Terms766076 -Node: Awk Debugging768673 -Node: Sample Debugging Session769565 -Node: Debugger Invocation770085 -Node: Finding The Bug771414 -Node: List of Debugger Commands777902 -Node: Breakpoint Control779236 -Node: Debugger Execution Control782900 -Node: Viewing And Changing Data786260 -Node: Execution Stack789616 -Node: Debugger Info791083 -Node: Miscellaneous Debugger Commands795064 -Node: Readline Support800509 -Node: Limitations801340 -Node: Dynamic Extensions803592 -Node: Plugin License804488 -Node: Sample Library805102 -Node: Internal File Description805786 -Node: Internal File Ops809499 -Ref: Internal File Ops-Footnote-1814062 -Node: Using Internal File Ops814202 -Node: Arbitrary Precision Arithmetic816578 -Ref: Arbitrary Precision Arithmetic-Footnote-1818230 -Node: General Arithmetic818378 -Node: Floating Point Issues820098 -Node: String Conversion Precision821193 -Ref: String Conversion Precision-Footnote-1822899 -Node: Unexpected Results823008 -Node: POSIX Floating Point Problems825161 -Ref: POSIX Floating Point Problems-Footnote-1828986 -Node: Integer Programming829024 -Node: Floating-point Programming830772 -Ref: Floating-point Programming-Footnote-1837036 -Node: Floating-point Representation837300 -Node: Floating-point Context838467 -Ref: table-ieee-formats839309 -Node: Rounding Mode840693 -Ref: table-rounding-modes841172 -Ref: Rounding Mode-Footnote-1844176 -Node: Gawk and MPFR844357 -Node: Arbitrary Precision Floats845598 -Ref: Arbitrary Precision Floats-Footnote-1848020 -Node: Setting Precision848331 -Node: Setting Rounding Mode851058 -Ref: table-gawk-rounding-modes851462 -Node: Floating-point Constants852659 -Node: Changing Precision854081 -Ref: Changing Precision-Footnote-1855481 -Node: Exact Arithmetic855655 -Node: Arbitrary Precision Integers858753 -Ref: Arbitrary Precision Integers-Footnote-1861835 -Node: Language History861982 -Node: V7/SVR3.1863504 -Node: SVR4865825 -Node: POSIX867267 -Node: BTL868275 -Node: POSIX/GNU869009 -Node: Common Extensions874544 -Node: Ranges and Locales875651 -Ref: Ranges and Locales-Footnote-1880269 -Ref: Ranges and Locales-Footnote-2880296 -Ref: Ranges and Locales-Footnote-3880556 -Node: Contributors880777 -Node: Installation885073 -Node: Gawk Distribution885967 -Node: Getting886451 -Node: Extracting887277 -Node: Distribution contents888969 -Node: Unix Installation894191 -Node: Quick Installation894808 -Node: Additional Configuration Options896770 -Node: Configuration Philosophy898247 -Node: Non-Unix Installation900589 -Node: PC Installation901047 -Node: PC Binary Installation902346 -Node: PC Compiling904194 -Node: PC Testing907138 -Node: PC Using908314 -Node: Cygwin912499 -Node: MSYS913499 -Node: VMS Installation914013 -Node: VMS Compilation914616 -Ref: VMS Compilation-Footnote-1915623 -Node: VMS Installation Details915681 -Node: VMS Running917316 -Node: VMS Old Gawk918923 -Node: Bugs919397 -Node: Other Versions923249 -Node: Notes928564 -Node: Compatibility Mode929151 -Node: Additions929934 -Node: Accessing The Source930861 -Node: Adding Code932286 -Node: New Ports938294 -Node: Derived Files942429 -Ref: Derived Files-Footnote-1947733 -Ref: Derived Files-Footnote-2947767 -Ref: Derived Files-Footnote-3948367 -Node: Future Extensions948465 -Node: Basic Concepts949952 -Node: Basic High Level950633 -Ref: Basic High Level-Footnote-1954668 -Node: Basic Data Typing954853 -Node: Glossary958208 -Node: Copying983184 -Node: GNU Free Documentation License1020741 -Node: Index1045878 +Ref: This Manual-Footnote-148675 +Node: Conventions48775 +Node: Manual History50909 +Ref: Manual History-Footnote-154179 +Ref: Manual History-Footnote-254220 +Node: How To Contribute54294 +Node: Acknowledgments55438 +Node: Getting Started59934 +Node: Running gawk62313 +Node: One-shot63499 +Node: Read Terminal64724 +Ref: Read Terminal-Footnote-166374 +Ref: Read Terminal-Footnote-266650 +Node: Long66821 +Node: Executable Scripts68197 +Ref: Executable Scripts-Footnote-170066 +Ref: Executable Scripts-Footnote-270168 +Node: Comments70715 +Node: Quoting73182 +Node: DOS Quoting77805 +Node: Sample Data Files78480 +Node: Very Simple81512 +Node: Two Rules86111 +Node: More Complex88258 +Ref: More Complex-Footnote-191188 +Node: Statements/Lines91273 +Ref: Statements/Lines-Footnote-195735 +Node: Other Features96000 +Node: When96928 +Node: Invoking Gawk99075 +Node: Command Line100536 +Node: Options101319 +Ref: Options-Footnote-1116717 +Node: Other Arguments116742 +Node: Naming Standard Input119400 +Node: Environment Variables120494 +Node: AWKPATH Variable121052 +Ref: AWKPATH Variable-Footnote-1123810 +Node: AWKLIBPATH Variable124070 +Node: Other Environment Variables124667 +Node: Exit Status127162 +Node: Include Files127837 +Node: Loading Shared Libraries131406 +Node: Obsolete132631 +Node: Undocumented133328 +Node: Regexp133571 +Node: Regexp Usage134960 +Node: Escape Sequences136986 +Node: Regexp Operators142749 +Ref: Regexp Operators-Footnote-1150129 +Ref: Regexp Operators-Footnote-2150276 +Node: Bracket Expressions150374 +Ref: table-char-classes152264 +Node: GNU Regexp Operators154787 +Node: Case-sensitivity158510 +Ref: Case-sensitivity-Footnote-1161478 +Ref: Case-sensitivity-Footnote-2161713 +Node: Leftmost Longest161821 +Node: Computed Regexps163022 +Node: Reading Files166432 +Node: Records168435 +Ref: Records-Footnote-1177359 +Node: Fields177396 +Ref: Fields-Footnote-1180429 +Node: Nonconstant Fields180515 +Node: Changing Fields182717 +Node: Field Separators188698 +Node: Default Field Splitting191327 +Node: Regexp Field Splitting192444 +Node: Single Character Fields195786 +Node: Command Line Field Separator196845 +Node: Field Splitting Summary200286 +Ref: Field Splitting Summary-Footnote-1203478 +Node: Constant Size203579 +Node: Splitting By Content208163 +Ref: Splitting By Content-Footnote-1211889 +Node: Multiple Line211929 +Ref: Multiple Line-Footnote-1217776 +Node: Getline217955 +Node: Plain Getline220171 +Node: Getline/Variable222260 +Node: Getline/File223401 +Node: Getline/Variable/File224723 +Ref: Getline/Variable/File-Footnote-1226322 +Node: Getline/Pipe226409 +Node: Getline/Variable/Pipe228969 +Node: Getline/Coprocess230076 +Node: Getline/Variable/Coprocess231319 +Node: Getline Notes232033 +Node: Getline Summary234820 +Ref: table-getline-variants235228 +Node: Read Timeout236084 +Ref: Read Timeout-Footnote-1239829 +Node: Command line directories239886 +Node: Printing240516 +Node: Print242147 +Node: Print Examples243484 +Node: Output Separators246268 +Node: OFMT248028 +Node: Printf249386 +Node: Basic Printf250292 +Node: Control Letters251831 +Node: Format Modifiers255643 +Node: Printf Examples261652 +Node: Redirection264367 +Node: Special Files271351 +Node: Special FD271884 +Ref: Special FD-Footnote-1275509 +Node: Special Network275583 +Node: Special Caveats276433 +Node: Close Files And Pipes277229 +Ref: Close Files And Pipes-Footnote-1284252 +Ref: Close Files And Pipes-Footnote-2284400 +Node: Expressions284550 +Node: Values285682 +Node: Constants286358 +Node: Scalar Constants287038 +Ref: Scalar Constants-Footnote-1287897 +Node: Nondecimal-numbers288079 +Node: Regexp Constants291138 +Node: Using Constant Regexps291613 +Node: Variables294668 +Node: Using Variables295323 +Node: Assignment Options297047 +Node: Conversion298919 +Ref: table-locale-affects304295 +Ref: Conversion-Footnote-1304919 +Node: All Operators305028 +Node: Arithmetic Ops305658 +Node: Concatenation308163 +Ref: Concatenation-Footnote-1310956 +Node: Assignment Ops311076 +Ref: table-assign-ops316064 +Node: Increment Ops317472 +Node: Truth Values and Conditions320942 +Node: Truth Values322025 +Node: Typing and Comparison323074 +Node: Variable Typing323863 +Ref: Variable Typing-Footnote-1327760 +Node: Comparison Operators327882 +Ref: table-relational-ops328292 +Node: POSIX String Comparison331841 +Ref: POSIX String Comparison-Footnote-1332797 +Node: Boolean Ops332935 +Ref: Boolean Ops-Footnote-1337013 +Node: Conditional Exp337104 +Node: Function Calls338836 +Node: Precedence342430 +Node: Locales346099 +Node: Patterns and Actions347188 +Node: Pattern Overview348242 +Node: Regexp Patterns349911 +Node: Expression Patterns350454 +Node: Ranges354139 +Node: BEGIN/END357105 +Node: Using BEGIN/END357867 +Ref: Using BEGIN/END-Footnote-1360598 +Node: I/O And BEGIN/END360704 +Node: BEGINFILE/ENDFILE362986 +Node: Empty365890 +Node: Using Shell Variables366206 +Node: Action Overview368491 +Node: Statements370848 +Node: If Statement372702 +Node: While Statement374201 +Node: Do Statement376245 +Node: For Statement377401 +Node: Switch Statement380553 +Node: Break Statement382650 +Node: Continue Statement384640 +Node: Next Statement386433 +Node: Nextfile Statement388823 +Node: Exit Statement391368 +Node: Built-in Variables393784 +Node: User-modified394879 +Ref: User-modified-Footnote-1403234 +Node: Auto-set403296 +Ref: Auto-set-Footnote-1413204 +Node: ARGC and ARGV413409 +Node: Arrays417260 +Node: Array Basics418765 +Node: Array Intro419591 +Node: Reference to Elements423909 +Node: Assigning Elements426179 +Node: Array Example426670 +Node: Scanning an Array428402 +Node: Controlling Scanning430716 +Ref: Controlling Scanning-Footnote-1435649 +Node: Delete435965 +Ref: Delete-Footnote-1438400 +Node: Numeric Array Subscripts438457 +Node: Uninitialized Subscripts440640 +Node: Multi-dimensional442268 +Node: Multi-scanning445362 +Node: Arrays of Arrays446953 +Node: Functions451598 +Node: Built-in452420 +Node: Calling Built-in453498 +Node: Numeric Functions455486 +Ref: Numeric Functions-Footnote-1459318 +Ref: Numeric Functions-Footnote-2459675 +Ref: Numeric Functions-Footnote-3459723 +Node: String Functions459992 +Ref: String Functions-Footnote-1483489 +Ref: String Functions-Footnote-2483618 +Ref: String Functions-Footnote-3483866 +Node: Gory Details483953 +Ref: table-sub-escapes485632 +Ref: table-sub-posix-92486986 +Ref: table-sub-proposed488329 +Ref: table-posix-sub489679 +Ref: table-gensub-escapes491225 +Ref: Gory Details-Footnote-1492432 +Ref: Gory Details-Footnote-2492483 +Node: I/O Functions492634 +Ref: I/O Functions-Footnote-1499289 +Node: Time Functions499436 +Ref: Time Functions-Footnote-1510328 +Ref: Time Functions-Footnote-2510396 +Ref: Time Functions-Footnote-3510554 +Ref: Time Functions-Footnote-4510665 +Ref: Time Functions-Footnote-5510777 +Ref: Time Functions-Footnote-6511004 +Node: Bitwise Functions511270 +Ref: table-bitwise-ops511828 +Ref: Bitwise Functions-Footnote-1516049 +Node: Type Functions516233 +Node: I18N Functions516703 +Node: User-defined518330 +Node: Definition Syntax519134 +Ref: Definition Syntax-Footnote-1524044 +Node: Function Example524113 +Node: Function Caveats526707 +Node: Calling A Function527128 +Node: Variable Scope528243 +Node: Pass By Value/Reference530218 +Node: Return Statement533658 +Node: Dynamic Typing536639 +Node: Indirect Calls537374 +Node: Internationalization547059 +Node: I18N and L10N548485 +Node: Explaining gettext549171 +Ref: Explaining gettext-Footnote-1554237 +Ref: Explaining gettext-Footnote-2554421 +Node: Programmer i18n554586 +Node: Translator i18n558786 +Node: String Extraction559579 +Ref: String Extraction-Footnote-1560540 +Node: Printf Ordering560626 +Ref: Printf Ordering-Footnote-1563410 +Node: I18N Portability563474 +Ref: I18N Portability-Footnote-1565923 +Node: I18N Example565986 +Ref: I18N Example-Footnote-1568621 +Node: Gawk I18N568693 +Node: Advanced Features569310 +Node: Nondecimal Data570823 +Node: Array Sorting572406 +Node: Controlling Array Traversal573103 +Node: Array Sorting Functions581340 +Ref: Array Sorting Functions-Footnote-1585014 +Ref: Array Sorting Functions-Footnote-2585107 +Node: Two-way I/O585301 +Ref: Two-way I/O-Footnote-1590733 +Node: TCP/IP Networking590803 +Node: Profiling593647 +Node: Library Functions601101 +Ref: Library Functions-Footnote-1604108 +Node: Library Names604279 +Ref: Library Names-Footnote-1607750 +Ref: Library Names-Footnote-2607970 +Node: General Functions608056 +Node: Strtonum Function609009 +Node: Assert Function611939 +Node: Round Function615265 +Node: Cliff Random Function616808 +Node: Ordinal Functions617824 +Ref: Ordinal Functions-Footnote-1620894 +Ref: Ordinal Functions-Footnote-2621146 +Node: Join Function621355 +Ref: Join Function-Footnote-1623126 +Node: Getlocaltime Function623326 +Node: Data File Management627041 +Node: Filetrans Function627673 +Node: Rewind Function631812 +Node: File Checking633199 +Node: Empty Files634293 +Node: Ignoring Assigns636523 +Node: Getopt Function638076 +Ref: Getopt Function-Footnote-1649380 +Node: Passwd Functions649583 +Ref: Passwd Functions-Footnote-1658558 +Node: Group Functions658646 +Node: Walking Arrays666730 +Node: Sample Programs668299 +Node: Running Examples668964 +Node: Clones669692 +Node: Cut Program670916 +Node: Egrep Program680761 +Ref: Egrep Program-Footnote-1688534 +Node: Id Program688644 +Node: Split Program692260 +Ref: Split Program-Footnote-1695779 +Node: Tee Program695907 +Node: Uniq Program698710 +Node: Wc Program706139 +Ref: Wc Program-Footnote-1710405 +Ref: Wc Program-Footnote-2710605 +Node: Miscellaneous Programs710697 +Node: Dupword Program711885 +Node: Alarm Program713916 +Node: Translate Program718665 +Ref: Translate Program-Footnote-1723052 +Ref: Translate Program-Footnote-2723280 +Node: Labels Program723414 +Ref: Labels Program-Footnote-1726785 +Node: Word Sorting726869 +Node: History Sorting730753 +Node: Extract Program732592 +Ref: Extract Program-Footnote-1740075 +Node: Simple Sed740203 +Node: Igawk Program743265 +Ref: Igawk Program-Footnote-1758422 +Ref: Igawk Program-Footnote-2758623 +Node: Anagram Program758761 +Node: Signature Program761829 +Node: Debugger762929 +Node: Debugging763895 +Node: Debugging Concepts764328 +Node: Debugging Terms766184 +Node: Awk Debugging768781 +Node: Sample Debugging Session769673 +Node: Debugger Invocation770193 +Node: Finding The Bug771522 +Node: List of Debugger Commands778010 +Node: Breakpoint Control779344 +Node: Debugger Execution Control783008 +Node: Viewing And Changing Data786368 +Node: Execution Stack789724 +Node: Debugger Info791191 +Node: Miscellaneous Debugger Commands795172 +Node: Readline Support800617 +Node: Limitations801448 +Node: Arbitrary Precision Arithmetic803700 +Ref: Arbitrary Precision Arithmetic-Footnote-1805341 +Node: General Arithmetic805489 +Node: Floating Point Issues807209 +Node: String Conversion Precision808304 +Ref: String Conversion Precision-Footnote-1810010 +Node: Unexpected Results810119 +Node: POSIX Floating Point Problems812272 +Ref: POSIX Floating Point Problems-Footnote-1816097 +Node: Integer Programming816135 +Node: Floating-point Programming817883 +Ref: Floating-point Programming-Footnote-1824147 +Node: Floating-point Representation824411 +Node: Floating-point Context825578 +Ref: table-ieee-formats826420 +Node: Rounding Mode827804 +Ref: table-rounding-modes828283 +Ref: Rounding Mode-Footnote-1831287 +Node: Gawk and MPFR831468 +Node: Arbitrary Precision Floats832709 +Ref: Arbitrary Precision Floats-Footnote-1835131 +Node: Setting Precision835442 +Node: Setting Rounding Mode838169 +Ref: table-gawk-rounding-modes838573 +Node: Floating-point Constants839770 +Node: Changing Precision841192 +Ref: Changing Precision-Footnote-1842592 +Node: Exact Arithmetic842766 +Node: Arbitrary Precision Integers845864 +Ref: Arbitrary Precision Integers-Footnote-1848946 +Node: Dynamic Extensions849093 +Node: Plugin License850011 +Node: Sample Library850625 +Node: Internal File Description851309 +Node: Internal File Ops855022 +Ref: Internal File Ops-Footnote-1859585 +Node: Using Internal File Ops859725 +Node: Language History862101 +Node: V7/SVR3.1863623 +Node: SVR4865944 +Node: POSIX867386 +Node: BTL868394 +Node: POSIX/GNU869128 +Node: Common Extensions874663 +Node: Ranges and Locales875770 +Ref: Ranges and Locales-Footnote-1880388 +Ref: Ranges and Locales-Footnote-2880415 +Ref: Ranges and Locales-Footnote-3880675 +Node: Contributors880896 +Node: Installation885192 +Node: Gawk Distribution886086 +Node: Getting886570 +Node: Extracting887396 +Node: Distribution contents889088 +Node: Unix Installation894310 +Node: Quick Installation894927 +Node: Additional Configuration Options896889 +Node: Configuration Philosophy898366 +Node: Non-Unix Installation900708 +Node: PC Installation901166 +Node: PC Binary Installation902465 +Node: PC Compiling904313 +Node: PC Testing907257 +Node: PC Using908433 +Node: Cygwin912618 +Node: MSYS913618 +Node: VMS Installation914132 +Node: VMS Compilation914735 +Ref: VMS Compilation-Footnote-1915742 +Node: VMS Installation Details915800 +Node: VMS Running917435 +Node: VMS Old Gawk919042 +Node: Bugs919516 +Node: Other Versions923368 +Node: Notes928683 +Node: Compatibility Mode929270 +Node: Additions930053 +Node: Accessing The Source930980 +Node: Adding Code932405 +Node: New Ports938413 +Node: Derived Files942548 +Ref: Derived Files-Footnote-1947852 +Ref: Derived Files-Footnote-2947886 +Ref: Derived Files-Footnote-3948486 +Node: Future Extensions948584 +Node: Basic Concepts950071 +Node: Basic High Level950752 +Ref: Basic High Level-Footnote-1954787 +Node: Basic Data Typing954972 +Node: Glossary958327 +Node: Copying983303 +Node: GNU Free Documentation License1020860 +Node: Index1045997 End Tag Table diff --git a/test/ChangeLog b/test/ChangeLog index 5414bfce..680954ed 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,9 @@ +2012-08-26 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (charasbytes): Revise test to canonicalize + whitespace. (For Mac OS X 10.5, at least.) + * charasbytes.ok: Updated. + 2012-08-23 Arnold D. Robbins <arnold@skeeve.com> * Makefile.am (revout, revtwoway): New tests. diff --git a/test/Makefile.am b/test/Makefile.am index ef833ef4..5f62852d 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1661,7 +1661,7 @@ charasbytes: @echo $@ @[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \ AWKPATH=$(srcdir) $(AWK) -b -f $@.awk $(srcdir)/$@.in | \ - od -c -t x1 >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + od -c -t x1 | sed -e 's/ */ /g' -e 's/ *$$//' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ # Targets generated for other tests: diff --git a/test/Makefile.in b/test/Makefile.in index c4b1bb60..35c7b201 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -2043,7 +2043,7 @@ charasbytes: @echo $@ @[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \ AWKPATH=$(srcdir) $(AWK) -b -f $@.awk $(srcdir)/$@.in | \ - od -c -t x1 >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + od -c -t x1 | sed -e 's/ */ /g' -e 's/ *$$//' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ Gt-dummy: # file Maketests, generated from Makefile.am by the Gentests program diff --git a/test/charasbytes.ok b/test/charasbytes.ok index a1702e64..f60f2ab4 100644 --- a/test/charasbytes.ok +++ b/test/charasbytes.ok @@ -1,3 +1,3 @@ -0000000 Z Z Z \n - 5a 5a 5a 0a +0000000 Z Z Z \n + 5a 5a 5a 0a 0000004 |