Update spec to require automake >= 1.13
[platform/upstream/gawk.git] / ChangeLog
1 2014-04-08         Arnold D. Robbins     <arnold@skeeve.com>
2
3         * 4.1.1: Release tar ball made.
4
5 2014-04-08         Arnold D. Robbins     <arnold@skeeve.com>
6
7         * README: Update.
8         * configure.ac: Bump version.
9
10 2014-04-03         Arnold D. Robbins     <arnold@skeeve.com>
11
12         * regcomp.c (parse_bracket_exp): Move a call to `re_free' inside
13         an ifdef. Makes the code marginally cleaner.
14
15 2014-03-30         Arnold D. Robbins     <arnold@skeeve.com>
16
17         * dfa.c: Sync with GNU grep.
18
19 2014-03-28         Arnold D. Robbins     <arnold@skeeve.com>
20
21         * configure.ac: Remove duplicate AC_HEADER_TIME and rearrange
22         order of macros some. May help on older systems.
23
24 2014-03-23         Arnold D. Robbins     <arnold@skeeve.com>
25
26         * dfa.c: Move include of dfa.h around for correct building
27         on Irix. Thanks to Nelson H.F. Beebe for the report.
28
29         Unrelated:
30
31         * .gitignore: Simplify .dSYM pattern for Mac OS X.
32
33 2014-03-21         Arnold D. Robbins     <arnold@skeeve.com>
34
35         * dfa.c (using_simple_locale): Add ifdefs in case there is no
36         locale support at all. Thanks to Scott Deifik for the report.
37
38         Unrelated:
39
40         * main.c (UPDATE_YEAR): Set to 2014.
41
42 2014-03-17         Arnold D. Robbins     <arnold@skeeve.com>
43
44         * .gitignore: Add .dSYM directories for Mac OS X.
45         Thanks to Hermann Peifer for the suggestion.
46
47 2014-03-10         Arnold D. Robbins     <arnold@skeeve.com>
48
49         * dfa.h, dfa.c: Sync with grep. Yet again.
50         * regex_internal.c (built_wcs_upper_buffer, build_upper_buffer):
51         Fixes from GNULIB for mixed case matching on Mac OS X.
52
53         Unrelated:
54
55         * builtin.c (format_tree): Smarten handling of %' flag. Always
56         pass it in for floating point formats. Then only add the
57         thousands_sep if there is one. Also, allow for thousands_sep
58         to be a string, not just one character.  Thanks to Michal Jaegermann
59         for the report.
60
61 2014-03-08         Andrew J. Schorr     <aschorr@telemetry-investments.com>
62
63         * gawkapi.c (api_impl): Add memory allocation function pointers.
64         * gawkapi.h (GAWK_API_MINOR_VERSION): Bump.
65         (gawk_api_t): Add memory allocation function pointers api_malloc,
66         api_calloc, api_realloc, and api_free.
67         (gawk_malloc, gawk_calloc, gawk_realloc, gawk_free): New macros.
68         (emalloc): Replace malloc with gawk_malloc.
69         (erealloc): Replace erealloc with gawk_erealloc.
70
71 2014-03-05         Arnold D. Robbins     <arnold@skeeve.com>
72
73         Straighten out enumerated types some more.
74
75         * awk.h (add_srcfile): Fix type of first parameter.
76         * awkgram.y (add_srcfile, do_add_srcfile): Ditto.
77         * cmd.h (A_NONE): New enum nametypeval.
78         * command.y (argtab): Use it in final value.
79         * ext.c (make_builtin): Use awk_false, awk_true.
80         * io.c (init_output_wrapper): Use awk_false.
81
82         Unrelated:
83
84         * debug.c (do_commands): Initialize num to silence warnings.
85         Thanks to Michal Jaegermann.
86
87         Unrelated:
88
89         * builtin.c (do_mktime): Change lint warning for minutes to
90         check against 59, not 60.  Thanks to Hermann Peifer for the report.
91
92 2014-03-03         Arnold D. Robbins     <arnold@skeeve.com>
93
94         * dfa.c: Sync with grep. Yet again.
95
96 2014-02-28         Arnold D. Robbins     <arnold@skeeve.com>
97
98         * dfa.c: Sync with grep. Looks like good improvement with
99         respect to bracket expressions.
100
101 2014-02-27         Arnold D. Robbins     <arnold@skeeve.com>
102
103         Fixes for enum/int mismatches as warned by some compilers.
104
105         * awk.h (ANONE): New enum for array sorting.
106         * array.c (assoc_list): Use it.
107         * builtin.c (format_tree): New MP_NONE value.
108         * gawkapi.c: Use awk_false and awk_true everywhere instead of
109         false and true.
110
111 2014-02-26         Arnold D. Robbins     <arnold@skeeve.com>
112
113         * configure.ac: Set up do-nothing extension/Makefile on
114         MirBSD also.
115
116 2014-02-21         Arnold D. Robbins     <arnold@skeeve.com>
117
118         * dfa.h, dfa.c (parse_bracket_exp): Sync with grep.
119
120 2014-02-20         Arnold D. Robbins     <arnold@skeeve.com>
121
122         * regex.h, regex.c, regex_internal.c, regex_internal.h: Sync
123         with GLIBC. Mainly copyright updates.
124         * getopt.c, getopt.h, getopt1.c, getopt_int.h: Ditto.
125         * dfa.c (parse_bracket_exp): Sync with grep, where they restored
126         the buggy code.  Sigh.
127
128         Unrelated:
129
130         * NEWS: Typo fix.
131         * interpret.h (r_interpret): Init a variable for BEGINFILE to avoid
132         compiler warnings. Thanks to Michal Jaegermann.
133
134 2014-02-15         Arnold D. Robbins     <arnold@skeeve.com>
135
136         * awkgram.c, command.c: Regenerated - Bison 3.0.2.
137
138 2014-02-04         Arnold D. Robbins     <arnold@skeeve.com>
139
140         * dfa.c (to_uchar): Make use of this. Syncs with GNU grep.
141
142 2014-02-03         Arnold D. Robbins     <arnold@skeeve.com>
143
144         * awkgram.y (negate_num): Bracket `tval' in #ifdef MPFR since it's
145         only used in that code.
146
147 2014-01-31         Arnold D. Robbins     <arnold@skeeve.com>
148
149         * Makefile.am (dist-hook): Improve creation of pc/config.h. We
150         have to jump through a lot of hoops for 'make distcheck' to
151         actually work.
152
153 2014-01-30         Arnold D. Robbins     <arnold@skeeve.com>
154
155         * Makefile.am (dist-hook): Improve creation of pc/config.h to copy
156         the new file into the distribution directory being created.
157         Also, put the temporary files into /tmp.
158
159 2014-01-28         Arnold D. Robbins     <arnold@skeeve.com>
160
161         * awkgram.y (negate_num): If just a double, return. Fixes a bug
162         that showed up on 32-bit systems with MPFR. Thanks to Eli Zaretskii
163         and Corinna Vinschen for the report.  Also, free the MPZ integer.
164         Thanks to valgrind for the report.
165
166         Unrelated:
167
168         * dfa.c: Sync with GNU grep - removed some special cased code
169         for grep.
170
171 2014-01-24         Arnold D. Robbins     <arnold@skeeve.com>
172
173         * configure.ac, field.c: Update copyright year.
174
175 2014-01-19         Arnold D. Robbins     <arnold@skeeve.com>
176
177         * awkgram.y (negate_num): Handle the case of -0 for MPFR; the sign
178         was getting lost. Thanks to Hermann Peifer for the report.
179
180 2014-01-18         Arnold D. Robbins     <arnold@skeeve.com>
181
182         * dfa.c (parse_bracket_exp): Sync with GNU grep, which now uses
183         gawk's code for RRI in single-byte locales!  Hurray.
184
185 2014-01-16         Arnold D. Robbins     <arnold@skeeve.com>
186
187         * configure.ac: For z/OS, restore creation of do-nothing
188         Makefile in extension directory.
189
190 2014-01-14         Arnold D. Robbins     <arnold@skeeve.com>
191
192         * field.c (do_split): Make sure split() gets FS value if no
193         third arg even after FPAT was set. Thanks to Janis Papanagnou
194         for the report.
195
196 2014-01-13         Arnold D. Robbins     <arnold@skeeve.com>
197
198         * README: Fix John Malmberg's email address.
199
200 2014-01-12         Arnold D. Robbins     <arnold@skeeve.com>
201
202         * awkgram.y:  Update copyright year.
203         (func_use): Simplify code.
204         * command.y:  Update copyright year.
205         * ext.c:  Update copyright year.
206         (make_builtin): Small simplification.
207         (make_old_builtin): Make code consistent with make_builtin(), add
208         call to track_ext_func().
209         * bootstrap.sh: Update copyright year. Remove touch of version.c
210         since that file is no longer autogenerated.
211
212 2014-01-07         Arnold D. Robbins     <arnold@skeeve.com>
213
214         * command.y (next_word): Move into ifdef for HAVE_LIBREADLINE,
215         since it's only used by that code.
216         * ext.c (load_old_ext): Minor improvements.
217
218 2014-01-03         Arnold D. Robbins     <arnold@skeeve.com>
219
220         * config.guess, config.rpath, config.sub, depcomp,
221         install-sh: Updated.
222         * dfa.h, dfa.c: Sync with GNU grep; comment fix and copyright year.
223         * NEWS: Updated some, including copyright year.
224
225 2013-12-26         Arnold D. Robbins     <arnold@skeeve.com>
226
227         * README: Add John Malmberg for VMS.
228
229 2013-12-24         Arnold D. Robbins     <arnold@skeeve.com>
230
231         * getopt.h: Add `defined(__sun)' to list of system that do get to
232         include stdlib.h.  Needed for Illumos. Thanks to
233         Richard Palo <richard.palo@free.fr> for the report.
234
235 2013-12-21         Mike Frysinger        <vapier@gentoo.org>
236
237         * configure.ac: Add --disable-extensions flag to control
238         compiling extensions.  Better for cross-compiling.
239         (AC_CANONICAL_HOST): Added. Changed case statments appropriately.
240         * Makefile.am (check-for-shared-lib-support): Removed.
241         (check-recursive, all-recursive): Removed.
242
243 2013-12-21         Arnold D. Robbins     <arnold@skeeve.com>
244
245         * config.guess: Updated.
246         * configure, aclocal.m4: Updated based on automake 1.13.4.
247
248 2013-12-19         Arnold D. Robbins     <arnold@skeeve.com>
249
250         * regexec.c (re_search_internal): Make sure `dfa' pointer is
251         not NULL before trying to dereference it.
252
253 2013-12-16         Arnold D. Robbins     <arnold@skeeve.com>
254
255         * configure.ac (AC_FUNC_VPRINTF): Remove. Not needed on current
256         systems.
257         * awk.h (HAVE_VPRINTF): Remove check.
258
259 2013-12-12         John E. Malmberg      <wb8tyw@qsl.net>
260
261         * io.c (redirect): Add additional VMS error codes.
262         (nextfile): Retry open after closing some files.
263
264 2013-12-10         Scott Deifik          <scottd.mail@sbcglobal.net>
265
266         * io.c (closemaybesocket): Add definition for DJGPP.
267
268 2013-12-10         Arnold D. Robbins     <arnold@skeeve.com>
269
270         * awk.h (Floor, Ceil): Remove declarations and VMS redefinitions.
271         * floatcomp.c (Floor, Ceil): Removed, not needed. Move bracketing
272         ifdef to the top of the file.
273         * builtin.c (double_to_int): Use floor() and ceil().
274
275 2013-12-07         Arnold D. Robbins     <arnold@skeeve.com>
276
277         * regex_internal.h (__attribute__): Define to empty if not GCC.
278         * custom.h (__attribute__): Remove the definition from here; the
279         right place was regex_internal.h.
280
281 2013-12-06         Arnold D. Robbins     <arnold@skeeve.com>
282
283         No need to generate version.c from version.in.
284         Thanks to John E. Malmberg <wb8tyw@qsl.net> for the suggestion.
285
286         * version.in: Removed.
287         * version.c: Use PACKAGE_STRING directly.
288         * Makefile.am (EXTRA_DIST): Remove version.in.
289         (distcleancheck_listfiles): Remove this rule.
290         (MAINTAINERCLEANFILES): Remove this definition.
291         (version.c): Remove the rule to create it.
292
293 2013-12-05         Arnold D. Robbins     <arnold@skeeve.com>
294
295         Fixes for Z/OS.
296
297         * custom.h (__attribute__): Define to empty.
298         * dfa.c (parse_bracket_exp): Add a cast to quiet a warning.
299         * regex.c: Correctly bracket include of <sys/param.h>.
300
301         Unrelated:
302
303         * debug.c (find_rule): Add a FIXME comment.
304
305 2013-12-03         John E. Malmberg     <wb8tyw@qsl.net>
306
307         * io.c (redirect): Add additional VMS error code to check.
308         (do_find_source): Append "/" if not a VMS filename.
309
310 2013-12-01         Andrew J. Schorr     <aschorr@telemetry-investments.com>
311
312         * main.c (optab): Sort by long option name.
313
314 2013-11-27         Andrew J. Schorr     <aschorr@telemetry-investments.com>
315
316         * main.c (optab): Add entry for --include.
317
318 2013-11-23         Arnold D. Robbins     <arnold@skeeve.com>
319
320         * dfa.c: Merge from grep; minor fixes in how bit twiddling
321         is done.
322
323 2013-11-01         Arnold D. Robbins     <arnold@skeeve.com>
324
325         * dfa.c (lex): Reset laststart so that stuff like \s* works.
326         Fix from grep.
327
328 2013-10-31         Arnold D. Robbins     <arnold@skeeve.com>
329
330         * builtin.c (efwrite): If write error to stdout is EPIPE,
331         die silently.  Thanks to Hermann Peifer for helping find this.
332
333 2013-10-22         Arnold D. Robbins     <arnold@skeeve.com>
334
335         Revise error messages when writing to standard output or standard
336         error to ignore EPIPE.  Add the ability based on an environment
337         variable to get the source file and line number.
338
339         * awk.h (r_warning): Renamed from warning.
340         (warning): New macro to set location and call warning.
341         * io.c (flush_io): Print errors only if not EPIPE.
342         (close_io): Ditto.
343         * main.c (lintfunc): Init to r_warning.
344         (main): Enhance explanatory comment.
345         (usage): Print errors only if not EPIPE.
346         (copyleft): Ditto.
347         * msg.c (err): Make printing srcfile and srcline depend upon
348         GAWK_MSG_SRC environment variable.
349         (r_warning): Renamed from warning.
350
351 2013-10-17         Arnold D. Robbins     <arnold@skeeve.com>
352
353         * main.c (main): Ignore SIGPIPE. See the comment in the code.
354         Thanks to Alan Broder for reporting the issue.
355
356 2013-10-16         Arnold D. Robbins     <arnold@skeeve.com>
357
358         Make -O work again.  Turns out that C99 bool variables
359         are clamped to zero or one.
360
361         * main.c (do_optimize): Init to false.
362         (main): Set do_optimize to true on -O.
363         * eval.c (setup_frame): Change all uses of do_optimize to be
364         a boolean check instead of a test > 1.
365         * awkgram.y: Ditto.
366         (optimize_assignment): Remove check against do_optimize since
367         it was inited to true anyway.
368
369         Unrelated:
370
371         * re.c (resetup): Add a comment about the joy of syntax bits.
372
373 2013-10-10         Arnold D. Robbins     <arnold@skeeve.com>
374
375         * dfa.c (lex): Sync with GNU grep. Handle multibyte \s and \S.
376
377         Unrelated:
378
379         * awk.h [ARRAY_MAXED]: Fix value of this and subsequent flags
380         after addition of NULL_FIELD.
381         * eval.c (flags2str): Add NULL_FIELD. Duh.
382
383 2013-10-09         Arnold D. Robbins     <arnold@skeeve.com>
384
385         * awkgram.y (mk_assignment): Rework switch to handle Op_assign,
386         and to provide a better error message upon unknown opcode.
387
388 2013-09-28         Arnold D. Robbins     <arnold@skeeve.com>
389
390         * dfa.c: Sync with GNU grep.
391
392 2013-09-24         Arnold D. Robbins     <arnold@skeeve.com>
393
394         * debug.c (find_rule): Handle case where lineno is zero. Can happen
395         if break is given without a line number on a current line. Thanks
396         to Ray Song <i@maskray.me> for the report.
397
398 2013-09-19         Arnold D. Robbins     <arnold@skeeve.com>
399
400         * dfa.c (parse_bracket_exp): Use code from grep to keep things within
401         range (updates change of 2013-09-08). Fix whitespace in one of the
402         gawk-only additions.
403
404 2013-09-13         Arnold D. Robbins     <arnold@skeeve.com>
405
406         Fix use of NF after it's extended, e.g. see test/nfloop.awk.
407
408         * awk.h (NULL_FIELD): New flag
409         * builtin.c (do_print_rec): Check f0->flags instead of if
410         equal to Nnull_string.
411         * eval.c (r_get_field): Check (*lhs)->flags instead of if
412         equal to Nnull_string or Null_field.
413         * field.c (init_fields): Init field zero and Null_field with
414         NULL_FIELD flag.
415         (set_NF): Set parse_high_water = NF in case NF extended past the
416         end. This is the actual bug fix.
417
418 2013-09-08         Arnold D. Robbins     <arnold@skeeve.com>
419
420         Fixes based on reports from a static code checker. Thanks to
421         Anders Wallin for sending in the list.
422
423         * array.c (asort_actual): Free list if it's not NULL.
424         * builtin.c (do_sub): Set buf to NULL and assert on it before using
425         it.
426         * cint_array.c (cint_array_init): Clamp any value of NHAT from the
427         environment such that it won't overflow power_two_table when used as
428         an index.
429         * dfa.c (parse_bracket_exp): Check that len is in range before using it
430         to index buf.
431         * getopt.c (_getopt_internal_r): Change call to alloca to use malloc.
432         * io.c (socket_open): Init read_len to zero.
433         (two_way_open): Upon failure to fork, close the slave fd also.
434         * re.c (research): Init try_backref to false.
435         * regcomp.c (build_range_exp): Free any items that were allocated in
436         the case where not all items were.
437         (build_charclass_op): Same. Init br_token to zero with memset.
438         (create_tree): Init token t to zero with memset.
439         * regex_internal.c (re_dfa_add_node): Free any items that were
440         allocated in the case where not all items were.
441         * symbol.c (destroy_symbol): On default, break, to fall into releasing
442         of resources.
443
444 2013-08-29         Arnold D. Robbins     <arnold@skeeve.com>
445
446         * debug.c (HAVE_HISTORY_LIST): Move checks and defines to the top.
447         (do_save, serialize): Adjust #if checks to depend on having both
448         readline and the history functions. Needed for Mac OS X whose
449         native readline is a very old version. Sigh.
450         * configh.in, configure: Regenerated due to change in m4/readline.m4.
451         Issue reported by Hermann Peifer and Larry Baker.
452
453         Unrelated:
454
455         * getopt.c: Sync with GLIBC, changes are minor.
456
457         Unrelated:
458
459         * dfa.c: Sync with version in grep. Primarily whitespace / comment
460         wording changes.
461
462 2013-08-26         Arnold D. Robbins     <arnold@skeeve.com>
463
464         * regcomp.c (parse_dup_op): Remove RE_TOKEN_INIT_BUG code (change of
465         Feb 19 2005) since it's no longer needed.
466
467         * regcomp.c (re_fastmap_iter): Undo addition of volatile from
468         Jan 18 2007; no longer needed and is one less change to have to
469         maintain aginst the upstream.
470
471         * regcomp.c, regex.h, regex_internal.h: Sync with GLIBC.
472
473 2013-08-20         Arnold D. Robbins     <arnold@skeeve.com>
474
475         * nonposix.h: New file. Contains FAKE_FD_VALUE.
476         * awk.h: Include it if MinGW or EMX.
477         * Makefile.am (base_sources): Add nonposix.h.
478
479 2013-08-18         Arnold D. Robbins     <arnold@skeeve.com>
480
481         * array.c (force_array): Set symbol->xarray to NULL before
482         initing the array if it was Node_var_new.
483         (null_array): Restore assert, undoing change of 2013-05-27.
484
485 2013-08-15         Arnold D. Robbins     <arnold@skeeve.com>
486
487         * debug.c (print_memory): Fix whitespace / indentation.
488
489 2013-07-24         Arnold D. Robbins     <arnold@skeeve.com>
490
491         * io.c (FAKE_FD_VALUE): Move definition from here ...
492         * awk.h (FAKE_FD_VALUE): ... to here. Fixes compilation on MinGW.
493
494 2013-07-08         Arnold D. Robbins     <arnold@skeeve.com>
495
496         * io.c (get_a_record): Change `min' to `MIN' for consistency with
497         other files and general practice.
498
499 2013-07-04         Andrew J. Schorr     <aschorr@telemetry-investments.com>
500
501         * gawkapi.h (awk_element_t): Add comment indicating that the array
502         element index will always be a string!
503         * gawkapi.c (api_flatten_array): When converting the index to an awk
504         value, request a string conversion, since we want the indices to
505         appear as strings to the extensions.  This makes the call to
506         force_string redundant, since node_to_awk_value does that internally
507         when we request a string.
508
509 2013-07-04         Arnold D. Robbins     <arnold@skeeve.com>
510
511         * builtin.c (format_tree): Fixes for %c with multibyte characters
512         and field width > 1. Bugs reported by Nethox <nethox@gmail.com>.
513
514 2013-07-02         Arnold D. Robbins     <arnold@skeeve.com>
515
516         * profile.c (pp_string): Add a call to chksize and fix another.
517         Avoids valgrind errors on profile5 test. Thanks to Andrew
518         Schorr for the report.
519
520 2013-06-27         Arnold D. Robbins     <arnold@skeeve.com>
521
522         * awkgram.y: Minor whitespace cleanup, remove redundant ifdef.
523
524 2013-06-24         Arnold D. Robbins     <arnold@skeeve.com>
525
526         * dfa.c (copytoks): Rewrite to call addtok_mb() directly. Avoids
527         problems with multibyte characters inside character sets.
528         Thanks to Steven Daniels <stevendaniels88@gmail.com> for reporting
529         the problem.  Much thanks to Mike Haertel <mike@ducky.net> for the
530         analysis and fix.
531
532 2013-06-24  Eli Zaretskii  <eliz@gnu.org>
533
534         * io.c: Move #include "popen.h" out of the HAVE_SOCKETS condition,
535         as this is needed for non-sockets builds as well.  See
536         http://lists.gnu.org/archive/html/bug-gawk/2013-06/msg00014.html
537         for the details of the problem this caused.
538
539 2013-06-15         Arnold D. Robbins     <arnold@skeeve.com>
540
541         * io.c: Add ifdefs for VMS so that it will compile again.
542         Thanks to Anders Wallin.
543
544 2013-06-11         Arnold D. Robbins     <arnold@skeeve.com>
545
546         * debug.c (print_lines): Move setting of binary mode to after all
547         the messing with the fd. Simplifies code some.
548         * io.c (srcopen): Rearrange so that can add call to setbinmode
549         here too. This fixes the debugger and makes reading source
550         files a little faster. Thanks again to Corinna Vinschen.
551
552 2013-06-10         Arnold D. Robbins     <arnold@skeeve.com>
553
554         * debug.c (print_lines): Set binary mode so that calculation of the
555         byte offsets will be right. Thanks to Corinna Vinschen for the
556         direction.
557
558 2013-06-10         Arnold D. Robbins     <arnold@skeeve.com>
559
560         * re.c (check_bracket_exp): Remove warning about ranges being
561         locale dependent, since they aren't anymore.
562
563 2013-06-09         Arnold D. Robbins     <arnold@skeeve.com>
564
565         * io.c (iop_finish): Change fstat call to fcntl/F_GETFL per
566         Eli Z., for Windows.
567
568 2013-06-03         Arnold D. Robbins     <arnold@skeeve.com>
569
570         * eval.c (unwind_stack): If exiting, don't worry about strange stuff
571         on the stack.
572
573         Unrelated:
574
575         * awk.h (init_sockets): Declare.
576         * io.c (init_io): Remove ifdef around call.
577
578 2013-06-01  Eli Zaretskii  <eliz@gnu.org>
579
580         * io.c (SHUT_RD) [SD_RECEIVE]: Define to SD_RECEIVE.
581         (SHUT_WR) [SD_SEND]: Define to SD_SEND.
582         (SHUT_RDWR) [SD_BOTH]: Define to SD_BOTH.
583         (FD_TO_SOCKET, closemaybesocket) [!FD_TO_SOCKET]: New macros.
584         (SOCKET_TO_FD, SOCKET) [!SOCKET_TO_FD]: New macros.
585         (PIPES_SIMULATED): Define only for DJGPP.
586         (pipe) [__MINGW32__]: Define to call _pipe, unless PIPES_SIMULATED
587         is defined.
588         (init_io) [HAVE_SOCKETS]: Call init_sockets.
589         (iop_close, socketopen): Call closemaybesocket instead of close.
590         (redirect) [__MINGW32__]: Call wait_any with a non-zero argument.
591         (devopen) [__EMX__ || __MINGW32__]: Don't call stat on network
592         pseudo-filenames.
593         (two_way_open) [HAVE_SOCKETS]: Switch input and output to binary
594         mode if appropriate.
595         (two_way_open) [!PIPES_SIMULATED]: Use the __EMX__ code for MinGW
596         as well.
597         [__MINGW32__] Call spawnl to invoke $ComSpec and pass it a
598         suitably quoted command line.
599         (two_way_open) [__MINGW32__]: Wait only for a specified process
600         ID.  If successful, update the exit status of the exited process.
601         Don't use signals that are undefined on MinGW.
602         (two_way_open) [!PIPES_SIMULATED]: Use the __EMX__ code for MinGW
603         as well.
604         (min): Define only if not already defined.
605         (read_with_timeout) [__MINGW32__]: Allow reading from sockets with
606         timeout.
607         (gawk_fclose) [__MINGW32__]: Close the underlying socket as well.
608
609         * getopt.c: Include stdlib.h for MinGW as well.
610
611 2013-05-30         Arnold D. Robbins     <arnold@skeeve.com>
612
613         More profiling fixes:
614
615         * profile.c (pprint): For Op_in_array, parenthesize subscript if
616         the precedence is lower. E.g.:  (c = tolower(foo)) in ARRAY.
617         (prec_level): Merge cases for precedence of 5.
618         (parenthesize): Simplify, as in 3.1.8. Avoids stuff like
619         `(x == 1 && (z ==2 && (q == 4 && w == 7)))'.
620
621         Unrelated:
622
623         * io.c (iop_finish): fstat the fd before closing it to avoid
624         errors on some operating systems. Thanks to Eli Zaretskii
625         for the report.
626
627 2013-05-29         Arnold D. Robbins     <arnold@skeeve.com>
628
629         * profile.c (pp_group3): Renamed from pp_concat. Change all calls.
630         (is_binary): Change return type to bool.
631         (is_scalar): New function.
632         (pp_concat): New function to handle concatenation operator better.
633         (pprint): Call it at case Op_concat. Fix Op_K_delete if multiple
634         indexes to separate with "][".
635         General: Add leading comments as needed.
636
637 2013-05-28         Arnold D. Robbins     <arnold@skeeve.com>
638
639         * main.c (main): Add minor hack to not run code if pretty printing
640         and undocumented env var GAWK_NO_PP_RUN exists.
641         * profile.c (pp_string): Explicitly print NUL chars as \000.
642
643 2013-05-27         Arnold D. Robbins     <arnold@skeeve.com>
644
645         * configure.ac (AM_INIT_AUTOMAKE): Add dist-lzip to quiet
646         outside maintainer warnings.
647
648         Unrelated:
649
650         * configure.ac (AC_STRUCT_ST_BLKSIZE): Replaced with call to
651         AC_CHECK_MEMBERS.
652
653         Unrelated:
654
655         * array.c (null_array): Remove the assert and just clear
656         symbol->xarray.
657
658 2013-05-26         Arnold D. Robbins     <arnold@skeeve.com>
659
660         * getopt.c: For Mac OS X, also include <stdlib.h> to avoid
661         some compiler warnings.
662
663 2013-05-20         Arnold D. Robbins     <arnold@skeeve.com>
664
665         * gawkapi.h [FAKE_FD_VALUE]: Moved from here to ...
666         * io.c [FAKE_FD_VALAUE]: here.
667
668 2013-05-14  Eli Zaretskii  <eliz@gnu.org>
669
670         * io.c (devopen) [__EMX__ || __MINGW32__]: Produce EISDIR on MinGW
671         when an attempt to open() a directory fails.
672         (two_way_open) [__EMX__ || __MINGW32__]: When trying to open() a
673         directory fails with EISDIR, assign FAKE_FD_VALUE to the file
674         descriptor and attributes of a directory to its mode bits.  This
675         is needed to support the readdir extension.
676
677         * gawkapi.h (FAKE_FD_VALUE): New macro, used in io.h and in
678         extension/gawkdirfd.h.
679
680 2013-05-09         Arnold D. Robbins     <arnold@skeeve.com>
681
682         * 4.1.0: Release tar ball made.
683
684 2013-05-09         Arnold D. Robbins     <arnold@skeeve.com>
685
686         * awkgram.y (snode): Make it a fatal error to use a regexp constant
687         as the second argument of index(). Thanks to Christopher Durant
688         <christopher.durant@marquesa.net> and Brian Kernighan for the report
689         and the advice.
690
691 2013-04-28  Eli Zaretskii  <eliz@gnu.org>
692
693         * io.c (redirect): Remove the HACK that called close_one when
694         errno was zero in the MinGW build.  This prevents failure in
695         several tests in the test suite, e.g., closebad.
696
697 2013-04-28         Arnold D. Robbins     <arnold@skeeve.com>
698
699         * bootstrap.sh: Fix a comment.
700
701 2013-04-24         Arnold D. Robbins     <arnold@skeeve.com>
702
703         * io.c (do_getline_redir): Fix the leading comment.
704
705 2013-04-23         Arnold D. Robbins     <arnold@skeeve.com>
706
707         * main.c (load_procinfo): Add PROCINFO entries for API major
708         and minor versions.
709
710 2013-04-21         Arnold D. Robbins     <arnold@skeeve.com>
711
712         * missing: Update from Automake 1.13.1.
713
714 2013-04-18         Arnold D. Robbins     <arnold@skeeve.com>
715
716         * configure.ac: Fix a typo.
717
718 2013-04-17         Corinna Vinschen      <vinschen@redhat.com>
719
720         * configure.ac: Remove special casing for cygwin for libiconv
721         and libintl.
722
723 2013-04-16         Arnold D. Robbins     <arnold@skeeve.com>
724
725         * bootstrap.sh: Touch gawk.texi too. Update copyright.
726
727 2013-04-16         Arnold D. Robbins     <arnold@skeeve.com>
728
729         * awkgram.c: Regenerated from bison 2.7.1.
730         * command.c: Ditto.
731         * dfa.h, dfa.c: Minor edits to sync with GNU grep.
732         * gettext.h: Sync with gettext 0.18.2.1.
733         * random.h: Remove obsolete __P macro and use. Update copyright year.
734         * Makefile.am, array.c, builtin.c, cint_array.c, cmd.h, debug.c,
735         eval.c, ext.c, field.c, gawkapi.c, gawkapi.h, gettext.h, int_array.c,
736         interpret.h, msg.c, node.c, profile.c, re.c, replace.c, str_array.c,
737         symbol.c: Update copyright year.
738
739         Update to automake 1.13.1:
740
741         * configure.ac (AM_INIT_AUTOMAKE): Update version.
742         * configure, Makefile.in, aclocal.m4, awklib/Makefile.in,
743         doc/Makefile.in, test/Makefile.in: Regenerated.
744
745         * getopt.c, getopt.h, getopt1.c, getopt_int.h: Sync with GLIBC.
746
747 2013-04-14         Arnold D. Robbins     <arnold@skeeve.com>
748
749         * awkgram.y (check_funcs): Fix logic of test for called but
750         not defined warning. Thanks to Scott Deifik for the bug report.
751
752 2013-04-02         Arnold D. Robbins     <arnold@skeeve.com>
753
754         * profile.c (print_lib_list): Send final newline to prof_fp
755         instead of stdout.  Thanks to Hermann Peifer for the bug report.
756
757 2013-03-27         Arnold D. Robbins     <arnold@skeeve.com>
758
759         * Makefile.am (SUBDIRS): Move extension back into the middle of
760         the list so that `make check' without a prior `make' works.
761
762         Unrelated:
763
764         * main.c (main): Move env_lc into ifdef for LIBC_IS_BORKED.
765
766 2013-03-20         Arnold D. Robbins     <arnold@skeeve.com>
767
768         For systems where libc is borked (MirBSD, maybe others).
769
770         * dfa.c: Force use of gawk_mb_cur_max instead of MB_CUR_MAX and make
771         mbrtowc a macro that always fails.
772         (using_utf8): Force utf8 to be 0 if libc borked and gawk_mb_cur_max
773         is one.
774         * main.c (main): If libc is borked and LC_ALL or LANG exist in the
775         environment and are set to "C" or "c", force gawk_mb_cur_max to one.
776
777 2013-03-11         Arnold D. Robbins     <arnold@skeeve.com>
778
779         * re.c (check_bracket_exp): Make handling of embedded ] in
780         regexp smarter. Thanks to Ed Morton <mortoneccc@comcast.net>
781         for reporting the bug.
782
783 2013-03-01         Arnold D. Robbins     <arnold@skeeve.com>
784
785         Don't build extensions if API isn't supported:
786
787         * Makefile.am (SUBDIRS): Move extension directory to last in case
788         building the extensions is not supported.
789         * configure.ac: Add check for MirBSD and don't even try to run the
790         checks for DYNAMIC if so.
791
792         Check for systems (MirBSD) where libc doesn't understand not
793         to use UTF-8 for LC_ALL=C.
794
795         * configure.ac (LIBC_IS_BORKED): AC_DEFINE if needed.
796         * regcomp.c (init_dfa): Change logic as needed if LIBC_IS_BORKED.
797
798 2013-02-28         Arnold D. Robbins     <arnold@skeeve.com>
799
800         Cause profiling / pretty printing to include a list of
801         loaded extensions. Thanks to Hermann Peifer for the bug report.
802
803         * awk.h (srcfiles): Add declaration.
804         * profile.c (print_lib_list): New function.
805         (dump_prog): Call it.
806
807 2013-02-26         Arnold D. Robbins     <arnold@skeeve.com>
808
809         * awkgram.y (expression_list): In case of error return the list
810         instead of NULL so that snode gets something it can count.
811
812 2013-02-12         Arnold D. Robbins     <arnold@skeeve.com>
813
814         * bisonfix.awk: Comment out code for fixing contined #if
815         statements. It is likely not needed anymore. Leave it there in
816         case I'm wrong.
817
818 2013-02-06         Arnold D. Robbins     <arnold@skeeve.com>
819
820         * builtin.c (printf_common): Move nargs > 0 check into assert.
821         (do_sprintf): Add nargs check and fatal message to here.
822
823 2013-02-04         Arnold D. Robbins     <arnold@skeeve.com>
824
825         * main.c (main): Remove undocumented -m option which was for
826         compatibility with BWK awk. His awk dropped it back in 2007.
827
828 2013-02-03         Arnold D. Robbins     <arnold@skeeve.com>
829
830         * configure.ac: Add Automake test for cross compiling.
831
832 2013-01-31         Arnold D. Robbins     <arnold@skeeve.com>
833
834         * regcomp.c, regex.c, regex_internal.c, regexec.c: Update
835         copyright years to sync with GLIBC.
836
837         From: http://www.sourceware.org/ml/libc-alpha/2013-01/msg00967.html,
838         by Andreas Schwab <schwab@suse.de>:
839
840         * regexec.c (extend_buffers): Add parameter min_len.
841         (check_matching): Pass minimum needed length.
842         (clean_state_log_if_needed): Likewise.
843         (get_subexp): Likewise.`
844
845 2013-01-31         Arnold D. Robbins     <arnold@skeeve.com>
846
847         * dfa.c: Include "dfa.h" which includes regex.h after limits.h
848         so that RE_DUP_MAX gets the correct value. Especially needed on
849         OpenVMS. Thanks to Anders Wallin.
850
851         * main.c (version): Print out API version numbers if DYNAMIC.
852         Helpful also for knowing if to run the shlib tests.
853
854         * configure: Regenerated after change in m4/readline.m4.
855
856 2013-01-31         Arnold D. Robbins     <arnold@skeeve.com>
857
858         * PROBLEMS: Removed. It is no longer needed.
859         * Makefile.am (EXTRA_DIST): Remove PROBLEMS from list.
860
861 2013-01-31         Andrew J. Schorr     <aschorr@telemetry-investments.com>
862
863         * configure.ac: Remove TEST_MPFR conditional added in last patch.
864         We will instead test for MPFR capability by looking at the output
865         from gawk --version.
866
867 2013-01-27         Andrew J. Schorr     <aschorr@telemetry-investments.com>
868
869         * configure.ac: Add MPFR test for use in test/Makefile.am.
870
871 2013-01-25         Arnold D. Robbins     <arnold@skeeve.com>
872
873         * awkgram.y (parms_shadow): Change int param to bool.
874         * cmd.h (output_is_tty): Sync type with rest of code (is bool).
875         * dfa.c (MALLOC): Undef first, for Irix.
876         * Makefile.am (LDADD): Use LIBREADLINE and LIBMPFR instead of
877         automake substitutions.
878         * configure.ac (AC_INIT): Version bump.
879         (GAWK_CHECK_READLINE): Renamed from GNUPG_CHECK_READLINE.
880
881 2013-01-23         Arnold D. Robbins     <arnold@skeeve.com>
882
883         * awk.h (list_functions): Change parameter to bool.
884         * symbol.c (list_functions): Ditto.
885         (get_symbols): Change sort parameter to bool. Additional
886         code cleanup.
887
888 2013-01-22         Arnold D. Robbins     <arnold@skeeve.com>
889
890         * symbol.c (get_symbols): Reset count after each loop to only
891         sort the actual items retrieved. Thanks to Hermann Peifer (by
892         way of Andrew Schorr) for reporting the bug.  Also add some
893         commentary and fix function name in emalloc calls.
894
895 2013-01-20         Arnold D. Robbins     <arnold@skeeve.com>
896
897         * re.c (regexflags2str): New routine.
898         (resetup): If do_intervals, also turn on RE_NO_BK_BRACES.
899         Thanks to Yan Lei <yanl.fnst@cn.fujitsu.com> for the
900         bug report.
901
902 2013-01-18         Arnold D. Robbins     <arnold@skeeve.com>
903
904         Fix a problem with include ordering to get ptrdiff_t definition,
905         showed up on Debian Lenny. Reported by Manuel Collado.
906         Fix brought over from grep.
907
908         * dfa.h: Include regex.h and stddef.h directly.
909         * dfa.c: Adjust includes.
910
911 2013-01-11         John Haque            <j.eh@mchsi.com>
912
913         * awk.h (do_mpfr_rshift): Renamed from do_mpfr_rhift.
914         * awkgram.y (do_mpfr_rshift): Renamed from do_mpfr_rhift.
915         * mpfr.c (_tz1, _tz2, _mpz1, _mpz2, mpz1, mpz2, get_bit_ops,
916         free_bit_ops): Removed.
917         (init_mpfr): Remove calls to mpz_init.
918         (get_intval, free_intval): New functions.
919         (do_mpfr_rshift, do_mpfr_lshift): Rework code.
920         (do_mpfr_and, do_mpfr_or, do_mpfr_xor): Accept two or more arguments
921         to match regular functions.
922
923 2013-01-11         Arnold D. Robbins     <arnold@skeeve.com>
924
925         * bisonfix.awk: Adjust ARGV / ARGC to force reading of standard
926         input; apparently needed for Mac OS X. Thanks to Akim Demaille
927         for the report.
928
929 2013-01-06         Arnold D. Robbins     <arnold@skeeve.com>
930
931         * io.c (redirect, two_way_open): Set the name field in the
932         awk_input_buf_t and awk_output_buf_t structures, as needed.
933         Thanks to Manuel Collado for the report.
934
935 2013-01-05         Arnold D. Robbins     <arnold@skeeve.com>
936
937         * regex_internal.h (struct re_dfa_t): Restore ifdefs around
938         __libc_lock_define, they really were needed. Bleah.
939
940 2013-01-01         Arnold D. Robbins     <arnold@skeeve.com>
941
942         Sync with GLIBC regex files.
943
944         * regex_internal.h (struct re_dfa_t): Remove ifdefs around
945         __libc_lock_define since it's already defined to empty in non-LIBC
946         case.
947         * regexec.c (check_node_accept_bytes): Restore decl with use from
948         GLIBC code since this is LIBC case.
949
950 2012-12-27         Arnold D. Robbins     <arnold@skeeve.com>
951
952         * builtin.c (do_print, do_printf): Use output_fp as default
953         output for print/printf only if running under the debugger.
954         Otherwise use stdout as Brian, Peter, and Al intended.
955
956 2012-12-25         Arnold D. Robbins     <arnold@skeeve.com>
957
958         Remove sym-constant from API after discussions with John
959         Haque and Andy Schorr.
960
961         * gawkapi.h (api_sym_constant): Removed field in API struct.
962         (sym_constant): Remove macro.
963         * gawkapi.c (set_constant, api_sym_update, api_sym_constant): Removed.
964         (sym_update_real): Renamed to api_sym_update(). is_const parameter
965         removed and code adjusted.
966
967 2012-12-24         Arnold D. Robbins     <arnold@skeeve.com>
968
969         * 4.0.2: Release tar ball made.
970
971 2012-12-23         John Haque      <j.eh@mchsi.com>
972
973         * eval.c (r_get_lhs): Node_array_ref. If original is Node_var,
974         don't assign null-string as value.
975         * ext.c (get_argument): Node_array_ref. Check if already a scalar.
976
977 2011-12-23         John Haque      <j.eh@mchsi.com>
978
979         * awkgram.y (is_deferred_variable): New function.
980         (func_install): Call it.
981         * eval.c (r_interpret): Op_push_arg. Check for uninitialized scalar.
982
983 2012-12-23         Arnold D. Robbins     <arnold@skeeve.com>
984
985         * awkgram.y (tokentab): Whitespace fix for "include".
986         * builtin.c (printf_common): Do a fatal error if no args to printf()
987         or sprintf().
988
989 2012-12-19         Arnold D. Robbins     <arnold@skeeve.com>
990
991         * bootstrap.sh: Touch extension/aclocal.m4 also.
992
993         Unrelated: Extend input parser API:
994
995         * awk.h (IOBUF): Remove read_func pointer.
996         * gawkapi.h (awk_input_buf_t): Move it to here.
997         * io.c (iop_alloc, get_a_record, get_read_timeout): Adjust code.
998
999         Unrelated: Make sure that variables like NF, NR, FNR are
1000         accessable correctly both through SYMTAB and through API.
1001
1002         * gawkapi.c (api_sym_lookup): Call update_global_values().
1003         (api_sym_lookup_scalar): Ditto.
1004         * interpret.h (Op_subscript, Op_subscript_lhs): Ditto.
1005         * main.c (update_global_values): Adjust comment.
1006
1007         Unrelated: Fix --disable-lint so that everything compiles.
1008
1009         * main.c (main): Move case lable inside ifdef.
1010         * awkgram.y (isnoeffect): Add ifdefs around declaration, use,
1011         and function body.
1012
1013         Unrelated: Restore building with tcc.
1014
1015         * awk.h (AFUNC): Move to array.c which is the only place its used.
1016         (ainit_ind, atypeof_ind, etc.): New macros for use in array.c
1017         * array.c (AFUNC): Change to use F##_ind. Works with tcc and other
1018         compilers.
1019         * configure.ac: Only add -export-dynamic flag if compiling with gcc.
1020
1021 2012-12-18         Andrew J. Schorr     <aschorr@telemetry-investments.com>
1022
1023         * gawkapi.c (sym_update_real): If setting a scalar variable that exists
1024         already in an undefined state with type set to Node_var_new, we must
1025         update the type to Node_var if the new value is not undefined.
1026
1027 2012-12-18         Arnold D. Robbins     <arnold@skeeve.com>
1028
1029         * awkgram.y (tokentab): "extension" needs to be inside ifdef DYNAMIC.
1030         Thanks to Anders Wallin for finding this.
1031
1032 2012-12-16         Arnold D. Robbins     <arnold@skeeve.com>
1033
1034         * debug.c (do_set_var): Fix last remaining `*assoc_lookup() = x'.
1035
1036 2012-12-15         Arnold D. Robbins     <arnold@skeeve.com>
1037
1038         Infrastructure Updates:
1039
1040         * awkgram.c, command.c: Regenerated with bison 2.7.
1041         * config.guess, config.sub, depcomp: Updated from automake 1.12.6.
1042
1043 2012-12-09         Arnold D. Robbins     <arnold@skeeve.com>
1044
1045         Clean up BINMODE to use symbolic values.
1046
1047         * awk.h (enum binmode_values): New enum.
1048         * eval.c (set_BINMODE): Use them.
1049         * io.c (binmode, close_rp, gawk_popen): Ditto.
1050         * main.c (main): Ditto.
1051         * builtin.c (do_system): Ditto.
1052
1053         Unrelated:
1054
1055         * configure.ac: Look for posix_openpt
1056         * io.c (two_way_open): Use posix_openpt if it's available.
1057         Thanks to Christian Weisgerber <naddy@mips.inka.de> for
1058         the changes.
1059
1060         Also unrelated:
1061
1062         * regex.c: Don't include <sys/param.h> on VMS. Thanks to
1063         Anders Wallin.
1064
1065         Also unrelated:
1066
1067         * ext.c (is_letter, is_identifier_char): New functions. Don't use
1068         <ctype.h> functions since those could rely on the locale.
1069         (make_builtin): Adjust test for valid name to call the new
1070         functions and return false instead of throwing a fatal error.
1071         (make_old_builtin): Adjust test for valid name to call the new
1072         function.
1073         * awk.h (is_identchar): Move from here, ...
1074         * awkgram.y (is_identchar): ... to here. This is safe, since
1075         the locale is C during parsing the program.
1076
1077         Also unrelated: Make all checks for bitflags being set consistent
1078         in case we should wish to switch them to macro calls:
1079
1080         * awkgram.y, builtin.c, cint_array.c, debug.c, eval.c, gawkapi.c,
1081         int_array.c, io.c, mpfr.c, node.c, profile.c, str_array.c: Fix
1082         as needed.
1083
1084 2012-12-07         Arnold D. Robbins     <arnold@skeeve.com>
1085
1086         * awkgram.y (tokentab): `fflush()' is now in POSIX, remove the
1087         RESX flag. This was the last use, so delete the flag.
1088         (yylex): Don't check RESX.
1089
1090         Thanks to Nathan Weeks <weeks@iastate.edu> for helping make this
1091         happen.
1092
1093 2012-12-01         Arnold D. Robbins     <arnold@skeeve.com>
1094
1095         * interpret.h: For op_assign_concat, if both strings
1096         have WSTRCUR, then do the realloc() and append for the
1097         wide string too.  Thanks to Janis Papanagnou
1098         <janis_papanagnou@hotmail.com> for the discussion in
1099         comp.lang.awk.
1100
1101 2012-11-30         Arnold D. Robbins     <arnold@skeeve.com>
1102
1103         * regcomp.c, regex.c, regex_internal.h, regexec.c: Sync
1104         with GLIBC.  Why not.
1105
1106         * gawkapi.c (awk_bool_t): Change into an enum with awk_false and
1107         awk_true values.
1108
1109 2012-01-30         Andrew J. Schorr     <aschorr@telemetry-investments.com>
1110
1111         Further cleanups of macros in awk.h
1112
1113         * awk.h (_r, _t): Remove declarations.
1114         (unref, m_force_string): Remove macros.
1115         (r_unref): Move declaration.
1116         (r_force_string): Remove declaration.
1117         (DEREF, force_string, force_number, unref): Now inline functions.
1118         (POP_STRING, TOP_STRING): Back to macros.
1119         * eval.c (_t): Remove definition.
1120         * main.c (_r): Remove definition.
1121         * node.c (r_force_string): Remove.
1122
1123 2012-11-27         Arnold D. Robbins     <arnold@skeeve.com>
1124
1125         * builtin.c (do_fflush): Make fflush() and fflush("") both
1126         flush everything. See the comment in the code.
1127
1128 2012-11-26         Arnold D. Robbins     <arnold@skeeve.com>
1129
1130         * awk.h (Node_old_ext_func, Op_old_ext_func): New enum values.
1131         * configure.ac: Use -export-dynamic if supported for old extension
1132         mechanism.
1133         * eval.c (nodeytpes): Add Node_old_ext_func.
1134         (optypetab): Add Op_old_ext_func.
1135         * ext.c (make_old_ext_builtin): "New" function.
1136         * interpret.h: Special case Op_old_ext_builtin. Add checks for
1137         Node_old_ext_func.
1138         * msg.c: Adjust placement of a comment.
1139
1140 2012-05-02         John Haque      <j.eh@mchsi.com>
1141
1142         * str_array.c (str_copy): Initialize next pointer in the linked list
1143         to avoid memory corruption.
1144         * int_array.c (int_copy): Ditto.
1145
1146 2012-04-21         John Haque      <j.eh@mchsi.com>
1147
1148         Shutdown routine for a dynamic extension.
1149
1150         * awk.h (SRCFILE): New field fini_func.
1151         * ext.c (load_ext): Takes an additional argument to look up and
1152         save the clean up routine in SRCFILE struct. 
1153         (INIT_FUNC, FINI_FUNC): Defines for default init and fini routine
1154         names.
1155         (do_ext): Use default for the name of the init or fini routine if
1156         one is not supplied. Adjust call to load_ext().
1157         (close_extensions): Execute fini routines.
1158         * interpret.h (Op_at_exit): Call close_extensions().
1159         * msg.c (gawk_exit): Ditto.
1160         * debug.c (close_all): Ditto.
1161         * main.c (main): Adjust call to load_ext().
1162         * awkgram.y (tokentab): Specify 2nd and 3rd optional arguments
1163         for the extension() built-in.
1164
1165         Unrelated:
1166
1167         * interpret.h (Op_arrayfor_init): Use assoc_length for array size. 
1168         
1169 2012-04-19         John Haque      <j.eh@mchsi.com>
1170
1171         Enhanced array interface to support transparent implementation
1172         using external storage and ...
1173
1174         * awk.h (astore): Optional post-assignment store routine for
1175         array subscripts.
1176         (Op_subscript_assign): New opcode to support the store routine.
1177         (alength): New array interface routine for array length.
1178         (assoc_length): New macro.
1179         (assoc_empty): Renamed from array_empty.
1180         * awkgram.y (snode): Append Op_subscript_assign opcode if
1181         (g)sub variable is an array element.
1182         (mk_getline): Same for getline variable.
1183         (mk_assignment): Same if assigning to an array element.
1184         * field.c (set_element): Call store routine if needed.
1185         * builtin.c (do_match): Ditto.
1186         (do_length): Use length routine for array size.
1187         * symbol.c (print_vars): Ditto.
1188         * array.c (null_length): Default function for array length interface.
1189         (asort_actual): Call store routine if defined.
1190         (asort_actual, assoc_list): Use length routine for array size.
1191         (null_array_func): Add length and store routine entries.
1192         * str_array.c (str_array_func): Same.
1193         * cint_array.c (cint_array_func): Same.
1194         * int_array.c (int_array_func): Same. 
1195         * eval.c (optypetab): Add Op_subscript_assign.
1196         * profile.c (pprint): Add case Op_subscript_assign.
1197         * interpret.h (set_array, set_idx): New variables to keep track
1198         of an array element with store routine.
1199         (Op_sub_array, Op_subscript_lhs, Op_store_sub, Op_subscript_assign):
1200         Add code to handle array store routine.
1201         * debug.c (print_symbol, print_array, cmp_val, watchpoint_triggered,
1202         initialize_watch_item): Use length routine for array size.
1203
1204         * awk.h (assoc_kind_t): New typedef for enum assoc_list_flags.
1205         (sort_context_t): Renamed from SORT_CONTEXT.
1206         * array.c (asort_actual, assoc_sort): Adjust.
1207         * cint_array.c (cint_list, tree_list, leaf_list): Adjust.
1208         * int_array.c (int_list): Adjust.
1209         * str_array.c (str_list): Adjust.
1210
1211 2012-04-18         John Haque      <j.eh@mchsi.com>
1212
1213         * awk.h (atypeof, AFUNC): New macros.
1214         (afunc_t): Renamed typedef from array_ptr.
1215         * array.c (register_array_func, null_lookup): Use AFUNC macro
1216         instead of hard-coded index for array functions.
1217         (asort_actual): Unref null array elements before overwriting.
1218         (force_array): Renamed from get_array.
1219         (null_array): Renamed from init_array. Also initialize flags to 0.
1220         (array_types): Renamed from atypes.
1221         (num_array_types): Renamed from num_atypes.
1222         * interpret.h (r_interpret): In case Op_sub_array, unref null array element.
1223         * str_array.c (str_array_init): Reworked for (re)initialization of array.
1224         * int_array.c (int_array_init): Ditto.
1225         * cint_array.c (cint_array_init): Ditto.
1226
1227 2012-11-24         Arnold D. Robbins     <arnold@skeeve.com>
1228
1229         Directory cleanup.
1230
1231         * TODO.xgawk, FUTURES: Merged into TODO.
1232         * TODO: More stuff added.
1233         * Makefile.am (EXTRA_DIST): Updated.
1234
1235 2012-11-22         Arnold D. Robbins     <arnold@skeeve.com>
1236
1237         Cleanup of awk.h.
1238
1239         * array.c (r_in_array): Removed.
1240         * awk.h (MALLOC_ARG_T): Replaced with size_t everywhere.
1241         (S_ISREG, setsid): Moved to io.c.
1242         (__extension__): Removed.
1243         (INT32_BIT): Moved to cint_array.c.
1244         (_t): Always declare.
1245         (DO_LINT_INVALID, et al): Moved into an enum.
1246         (POP_ARRAY, POP_PARAM, POP_SCALAR, TOP_SCALAR, dupnode, in_array):
1247         Moved into inline functions.
1248         (force_number, force_string): Simplified.
1249         (ZOS_USS): Remove undef of DYNAMIC, it's handled in configure.ac.
1250         * io.c (S_ISREG, setsid): Moved to here.
1251         * cint_array.c (INT32_BIT): Moved to here.
1252         * eval.c (_t): Always define.
1253         * protos.h: Use size_t directly instead of MALLOC_ARG_T.
1254
1255         Unrelated:
1256
1257         * gawkapi.h: Add `awk_' prefix to structure tags where they
1258         were missing.  Document the full list of include files needed.
1259
1260 2012-11-14         Arnold D. Robbins     <arnold@skeeve.com>
1261
1262         * io.c (do_find_source): On VMS, don't add the `/' separater.
1263         Thanks to Anders Wallin.
1264
1265         MPFR minor cleanup:
1266
1267         * awk.h (mpfr_unset): Declare new function.
1268         * mpfr.c (mpfr_unset): New function.
1269         * node.c (r_unref): Call it instead of inline code.
1270         * gawk_api.c (api_sym_update_scalar): Call it instead of inline code.
1271
1272 2012-11-13         Arnold D. Robbins     <arnold@skeeve.com>
1273
1274         * symbol.c (get_symbols): Check type, not vname. Keeps
1275         valgrind happy. Thanks to Andrew Schorr for noticing the problem.
1276
1277 2012-11-10         Arnold D. Robbins     <arnold@skeeve.com>
1278
1279         * Update to bison 2.6.5. Various files regenerated.
1280         * io.c (find_source): Add a default value for SHLIBEXT.
1281         (read_with_timeout): For VMS also, just use read().
1282
1283 2012-11-10         John Haque      <j.eh@mchsi.com>
1284
1285         * int_array.c (int_copy): Initialize next pointer of newchain to null.
1286         * eval.c (eval_condition): Force string context for an integer used
1287         as array index.
1288
1289 2012-11-10         Arnold D. Robbins     <arnold@skeeve.com>
1290
1291         * gawkapi.c (api_add_ext_func, api_awk_atexit, api_clear_array,
1292         api_create_array, api_create_value, api_register_ext_version,
1293         api_release_value, api_update_ERRNO_string, node_to_awk_value,
1294         remove_element, run_ext_exit_handlers): Add null pointer checks.
1295         Everywhere: Add / fixup leading comments.
1296
1297         * interpret.h (Op_store_sub): If assigning to an unitialized variable
1298         through SYMTAB, change it to Node_var. Add explanatory comments.
1299         * symbol.c (get_symbol): Rationalized. Skip non-variables in SYMTAB.
1300
1301 2012-11-04         Arnold D. Robbins     <arnold@skeeve.com>
1302
1303         * gawkapi.h: Minor documentation edit.
1304
1305 2012-10-31         Arnold D. Robbins     <arnold@skeeve.com>
1306
1307         * awkgram.y (want_regexp): Use as a bool, not as an int.
1308         * field.c: Fix a comment.
1309         * gawkapi.h: Add comment to include <errno.h>.
1310         * symbol.c (load_symbols): ``No automatic aggregate initialization.''
1311         Here too. Sigh again.
1312
1313         * gawkapi.h: Minor documentation edits.
1314
1315 2012-11-27         Arnold D. Robbins     <arnold@skeeve.com>
1316
1317         * builtin.c (do_fflush): Make fflush() and fflush("") both
1318         flush everything. See the comment in the code.
1319
1320 2012-10-28         Arnold D. Robbins     <arnold@skeeve.com>
1321
1322         * Update to bison 2.6.4. Various files regenerated.
1323
1324 2012-10-27         Arnold D. Robbins     <arnold@skeeve.com>
1325
1326         * gawkapi.h: Continuing the minor formatting / doc cleanups.
1327
1328 2012-10-26         Arnold D. Robbins     <arnold@skeeve.com>
1329
1330         * gawkapi.h: Continuing the minor formatting / doc cleanups.
1331
1332 2012-10-24         Arnold D. Robbins     <arnold@skeeve.com>
1333
1334         * gawkapi.h: Still more minor formatting / doc cleanups.
1335
1336 2012-10-23         Arnold D. Robbins     <arnold@skeeve.com>
1337
1338         * gawkapi.h: More minor formatting / doc cleanups.
1339
1340 2012-10-21         Arnold D. Robbins     <arnold@skeeve.com>
1341
1342         Fixes for z/OS from Dave Pitts.
1343
1344         * awk.h (assoc_list_flags): No trailing comma on last enum value.
1345         * gawkapi.h (awk_valtype_t): Ditto.
1346         * symbol.c (lookup): ``No automatic aggregate initialization.'' Sigh.
1347
1348         Unrelated:
1349
1350         * gawkapi.h: Minor formatting / doc cleanups.
1351
1352 2012-10-19         Arnold D. Robbins     <arnold@skeeve.com>
1353
1354         If SYMTAB is used, make sure ENVIRON and PROCINFO get loaded too.
1355
1356         * awkgram.y (process_deferred): New function. Call it when program
1357         is completely parsed.
1358         (symtab_used): New variable.
1359         (variable): Set it to true if SYMTAB is looked up.
1360         * main.c (load_environ, load_procinfo): Make sure the routines are
1361         only called once.
1362
1363         Unrelated fixes:
1364
1365         * awkgram.y (yylex): Check continue_allowed and break_allowed as
1366         soon as they are seen in the scanner; the rules that check them
1367         can not be reduced until after a token that allows them is seen,
1368         leading to errors at execution time.
1369         * interpret.h (Op_K_break, Op_K_continue, Op_jmp): Add asssertion
1370         that pc->target_jmp is not NULL.
1371
1372         * symbol.c (lookup): Correct a comment.
1373
1374 2012-10-14         Arnold D. Robbins     <arnold@skeeve.com>
1375
1376         * gawkapi.h (IOBUF_PUBLIC): Renamed awk_input_buf_t.
1377         (struct iobuf_public): Renamed struct awk_input.
1378         * awk.h: Adjust.
1379
1380 2012-10-13         Arnold D. Robbins     <arnold@skeeve.com>
1381
1382         * Update to Automake 1.12.4. Various files regenerated.
1383
1384 2012-10-11         Arnold D. Robbins     <arnold@skeeve.com>
1385
1386         * awk.h (dup_ent): New member for Node_param_list.
1387         * symbol.c (install): For parameters, if this is a duplicate, chain
1388         it off the original using the dup_ent pointer.
1389         (remove_params): If there's a duplicate, remove it from the list.
1390
1391         * awk.h: Fix flags to have unique numeric values. Oops.
1392
1393 2012-10-10         Arnold D. Robbins     <arnold@skeeve.com>
1394
1395         * gawkapi.h: Add considerably more documentation. Rearrange order
1396         of functions in the struct to make more sense, grouping related
1397         functions together in a more logical order.
1398         * gawkapi.c: Adjust as needed.
1399         * ext.c (make_builtin): Adjust for name change in struct member.
1400
1401 2012-10-05         Arnold D. Robbins     <arnold@skeeve.com>
1402
1403         * mbsupport.h: Add a bunch of undefs for z/OS.
1404
1405 2012-10-04         Arnold D. Robbins     <arnold@skeeve.com>
1406
1407         * TODO.xgawk: Update.
1408         * awk.h (make_str_node): Removed macro.
1409         (make_string): Modified to call make_str_node.
1410         (r_make_str_node): Renamed to make_str_node.
1411         * gawkapi.c: Changed r_make_str_node to make_str_node everywhere.
1412         * node.c (make_str_node): Renamed from make_str_node.
1413
1414         Update to automake 1.12.4.
1415
1416         * Makefile.in, aclocal.m4, awklib/Makefile.in, doc/Makefile.in,
1417         extension/Makefile.in, extension/aclocal.m4, test/Makefile.in:
1418         Regenerated.
1419
1420         * interpret.h (Op_Subscript): Added lint warnings for FUNCTAB
1421         and SYMTAB.
1422
1423 2012-10-02         Arnold D. Robbins     <arnold@skeeve.com>
1424
1425         * awk.h (func_table): Declare.
1426         * awkgram.y: If do_posix or do_traditional, then check for
1427         delete on SYMTAB. Add check for delete on FUNCTAB, also.
1428         * interpret.h (Op_Subscript): For FUNCTAB, return the element name
1429         as its value too.  Avoids lots of weirdness and allows indirect calls
1430         after assignment from FUNCTAB["foo"] to work.
1431         (Op_store_sub): Disallow assignment to elements of FUNCTAB.
1432         (Op_indirect_func_all): Turn assert into check and fatal error.
1433         * symbol.c (func_table): No longer static.
1434         (lookup): If do_posix or do_traditional, skip the global table.
1435         (release_all_vars): Clear func_table too.
1436
1437 2012-09-25         Arnold D. Robbins     <arnold@skeeve.com>
1438
1439         First cut at SYMTAB and FUNCTAB. This does the following:
1440         - Change symbol table handling to use gawk arrays.
1441         - Store symbols in SYMTAB array and allow indirect access
1442           through SYMTAB to variables, both getting and setting.
1443         - List function names in FUNCTAB indexes; Values cannot be
1444           used at the moment.
1445         - No documentation yet.
1446
1447         * awk.h (Node_hashnode, hnext, hname, hlength, hcode, hvalue):
1448         Removed, not needed any more.
1449         (init_symbol_table, symbol_table): Add declarations.
1450         * awkgram.y: Disallow delete on SYMTAB, fix warning for tawk
1451         extension if traditional.
1452         * eval.c (nodetypes): Remove Node_hashnode element.
1453         * interpret.h (Op_subscript, Op_store_sub): Handle SYMTAB and go
1454         through to the actual value.
1455         * main.c (main): Init Nnull_string earlier. Add call to
1456         init_symbol_table().
1457         * profile.c (pp_str, pp_len): Change definitions.
1458         (pp_next): New macro.
1459         (pp_push, pp_pop): Adjust uses.
1460         * symbol.c (variables): Removed.
1461         (global_table, param_table, func_table, symbol_table,
1462         installing_specials): New variables.
1463         (lookup, make_params, install_params, remove_params, remove_symbol,
1464         make_symbol, install, get_symbols, release_all_vars, append_symbol,
1465         release_symbols, load_symbols): Rework logic considerably.
1466         (init_symbol_table): New function.
1467
1468 2012-09-23         Arnold D. Robbins     <arnold@skeeve.com>
1469
1470         `delete array' and `nextfile' are now in POSIX.
1471         Thanks to Nathan Weeks <weeks@iastate.edu> for the
1472         initiative and letting us know about it.
1473
1474         * awkgram.y: Make the right code changes for `delete array'
1475         and `nextfile'.
1476         (tokentab): Set flags to zero for nextfile.
1477
1478 2012-09-19         Arnold D. Robbins     <arnold@skeeve.com>
1479
1480         * symbol.c (load_symbols): Zero out the new node. Prevents assertion
1481         failure on PPC Mac OS X.
1482
1483 2012-09-14         Arnold D. Robbins     <arnold@skeeve.com>
1484
1485         Allow read-only access to built-in variables from extensions.
1486
1487         * awk.h (NO_EXT_SET): New flag.
1488         * gawkapi.c (api_sym_lookup, api_sym_update_real): Set flag if off
1489         limits variable instead of failing. Adjust logic.
1490         (api_sym_update_scalar, api_set_array_element, api_del_array_element,
1491         api_release_flattened_array): Adjust logic.
1492         * gawkapi.h: Adjust documentation.
1493
1494         Provide PROCINFO["identifiers"]. Undocumented for now.
1495
1496         * awk.h (load_symbols): Add declaration.
1497         * awkgram.y (variable): Adjust comment formatting.
1498         * main.c (main): Call load_symbols().
1499         * symbol.c (load_symbols): New function.
1500
1501 2012-09-13         Arnold D. Robbins     <arnold@skeeve.com>
1502
1503         * configure.ac: Determination of DYNAMIC adjusted. Hopefully is
1504         smarter for z/OS.
1505
1506 2012-09-13         Dave Pitts            <dpitts@cozx.com>
1507
1508         * awk.h: Add defines for z/OS for newer types.
1509
1510 2012-08-31         Arnold D. Robbins     <arnold@skeeve.com>
1511
1512         * gawkapi.c: Wrap various bits in #ifdef DYNAMIC so that
1513         gawk will compile on systems without dynamic loading.
1514
1515 2012-08-24         Arnold D. Robbins     <arnold@skeeve.com>
1516
1517         Add version facility to API. Thanks to Manuel Collado
1518         for the idea.
1519
1520         * awk.h (print_ext_versions): Declare.
1521         Rearrange includes and decls to make more sense.
1522         * gawkapi.h (register_ext_version): New API.
1523         (dl_load_func): Add code for ext_version.
1524         * gawkapi.c (api_register_ext_version, print_ext_versions):
1525         New functions.
1526         * main.c (do_version): New variable.
1527         (optab): Set it for -v / --version.
1528         (main): Set it in arg parsing switch. Call version() after the
1529         extensions have been loaded.
1530
1531 2012-08-22         Arnold D. Robbins     <arnold@skeeve.com>
1532
1533         Add output wrapper and two-way processor to extension API.
1534
1535         * awk.h (struct redirect): Replace output FILE * with awk_output_buf_t.
1536         (register_output_wrapper, register_two_way_processor): Declare.
1537         * builtin.c (efwrite): Adjust logic to use rp->output data and
1538         functions if rp is not NULL. Remove redundant declaration of function.
1539         (do_fflush, do_printf, do_print, do_print_rec): Same adjustment.
1540         * ext.c (make_builtin): Adjust error messages.
1541         * gawkapi.c (api_register_output_wrapper,
1542         api_register_two_way_processor): New functions.
1543         (sym_update_real): Adjust code formatting.
1544         * gawkapi.h (awk_input_parser_t): Make next pointer awk_const.
1545         (awk_output_buf_t, awk_two_way_processor_t): New structs.
1546         (api_register_output_wrapper, api_register_two_way_processor): New APIs.
1547         (dl_load_func): Allow for empty function table (NULL elements).
1548         * io.c (find_output_wrapper, init_output_wrapper, find_two_processor,
1549         gawk_fwrite, gawk_ferror, gawk_fflush, gawk_fclose): New functions.
1550         (redirect): Call init_output_wrapper, find_output_wrapper as needed.
1551         Adjust use of rp->fp to rp->output.fp and also function calls.
1552         (close_rp, close_redir, flush_io): Same adjustment.
1553         (two_way_open): Same adjustment. Call find_two_way_processor, and
1554         find_output_wrapper, as needed.
1555
1556 2012-08-17         Arnold D. Robbins     <arnold@skeeve.com>
1557
1558         * Update infrastructure: Automake 1.12.3 and bison 2.6.2.
1559
1560 2012-08-15         Arnold D. Robbins     <arnold@skeeve.com>
1561
1562         * dfa.c: Sync w/GNU grep.
1563
1564 2012-08-12         Arnold D. Robbins     <arnold@skeeve.com>
1565
1566         * gawkapi.h: Make the versions enum constants instead of defines.
1567
1568 2012-08-11         Andrew J. Schorr     <aschorr@telemetry-investments.com>
1569
1570         * awkgram.y (add_srcfile): It is now a fatal error to load the
1571         same file with -f and -i (or @include).
1572         * TODO.xgawk: Update to reflect this change.
1573
1574 2012-08-10         Arnold D. Robbins     <arnold@skeeve.com>
1575
1576         * FUTURES, TODO.xgawk: Updates.
1577
1578 2012-08-08         Arnold D. Robbins     <arnold@skeeve.com>
1579
1580         * configure.ac: Add -DNDEBUG to remove asserts if not developing.
1581
1582         * gawkapi.h: Document how to build up arrays.
1583         * gawkapi.c (api_sym_update): For an array, pass the new cookie
1584         back out to the extension.
1585
1586         * awk.h (IOBUF): Move struct stat into IOBUF_PUBLIC.
1587         (os_isreadable): Change to take an IOBUF_PUBLIC.
1588         * gawkapi.h (IOBUF_PUBLIC): Received struct stat.
1589         (INVALID_HANDLE): Moves to here.
1590         * io.c (iop_alloc): Stat the fd and fill in stat buf.
1591         (iop_finish): Use passed in stat info.
1592
1593 2012-08-05         Arnold D. Robbins     <arnold@skeeve.com>
1594
1595         * README.git: More stuff added.
1596
1597 2012-08-01         Arnold D. Robbins     <arnold@skeeve.com>
1598
1599         * io.c (iop_finish): New function.
1600         (iop_alloc): Add errno_val parameter. Move code into iop_finish.
1601         Add large explanatory leading comment.
1602         (after_beginfile): Rework logic. Check for input parser first, then
1603         check for invalid iop.
1604         (nextfile): Organize code better. Call iop_alloc then iop_finish.
1605         (redirect): Call iop_alloc, find_input_parser, iop_finish.
1606         (two_way_open): Call iop_alloc, find_input_parser, iop_finish.
1607         (gawk_popen): Call iop_alloc, find_input_parser, iop_finish.
1608         (find_input_parser): Set iop->valid if input parser takes control.
1609         (get_a_record): Rework setting RT to use macros.
1610
1611 2012-07-29         Andrew J. Schorr     <aschorr@telemetry-investments.com>
1612
1613         * awk.h (set_RT_to_null, set_RT): Removed.
1614         * gawkapi.h (api_set_RT): Removed.
1615         (get_record): Signature changed in input parser struct.
1616         * gawkapi.c (api_set_RT): Removed.
1617         * io.c (set_RT_to_null, set_RT): Removed.
1618         (get_a_record): Adjustments for new API for input parser.
1619
1620 2012-07-29         Arnold D. Robbins     <arnold@skeeve.com>
1621
1622         * awk.h (os_isreadable): Adjust declaration.
1623         (struct iobuf): Add new member `valid'.
1624         * io.c (iop_alloc): Remove do_input_parsers parameter, it's
1625         always true. Adjust logic to set things to invalid if could not
1626         find an input parser.
1627         (after_beginfile): Use valid member to check if iobuf is valid.
1628         Don't clear iop->errcode.
1629         (nextfile): Adjust logic to clear errcode if valid is true and
1630         also to update ERRNO.
1631         (redirect): Check iop->valid and cleanup as necessary, including
1632         setting ERRNO.
1633         (two_way_open): Ditto.
1634         (gawk_popen): Ditto.
1635         (devopen): Remove check for directory.
1636
1637 2012-07-27         Andrew J. Schorr     <aschorr@telemetry-investments.com>
1638
1639         * io.c (find_input_parser): Issue a warning if take_control_of fails.
1640
1641 2012-07-27         Arnold D. Robbins     <arnold@skeeve.com>
1642
1643         * awk.h (set_RT): Change to take a NODE * parameter.
1644         * io.c (set_RT): Change to take a NODE * parameter.
1645         * gawkapi.h: Change open hook to input parser in comment.
1646         * gawkapi.c (api_set_RT): Adjust call to set_RT.
1647
1648 2012-07-26         Arnold D. Robbins     <arnold@skeeve.com>
1649
1650         * awk.h (set_RT_to_null, set_RT): Declare functions.
1651         (os_isreadable): Declare function.
1652         * io.c (set_RT_to_null, set_RT): New functions.
1653         (iop_close): Init ret to zero.
1654         * gawkapi.c (api_register_input_parser): Check for null pointer.
1655         (api_set_RT): New function.
1656         * gawkapi.h (api_set_RT): New function.
1657
1658 2012-07-26         Andrew J. Schorr     <aschorr@telemetry-investments.com>
1659
1660         * gawkapi.h (IOBUF_PUBLIC): Document the get_record and close_func
1661         API.
1662         (awk_input_parser_t) Change can_take_file argument to const, and
1663         document the API.
1664         * io.c (get_a_record): Document that the caller initializes *errcode
1665         to 0, and remote the test for non-NULL errcode.
1666
1667 2012-07-26         Andrew J. Schorr     <aschorr@telemetry-investments.com>
1668
1669         * gawkapi.c (api_sym_update_scalar): Fix some minor bugs.  Was
1670         not updating AWK_NUMBER when valref != 1.  And strings were not
1671         freeing MPFR values.
1672
1673 2012-07-25         Arnold D. Robbins     <arnold@skeeve.com>
1674
1675         Start refactoring of IOBUF handling and turn "open hooks"
1676         into "input parsers".
1677
1678         * awk.h (IOP_NOFREE_OBJ): Flag removed.
1679         (register_input_parser): Renamed from register_open_hook.
1680         * ext.c (load_ext): Make sure lib_name is not NULL.
1681         * gawk_api.c (api_register_input_parser): Renamed from
1682         api_register_open_hook.
1683         * gawk_api.h (api_register_input_parser): Renamed from
1684         api_register_open_hook.  Rework structure to have "do you want it"
1685         and "take control of it" functions.
1686         * io.c (iop_alloc): Remove third argument which is IOBUF pointer.
1687         Always malloc it. Remove use of IOP_NOFREE_OBJ everywhere.
1688         (find_input_parser): Renamed from find_open_hook.
1689         (nextfile): Don't use static IOBUF.
1690         (iop_close): Call close_func first. Then close fd or remap it
1691         if it's still not INVALID_HANDLE.
1692         (register_input_parser): Renamed from register_open_hook.
1693         Use a FIFO list and check if more than one parser will accept the
1694         file. If so, fatal error.
1695
1696 2012-07-25         Andrew J. Schorr     <aschorr@telemetry-investments.com>
1697
1698         * configure.ac: Instead of using acl_shlibext for the shared library
1699         extension, define our own variable GAWKLIBEXT with a hack to work
1700         correctly on Mac OS X.
1701         * Makefile.am (SHLIBEXT): Use the value of GAWKLIBEXT instead of
1702         acl_shlibext.
1703
1704 2012-07-24         Arnold D. Robbins     <arnold@skeeve.com>
1705
1706         * configure.ac: Add crude but small hack to make plug-ins work
1707         on Mac OS X.
1708
1709 2012-07-20         Arnold D. Robbins     <arnold@skeeve.com>
1710
1711         * gawkapi.h: Rework table to not take up so much space.
1712         * gawkapi.c (api_sym_update_scalar): Rework optimization code
1713         to clean up the function.
1714
1715 2012-07-17         Andrew J. Schorr     <aschorr@telemetry-investments.com>
1716
1717         * gawkapi.h: Add comments explaining new api_create_value and
1718         api_release_value functions.
1719         * gawkapi.c (sym_update_real): Allow updates with AWK_SCALAR and
1720         AWK_VALUE_COOKIE types.  After creating a regular variable,
1721         remove the call to unref(node->var_value), since this is not
1722         done elsewhere in the code (see, for example, main.c:init_vars).
1723         If the update is for an existing variable, allow any val_type
1724         except AWK_ARRAY (was previously disallowing AWK_SCALAR and
1725         AWK_VALUE_COOKIE for no apparent reason).
1726         (api_sym_update_scalar): The switch should return false for an
1727         invalid val_type value, so change the AWK_ARRAY case to default.
1728         (valid_subscript_type): Any scalar value is good, so accept any valid
1729         type except AWK_ARRAY.
1730         (api_create_value): Accept only AWK_NUMBER and AWK_STRING values.
1731         Anything else should fail.
1732
1733 2012-07-17         Arnold D. Robbins     <arnold@skeeve.com>
1734
1735         Speedup:
1736
1737         * awk.h (r_free_wstr): Renamed from free_wstr.
1738         (free_wstr): Macro to test the WSTRCUR flag first.
1739         * node.c (r_free_wstr): Renamed from free_wstr.
1740
1741         Support value cookies:
1742
1743         * gawkapi.h (awk_val_type_t): Add AWK_VALUE_COOKIE.
1744         (awk_value_cookie_t): New type.
1745         (awk_value_t): Support AWK_VALUE_COOKIE.
1746         (api_create_value, api_release_value): New function pointers.
1747         * gawkapi.c (awk_value_to_node, api_sym_update_scalar,
1748         valid_subscript_type): Handle AWK_VALUE_COOKIE.
1749         (api_create_value, api_release_value): New functions.
1750
1751 2012-07-16         Arnold D. Robbins     <arnold@skeeve.com>
1752
1753         * gawkapi.c (awk_value_to_node): Support AWK_SCALAR.
1754         (api_sym_update_scalar): Performance improvements.
1755
1756 2012-07-12         Arnold D. Robbins     <arnold@skeeve.com>
1757
1758         Allow creation of constants. Thanks to John Haque for the
1759         implementation concept.
1760
1761         * gawk_api.h (api_sym_constant): Create a constant.
1762         * gawk_api.h (api_sym_update_real): Renamed from api_sym_update.
1763         Add is_const paramater and do the right thing if true.
1764         (api_sym_update, api_sym_constant): Call api_sym_update_real
1765         in the correct way.
1766         (set_constant): New function.
1767
1768 2012-07-11         Andrew J. Schorr     <aschorr@telemetry-investments.com>
1769
1770         * gawkapi.h: Fix typo in comment.
1771         (awk_value_t): Type for scalar_cookie should be awk_scalar_t,
1772         not awk_array_t.
1773         (gawk_api): Add new api_sym_lookup_scalar function.
1774         (sym_lookup_scalar): New wrapper macro for api_sym_lookup_scalar hook.
1775         * gawkapi.c (api_sym_lookup_scalar): New function for faster scalar
1776         lookup.
1777         (api_impl): Add entry for api_sym_lookup_scalar.
1778
1779 2012-07-11         Andrew J. Schorr     <aschorr@telemetry-investments.com>
1780
1781         * gawkapi.c (awk_value_to_node): Change to a switch statement
1782         so AWK_SCALAR or other invalid type is handled properly.
1783         (valid_subscript_type): Test whether a value type is acceptable
1784         for use as an array subscript (any scalar value will do).
1785         (api_get_array_element, api_set_array_element, api_del_array_element):
1786         Use new valid_subscript_type instead of restricting to string values.
1787
1788 2012-07-11         Arnold D. Robbins     <arnold@skeeve.com>
1789
1790         Lots of API work.
1791
1792         * gawkapi.h: Function pointer members renamed api_XXXX and
1793         macros adjusted. More documentation.
1794         (awk_valtype_t): New AWK_SCALAR enum for scalar cookies.
1795         (awk_scalar_t): New type.
1796         (awk_value_t): New member scalar_cookie.
1797         (api_sym_update_scalar): New API function.
1798         (erealloc): New macro.
1799         (make_const_string): New macro, renamed from dup_string.
1800         (make_malloced_string): New macro, renamed from make_string.
1801         (make_null_string): New inline function.
1802         (dl_load_func): Add call to init routine through pointer if
1803         not NULL.
1804
1805         * gawkapi.c (awk_value_to_node): Assume that string values came
1806         from malloc.
1807         (node_to_awk_value): Handle AWK_SCALAR.
1808         (api_sym_update): Ditto.
1809         (api_sym_update_scalar): New routine.
1810         (api_get_array_element): Return false if the element doesn't exist.
1811         Always unref the subscript.
1812         (remove_element): New helper routine.
1813         (api_del_array_element): Use it.
1814         (api_release_flattened_array): Ditto.
1815         (api_impl): Add the new routine.
1816
1817 2012-07-11         Andrew J. Schorr     <aschorr@telemetry-investments.com>
1818
1819         * gawkapi.c (api_sym_update): Allow val_type to be AWK_UNDEFINED
1820         for setting a variable to "", i.e. dupnode(Nnull_string).
1821
1822 2012-07-10         Andrew J. Schorr     <aschorr@telemetry-investments.com>
1823
1824         * awkgram.y (add_srcfile): Lint warning message for a previously loaded
1825         shared library should say "already loaded shared library" instead
1826         of "already included source file".
1827
1828 2012-07-08         Arnold D. Robbins     <arnold@skeeve.com>
1829
1830         * gawkapi.h (set_array_element): Use index + value instead
1831         of element structure. Matches get_array_element.
1832         (set_array_element_by_elem): New macro to use an element.
1833         * gawkapi.c (api_set_array_element): Make the necessary adjustments.
1834
1835 2012-07-04         Arnold D. Robbins     <arnold@skeeve.com>
1836
1837         * awkgram.y (tokentab): Remove limit on number of arguments
1838         for "and", "or", and "xor".
1839         * builtin.c (do_and, do_or, do_xor): Modify code to perform the
1840         respective operation on any number of arguments. There must be
1841         at least two.
1842
1843 2012-06-29         Arnold D. Robbins     <arnold@skeeve.com>
1844
1845         * gawkapi.h: Improve the documentation of the return values
1846         per Andrew Schorr.
1847
1848 2012-06-25         Arnold D. Robbins     <arnold@skeeve.com>
1849
1850         * TODO.xgawk: Updated.
1851         * awk.h (track_ext_func): Declared.
1852         * awkgram.y (enum defref): Add option for extension function.
1853         (struct fdesc): Add member for extension function.
1854         (func_use): Handle extension function, mark as extension and defined.
1855         (track_ext_func): New function.
1856         (check_funcs): Update logic for extension functions.
1857         * ext.c (make_builtin): Call track_ext_func.
1858
1859 2012-06-24         Andrew J. Schorr     <aschorr@telemetry-investments.com>
1860
1861         * TODO.xgawk: Most of IOBUF has been hidden.
1862         * gawkapi.h (IOBUF): Remove declaration (now back in awk.h).
1863         (IOBUF_PUBLIC): Declare new structure defining subset of IOBUF fields
1864         that should be exposed to extensions.
1865         (gawk_api): Update register_open_hook argument from IOBUF to
1866         IOBUF_PUBLIC.
1867         * awk.h (IOBUF): Restore declaration with 5 fields moved to new
1868         IOBUF_PUBLIC structure.
1869         (register_open_hook): Update open_func argument from IOBUF to
1870         IOBUF_PUBLIC.
1871         * gawkapi.c (api_register_open_hook): Ditto.
1872         * io.c (after_beginfile, nextfile, iop_close, gawk_pclose): Some fields
1873         such as fd and name are now inside the IOBUF public structure.
1874         (struct open_hook): Update open_func argument from IOBUF to
1875         (register_open_hook): Ditto.
1876         (find_open_hook): opaque now inside IOBUF_PUBLIC.
1877         (iop_alloc): fd and name now in IOBUF_PUBLIC.
1878         (get_a_record): If the get_record hook returns EOF, set the IOP_AT_EOF
1879         flag.  Access fd inside IOBUF_PUBLIC.
1880         (get_read_timeout): File name now inside IOBUF_PUBLIC.
1881         * interpret.h (r_interpret): File name now inside IOBUF_PUBLIC.
1882         * ext.c (load_ext): No need to call return at the end of a void
1883         function.
1884
1885 2012-06-24         Arnold D. Robbins     <arnold@skeeve.com>
1886
1887         * ext.c (load_ext): Don't retun a value from a void function.
1888         * gawkapi.c (api_set_array_element): Set up vname and parent_array.
1889
1890 2012-06-21         Arnold D. Robbins     <arnold@skeeve.com>
1891
1892         More API and cleanup:
1893
1894         * awk.h (stopme): Make signature match other built-ins.
1895         * awkgram.y (stopme): Make signature match other built-ins.
1896         (regexp): Minor edit.
1897         * gawkapi.c (api_set_argument): Remove unused variable.
1898         Set parent_array field of array value.
1899         * TODO.xgawk: Update some.
1900
1901         Remove extension() builtin.
1902
1903         * awk.h (do_ext): Removed.
1904         (load_ext): Signature changed.
1905         * awkgram.y (tokentab): Remove do_ext.
1906         Change calls to do_ext.
1907         * ext.c (load_ext): Make init function a constant.
1908         * main.c (main): Change calls to do_ext.
1909
1910 2012-06-20         Arnold D. Robbins     <arnold@skeeve.com>
1911
1912         Restore lost debugging function:
1913
1914         * awkgram.y (stopme): Restore long lost debugging function.
1915         * awk.h (stopme): Add declaration.
1916
1917         API work:
1918
1919         * ext.c (get_argument): Make extern.
1920         * awk.h (get_argument): Declare it.
1921         * gawkapi.c (api_set_argument): Call it. Finish off the logic.
1922         (api_get_argument): Refine logic to use get_argument.
1923         * gawkapi.h (set_argument): New API.
1924
1925 2012-06-19         Arnold D. Robbins     <arnold@skeeve.com>
1926
1927         Remove code duplication in gawkapi.c from msg.c:
1928
1929         * awk.h (err): Add `isfatal' first parameter.
1930         * awkgram.y (err): Adjust all calls.
1931         * msg.c (err): Adjust all calls. Move fatal code to here ...
1932         (r_fatal): From here.
1933         * gawkapi.c: Remove code duplication and adjust calls to `err'.
1934
1935         Handle deleting elements of flattened array:
1936
1937         * awk.h (get_argument): Remove declaration.
1938         * ext.c (get_argument): Make static.
1939         * gawkapi.h (awk_flat_array_t): Make opaque fields const. Add
1940         more descriptive comments.
1941         * gawkapi.c (release_flattened_array): Delete elements flagged
1942         for deletion. Free the flattened array also.
1943
1944         Add additional debugging when developing:
1945
1946         * configure.ac: Add additional debugging flags.
1947         * configure: Regenerated.
1948
1949 2012-06-18         Arnold D. Robbins     <arnold@skeeve.com>
1950
1951         * gawkapi.h (get_array_element): Restore `wanted' paramater.
1952         (awk_element_t): Use awk_value_t for index. Add awk_flat_array_t.
1953         (flatten_array): Change signature to use awk_flat_array_t;
1954         (release_flattened_array): Change signature to use awk_flat_array_t;
1955         * gawkapi.c (api_sym_update): Handle case where variable exists already.
1956         (api_get_array_element): Restore `wanted' paramater and pass it
1957         on to node_to_awk_value.
1958         (api_set_array_element): Revisse to match changed element type.
1959         (api_flatten_array): Revise signature, implement.
1960         (api_release_flattened_array): Revise signature, implement.
1961
1962 2012-06-17         Arnold D. Robbins     <arnold@skeeve.com>
1963
1964         API Work:
1965
1966         * gawkapi.h (get_array_element): Remove `wanted' parameter.
1967         (r_make_string): Comment the need for `api' and `ext_id' parameters.
1968         * gawkapi.c (api_sym_update): Move checks to front.
1969         Initial code for handling arrays. Still needs work.
1970         (api_get_array_element): Implemented.
1971         (api_set_array_element): Additional checking code.
1972         (api_del_array_element): Implemented.
1973         (api_create_array): Implemented.
1974         (init_ext_api): Force do_xxx values to be 1 or 0.
1975         (update_ext_api): Ditto.
1976
1977 2012-06-12         Arnold D. Robbins     <arnold@skeeve.com>
1978
1979         API Work:
1980
1981         * gawkapi.h (awk_value_t): Restore union.
1982         (get_curfunc_param): Renamed to get_argument. Return type changed
1983         to awk_bool_t. Semantics better thought out and documented.
1984         (awk_atexit, get_array_element): Return type now void.
1985         (sym_lookup): Return type now void. Argument order rationalized.
1986         * gawkapi.c (node_to_awk_value): Return type is now awk_bool_t.
1987         Semantics now match table in gawkawpi.h.
1988         (api_awk_atexit): Return type now void.
1989         (api_sym_lookup): Return type is now awk_bool_t. Change parameter
1990         order.
1991         (api_get_array_element): Return type is now awk_bool_t.
1992
1993         Further API implementations and fixes for extension/testext.c:
1994
1995         * awk.h (final_exit): Add declaration.
1996         * ext.c (load_ext): Change `func' to install_func.
1997         * gawkapi.c: Add casts to void for id param in all functions.
1998         (api_sym_update): Finish implementation.
1999         (api_get_array_element): Start implementation.
2000         (api_set_array_element): Add error checking.
2001         (api_get_element_count): Add error checking, return the right value.
2002         * main.c (main): Call final_exit instead of exit.
2003         (arg_assign): Ditto.
2004         * msg.c (final_exit): New routine to run the exit handlers and exit.
2005         (gawk_exit): Call it.
2006         * profile.c (dump_and_exit): Ditto.
2007
2008 2012-06-10         Andrew J. Schorr     <aschorr@telemetry-investments.com>
2009
2010         * TODO.xgawk: Addition of time extension moved to "done" section.
2011
2012 2012-06-10         Andrew J. Schorr     <aschorr@telemetry-investments.com>
2013
2014         * gawkapi.c (api_update_ERRNO_string): Treat boolean true as a request
2015         for TRANSLATE, and false as DONT_TRANSLATE.
2016
2017 2012-06-06         Arnold D. Robbins     <arnold@skeeve.com>
2018
2019         * cint_array.c (tree_print, leaf_print): Add additional casts
2020         for printf warnings.
2021
2022         * awk.h (update_ext_api): Add declaration.
2023         * gawkapi.c (update_ext_api): New function.
2024         * eval.c (set_LINT): Call update_ext_api() at the end.
2025         * gawkapi.h: Document that do_XXX could change on the fly.
2026
2027         * awk.h (run_ext_exit_handlers): Add declaration.
2028         * msg.c (gawk_exit): Call it.
2029
2030 2012-06-05         Arnold D. Robbins     <arnold@skeeve.com>
2031
2032         * ext.c (load_ext): Remove use of RTLD_GLOBAL. Not needed in new
2033         scheme. Clean up error messages.
2034
2035 2012-06-04         Arnold D. Robbins     <arnold@skeeve.com>
2036
2037         * configure.ac: Remove use of -export-dynamic for GCC.
2038         * configure: Regenerated.
2039
2040 2012-05-30         Arnold D. Robbins     <arnold@skeeve.com>
2041
2042         * main.c (is_off_limits_var): Minor coding style edit.
2043         * gawkapi.c (awk_value_to_node): More cleanup.
2044         (node_to_awk_value): Use `wanted' for decision making.
2045         (api_sym_update): Start implementation. Needs more work.
2046         General: More cleanup, comments.
2047         * gawkapi.h (api_sym_update): Add additional comments.
2048
2049 2012-05-29         Arnold D. Robbins     <arnold@skeeve.com>
2050
2051         * gawkapi.c (node_to_awk_value): Add third parameter indicating type
2052         of value desired. Based on that, do force_string or force_number
2053         to get the "other" type.
2054         (awk_value_to_node): Clean up the code a bit.
2055         (get_curfunc_param): Move forcing of values into node_to_awk_value.
2056         (api_sym_lookup): Add third parameter indicating type of value wanted.
2057         (api_get_array_element): Ditto.
2058         * gawk_api.h: Additional comments and clarifications. Revise APIs
2059         to take third 'wanted' argument as above.
2060         (awk_value_t): No longer a union so that both values may be accessed.
2061         All macros: Parenthesized the bodies.
2062         * bootstrap.sh: Rationalize a bit.
2063
2064 2012-05-26         Andrew J. Schorr     <aschorr@telemetry-investments.com>
2065
2066         * Makefile.am (include_HEADERS): Add so gawkapi.h will be installed.
2067         (base_sources): Add gawkapi.h so that it is in dist tarball.
2068         * TODO.xgawk: Update.
2069         * main.c (is_off_limits_var): Stop returning true for everything
2070         except PROCINFO.
2071
2072 2012-05-25         Arnold D. Robbins     <arnold@skeeve.com>
2073
2074         * main.c (is_off_limits_var): New function to check if a variable
2075         is one that an extension function may not change.
2076         * awk.h (is_off_limits_var): Declare it.
2077         * gawkapi.c (api_sym_lookup): Use it.
2078
2079         * bootstrap.sh: Touch various files in the extension directory also.
2080
2081 2012-05-24         Andrew J. Schorr     <aschorr@telemetry-investments.com>
2082
2083         * gawkapi.h (awk_param_type_t): Remove (use awk_valtype_t instead).
2084         (awk_ext_func_t): Pass a result argument, and return an awk_value_t *.
2085         (gawk_api.get_curfunc_param): Add a result argument.
2086         (gawk_api.set_return_value): Remove obsolete function.
2087         (gawk_api.sym_lookup, gawk_api.get_array_element): Add a result
2088         argument.
2089         (gawk_api.api_make_string, gawk_api.api_make_number): Remove hooks,
2090         since access to gawk internal state is not required to do this.
2091         (set_return_value): Remove obsolete macro.
2092         (get_curfunc_param, sym_lookup, get_array_element): Add result argument.
2093         (r_make_string, make_number): New static inline functions.
2094         (make_string, dup_string): Revise macro definitions.
2095         (dl_load_func): Remove global_api_p and global_ext_id args,
2096         and fix SEGV by setting api prior to checking its version members.
2097         (GAWK): Expand ifdef to include more stuff.
2098         * gawkapi.c (node_to_awk_value): Add result argument.
2099         (api_get_curfunc_param): Add result argument, and use awk_valtype_t.
2100         (api_set_return_value): Remove obsolete function.
2101         (awk_value_to_node): New global function to convert back into internal
2102         format.
2103         (api_add_ext_func): Simply call make_builtin.
2104         (node_to_awk_value): Add result argument, and handle Node_val case.
2105         (api_sym_lookup, api_get_array_element): Add result argument.
2106         (api_set_array_element): Implement.
2107         (api_make_string, api_make_number): Remove functions that belong on
2108         client side.
2109         (api_impl): Remove 3 obsolete entries.
2110         * TODO.xgawk: Update to reflect progress.
2111         * Makefile.am (base_sources): Add gawkapi.c.
2112         * awk.h: Include gawkapi.h earlier.
2113         (api_impl, init_ext_api, awk_value_to_node): Add declarations
2114         so we can hook in new API.
2115         (INSTRUCTION): Add new union type efptr for external functions.
2116         (extfunc): New define for d.efptr.
2117         (load_ext): Remove 3rd obj argument that was never used for anything.
2118         (make_builtin): Change signature for new API.
2119         * awkgram.y (load_library): Change 2nd argument to load_ext
2120         from dlload to dl_load, and remove pointless 3rd argument.
2121         * main.c (main): Call init_ext_api() before loading shared libraries.
2122         Change 2nd argument to load_ext from dlload to dl_load, and remove
2123         pointless 3rd argument.
2124         * ext.c (do_ext): Remove pointless 3rd argument to load_ext.
2125         (load_ext): Remove 3rd argument.  Port to new API (change initialization
2126         function signature).  If initialization function fails, issue a warning
2127         and return -1, else return 0.
2128         (make_builtin): Port to new API.
2129         * interpret.h (r_interpret): For Op_ext_builtin, call external functions
2130         with an awk_value_t result buffer, and convert the returned value
2131         to a NODE *.  For Node_ext_func, code now in extfunc instead of builtin.
2132
2133 2012-05-21         Andrew J. Schorr     <aschorr@telemetry-investments.com>
2134
2135         * configure.ac: Remove libtool, and call configure in the
2136         extension subdirectory.  Change pkgextensiondir to remove the
2137         version number, since the new API has builtin version checks.
2138         * TODO.xgawk: Update.
2139         * ltmain.sh: Removed, since libtool no longer used here.
2140
2141 2012-05-19         Andrew J. Schorr     <aschorr@telemetry-investments.com>
2142
2143         * TODO.xgawk: Update to reflect progress and new issues.
2144         * main.c (main): Add -i (--include) option.
2145         (usage): Ditto.
2146         * awkgram.y (add_srcfile): Eliminate duplicates only for SRC_INC
2147         and SRC_EXTLIB sources (i.e. -f duplicates should not be removed).
2148         * io.c (find_source): Set DEFAULT_FILETYPE to ".awk" if not defined
2149         elsewhere.
2150
2151 2012-05-15         Arnold D. Robbins     <arnold@skeeve.com>
2152
2153         * awk.h: Include "gawkapi.h" to get IOBUF.
2154         * gawkapi.h: Considerable updates.
2155         * gawkapi.c: New file. Start at implementing the APIs.
2156
2157 2012-05-13         Andrew J. Schorr     <aschorr@telemetry-investments.com>
2158
2159         * TODO.xgawk: Update to reflect recent discussions and deletion of
2160         extension/xreadlink.[ch].
2161
2162 2012-05-11         Arnold D. Robbins     <arnold@skeeve.com>
2163
2164         Sweeping change: Use `bool', `true', and `false' everywhere.
2165
2166 2012-04-09         Andrew J. Schorr     <aschorr@telemetry-investments.com>
2167
2168         * eval.c (unset_ERRNO): Fix memory management bug -- need to use
2169         dupnode with Nnull_string.
2170
2171 2012-04-08         Andrew J. Schorr     <aschorr@telemetry-investments.com>
2172
2173         * Makefile.am (valgrind): Define VALGRIND instead of redefining AWK.
2174         This allows test/Makefile.am to set up the command environment as
2175         desired.
2176         (valgrind-noleak): Ditto, plus set --leak-check=no instead of the
2177         default summary setting.
2178
2179 2012-04-07         Andrew J. Schorr     <aschorr@telemetry-investments.com>
2180
2181         * TODO.xgawk: Update to reflect progress.
2182
2183 2012-04-01         Andrew J. Schorr     <aschorr@telemetry-investments.com>
2184
2185         * TODO.xgawk: Move valgrind-noleak item into "done" section.
2186         * Makefile.am (valgrind-noleak): Add new valgrind rule that omits
2187         the "--leak-check=full" option to help spot more serious problems.
2188
2189 2012-04-01         Andrew J. Schorr     <aschorr@telemetry-investments.com>
2190
2191         * TODO.xgawk: Move ERRNO item into "done" section.
2192         * awk.h (update_ERRNO, update_ERRNO_saved): Remove declarations.
2193         (update_ERRNO_int, enum errno_translate, update_ERRNO_string,
2194         unset_ERRNO): Add new declarations.
2195         * eval.c (update_ERRNO_saved): Renamed to update_ERRNO_int.
2196         (update_ERRNO_string, unset_ERRNO): New functions.
2197         * ext.c (do_ext): Use new update_ERRNO_string function.
2198         * io.c (ERRNO_node): Remove redundant extern declaration (in awk.h).
2199         (after_beginfile, nextfile): Replace update_ERRNO() with
2200         update_ERRNO_int(errno).
2201         (inrec): Replace update_ERRNO_saved with update_ERRNO_int.
2202         (do_close): Use new function update_ERRNO_string.
2203         (close_redir, do_getline_redir, do_getline): Replace update_ERRNO_saved
2204         with update_ERRNO_int.
2205
2206 2012-03-27         Andrew J. Schorr     <aschorr@telemetry-investments.com>
2207
2208         * TODO.xgawk: Update to reflect debate about how to support Cygwin
2209         and other platforms that cannot link shared libraries with unresolved
2210         references.
2211         * awkgram.y (add_srcfile): Minor bug fix: reverse sense of test
2212         added by Arnold in last patch.
2213         * configure.ac: AC_DISABLE_STATIC must come before AC_PROG_LIBTOOL.
2214
2215 2012-03-26         Arnold D. Robbins     <arnold@skeeve.com>
2216
2217         Some cleanups.
2218
2219         * awkgram.y (add_srcfile): Use whole messages, better for
2220         translations.
2221         * io.c (init_awkpath): Small style tweak.
2222         * main.c (path_environ): Straighten out initial comment, fix
2223         compiler warning by making `val' const char *.
2224
2225 2012-03-25         Andrew J. Schorr     <aschorr@telemetry-investments.com>
2226
2227         * configure.ac (AC_DISABLE_STATIC): Add this to avoid building useless
2228         static extension libraries.
2229
2230 2012-03-25         Andrew J. Schorr     <aschorr@telemetry-investments.com>
2231
2232         * TODO.xgawk: New file listing completed and pending xgawk enhancements.
2233
2234 2012-03-24         Andrew J. Schorr     <aschorr@telemetry-investments.com>
2235
2236         * io.c (path_info): Fix white space.
2237         (pi_awkpath, pi_awklibpath): Avoid structure initializers.
2238         (do_find_source): Eliminate pointless parentheses.
2239         (find_source): Leave a space after "&".
2240         * main.c (load_environ): Fix typo in comment.
2241
2242 2012-03-21         Andrew J. Schorr     <aschorr@telemetry-investments.com>
2243
2244         * awkgram.y (LEX_LOAD): New token to support @load.
2245         (grammar): Add rules to support @load.
2246         (tokentab): Add "load".
2247         (add_srcfile): Improve error message to distinguish between source files
2248         and shared libraries.
2249         (load_library): New function to load libraries specified with @load.
2250         (yylex): Add support for LEX_LOAD (treated the same way as LEX_INCLUDE).
2251
2252 2012-03-20         Andrew J. Schorr     <aschorr@telemetry-investments.com>
2253
2254         * Makefile.am (EXTRA_DIST): Remove extension.
2255         (SUBDIRS): Add extension so libraries will be built.
2256         (DEFS): Define DEFLIBPATH and SHLIBEXT so we can find shared libraries.
2257         * awk.h (deflibpath): New extern declaration.
2258         * configure.ac: Add support for building shared libraries by adding
2259         AC_PROG_LIBTOOL and AC_SUBST for acl_shlibext and pkgextensiondir.
2260         (AC_CONFIG_FILES): Add extension/Makefile.
2261         * io.c (pi_awkpath, pi_awklibpath): New static structures to contain
2262         path information.
2263         (awkpath, max_pathlen): Remove static variables now inside pi_awkpath.
2264         (init_awkpath): Operate on path_info structure to support both
2265         AWKPATH and AWKLIBPATH.  No need for max_path to be static, since
2266         this should be called only once for each environment variable.
2267         (do_find_source): Add a path_info arg to specify which path to search.
2268         Check the try_cwd parameter to decide whether to search the current
2269         directory (not desirable for AWKLIBPATH).
2270         (find_source): Choose appropriate path_info structure based on value
2271         of the is_extlib argument.  Set EXTLIB_SUFFIX using SHLIBEXT define
2272         instead of hardcoding ".so".
2273         * main.c (path_environ): New function to add AWKPATH or AWKLIBPATH
2274         to the ENVIRON array.
2275         (load_environ): Call path_environ for AWKPATH and AWKLIBPATH.
2276
2277 2012-06-19         Arnold D. Robbins     <arnold@skeeve.com>
2278
2279         * main.c (main): Do setlocale to "C" if --characters-as-bytes.
2280         Thanks to "SP" for the bug report.
2281
2282 2012-05-09         Arnold D. Robbins     <arnold@skeeve.com>
2283
2284         * configure.ac: Added AC_HEADER_STDBOOL
2285         * awk.h, dfa.c, regex.c: Reworked to use results
2286         of test and include missing_d/gawkbool.h.
2287
2288 2012-05-07         Arnold D. Robbins     <arnold@skeeve.com>
2289
2290         * array.c (prnode): Add casts to void* for %p format.
2291         * debug.c (print_instruction): Ditto.
2292         * builtin.c: Fix %lf format to be %f everywhere.
2293
2294         Unrelated:
2295
2296         * replace.c: Don't include "config.h", awk.h gets it for us.
2297
2298 2012-05-04         Arnold D. Robbins     <arnold@skeeve.com>
2299
2300         * getopt.c [DJGPP]: Change to __DJGPP__.
2301         * mbsupport.h [DJGPP]: Change to __DJGPP__.
2302
2303         Unrelated:
2304
2305         * awk.h: Workarounds for _TANDEM_SOURCE.
2306
2307 2012-05-01         Arnold D. Robbins     <arnold@skeeve.com>
2308
2309         * dfa.c: Sync with GNU grep. RRI code now there, needed additional
2310         change for gawk.
2311         * configure.ac: Add check for stdbool.h.
2312         * regex.c: Add check for if not have stdbool.h, then define the
2313         bool stuff.
2314
2315 2012-04-27         Arnold D. Robbins     <arnold@skeeve.com>
2316
2317         * dfa.c: Sync with GNU grep.
2318         * xalloc.h (xmemdup): Added, from grep, for dfa.c. Sigh.
2319
2320 2012-04-27         Arnold D. Robbins     <arnold@skeeve.com>
2321
2322         Update to autoconf 2.69, automake 1.12.
2323
2324         * INSTALL, aclocal.m4, configh.in, depcomp, install-sh, missing,
2325         mkinstalldirs, ylwrap: Updated.
2326         * configure.ac (AC_TYPE_LONG_LONG_INT, AC_TYPE_UNSIGNED_LONG_LONG_INT,
2327         AC_TYPE_INTMAX_T, AC_TYPE_UINTMAX_T): Renamed from gl_* versions.
2328         * configure: Regenerated.
2329
2330 2012-04-24         Arnold D. Robbins     <arnold@skeeve.com>
2331
2332         * cmd.h (dPrompt, commands_Prompt, eval_Prompt, dgawk_Prompt): Changed
2333         to dbg_prompt, commands_prompt, eval_prompt, dgawk_prompt.
2334         * debug.c: Ditto.
2335         * command.y: Ditto.  Some minor whitespace and comments cleanup.
2336
2337 2012-04-24         Arnold D. Robbins     <arnold@skeeve.com>
2338
2339         io.c cleanup and some speedup for RS as regexp parsing.
2340
2341         * awk.h (Regexp): New members has_meta and maybe_long.
2342         (enum redirval): Add redirect_none as value 0.
2343         (remaybelong): Remove function declaration.
2344         * awkgram.y: Use redirect_none instead of 0 for no redirect cases.
2345         * io.c (go_getline_redir): Second arg now of type enum redirval.
2346         Changed intovar into into_variable.
2347         (comments and whitespace): Lots of general cleanup.
2348         (socket_open): readle changed to read_len.
2349         (two_way_open): Add additional calls to os_close_on_exec.
2350         (rsrescan): Simplify code a bit and use RS->maybe_long.
2351         * re.c (make_regexp): Set up new members in Regexp struct.
2352         (remaybelong): Remove function.
2353         (reisstring): Simplified code.
2354
2355 2012-04-16  Eli Zaretskii  <eliz@gnu.org>
2356
2357         * io.c (read_with_timeout) [__MINGW32__]: Just call the blocking
2358         'read', as 'select' is only available for sockets.
2359         * mpfr.c (set_ROUNDMODE) [!HAVE_MPFR]: Renamed from set_RNDMODE.
2360         * main.c (load_procinfo): Declare name[] also when HAVE_MPFR is
2361         defined even though HAVE_GETGROUPS etc. are not.
2362
2363 2012-04-12         John Haque      <j.eh@mchsi.com>
2364
2365         * array.c, awk.h, awkgram.y, builtin.c, command.y, debug.c,
2366         field.c, mpfr.c, profile.c: Change RND_MODE to ROUND_MODE.
2367
2368 2012-04-11         John Haque      <j.eh@mchsi.com>
2369
2370         * main.c (varinit): Change RNDMODE to ROUNDMODE.
2371
2372 2012-04-11         Arnold D. Robbins     <arnold@skeeve.com>
2373
2374         * main.c: Change --arbitrary-precision to --bignum.
2375
2376 2012-04-02         John Haque      <j.eh@mchsi.com>
2377         
2378         Add support for arbitrary-precision arithmetic.
2379
2380         * mpfr.c: New file.
2381         * awk.h (struct exp_node): Add union to handle different number types.
2382         (MPFN, MPZN): New flag values.
2383         (DO_MPFR, do_mpfr): New defines.
2384         (PREC_node, RNDMODE_node): Add declarations.
2385         (PRECISION, RND_MODE, MNR, MFNR, mpzval, do_ieee_fmt): Add declarations.
2386         (make_number, str2number, format_val, cmp_numbers): Ditto.
2387         (force_number): Change definition.
2388         (Func_pre_exec, Func_post_exec): New typedefs.
2389         (POP_NUMBER, TOP_NUMBER): Change definitions.
2390         (get_number_ui, get_number_si, get_number_d, get_number_uj,
2391         iszero, IEEE_FMT, mpg_float, mpg_integer, mpg_float,
2392         mpg_integer): New defines.
2393         * awkgram.y (tokentab): Add alternate function entries for MPFR/GMP.
2394         (snode): Choose the appropriate function.
2395         (negate_num): New function to negate a number.
2396         (grammar): Use it.
2397         (yylex): Adjust number handling code.
2398         * array.c (value_info, asort_actual, sort_user_func): Adjust for
2399         MPFR/GMP numbers.
2400         (do_adump, indent): Minor changes.
2401         (sort_up_index_number, sort_up_value_number, sort_up_value_type): Use
2402         cmp_numbers() for numeric comparisons.
2403         * builtin.c (mpz2mpfr): New function.
2404         (format_tree): Adjust to handle MPFR and GMP numbers.
2405         * eval.c (register_exec_hook): New function to manage interpreter hooks.
2406         (num_exec_hook, pre_execute, post_execute): New and adjusted definitions.
2407         (h_interpret): Renamed from debug_interpret.
2408         (init_interpret): Changed to use the new name.  
2409         (flags2str): New entries for MPFN and MPZN.
2410         (cmp_nodes): Reworked to use seperate routine for numeric comparisons.
2411         (set_IGNORECASE, set_BINMODE, set_LINT, update_NR, update_FNR,
2412         update_NF): Adjust code and some cleanup.
2413         * field.c (rebuild_record): Field copying code reworked to handle
2414         MPFR/GMP numbers.
2415         (set_NF): Minor adjustment.
2416         * io.c (INCREMENT_REC): New macro.
2417         (inrec, do_getline): Use the new macro.
2418         (nextfile, set_NR, set_FNR, get_read_timeout, pty_vs_pipe): Adjust code
2419         to handle MPFR/GMP numbers.
2420         * interpret.h (r_interpret): Adjust TOP_NUMBER/POP_NUMBER usage.
2421         (EXEC_HOOK): New macro and definition.
2422         (DEBUGGING): Removed.
2423         * main.c (DEFAULT_PREC, DEFAULT_RNDMODE): New defines.
2424         (opttab): New entry for option arbitrary-precision.
2425         (main): Handle the new option.
2426         (usage): Add to usage message.
2427         (varinit): Add PREC and RNDMODE.
2428         (load_procinfo): Install MPFR and GMP related items.
2429         (version): Append MPFR and GMP versions to message.
2430         * msg.c (err) : Adjust FNR handling with MPFR/GMP.
2431         * node.c (r_format_val): Renamed from format_val.
2432         (r_force_number): Return NODE * instead of AWKNUM.
2433         (make_number, str2number, format_val, cmp_numpers: Defined and initialized.
2434         (r_unref): Free MPFR/MPZ numbers.
2435         (get_numbase): Renamed from isnondecimal and return the base.
2436         (cmp_awknums): New function to compare two AWKNUMs.
2437         * command.y (yylex): Adjust number handling code.
2438         (grammar): Minor adjustments to handle negative numbers.
2439         * debug.c (init_debug): New function.
2440         (do_info, do_set_var, watchpoint_triggered, serialize,
2441         initialize_watch_item, do_watch, print_watch_item): Minor adjustments.
2442         (debug_pre_execute): Adjusted to handle MPFR and GMP numbers.
2443
2444 2012-04-09         Arnold D. Robbins     <arnold@skeeve.com>
2445
2446         * INSTALL, config.guess, config.sub, depcomp, install-sh,
2447         missing, mkinstalldirs, ylwrap: Update to latest from automake 1.11.4.
2448
2449 2012-04-08         Arnold D. Robbins     <arnold@skeeve.com>
2450
2451         * Update various files to automake 1.11.4.
2452
2453 2012-03-30         Arnold D. Robbins     <arnold@skeeve.com>
2454
2455         * configure.ac (GAWK_AC_NORETURN): Do as macro instead of inline.
2456
2457 2012-03-29         Arnold D. Robbins     <arnold@skeeve.com>
2458
2459         * dfa.h, dfa.c: Sync with grep. Major cleanups and some changes
2460         there.
2461         * re.c (research): Pass size_t* to dfaexec to match type change.
2462         * configure.ac (AH_VERBATIM[_Noreturn]): Added from Paul Eggert to
2463         ease compiling.
2464         (AC_INIT): Bump version.
2465         * configure, configh.in, version.c: Regenerated.
2466
2467 2012-03-28         Arnold D. Robbins     <arnold@skeeve.com>
2468
2469         * 4.0.1: Release tar ball made.
2470
2471 2012-03-28         Arnold D. Robbins     <arnold@skeeve.com>
2472
2473         * getopt.c: Add DJGPP to list of platforms where it's ok
2474         to include <stdlib.h>.
2475         * awkgram.y, builtin.c, ext.c, mbsupport.h, re.c: Update
2476         copyright year.
2477
2478 2012-03-21         Corinna Vinschen      <vinschen@redhat.com>
2479
2480         * getopt.c: Add Cygwin to list of platforms where it's ok
2481         to include <stdlib.h>.
2482
2483 2012-03-20         Arnold D. Robbins     <arnold@skeeve.com>
2484
2485         Get new getopt to work on Linux and C90 compilers:
2486
2487         * getopt.c: Undef ELIDE_CODE for gawk.
2488         (_getopt_internal_r): Init first.needs_free to 0. In test for -W
2489         move executable code to after declarations for C90 compilers.
2490         * getopt1.c: Undef ELIDE_CODE for gawk.
2491
2492         Minor bug fix with printf, thanks to John Haque:
2493
2494         * builtin.c (format_tree): Initialize base to zero at the top
2495         of the while loop.
2496
2497         Getting next tar ball ready:
2498
2499         * configure.ac: Remove duplicate check for wcscoll. Thanks
2500         to Stepan Kasal.
2501
2502 2012-03-16         Arnold D. Robbins     <arnold@skeeve.com>
2503
2504         * getopt.c, getopt.h, getopt1.c, getopt_int.h, regcomp.c,
2505         regex.c, regex.h, regex_internal.c, regex_internal.h,
2506         regexec.c: Sync with GLIBC, what the heck.
2507
2508 2012-03-14         Eli Zaretskii  <eliz@gnu.org>
2509
2510         * mbsupport.h (btowc): Change for non-DJGPP.
2511         * re.c (dfaerror): Add call to exit for DJGPP.
2512
2513 2012-03-14         Arnold D. Robbins     <arnold@skeeve.com>
2514
2515         * regex_internal.c (re_string_skip_chars): Fix calculation of
2516         remain_len with m.b. chars. Thanks to Stanislav Brabec
2517         <sbrabec@suse.cz>.
2518
2519 2012-02-28         Arnold D. Robbins     <arnold@skeeve.com>
2520
2521         * main.c (init_groupset): Make `getgroups' failing a non-fatal
2522         error.  After all, what's the big deal?  Should help on Plan 9.
2523
2524 2012-02-27         Arnold D. Robbins     <arnold@skeeve.com>
2525
2526         * dfa.c (parse_bracket_exp): Revert changes 2012-02-15 to stay
2527         in sync with grep.
2528         * dfa.h (dfarerror): Add __attribute__ from grep.
2529
2530 2012-02-15         Arnold D. Robbins     <arnold@skeeve.com>
2531
2532         Fix warnings from GCC 4.6.2 -Wall option.
2533
2534         * awkgram.y (newline_eof): New function to replace body of
2535         NEWLINE_EOF macro.
2536         (yylex): Replace body of NEWLINE_EOF macro.
2537         * dfa.c (parse_bracket_exp): Init variables to zero.
2538         * ext.c (dummy, junk): Remove.
2539         * regex_internal.c (re_string_reconstruct): Remove buf array. It was
2540         set but not used.
2541
2542 2012-02-10         Arnold D. Robbins     <arnold@skeeve.com>
2543
2544         * dfa.c: Sync with GNU grep.
2545
2546 2012-02-07         Arnold D. Robbins     <arnold@skeeve.com>
2547
2548         * main.c (main): Move init of `output_fp' to before parsing of
2549         program so that error messages from msg.c don't dump core.
2550         Thanks to Michael Haardt <michael@moria.de>.
2551
2552 2012-01-13         Arnold D. Robbins     <arnold@skeeve.com>
2553
2554         * dfa.c [is_valid_unibtye_character]: Fix from GNU grep to 
2555         bug reported by me from Scott Deifik for DJGPP.
2556
2557 2012-01-03         Arnold D. Robbins     <arnold@skeeve.com>
2558
2559         * dfa.c: Sync with GNU grep.
2560
2561 2012-01-02         Arnold D. Robbins     <arnold@skeeve.com>
2562
2563         * io.c (Read_can_timeout, Read_timeout, Read_default_timeout):
2564         Renamed to use lower case.
2565         Other minor stylistic edits.
2566
2567 2012-01-01         John Haque      <j.eh@mchsi.com>
2568
2569         * awk.h (struct iobuf): New entry read_func.
2570         * io.c (Read_can_timeout, Read_timeout, Read_default_timeout):
2571         New variables.
2572         (init_io): New routine to initialize the variables.
2573         (in_PROCINFO): New "clever" routine to parse elements with indices
2574         seperated by a SUPSEP.
2575         (get_read_timeout): New routine to read timeout value for an IOBUF.
2576         (read_with_timeout): New routine to read from a fd with a timeout.
2577         (pty_vs_pipe): Use in_PROCINFO().
2578         (get_a_record): Set the timeout value and the read routine as necessary.
2579         * main.c (main): Call init_io().
2580
2581 2011-12-31         Arnold D. Robbins     <arnold@skeeve.com>
2582
2583         * profile_p.c: Remove the file.
2584         * msg.c (err): Remove check for name being dgawk.
2585
2586 2011-12-31         Arnold D. Robbins     <arnold@skeeve.com>
2587
2588         * awk.h [STREQ, STREQN]: Remove macros.
2589         * awkgram.y, builtin.c, command.y, debug.c, eval.c,
2590         io.c, msg.c: Change all uses to call strcmp, strncmp.
2591
2592 2011-12-28         Arnold D. Robbins     <arnold@skeeve.com>
2593
2594         * int_array.c, str_array.c: Fix some compiler warnings 32/64
2595         bit system differences.
2596
2597 2011-12-26         John Haque      <j.eh@mchsi.com>
2598
2599         Merge gawk, pgawk and dgawk into a single executable gawk.
2600
2601         * awk.h (DO_PRETTY_PRINT, DO_PROFILE, DO_DEBUG,
2602         do_pretty_print, do_debug): New defines.
2603         (interpret): New variable, a pointer to an interpreter routine.
2604         (enum exe_mode): Nuked.
2605         * main.c (opttab): New options --pretty-print and --debug;
2606         Remove option --command.
2607         (usage): Update usage messages.
2608         * interpret.h: New file.
2609         * eval.c (r_interpret): Move to the new file.
2610         (debug_interpret): New interpreter routine when debugging.
2611         (init_interpret): New routine to initialize interpreter related
2612         variables.
2613         * eval_d.c, eval_p.c: Delete files.
2614         * debug.c (interpret): Renamed to debug_prog.
2615         (DEFAULT_PROMPT, DEFAULT_HISTFILE, DEFAULT_OPTFILE): Remove prefix 'd'.
2616         * profile.c (init_profiling): Nuked.
2617         * Makefile.am: Adjusted.
2618
2619         Add command line option --load for loading extensions.
2620
2621         * awk.h (srctype): Add new source type SRC_EXTLIB.
2622         * ext.c(load_ext): New routine to load extension.
2623         (do_ext): Adjust to use load_ext().
2624         * main.c (opttab): Add new option --load.
2625         (main): Call load_ext() to load extensions.
2626         (usage): Add usage message for the new option.
2627         * io.c (get_cwd): New routine.
2628         (do_find_source): Use the new routine.
2629         (find_source): Handle new type SRC_EXTLIB.
2630         * awkgram.y (parse_program, next_sourcefile): Skip type SRC_EXTLIB.
2631         (add_srcfile): Adjust call to find_source.
2632         * debug.c (source_find): Same.
2633
2634         Unrelated:
2635
2636         * ext.c (get_argument): Fixed argument parsing.
2637         * array.c (null_array_func): Reworked array routines for an empty array.
2638         * str_array.c, int_array.c: Make GCC happy, use %u instead of %lu
2639         printf formats.
2640         * eval.c (node_Boolean): New array for TRUE and FALSE nodes.
2641         (init_interpret): Create the new nodes.
2642         (eval_condition): Add test for the new nodes.
2643         (setup_frame): Disable tail-recursion optimization when profiling.
2644         * interpret.h (r_interpret): Use the boolean nodes instead of making
2645         new ones when needed.
2646
2647 2011-12-26         Arnold D. Robbins     <arnold@skeeve.com>
2648
2649         Finish Rational Range Interpretation (!)
2650
2651         * dfa.c (match_mb_charset): Compare wide characters directly
2652         instead of using wcscoll().
2653         * regexec.c (check_node_accept_byte): Ditto.
2654
2655         Thanks to Paolo Bonzini for pointing these out.
2656
2657 2011-12-06         John Haque      <j.eh@mchsi.com>
2658
2659         * debug.c (source_find): Fix misplaced call to efree.
2660         * profile.c (redir2str): Add a missing comma in the redirtab array.
2661         * eval.c (r_interpret): Disallow call to exit if currule is undefined.
2662         This avoids the possiblity of running END blocks more than once when
2663         used in a user-defined sorted-in comparision function.
2664         * array.c (sort_user_func): Adjust appropriately.
2665
2666 2011-12-06         Arnold D. Robbins     <arnold@skeeve.com>
2667
2668         * awk.h, mbsupport.h: Changes for MBS support on DJGPP
2669         and z/OS.
2670         * io.c: Disable pty support on z/OS.
2671
2672 2011-11-27         Arnold D. Robbins     <arnold@skeeve.com>
2673
2674         * dfa.c: Sync with GNU grep.
2675         * dfa.h: Add _GL_ATTRIBUTE_PURE macro. Bleah.
2676
2677 2011-11-14         John Haque      <j.eh@mchsi.com>
2678
2679         * debug.c (set_breakpoint_at): Fix problem with setting
2680         breakpoints in a switch statement. Thanks to Giorgio Palandri
2681         <giorgio.palandri@gmail.com> for the bug report.
2682
2683 2011-11-14         Arnold D. Robbins     <arnold@skeeve.com>
2684
2685         * mbsupport.h: Add check for HAVE_BTOWC, per Pat Rankin.
2686
2687 2011-11-12         Eli Zaretskii  <eliz@gnu.org>
2688
2689         * mbsupport.h: Additional glop for dfa.c in Windows environment.
2690
2691 2011-11-01         Arnold D. Robbins     <arnold@skeeve.com>
2692
2693         * dfa.c: Move glop for ! MBS_SUPPORT to ...
2694         * mbsupport.h: ... here.
2695         * replace.c: Include missing_d/wcmisc.c if ! MBS_SUPPORT.
2696         * regex_internal.h: Move include of mbsupport.h up and add
2697         additional checks to avoid inclusion of wctype.h and wchar.h.
2698
2699 2011-10-27         Arnold D. Robbins     <arnold@skeeve.com>
2700
2701         * builtin.c (do_strftime): Per Pat Rankin, instead of casting
2702         fclock, use a long variable and check for negative or overflow.
2703
2704 2011-10-25         Arnold D. Robbins     <arnold@skeeve.com>
2705
2706         Merge with gawk_performance branch done. Additionally:
2707
2708         * cint_array.c, int_array.c, str_array.c: Fix compiler complaints
2709         about printf formats (signed / unsigned vs. %d / %u).
2710         * eval.c (setup_frame): Add a missing return value.
2711
2712 2011-10-25         Arnold D. Robbins     <arnold@skeeve.com>
2713
2714         * Makefile.am (dist-hook): Use `cd $(srcdir)/pc' so that
2715         `make distcheck' works completely.
2716         * builtin.c (do_strftime): Add cast to long int in check
2717         for fclock < 0 for systems where time_t is unsigned (e.g., VMS).
2718
2719 2011-10-25  Stefano Lattarini  <stefano.lattarini@gmail.com>
2720
2721         dist: generated file `version.c' is not removed by "make distclean"
2722
2723         * Makefile.am (distcleancheck_listfiles): Define to ignore the
2724         generated `version.c' file.
2725
2726 2011-10-24         Arnold D. Robbins     <arnold@skeeve.com>
2727
2728         * dfa.c (wcscoll): Create for VMS.
2729         * Makefile.am (dist-hook): Run sed scripts to make pc/config.h.
2730
2731 2011-10-24  Eli Zaretskii  <eliz@gnu.org>
2732
2733         * builtin.c [HAVE_POPEN_H]: Include "popen.h".
2734         * README.git: Update for pc/ systems.
2735
2736 2011-10-21         Arnold D. Robbins     <arnold@skeeve.com>
2737
2738         * Makefile.am (distcleancheck_listfiles): Added, per advice from
2739         Stefano Lattarini <stefano.lattarini@gmail.com>.
2740         * dfa.c: Additional faking of mbsupport for systems without it;
2741         mainly VMS.
2742
2743 2011-10-21  Stefano Lattarini  <stefano.lattarini@gmail.com>
2744
2745         * configure.ac (AM_C_PROTOTYPES): Remove call to this macro.
2746         The comments in configure.ac said that the call to AM_C_PROTOTYPES
2747         was needed for dfa.h, synced from GNU grep; but this statement is
2748         not true anymore in grep since commit v2.5.4-24-g9b5e7d4 "replace
2749         AC_CHECK_* with gnulib modules", dating back to 2009-11-26.  Also,
2750         the support for automatic de-ANSI-fication has been deprecated in
2751         automake 1.11.2, and will be removed altogether in automake 1.12.
2752         * vms/vms-conf.h (PROTOTYPES, __PROTOTYPES): Remove these #define,
2753         they are not used anymore.
2754         * pc/config.h (PROTOTYPES): Likewise.
2755
2756 2011-10-18         Dave Pitts            <dpitts@cozx.com>
2757
2758         * dfa.c: Move some decls to the top of their functions for
2759         C90 compilers.
2760
2761 2011-10-18         Arnold D. Robbins     <arnold@skeeve.com>
2762
2763         * builtin.c (do_strftime): Add check for negative / overflowed
2764         time_t value with fatal error. Thanks to Hermann Peifer
2765         <peifer@gmx.eu> for the bug report.
2766         * dfa.c (setbit_wc): Non-MBS version. Add a return false
2767         since VMS compiler doesn't understand that abort doesn't return.
2768
2769 2011-10-10         Arnold D. Robbins     <arnold@skeeve.com>
2770
2771         * builtin.c (do_sub): Init textlen to zero to avoid "may be
2772         used unitialized" warning. Thanks to Corinna Vinschen for
2773         pointing this out.
2774         * eval.c (unwind_stack): Add parentheses around condition in while
2775         to avoid overzealous warning from GCC.
2776
2777 2011-09-30  Eli Zaretskii  <eliz@gnu.org>
2778
2779         * io.c (remap_std_file): Fix non-portable code that caused
2780         redirected "print" to fail if a previous read from standard input
2781         returned EOF.  Reported by David Millis <tvtronix@yahoo.com>.
2782         (remap_std_file): Per Eli's suggestion, removed the leading close
2783         of oldfd and will let dup2 do the close for us.
2784
2785 2011-10-11         John Haque     <j.eh@mchsi.com>
2786
2787         * symbol.c: Add licence notice.
2788         * array.c (PREC_NUM, PREC_STR): Define as macros.
2789
2790 2011-10-09         Arnold D. Robbins     <arnold@skeeve.com>
2791
2792         * dfa.c: Sync with GNU grep.
2793
2794 2011-10-07         John Haque     <j.eh@mchsi.com>
2795
2796         Tail recursion optimization.
2797         * awkgram.y (grammar, mk_function): Recognize tail-recursive
2798         calls.
2799         * awk.h (tail_call, num_tail_calls): New defines.
2800         * eval.c (setup_frame): Reuse function call stack for
2801         tail-recursive calls.
2802         (dump_fcall_stack): Reworked.
2803
2804 2011-10-04         Arnold D. Robbins     <arnold@skeeve.com>
2805
2806         * awk.h, main.c (gawk_mb_cur_max): Make it a constant 1 when
2807         MBS_SUPPORT isn't available to allow GCC dead code constant
2808         expression computation and dead code elimination to help out.
2809
2810 2011-10-02         Arnold D. Robbins     <arnold@skeeve.com>
2811
2812         * io.c (rsnullscan, get_a_record): Fix the cases where terminators
2813         are incomplete when RS == "". Also fix the case where the new value
2814         is shorter than the old one.  Based on patch from Rogier
2815         <rogier777@gmail.com> as submitted by Jeroen Schot
2816         <schot@A-Eskwadraat.nl>.
2817
2818 2011-09-24         Arnold D. Robbins     <arnold@skeeve.com>
2819
2820         * eval.c, io.c, re.c: Fix some spelling errors. Thanks to
2821         Jeroen Schot <schot@A-Eskwadraat.nl>.
2822
2823 2011-09-21         Arnold D. Robbins     <arnold@skeeve.com>
2824
2825         * dfa.c, mbsupport.h: Sync with GNU grep. Large amount of changes
2826         that remove many ifdefs, moving many conditions for multibyte
2827         support into regular C code and relying GCC's dead code optimization
2828         to elimnate code that won't be needed.
2829         * dfa.c: For gawk, add a number of additional defines so that things
2830         will compile if MBS_SUPPORT is 0.
2831         * array.c, awk.h, awkgram.y, builtin.c, eval.c, field.c, main.c,
2832         node.c, re.c: Change `#ifdef MBS_SUPPORT' to `#if MBS_SUPPORT'.
2833         * awk.h, regex_internal.h: Move NO_MBSUPPORT handling to ...
2834         * mbsupport.h: ...here.
2835
2836 2011-09-16         Arnold D. Robbins     <arnold@skeeve.com>
2837
2838         * dfa.c: Sync with GNU grep.
2839
2840 2011-09-08         John Haque     <j.eh@mchsi.com>
2841
2842         Optimization for compound assignment, increment and
2843         decrement operators; Avoid unref and make_number calls
2844         when there is no extra references to the value NODE.
2845
2846 2011-09-03         Arnold D. Robbins     <arnold@skeeve.com>
2847
2848         * dfa.c: Sync with GNU grep.
2849
2850 2011-08-31         John Haque     <j.eh@mchsi.com>
2851
2852         Grammar related changes: Simplify grammar for user-defined
2853         functions and general cleanups.
2854
2855         * symbol.c: New file.
2856         * awkgram.y: Move symbol table related routines to the
2857         new file.
2858         (rule, func_name, function_prologue, param_list): Reworked.
2859         (install_function, check_params): Do all error checkings
2860         for the function name and parameters before installing in
2861         the symbol table.
2862         (mk_function): Finalize function definition.
2863         (func_install, append_param, dup_params): Nuked.
2864         * symbol.c (make_params): allocate function parameter nodes
2865         for the symbol table. Use the hash node as Node_param_list;
2866         Saves a NODE for each parameter.
2867         (install_params): Install function parameters into the symbol
2868         table.
2869         (remove_params): Remove parameters out of the symbol table.
2870         * awk.h (parmlist, FUNC): Nuked.
2871         (fparms): New define.
2872
2873
2874         Dynamically loaded function parameters are now handled like
2875         those for a builtin.
2876
2877         * awk.h (Node_ext_func, Op_ext_builtin): New types.
2878         (Op_ext_func): Nuked.
2879         * ext.c (make_builtin): Simplified.
2880         (get_curfunc_arg_count): Nuked; Use the argument 'nargs' of
2881         the extension function instead.
2882         (get_argument, get_actual_argument): Adjust.
2883         * eval.c (r_interpret): Update case Op_func_call for a dynamic
2884         extension function. Handle the new opcode Op_ext_builtin.
2885         * pprint (profile.c): Adjust.
2886
2887
2888         Use a single variable to process gawk options.
2889
2890         * awk.h (do_flags): New variable.
2891         (DO_LINT_INVALID, DO_LINT_ALL, DO_LINT_OLD, DO_TRADITIONAL,
2892         DO_POSIX, DO_INTL, DO_NON_DEC_DATA, DO_INTERVALS,
2893         DO_PROFILING, DO_DUMP_VARS, DO_TIDY_MEM,
2894         DO_SANDBOX): New defines.
2895         (do_traditional, do_posix, do_intervals, do_intl,
2896         do_non_decimal_data, do_profiling, do_dump_vars,
2897         do_tidy_mem, do_sandbox, do_lint,
2898         do_lint_old): Defined as macros.        
2899         * main.c: Remove definitions of the do_XX variables. Add
2900         do_flags definition.
2901         * debug.c (execute_code, do_eval, parse_condition): Save
2902         do_flags before executing/parsing and restore afterwards.
2903
2904
2905         Nuke PERM flag. Always increment/decrement the reference
2906         count for a Node_val. Simplifies macros and avoids
2907         occassional memory leaks, specially in the debugger.
2908
2909         * awk.h (UPREF, DEREF, dupnode, unref): Simplified.
2910         (mk_number): Nuked.
2911         * (*.c): Increment the reference count of Nnull_string before
2912         assigning as a value.
2913
2914
2915         Revamped array handling mechanism for more speed and
2916         less memory consumption.
2917
2918         * awk.h (union bucket_item, BUCKET): New definitions. Used as
2919         bucket elements for the hash table implementations of arrays;
2920         40% space saving in 32 bit x86.
2921         (buckets, nodes, array_funcs, array_base, array_capacity,
2922         xarray, alookup, aexists, aclear, aremove, alist,
2923         acopy, adump, NUM_AFUNCS): New defines.
2924         (array_empty): New macro to test for an empty array.
2925         (assoc_lookup, in_array): Defined as macros.
2926         (enum assoc_list_flags): New declaration.
2927         (Node_ahash, NUMIND): Nuked.
2928         * eval.c (r_interpret): Adjust cases Op_subscript,
2929         Op_subscript_lhs, Op_store_var and Op_arrayfor_incr.
2930         * node.c (dupnode, unref): Removed code related to Node_ahash. 
2931         * str_array.c: New file to handle array with string indices.
2932         * int_array.c: New file to handle array with integer indices.
2933         * cint_array.c: New file. Special handling of arrays with
2934         (mostly) consecutive integer indices.
2935
2936
2937         Memory pool management reworked to handle NODE and BUCKET.
2938
2939         * awk.h (struct block_item, BLOCK, block_id): New definitions.
2940         (getblock, freeblock): New macros.
2941         (getbucket, freebucket): New macros to allocate and deallocate
2942         a BUCKET.
2943         (getnode, freenode): Adjusted.
2944         * node.c (more_nodes): Nuked.
2945         (more_blocks): New routine to allocate blocks of memory.
2946
2947 2011-08-24         Arnold D. Robbins     <arnold@skeeve.com>
2948
2949         Fix pty co-process communication on Ubuntu GNU/Linux.
2950
2951         * io.c: Add include of <sys/ioctl.h> to get definition of TIOCSCTTY.
2952         (two_way_open): Move call for this ioctl to after setsid() call.
2953
2954 2011-08-23         Arnold D. Robbins     <arnold@skeeve.com>
2955
2956         * regex_internal.c (re_string_fetch_byte_case ): Remove
2957         __attribute((pure)) since it causes failures with gcc -O2
2958         -fno-inline. Thanks to Neil Cahill <ncahill_alt@yahoo.com>
2959         for reporting the bug.
2960
2961 2011-08-10         John Haque      <j.eh@mchsi.com>
2962
2963         BEGINFILE/ENDFILE related code redone.
2964
2965         * awk.h (prev_frame_size, has_endfile, target_get_record,
2966         target_newfile): New defines.
2967         * awkgram.y (mk_program): Initialize has_endfile appropriately for
2968         Op_get_record.
2969         (parse_program): Initialize new jump targets for
2970         Op_get_record and Op_newfile.
2971         * eval.c (unwind_stack): Change argument to number of
2972         items to be left in the stack. Adjust code.
2973         (pop_fcall, pop_stack): New defines.
2974         (setup_frame): Initialize prev_frame_size.
2975         (exec_state, EXEC_STATE): New structure and typedef.
2976         (exec_state_stack): New variable.
2977         (push_exec_state, pop_exec_state): New functions to save and
2978         later retrieve an execution state.
2979         (r_interpret): Use the new functions and the defines in
2980         cases Op_K_getline, Op_after_beginfile, Op_after_endfile,
2981         Op_newfile and Op_K_exit.
2982         * io.c (after_beginfile): When skipping a file using nextfile,
2983         return zero in case there was an error opening the file. 
2984         (has_endfile): Nuke global variable.
2985         (inrec): Add a second argument to pass errno to the calling
2986         routine.
2987         * debug.c (print_instruction): Update cases.
2988
2989 2011-08-10         Arnold D. Robbins     <arnold@skeeve.com>
2990
2991         Fix (apparently long-standing) problem with FIELDWIDTHS.
2992         Thanks to Johannes Meixner <jsmeix@suse.de>.
2993
2994         * field.c (set_FIELDWIDTHS): Adjust calculations.
2995
2996         Fix problem with FPAT, reported by "T. X. G." <leopardie333@yahoo.com>
2997
2998         * awk.h (Regexp): Add new member 'non_empty'.
2999         * field.c (fpat_parse_field): Save/restore local variable non_empty
3000         from member in Regexp struct.
3001
3002 2011-08-09         Arnold D. Robbins     <arnold@skeeve.com>
3003
3004         Fix pty issue reported by "T. X. G." <leopardie333@yahoo.com>
3005
3006         * configure.ac: Check for setsid.
3007         * awk.h: If not HAVE_SETSID define it as an empty macro.
3008         * io.c (two_way_open): Call setsid if using pty's.
3009
3010 2011-07-29  Eli Zaretskii  <eliz@gnu.org>
3011
3012         * builtin.c (format_tree): Rename small -> small_flag,
3013         big -> big_flag, bigbig -> bigbig_flag.  Solves compilation errors
3014         when building Gawk with libsigsegv on MS-Windows, see
3015         https://lists.gnu.org/archive/html/bug-gawk/2011-07/msg00029.html.
3016
3017 2011-07-28         Arnold D. Robbins     <arnold@skeeve.com>
3018
3019         * builtin.c (do_sub): Revert to gawk 3.1 behavior for backslash
3020         handling. It was stupid to think I could break compatibility.
3021         Thanks to John Ellson <ellson@research.att.com> for raising
3022         the issue.
3023
3024 2011-07-26         John Haque      <j.eh@mchsi.com>
3025
3026         * eval.c (r_interpret): In cases Op_var_assign and Op_field_assign,
3027         include Op_K_getline_redir in the test for skipping the routine.
3028
3029 2011-07-26         John Haque      <j.eh@mchsi.com>
3030
3031         Fix handling of assign routines for 'getline var'.
3032         Rework the previous fix for (g)sub.
3033
3034         * awk.h: New define assign_ctxt for use in Op_var_assign
3035         and Op_field_assign opcodes. Remove define AFTER_ASSIGN.
3036         * awkgram.y (snode, mk_getline): Initialize assign_ctxt.
3037         * builtin.c (do_sub): Adjust to take only the first two
3038         arguments.
3039         * eval.c (r_interpret): In cases Op_var_assign and Op_field_assign,
3040         skip the routine as appropriate. Adjust case Op_sub_builtin.
3041         * main.c (get_spec_varname): New function.
3042         * debug.c (print_instruction): Use the new function to get
3043         special variable name.
3044
3045 2011-07-17         Arnold D. Robbins     <arnold@skeeve.com>
3046
3047         * main.c (varinit): Mark FPAT as NON_STANDARD. Thanks to
3048         Wolfgang Seeberg <wolfgang.seeberg@yahoo.com> for the report.
3049         * Makefile.am (EXTRA_DIST): Add po/README, per advice from
3050         Bruno Haible.
3051         * dfa.c: Sync with GNU grep.
3052         * xalloc.h (xzalloc): New function, from GNU grep, for dfa.c.
3053         * README: Note that bug list is really a real mailing list.
3054
3055 2011-07-16         Arnold D. Robbins     <arnold@skeeve.com>
3056
3057         * Makefile.am (AUTOMAKE_OPTIONS): Removed.
3058         * configure.ac (AM_INIT_AUTOMAKE): Removed dist-bzip2 option, on
3059         advice from Karl Berry.
3060
3061 2011-07-15         John Haque      <j.eh@mchsi.com>
3062
3063         * awk.h (Op_sub_builtin): New opcode.
3064         (GSUB, GENSUB, AFTER_ASSIGN, LITERAL): New flags for 
3065         Op_sub_builtin.
3066         * awkgram.y (struct tokentab): Change opcode to Op_sub_builtin
3067         for sub, gsub and gensub.
3068         (snode): Update processing of sub, gsub and gensub.
3069         * builtin.c (do_sub, do_gsub, do_gensub): Nuke.
3070         (sub_common): Renamed to do_sub. Relocate gensub argument
3071         handling code from do_gensub to here; Simplify the code a
3072         little bit. 
3073         * eval.c (r_interpret): Handle Op_sub_builtin. Avoid field
3074         re-splitting or $0 rebuilding if (g)sub target string is
3075         a field and no substitutions were done.
3076         * pprint (profile.c): Add case for the new opcode.
3077         * print_instruction (debug.c): Ditto.
3078
3079         Take out translation for errno strings; extensions will
3080         need to use their own domain.
3081
3082         * awk.h (enum errno_translate): Removed.
3083         (update_ERRNO_string): Remove second translate paramater.
3084         * eval.c (update_ERRNO_string): Remove second translate paramater
3085         and code that used it.
3086         * gawkapi.h (api_update_ERRNO_string): Remove third translate
3087         parameter.
3088         * gawkapi.c (api_update_ERRNO_string): Remove third translate
3089         paramater and change call to update_ERRNO_string.
3090         * io.c (do_close): Fix call to update_ERRNO_string.
3091
3092 2011-07-15         Arnold D. Robbins     <arnold@skeeve.com>
3093
3094         * awk.h: Typo fix: "loner" --> longer. Thanks to Nelson Beebe.
3095         * builtin.c (efwrite): Fix flushing test back to what it was 
3096         in 3.1.8. Thanks to Strefil <strefil@yandex.ru> for the problem
3097         report.
3098         * configure.ac: Bump version to 4.0.0a for stable branch.
3099
3100 2011-06-24         Arnold D. Robbins     <arnold@skeeve.com>
3101
3102         * Makefile.am (EXTRA_DIST): Add ChangeLog.0.
3103         * 4.0.0: Remake the tar ball.
3104
3105 2011-06-23         Arnold D. Robbins     <arnold@skeeve.com>
3106
3107         * configure.ac: Update version to 4.0.0.
3108         * configure: Regenerated.
3109         * ChangeLog.0: Rotated ChangeLog into this file.
3110         * ChangeLog: Created anew for gawk 4.0.0 and on.
3111         * README: Bump version to 4.0.0.
3112         * 4.0.0: Release tar ball made.