gawk-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gawk-diffs] [SCM] gawk branch, array-iface, updated. ae9e583a257264f458


From: Arnold Robbins
Subject: [gawk-diffs] [SCM] gawk branch, array-iface, updated. ae9e583a257264f4580d07354e79aac63db72695
Date: Sun, 09 Dec 2012 20:11:19 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, array-iface has been updated
       via  ae9e583a257264f4580d07354e79aac63db72695 (commit)
       via  d283194601bc7cb7c071317a8d53a89a3cbac40d (commit)
       via  049873587037f41580a4759a7b903719d5c85b68 (commit)
       via  caf62f0dad3e07f873b6a80322d11759427d4cae (commit)
       via  28f187d2b3871c0e76d301b51c4b4855bd3c56e4 (commit)
       via  134fa0445295460d897661ee18027c645b2baa73 (commit)
       via  4ed8e81f87aadda3521a967b5c5e714bf027194b (commit)
       via  549694bc88a7345c10551d13017fa8a0eccb8619 (commit)
      from  a5a114bf6c6f2efdcd7889ebf0d7f9f3ec235a74 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=ae9e583a257264f4580d07354e79aac63db72695

commit ae9e583a257264f4580d07354e79aac63db72695
Merge: a5a114b d283194
Author: Arnold D. Robbins <address@hidden>
Date:   Sun Dec 9 22:11:01 2012 +0200

    Merge branch 'master' into array-iface

diff --cc ChangeLog
index 8191e9d,cc9a469..0dab72a
--- a/ChangeLog
+++ b/ChangeLog
@@@ -1,3 -1,42 +1,44 @@@
+ 2012-12-09         Arnold D. Robbins     <address@hidden>
+ 
+       Clean up BINMODE to use symbolic values.
+ 
+       * awk.h (enum binmode_values): New enum.
+       * eval.c (set_BINMODE): Use them.
+       * io.c (binmode, close_rp, gawk_popen): Ditto.
+       * main.c (main): Ditto.
+       * builtin.c (do_system): Ditto.
+ 
+       Unrelated:
+ 
+       * configure.ac: Look for posix_openpt
+       * io.c (two_way_open): Use posix_openpt if it's available.
+       Thanks to Christian Weisgerber <address@hidden> for
+       the changes.
+ 
+       Also unrelated:
+ 
+       * regex.c: Don't include <sys/param.h> on VMS. Thanks to
+       Anders Wallin.
+ 
+       Also unrelated:
+ 
+       * ext.c (is_letter, is_identifier_char): New functions. Don't use
+       <ctype.h> functions since those could rely on the locale.
+       (make_builtin): Adjust test for valid name to call the new
+       functions and return false instead of throwing a fatal error.
++      (make_old_builtin): Adjust test for valid name to call the new
++      function.
+       * awk.h (is_identchar): Move from here, ...
+       * awkgram.y (is_identchar): ... to here. This is safe, since
+       the locale is C during parsing the program.
+ 
+       Also unrelated: Make all checks for bitflags being set consistent
+       in case we should wish to switch them to macro calls:
+ 
+       * awkgram.y, builtin.c, cint_array.c, debug.c, eval.c, gawkapi.c,
+       int_array.c, io.c, mpfr.c, node.c, profile.c, str_array.c: Fix
+       as needed.
+ 
  2012-12-07         Arnold D. Robbins     <address@hidden>
  
        * awkgram.y (tokentab): `fflush()' is now in POSIX, remove the
diff --cc cint_array.c
index d30f0d0,625730a..29b6fdf
--- a/cint_array.c
+++ b/cint_array.c
@@@ -457,7 -447,7 +457,7 @@@ cint_list(NODE *symbol, NODE *t
        /* populate it with index in ascending or descending order */
  
        for (ja = NHAT, jd = INT32_BIT - 1; ja < INT32_BIT && jd >= NHAT; ) {
-               j = (assoc_kind & ADESC) ? jd-- : ja++;
 -              j = (t->flags & ADESC) != 0 ? jd-- : ja++;
++              j = (assoc_kind & ADESC) != 0 ? jd-- : ja++;
                tn = symbol->nodes[j];
                if (tn == NULL)
                        continue;
@@@ -896,7 -885,7 +896,7 @@@ tree_list(NODE *tree, NODE **list, asso
                hsize /= 2;
  
        for (j = 0; j < hsize; j++) {
-               cj = (assoc_kind & ADESC) ? (hsize - 1 - j) : j;
 -              cj = (flags & ADESC) != 0 ? (hsize - 1 - j) : j;
++              cj = (assoc_kind & ADESC) != 0 ? (hsize - 1 - j) : j;
                tn = tree->nodes[cj];
                if (tn == NULL)
                        continue;
@@@ -1158,14 -1146,14 +1158,14 @@@ leaf_list(NODE *array, NODE **list, ass
        static char buf[100];
  
        for (i = 0; i < size; i++) {
-               ci = (assoc_kind & ADESC) ? (size - 1 - i) : i;
 -              ci = (flags & ADESC) != 0 ? (size - 1 - i) : i;
++              ci = (assoc_kind & ADESC) != 0 ? (size - 1 - i) : i;
                r = array->nodes[ci];
                if (r == NULL)
                        continue;
  
                /* index */
                num = array->array_base + ci;
-               if (assoc_kind & AISTR) {
 -              if ((flags & AISTR) != 0) {
++              if ((assoc_kind & AISTR) != 0) {
                        sprintf(buf, "%ld", num); 
                        subs = make_string(buf, strlen(buf));
                        subs->numbr = num;
@@@ -1177,11 -1165,11 +1177,11 @@@
                list[k++] = subs;
  
                /* value */
-               if (assoc_kind & AVALUE) {
 -              if ((flags & AVALUE) != 0) {
++              if ((assoc_kind & AVALUE) != 0) {
                        if (r->type == Node_val) {
 -                              if ((flags & AVNUM) != 0)
 +                              if ((assoc_kind & AVNUM) != 0)
                                        (void) force_number(r);
 -                              else if ((flags & AVSTR) != 0)
 +                              else if ((assoc_kind & AVSTR) != 0)
                                        r = force_string(r);
                        }
                        list[k++] = r;
diff --cc doc/gawk.info
index 09f3043,6843eff..2e542fd
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@@ -32726,119 -32177,118 +32732,235 @@@ Ref: call-new-function87667
  Node: Extension Future Growth878671
  Node: Extension API Description879489
  Node: Extension API Functions Introduction880817
++<<<<<<< HEAD
 +Node: General Data Types885517
 +Ref: General Data Types-Footnote-1891119
 +Node: Requesting Values891418
 +Ref: table-value-types-returned892149
 +Node: Constructor Functions893103
 +Node: Registration Functions896099
 +Node: Extension Functions896784
 +Node: Exit Callback Functions898616
 +Node: Extension Version String899859
 +Node: Input Parsers900509
 +Node: Output Wrappers909096
 +Node: Two-way processors913512
 +Node: Printing Messages915642
 +Ref: Printing Messages-Footnote-1916719
 +Node: Updating `ERRNO'916871
 +Node: Accessing Parameters917610
 +Node: Symbol Table Access918840
 +Node: Symbol table by name919352
 +Ref: Symbol table by name-Footnote-1921522
 +Node: Symbol table by cookie921602
 +Ref: Symbol table by cookie-Footnote-1925731
 +Node: Cached values925794
 +Ref: Cached values-Footnote-1929237
 +Node: Array Manipulation929328
 +Ref: Array Manipulation-Footnote-1930426
 +Node: Array Data Types930465
 +Ref: Array Data Types-Footnote-1933168
 +Node: Array Functions933260
 +Node: Flattening Arrays937026
 +Node: Creating Arrays943859
 +Node: Extension API Variables948654
 +Node: Extension Versioning949290
 +Node: Extension API Informational Variables951191
 +Node: Extension API Boilerplate952277
 +Node: Finding Extensions956108
 +Node: Extension Example956655
 +Node: Internal File Description957393
 +Node: Internal File Ops961081
 +Ref: Internal File Ops-Footnote-1972528
 +Node: Using Internal File Ops972668
 +Ref: Using Internal File Ops-Footnote-1975021
 +Node: Extension Samples975287
 +Node: Extension Sample File Functions976730
 +Node: Extension Sample Fnmatch985203
 +Node: Extension Sample Fork986929
 +Node: Extension Sample Ord988143
 +Node: Extension Sample Readdir988919
 +Node: Extension Sample Revout990423
 +Node: Extension Sample Rev2way991016
 +Node: Extension Sample Read write array991706
 +Node: Extension Sample Readfile993589
 +Node: Extension Sample API Tests994344
 +Node: Extension Sample Time994869
 +Node: gawkextlib996176
 +Node: Language History998557
 +Node: V7/SVR3.11000079
 +Node: SVR41002400
 +Node: POSIX1003842
 +Node: BTL1004850
 +Node: POSIX/GNU1005655
 +Node: Common Extensions1011190
 +Node: Ranges and Locales1012249
 +Ref: Ranges and Locales-Footnote-11016867
 +Ref: Ranges and Locales-Footnote-21016894
 +Ref: Ranges and Locales-Footnote-31017154
 +Node: Contributors1017375
 +Node: Installation1021671
 +Node: Gawk Distribution1022565
 +Node: Getting1023049
 +Node: Extracting1023875
 +Node: Distribution contents1025567
 +Node: Unix Installation1030789
 +Node: Quick Installation1031406
 +Node: Additional Configuration Options1033368
 +Node: Configuration Philosophy1034845
 +Node: Non-Unix Installation1037187
 +Node: PC Installation1037645
 +Node: PC Binary Installation1038944
 +Node: PC Compiling1040792
 +Node: PC Testing1043736
 +Node: PC Using1044912
 +Node: Cygwin1049097
 +Node: MSYS1050097
 +Node: VMS Installation1050611
 +Node: VMS Compilation1051214
 +Ref: VMS Compilation-Footnote-11052221
 +Node: VMS Installation Details1052279
 +Node: VMS Running1053914
 +Node: VMS Old Gawk1055521
 +Node: Bugs1055995
 +Node: Other Versions1059847
 +Node: Notes1065162
 +Node: Compatibility Mode1065821
 +Node: Additions1066604
 +Node: Accessing The Source1067531
 +Node: Adding Code1069134
 +Node: New Ports1075176
 +Node: Derived Files1079311
 +Ref: Derived Files-Footnote-11084619
 +Ref: Derived Files-Footnote-21084653
 +Ref: Derived Files-Footnote-31085253
 +Node: Future Extensions1085351
 +Node: Implementation Limitations1085932
 +Node: Basic Concepts1087159
 +Node: Basic High Level1087840
 +Ref: figure-general-flow1088111
 +Ref: figure-process-flow1088710
 +Ref: Basic High Level-Footnote-11091939
 +Node: Basic Data Typing1092124
 +Node: Glossary1095479
 +Node: Copying1120790
 +Node: GNU Free Documentation License1158347
 +Node: Index1183484
 +>>>>>>> master
++=======
+ Node: General Data Types885595
+ Ref: General Data Types-Footnote-1891197
+ Node: Requesting Values891496
+ Ref: table-value-types-returned892227
+ Node: Constructor Functions893181
+ Node: Registration Functions896177
+ Node: Extension Functions896862
+ Node: Exit Callback Functions899036
+ Node: Extension Version String900279
+ Node: Input Parsers900929
+ Node: Output Wrappers909516
+ Node: Two-way processors913932
+ Node: Printing Messages916062
+ Ref: Printing Messages-Footnote-1917139
+ Node: Updating `ERRNO'917291
+ Node: Accessing Parameters918030
+ Node: Symbol Table Access919260
+ Node: Symbol table by name919772
+ Ref: Symbol table by name-Footnote-1921942
+ Node: Symbol table by cookie922022
+ Ref: Symbol table by cookie-Footnote-1926151
+ Node: Cached values926214
+ Ref: Cached values-Footnote-1929657
+ Node: Array Manipulation929748
+ Ref: Array Manipulation-Footnote-1930846
+ Node: Array Data Types930885
+ Ref: Array Data Types-Footnote-1933588
+ Node: Array Functions933680
+ Node: Flattening Arrays937446
+ Node: Creating Arrays944279
+ Node: Extension API Variables949074
+ Node: Extension Versioning949710
+ Node: Extension API Informational Variables951611
+ Node: Extension API Boilerplate952697
+ Node: Finding Extensions956528
+ Node: Extension Example957075
+ Node: Internal File Description957813
+ Node: Internal File Ops961501
+ Ref: Internal File Ops-Footnote-1972948
+ Node: Using Internal File Ops973088
+ Ref: Using Internal File Ops-Footnote-1975441
+ Node: Extension Samples975707
+ Node: Extension Sample File Functions977150
+ Node: Extension Sample Fnmatch985623
+ Node: Extension Sample Fork987349
+ Node: Extension Sample Ord988563
+ Node: Extension Sample Readdir989339
+ Node: Extension Sample Revout990843
+ Node: Extension Sample Rev2way991436
+ Node: Extension Sample Read write array992126
+ Node: Extension Sample Readfile994009
+ Node: Extension Sample API Tests994764
+ Node: Extension Sample Time995289
+ Node: gawkextlib996596
+ Node: Language History998977
+ Node: V7/SVR3.11000499
+ Node: SVR41002820
+ Node: POSIX1004262
+ Node: BTL1005270
+ Node: POSIX/GNU1006075
+ Node: Common Extensions1011610
+ Node: Ranges and Locales1012669
+ Ref: Ranges and Locales-Footnote-11017287
+ Ref: Ranges and Locales-Footnote-21017314
+ Ref: Ranges and Locales-Footnote-31017574
+ Node: Contributors1017795
+ Node: Installation1022091
+ Node: Gawk Distribution1022985
+ Node: Getting1023469
+ Node: Extracting1024295
+ Node: Distribution contents1025987
+ Node: Unix Installation1031248
+ Node: Quick Installation1031865
+ Node: Additional Configuration Options1033827
+ Node: Configuration Philosophy1035304
+ Node: Non-Unix Installation1037646
+ Node: PC Installation1038104
+ Node: PC Binary Installation1039403
+ Node: PC Compiling1041251
+ Node: PC Testing1044195
+ Node: PC Using1045371
+ Node: Cygwin1049556
+ Node: MSYS1050556
+ Node: VMS Installation1051070
+ Node: VMS Compilation1051673
+ Ref: VMS Compilation-Footnote-11052680
+ Node: VMS Installation Details1052738
+ Node: VMS Running1054373
+ Node: VMS Old Gawk1055980
+ Node: Bugs1056454
+ Node: Other Versions1060306
+ Node: Notes1065621
+ Node: Compatibility Mode1066280
+ Node: Additions1067063
+ Node: Accessing The Source1067990
+ Node: Adding Code1069593
+ Node: New Ports1075635
+ Node: Derived Files1079770
+ Ref: Derived Files-Footnote-11085078
+ Ref: Derived Files-Footnote-21085112
+ Ref: Derived Files-Footnote-31085712
+ Node: Future Extensions1085810
+ Node: Implementation Limitations1086391
+ Node: Basic Concepts1087618
+ Node: Basic High Level1088299
+ Ref: figure-general-flow1088570
+ Ref: figure-process-flow1089169
+ Ref: Basic High Level-Footnote-11092398
+ Node: Basic Data Typing1092583
+ Node: Glossary1095938
+ Node: Copying1121249
+ Node: GNU Free Documentation License1158806
+ Node: Index1183943
++>>>>>>> master
  
  End Tag Table
diff --cc ext.c
index 54098e5,24a0b27..ff0beb9
--- a/ext.c
+++ b/ext.c
@@@ -32,11 -31,44 +32,47 @@@ extern SRCFILE *srcfiles
  
  #ifdef DYNAMIC
  
 +#define OLD_INIT_FUNC "dlload"
 +#define OLD_FINI_FUNC "dlunload"
 +
  #include <dlfcn.h>
  
+ /*
+  * is_letter --- function to check letters
+  *    isalpha() isn't good enough since it can look at the locale.
+  * Underscore counts as a letter in awk identifiers
+  */
+ 
+ static bool
+ is_letter(unsigned char c)
+ {
+       switch (c) {
+       case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
+       case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
+       case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
+       case 's': case 't': case 'u': case 'v': case 'w': case 'x':
+       case 'y': case 'z':
+       case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
+       case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
+       case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
+       case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
+       case 'Y': case 'Z':
+       case '_':
+               return true;
+       default:
+               return false;
+       }
+ }
+ 
+ /* is_identifier_char --- return true if a character can be used in an 
identifier */
+ 
+ static bool
+ is_identifier_char(unsigned char c)
+ {
+       return (is_letter(c) || isdigit(c));
+ }
+ 
+ 
  #define INIT_FUNC     "dl_load"
  
  /* load_ext --- load an external library */
@@@ -223,57 -171,6 +263,57 @@@ make_builtin(const awk_ext_func_t *func
        return true;
  }
  
 +/* make_old_builtin --- register name to be called as func with a builtin 
body */
 +
 +void
 +make_old_builtin(const char *name, NODE *(*func)(int), int count)     /* 
temporary */
 +{
 +      NODE *symbol, *f;
 +      INSTRUCTION *b;
 +      const char *sp;
 +      char c;
 +
 +      sp = name;
 +      if (sp == NULL || *sp == '\0')
 +              fatal(_("extension: missing function name"));
 +
 +      while ((c = *sp++) != '\0') {
 +              if ((sp == & name[1] && c != '_' && ! isalpha((unsigned char) 
c))
-                               || (sp > &name[1] && ! is_identchar((unsigned 
char) c)))
++                              || (sp > &name[1] && ! 
is_identifier_char((unsigned char) c)))
 +                      fatal(_("extension: illegal character `%c' in function 
name `%s'"), c, name);
 +      }
 +
 +      f = lookup(name);
 +
 +      if (f != NULL) {
 +              if (f->type == Node_func) {
 +                      /* user-defined function */
 +                      fatal(_("extension: can't redefine function `%s'"), 
name);
 +              } else if (f->type == Node_ext_func) {
 +                      /* multiple extension() calls etc. */ 
 +                      if (do_lint)
 +                              lintwarn(_("extension: function `%s' already 
defined"), name);
 +                      return;
 +              } else
 +                      /* variable name etc. */ 
 +                      fatal(_("extension: function name `%s' previously 
defined"), name);
 +      } else if (check_special(name) >= 0)
 +              fatal(_("extension: can't use gawk built-in `%s' as function 
name"), name); 
 +
 +      if (count < 0)
 +              fatal(_("make_builtin: negative argument count for function 
`%s'"),
 +                              name);
 +
 +      b = bcalloc(Op_symbol, 1, 0);
 +      b->builtin = func;
 +      b->expr_count = count;
 +
 +      /* NB: extension sub must return something */
 +
 +              symbol = install_symbol(estrdup(name, strlen(name)), 
Node_old_ext_func);
 +      symbol->code_ptr = b;
 +}
 +
  
  /* get_argument --- get the i'th argument of a dynamically linked function */
  
diff --cc int_array.c
index 02e682f,2909f6f..769ac9b
--- a/int_array.c
+++ b/int_array.c
@@@ -494,7 -486,7 +494,7 @@@ int_list(NODE *symbol, NODE *t
                        for (j = 0; j < b->aicount; j++) {
                                /* index */
                                num = b->ainum[j];
-                               if (assoc_kind & AISTR) {
 -                              if ((t->flags & AISTR) != 0) {
++                              if ((assoc_kind & AISTR) != 0) {
                                        sprintf(buf, "%ld", num); 
                                        subs = make_string(buf, strlen(buf));
                                        subs->numbr = num;
@@@ -506,12 -498,12 +506,12 @@@
                                list[k++] = subs;
  
                                /* value */
-                               if (assoc_kind & AVALUE) {
 -                              if ((t->flags & AVALUE) != 0) {
++                              if ((assoc_kind & AVALUE) != 0) {
                                        r = b->aivalue[j];
                                        if (r->type == Node_val) {
 -                                              if ((t->flags & AVNUM) != 0)
 +                                              if ((assoc_kind & AVNUM) != 0)
                                                        (void) force_number(r);
 -                                              else if ((t->flags & AVSTR) != 
0)
 +                                              else if ((assoc_kind & AVSTR) 
!= 0)
                                                        r = force_string(r);
                                        }
                                        list[k++] = r;
diff --cc str_array.c
index a38562c,db6031d..e5b3b40
--- a/str_array.c
+++ b/str_array.c
@@@ -378,17 -370,17 +378,17 @@@ str_list(NODE *symbol, NODE *t
                for (b = symbol->buckets[i]; b != NULL; b = b->ahnext) {
                        /* index */
                        subs = b->ahname;
-                       if (assoc_kind & AINUM)
 -                      if ((t->flags & AINUM) != 0)
++                      if ((assoc_kind & AINUM) != 0)
                                (void) force_number(subs);
                        list[k++] = dupnode(subs);
  
                        /* value */
-                       if (assoc_kind & AVALUE) {
 -                      if ((t->flags & AVALUE) != 0) {
++                      if ((assoc_kind & AVALUE) != 0) {
                                val = b->ahvalue;
                                if (val->type == Node_val) {
 -                                      if ((t->flags & AVNUM) != 0)
 +                                      if ((assoc_kind & AVNUM) != 0)
                                                (void) force_number(val);
 -                                      else if ((t->flags & AVSTR) != 0)
 +                                      else if ((assoc_kind & AVSTR) != 0)
                                                val = force_string(val);
                                }
                                list[k++] = val;

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog        |   41 ++++++
 TODO             |    4 +-
 awk.h            |   11 ++-
 awkgram.c        |  396 +++++++++++++++++++++++++++---------------------------
 awkgram.y        |   14 +-
 builtin.c        |   12 +-
 cint_array.c     |   12 +-
 configh.in       |    3 +
 configure        |    2 +-
 configure.ac     |    2 +-
 debug.c          |   34 +++---
 doc/ChangeLog    |    6 +
 doc/awkforai.txt |  158 ++--------------------
 doc/gawk.info    |  148 ++++++++++++++++++--
 doc/gawk.texi    |   13 ++-
 eval.c           |   32 +++---
 ext.c            |   48 ++++++-
 gawkapi.c        |   12 +-
 int_array.c      |    4 +-
 io.c             |   31 +++--
 main.c           |    4 +-
 mpfr.c           |    6 +-
 node.c           |   12 +-
 profile.c        |    6 +-
 regex.c          |    2 +
 str_array.c      |    4 +-
 vms/ChangeLog    |    4 +
 vms/vmstest.com  |  177 +++++++++++++++---------
 28 files changed, 678 insertions(+), 520 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]