gawk-diffs
[Top][All Lists]
Advanced

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

[gawk-diffs] [SCM] gawk branch, master, updated. gawk-4.1.0-2388-g1f05c3


From: Arnold Robbins
Subject: [gawk-diffs] [SCM] gawk branch, master, updated. gawk-4.1.0-2388-g1f05c34
Date: Thu, 22 Dec 2016 15:40:21 +0000 (UTC)

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, master has been updated
       via  1f05c34b1b0d8b0a0c561ce38570d4ed8774f54a (commit)
       via  af6f677758c6b873fb3130b34705e2a705270a75 (commit)
       via  cd820dc4359b8dc1a40fedc0c5d3924ed8f88df0 (commit)
       via  293b5a86a9053668773e75b35682c41ca64e0db6 (commit)
       via  0eb15bcef4ca13a329c9bf3d5e608e29bbce42ad (commit)
       via  0ea062a3f282cd47ff6f94b91e4f612ab9577bee (commit)
       via  2eb77d13c2e4f69f8422e2d6de2421c1f4ccabad (commit)
       via  388f033a7f899cc58504418977aaadfa7c72c404 (commit)
       via  42584a5cb9340576a91aaee55c36707e1ca6ba42 (commit)
       via  352af50d54071be81f6be1c4d93bfd791f473755 (commit)
       via  16761af5b3cec40f1e341cb33787af33cb2b45c2 (commit)
       via  4a20341b487c17b49fc455ba37df84946eda38a7 (commit)
       via  2b9a30b2ab91ea465a649be0fd0927c2aebc67ff (commit)
       via  4bcb4e30c50e95c6fd58b4b418d9fc56bb2d3ce3 (commit)
       via  68754e0678e84a30f6ce996cc8550d5bb9b8f5f0 (commit)
       via  1b66a15c2eec9b48008e018e526b333cdeb56338 (commit)
       via  bf847b770dec8fd2e364a56abc8618987b9de917 (commit)
      from  0f15f82e19b32823fe3fdf51052389ca3b60e92e (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=1f05c34b1b0d8b0a0c561ce38570d4ed8774f54a

commit 1f05c34b1b0d8b0a0c561ce38570d4ed8774f54a
Author: Arnold D. Robbins <address@hidden>
Date:   Thu Dec 22 17:40:01 2016 +0200

    Finish merging by updating generated docs.

diff --git a/doc/gawk.info b/doc/gawk.info
index 67b52f5..696c8c3 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -23628,7 +23628,8 @@ use them.
 '    AWK_ARRAY,'
 '    AWK_SCALAR,         /* opaque access to a variable */'
 '    AWK_VALUE_COOKIE,   /* for updating a previously created value */'
-'    AWK_REGEX'
+'    AWK_REGEX,'
+'    AWK_STRNUM'
 '} awk_valtype_t;'
      This 'enum' indicates the type of a value.  It is used in the
      following 'struct'.
@@ -23648,6 +23649,7 @@ use them.
      type.
 
 '#define str_value      u.s'
+'#define strnum_value    str_value'
 '#define regex_value    str_value'
 '#define num_value      u.d'
 '#define array_cookie   u.a'
@@ -23667,15 +23669,21 @@ use them.
      This is also discussed in a general fashion in the text following
      this list, and in more detail in *note Cached values::.
 
-   Scalar values in 'awk' are numbers, strings, or typed regexps.  The
-'awk_value_t' struct represents values.  The 'val_type' member indicates
-what is in the 'union'.
+   Scalar values in 'awk' are numbers, strings, strnums, or typed
+regexps.  The 'awk_value_t' struct represents values.  The 'val_type'
+member indicates what is in the 'union'.
 
    Representing numbers is easy--the API uses a C 'double'.  Strings
 require more work.  Because 'gawk' allows embedded NUL bytes in string
 values, a string must be represented as a pair containing a data pointer
 and length.  This is the 'awk_string_t' type.
 
+   A strnum (numeric string) value is represented as a string and
+consists of user input data that appears to be numeric.  When an
+extension attempts to create a strnum value, a string flagged as user
+input is created.  Subsequent parsing will determine whether it looks
+like a number and should be treated as a strnum or a regular string.
+
    Typed regexp values (*note Strong Regexp Constants::) are not of much
 use to extension functions.  Extension functions can tell that they've
 received them, and create them for scalar values.  Otherwise, they can
@@ -23842,9 +23850,29 @@ code would use them:
      variable pointed to by 'result'.
 
 'static inline awk_value_t *'
-'make_regex(const char *string, size_t length, awk_value_t *result);'
+'make_const_user_input(const char *string, size_t length, awk_value_t 
*result);'
+     This function is identical to 'make_const_string', but the string
+     is flagged as user input that should be treated as a strnum value
+     if the contents of the string are numeric.
+
+'static inline awk_value_t *'
+'make_malloced_user_input(const char *string, size_t length, awk_value_t 
*result);'
+     This function is identical to 'make_malloced_string', but the
+     string is flagged as user input that should be treated as a strnum
+     value if the contents of the string are numeric.
+
+'static inline awk_value_t *'
+'make_const_regex(const char *string, size_t length, awk_value_t *result);'
+     This function creates a strongly typed regexp value by allocating a
+     copy of the string.  'string' is the regular expression of length
+     'len'.
+
+'static inline awk_value_t *'
+'make_malloced_regex(const char *string, size_t length, awk_value_t *result);'
      This function creates a strongly typed regexp value.  'string' is
-     the regular expression of length 'len'.
+     the regular expression of length 'len'.  It expects 'string' to be
+     a 'char *' value pointing to data previously obtained from
+     'gawk_malloc()', 'gawk_calloc()', or 'gawk_realloc()'.
 
 
 File: gawk.info,  Node: Registration Functions,  Next: Printing Messages,  
Prev: Constructor Functions,  Up: Extension API Description
@@ -24593,9 +24621,9 @@ was discussed earlier, in *note General Data Types::.
 
 'awk_bool_t sym_update_scalar(awk_scalar_t cookie, awk_value_t *value);'
      Update the value associated with a scalar cookie.  Return false if
-     the new value is not of type 'AWK_STRING', 'AWK_REGEX', or
-     'AWK_NUMBER'.  Here too, the predefined variables may not be
-     updated.
+     the new value is not of type 'AWK_STRING', 'AWK_STRNUM',
+     'AWK_REGEX', or 'AWK_NUMBER'.  Here too, the predefined variables
+     may not be updated.
 
    It is not obvious at first glance how to work with scalar cookies or
 what their raison d'e^tre really is.  In theory, the 'sym_lookup()' and
@@ -24710,9 +24738,9 @@ follows:
 'awk_bool_t create_value(awk_value_t *value, awk_value_cookie_t *result);'
      Create a cached string or numeric value from 'value' for efficient
      later assignment.  Only values of type 'AWK_NUMBER', 'AWK_REGEX',
-     and 'AWK_STRING' are allowed.  Any other type is rejected.
-     'AWK_UNDEFINED' could be allowed, but doing so would result in
-     inferior performance.
+     'AWK_STRNUM', and 'AWK_STRING' are allowed.  Any other type is
+     rejected.  'AWK_UNDEFINED' could be allowed, but doing so would
+     result in inferior performance.
 
 'awk_bool_t release_value(awk_value_cookie_t vc);'
      Release the memory associated with a value cookie obtained from
@@ -24939,12 +24967,20 @@ The following functions relate to individual array 
elements:
      array, but after calling this function, it has no elements.  This
      is equivalent to using the 'delete' statement (*note Delete::).
 
+'awk_bool_t flatten_array_typed(awk_array_t a_cookie, awk_flat_array_t **data, 
awk_valtype_t index_type, awk_valtype_t value_type);'
+     For the array represented by 'a_cookie', create an
+     'awk_flat_array_t' structure and fill it in with indices and values
+     of the requested types.  Set the pointer whose address is passed as
+     'data' to point to this structure.  Return true upon success, or
+     false otherwise.  *Note Flattening Arrays::, for a discussion of
+     how to flatten an array and work with it.
+
 'awk_bool_t flatten_array(awk_array_t a_cookie, awk_flat_array_t **data);'
      For the array represented by 'a_cookie', create an
-     'awk_flat_array_t' structure and fill it in.  Set the pointer whose
-     address is passed as 'data' to point to this structure.  Return
-     true upon success, or false otherwise.  *Note Flattening Arrays::,
-     for a discussion of how to flatten an array and work with it.
+     'awk_flat_array_t' structure and fill it in with 'AWK_STRING'
+     indices and 'AWK_UNDEFINED' values.  This is superseded by
+     'flatten_array_typed' and retained only for legacy binary
+     compatibility.
 
 'awk_bool_t release_flattened_array(awk_array_t a_cookie,'
 '                                   awk_flat_array_t *data);'
@@ -25046,7 +25082,7 @@ count of elements in the array and print it:
 double-check that the count in the 'awk_flat_array_t' is the same as the
 count just retrieved:
 
-         if (! flatten_array(value2.array_cookie, & flat_array)) {
+         if (! flatten_array_typed(value2.array_cookie, & flat_array, 
AWK_STRING, AWK_UNDEFINED)) {
              printf("dump_array_and_delete: could not flatten array\n");
              goto out;
          }
@@ -35820,142 +35856,142 @@ Ref: figure-call-new-function948497
 Node: Extension API Description950559
 Node: Extension API Functions Introduction952201
 Node: General Data Types957512
-Ref: General Data Types-Footnote-1963823
-Node: Memory Allocation Functions964122
-Ref: Memory Allocation Functions-Footnote-1966967
-Node: Constructor Functions967066
-Node: Registration Functions969028
-Node: Extension Functions969713
-Node: Exit Callback Functions974911
-Node: Extension Version String976161
-Node: Input Parsers976824
-Node: Output Wrappers986706
-Node: Two-way processors991218
-Node: Printing Messages993483
-Ref: Printing Messages-Footnote-1994654
-Node: Updating ERRNO994807
-Node: Requesting Values995546
-Ref: table-value-types-returned996283
-Node: Accessing Parameters997166
-Node: Symbol Table Access998401
-Node: Symbol table by name998913
-Node: Symbol table by cookie1000702
-Ref: Symbol table by cookie-Footnote-11004873
-Node: Cached values1004937
-Ref: Cached values-Footnote-11008458
-Node: Array Manipulation1008549
-Ref: Array Manipulation-Footnote-11009640
-Node: Array Data Types1009677
-Ref: Array Data Types-Footnote-11012335
-Node: Array Functions1012427
-Node: Flattening Arrays1016285
-Node: Creating Arrays1023193
-Node: Redirection API1027962
-Node: Extension API Variables1030793
-Node: Extension Versioning1031426
-Ref: gawk-api-version1031863
-Node: Extension API Informational Variables1033591
-Node: Extension API Boilerplate1034655
-Node: Changes from API V11038517
-Node: Finding Extensions1039177
-Node: Extension Example1039736
-Node: Internal File Description1040534
-Node: Internal File Ops1044614
-Ref: Internal File Ops-Footnote-11056014
-Node: Using Internal File Ops1056154
-Ref: Using Internal File Ops-Footnote-11058537
-Node: Extension Samples1058811
-Node: Extension Sample File Functions1060340
-Node: Extension Sample Fnmatch1067989
-Node: Extension Sample Fork1069476
-Node: Extension Sample Inplace1070694
-Node: Extension Sample Ord1073904
-Node: Extension Sample Readdir1074740
-Ref: table-readdir-file-types1075629
-Node: Extension Sample Revout1076434
-Node: Extension Sample Rev2way1077023
-Node: Extension Sample Read write array1077763
-Node: Extension Sample Readfile1079705
-Node: Extension Sample Time1080800
-Node: Extension Sample API Tests1082148
-Node: gawkextlib1082640
-Node: Extension summary1085087
-Node: Extension Exercises1088789
-Node: Language History1090287
-Node: V7/SVR3.11091943
-Node: SVR41094095
-Node: POSIX1095529
-Node: BTL1096908
-Node: POSIX/GNU1097637
-Node: Feature History1103499
-Node: Common Extensions1117869
-Node: Ranges and Locales1119152
-Ref: Ranges and Locales-Footnote-11123768
-Ref: Ranges and Locales-Footnote-21123795
-Ref: Ranges and Locales-Footnote-31124030
-Node: Contributors1124251
-Node: History summary1129811
-Node: Installation1131191
-Node: Gawk Distribution1132135
-Node: Getting1132619
-Node: Extracting1133580
-Node: Distribution contents1135218
-Node: Unix Installation1141303
-Node: Quick Installation1141985
-Node: Shell Startup Files1144399
-Node: Additional Configuration Options1145477
-Node: Configuration Philosophy1147282
-Node: Non-Unix Installation1149651
-Node: PC Installation1150111
-Node: PC Binary Installation1150949
-Node: PC Compiling1151384
-Node: PC Using1152501
-Node: Cygwin1155546
-Node: MSYS1156316
-Node: VMS Installation1156817
-Node: VMS Compilation1157608
-Ref: VMS Compilation-Footnote-11158837
-Node: VMS Dynamic Extensions1158895
-Node: VMS Installation Details1160580
-Node: VMS Running1162833
-Node: VMS GNV1167112
-Node: VMS Old Gawk1167847
-Node: Bugs1168318
-Node: Bug address1168981
-Node: Usenet1171378
-Node: Maintainers1172153
-Node: Other Versions1173529
-Node: Installation summary1180113
-Node: Notes1181148
-Node: Compatibility Mode1182013
-Node: Additions1182795
-Node: Accessing The Source1183720
-Node: Adding Code1185155
-Node: New Ports1191374
-Node: Derived Files1195862
-Ref: Derived Files-Footnote-11201347
-Ref: Derived Files-Footnote-21201382
-Ref: Derived Files-Footnote-31201980
-Node: Future Extensions1202094
-Node: Implementation Limitations1202752
-Node: Extension Design1203935
-Node: Old Extension Problems1205089
-Ref: Old Extension Problems-Footnote-11206607
-Node: Extension New Mechanism Goals1206664
-Ref: Extension New Mechanism Goals-Footnote-11210028
-Node: Extension Other Design Decisions1210217
-Node: Extension Future Growth1212330
-Node: Old Extension Mechanism1213166
-Node: Notes summary1214929
-Node: Basic Concepts1216111
-Node: Basic High Level1216792
-Ref: figure-general-flow1217074
-Ref: figure-process-flow1217759
-Ref: Basic High Level-Footnote-11221060
-Node: Basic Data Typing1221245
-Node: Glossary1224573
-Node: Copying1256520
-Node: GNU Free Documentation License1294059
-Node: Index1319177
+Ref: General Data Types-Footnote-1964227
+Node: Memory Allocation Functions964526
+Ref: Memory Allocation Functions-Footnote-1967371
+Node: Constructor Functions967470
+Node: Registration Functions970465
+Node: Extension Functions971150
+Node: Exit Callback Functions976348
+Node: Extension Version String977598
+Node: Input Parsers978261
+Node: Output Wrappers988143
+Node: Two-way processors992655
+Node: Printing Messages994920
+Ref: Printing Messages-Footnote-1996091
+Node: Updating ERRNO996244
+Node: Requesting Values996983
+Ref: table-value-types-returned997720
+Node: Accessing Parameters998603
+Node: Symbol Table Access999838
+Node: Symbol table by name1000350
+Node: Symbol table by cookie1002139
+Ref: Symbol table by cookie-Footnote-11006324
+Node: Cached values1006388
+Ref: Cached values-Footnote-11009924
+Node: Array Manipulation1010015
+Ref: Array Manipulation-Footnote-11011106
+Node: Array Data Types1011143
+Ref: Array Data Types-Footnote-11013801
+Node: Array Functions1013893
+Node: Flattening Arrays1018207
+Node: Creating Arrays1025148
+Node: Redirection API1029917
+Node: Extension API Variables1032748
+Node: Extension Versioning1033381
+Ref: gawk-api-version1033818
+Node: Extension API Informational Variables1035546
+Node: Extension API Boilerplate1036610
+Node: Changes from API V11040472
+Node: Finding Extensions1041132
+Node: Extension Example1041691
+Node: Internal File Description1042489
+Node: Internal File Ops1046569
+Ref: Internal File Ops-Footnote-11057969
+Node: Using Internal File Ops1058109
+Ref: Using Internal File Ops-Footnote-11060492
+Node: Extension Samples1060766
+Node: Extension Sample File Functions1062295
+Node: Extension Sample Fnmatch1069944
+Node: Extension Sample Fork1071431
+Node: Extension Sample Inplace1072649
+Node: Extension Sample Ord1075859
+Node: Extension Sample Readdir1076695
+Ref: table-readdir-file-types1077584
+Node: Extension Sample Revout1078389
+Node: Extension Sample Rev2way1078978
+Node: Extension Sample Read write array1079718
+Node: Extension Sample Readfile1081660
+Node: Extension Sample Time1082755
+Node: Extension Sample API Tests1084103
+Node: gawkextlib1084595
+Node: Extension summary1087042
+Node: Extension Exercises1090744
+Node: Language History1092242
+Node: V7/SVR3.11093898
+Node: SVR41096050
+Node: POSIX1097484
+Node: BTL1098863
+Node: POSIX/GNU1099592
+Node: Feature History1105454
+Node: Common Extensions1119824
+Node: Ranges and Locales1121107
+Ref: Ranges and Locales-Footnote-11125723
+Ref: Ranges and Locales-Footnote-21125750
+Ref: Ranges and Locales-Footnote-31125985
+Node: Contributors1126206
+Node: History summary1131766
+Node: Installation1133146
+Node: Gawk Distribution1134090
+Node: Getting1134574
+Node: Extracting1135535
+Node: Distribution contents1137173
+Node: Unix Installation1143258
+Node: Quick Installation1143940
+Node: Shell Startup Files1146354
+Node: Additional Configuration Options1147432
+Node: Configuration Philosophy1149237
+Node: Non-Unix Installation1151606
+Node: PC Installation1152066
+Node: PC Binary Installation1152904
+Node: PC Compiling1153339
+Node: PC Using1154456
+Node: Cygwin1157501
+Node: MSYS1158271
+Node: VMS Installation1158772
+Node: VMS Compilation1159563
+Ref: VMS Compilation-Footnote-11160792
+Node: VMS Dynamic Extensions1160850
+Node: VMS Installation Details1162535
+Node: VMS Running1164788
+Node: VMS GNV1169067
+Node: VMS Old Gawk1169802
+Node: Bugs1170273
+Node: Bug address1170936
+Node: Usenet1173333
+Node: Maintainers1174108
+Node: Other Versions1175484
+Node: Installation summary1182068
+Node: Notes1183103
+Node: Compatibility Mode1183968
+Node: Additions1184750
+Node: Accessing The Source1185675
+Node: Adding Code1187110
+Node: New Ports1193329
+Node: Derived Files1197817
+Ref: Derived Files-Footnote-11203302
+Ref: Derived Files-Footnote-21203337
+Ref: Derived Files-Footnote-31203935
+Node: Future Extensions1204049
+Node: Implementation Limitations1204707
+Node: Extension Design1205890
+Node: Old Extension Problems1207044
+Ref: Old Extension Problems-Footnote-11208562
+Node: Extension New Mechanism Goals1208619
+Ref: Extension New Mechanism Goals-Footnote-11211983
+Node: Extension Other Design Decisions1212172
+Node: Extension Future Growth1214285
+Node: Old Extension Mechanism1215121
+Node: Notes summary1216884
+Node: Basic Concepts1218066
+Node: Basic High Level1218747
+Ref: figure-general-flow1219029
+Ref: figure-process-flow1219714
+Ref: Basic High Level-Footnote-11223015
+Node: Basic Data Typing1223200
+Node: Glossary1226528
+Node: Copying1258475
+Node: GNU Free Documentation License1296014
+Node: Index1321132
 
 End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index 35db347..414fa14 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -32560,7 +32560,8 @@ multibyte encoding.
 @itemx @ @ @ @ AWK_ARRAY,
 @itemx @ @ @ @ AWK_SCALAR,@ @ @ @ @ @ @ @ @ /* opaque access to a variable */
 @itemx @ @ @ @ AWK_VALUE_COOKIE,@ @ @ /* for updating a previously created 
value */
address@hidden @ @ @ @ AWK_REGEX
address@hidden @ @ @ @ AWK_REGEX,
address@hidden @ @ @ @ AWK_STRNUM
 @itemx @} awk_valtype_t;
 This @code{enum} indicates the type of a value.
 It is used in the following @code{struct}.
@@ -32580,6 +32581,7 @@ The @code{val_type} member indicates what kind of value 
the
 @code{union} holds, and each member is of the appropriate type.
 
 @item #define str_value@ @ @ @ @ @ u.s
address@hidden #define strnum_value@ @ @ @ str_value
 @itemx #define regex_value@ @ @ @ str_value
 @itemx #define num_value@ @ @ @ @ @ u.d
 @itemx #define array_cookie@ @ @ u.a
@@ -32601,7 +32603,7 @@ and in more detail in @ref{Cached values}.
 
 @end table
 
-Scalar values in @command{awk} are numbers, strings, or typed regexps. The
+Scalar values in @command{awk} are numbers, strings, strnums, or typed 
regexps. The
 @code{awk_value_t} struct represents values.  The @code{val_type} member
 indicates what is in the @code{union}.
 
@@ -32610,6 +32612,12 @@ require more work. Because @command{gawk} allows 
embedded @sc{nul} bytes
 in string values, a string must be represented as a pair containing a
 data pointer and length. This is the @code{awk_string_t} type.
 
+A strnum (numeric string) value is represented as a string and consists
+of user input data that appears to be numeric.
+When an extension attempts to create a strnum value, a string flagged
+as user input is created. Subsequent parsing will determine whether it
+looks like a number and should be treated as a strnum or a regular string.
+
 Typed regexp values (@pxref{Strong Regexp Constants}) are not of
 much use to extension functions.  Extension functions can tell that
 they've received them, and create them for scalar values. Otherwise,
@@ -32784,9 +32792,29 @@ This function simply creates a numeric value in the 
@code{awk_value_t} variable
 pointed to by @code{result}.
 
 @item static inline awk_value_t *
address@hidden make_regex(const char *string, size_t length, awk_value_t 
*result);
address@hidden make_const_user_input(const char *string, size_t length, 
awk_value_t *result);
+This function is identical to @code{make_const_string}, but the string is
+flagged as user input that should be treated as a strnum value if the contents
+of the string are numeric.
+
address@hidden static inline awk_value_t *
address@hidden make_malloced_user_input(const char *string, size_t length, 
awk_value_t *result);
+This function is identical to @code{make_malloced_string}, but the string is
+flagged as user input that should be treated as a strnum value if the contents
+of the string are numeric.
+
address@hidden static inline awk_value_t *
address@hidden make_const_regex(const char *string, size_t length, awk_value_t 
*result);
+This function creates a strongly typed regexp value by allocating a copy of 
the string.
address@hidden is the regular expression of length @code{len}.
+
address@hidden static inline awk_value_t *
address@hidden make_malloced_regex(const char *string, size_t length, 
awk_value_t *result);
 This function creates a strongly typed regexp value.
 @code{string} is the regular expression of length @code{len}.
+It expects @code{string} to be a @samp{char *}
+value pointing to data previously obtained from @code{gawk_malloc()}, 
@code{gawk_calloc()}, or @code{gawk_realloc()}.
+
 @end table
 
 @node Registration Functions
@@ -33570,29 +33598,28 @@ value type, as appropriate.  This behavior is 
summarized in
 @end ifnotplaintext
 @ifplaintext
 @example
-                        
+-------------------------------------------------------------+
-                        |                    Type of Actual Value:             
       |
-                        
+------------+------------+-----------+-----------+-----------+
-                        |   String   |   Number   | Regex     | Array     | 
Undefined |
-+-----------+-----------+------------+------------+-----------+-----------+-----------+
-|           | String    |   String   |   String   | String    | false     | 
false     |
-|           
+-----------+------------+------------+-----------+-----------+-----------+
-|           | Number    | Number if  |   Number   | false     | false     | 
false     |
-|           |           | can be     |            |           |           |    
       |
-|           |           | converted, |            |           |           |    
       |
-|           |           | else false |            |           |           |    
       |
-|           
+-----------+------------+------------+-----------+-----------+-----------+
-|           | Regex     |   false    |   false    |  Regex    | false     | 
false     |
-|           
+-----------+------------+------------+-----------+-----------+-----------+
-|   Type    | Array     |   false    |   false    |  false    | Array     | 
false     |
-| Requested 
+-----------+------------+------------+-----------+-----------+-----------+
-|           | Scalar    |   Scalar   |   Scalar   |  Scalar   | false     | 
false     |
-|           
+-----------+------------+------------+-----------+-----------+-----------+
-|           | Undefined |  String    |   Number   |  Regex    | Array     | 
Undefined |
-|           
+-----------+------------+------------+-----------+-----------+-----------+
-|           | Value     |   false    |   false    |  false    | false     | 
false     |
-|           | Cookie    |            |            |           |           |    
       |
-+-----------+-----------+------------+------------+-----------+-----------+-----------+
+                        
+-------------------------------------------------------+
+                        |                   Type of Actual Value:              
 |
+                        
+--------+--------+--------+--------+-------+-----------+
+                        | String | Strnum | Number | Regex  | Array | 
Undefined |
++-----------+-----------+--------+--------+--------+--------+-------+-----------+
+|           | String    | String | String | String | String | false | false    
 |
+|           
+-----------+--------+--------+--------+--------+-------+-----------+
+|           | Strnum    | false  | Strnum | Strnum | false  | false | false    
 |
+|           
+-----------+--------+--------+--------+--------+-------+-----------+
+|           | Number    | Number | Number | Number | false  | false | false    
 |
+|           
+-----------+--------+--------+--------+--------+-------+-----------+
+|           | Regex     | false  | false  | false  | Regex  | false | false    
 |
+|           
+-----------+--------+--------+--------+--------+-------+-----------+
+|   Type    | Array     | false  | false  | false  | false  | Array | false    
 |
+| Requested 
+-----------+--------+--------+--------+--------+-------+-----------+
+|           | Scalar    | Scalar | Scalar | Scalar | Scalar | false | false    
 |
+|           
+-----------+--------+--------+--------+--------+-------+-----------+
+|           | Undefined | String | Strnum | Number | Regex  | Array | 
Undefined |
+|           
+-----------+--------+--------+--------+--------+-------+-----------+
+|           | Value     | false  | false  | false  | false  | false | false    
 |
+|           | Cookie    |        |        |        |        |       |          
 |
++-----------+-----------+--------+--------+--------+--------+-------+-----------+
 @end example
 @end ifplaintext
 @end float
@@ -33692,7 +33719,7 @@ Return false if the value cannot be retrieved.
 
 @item awk_bool_t sym_update_scalar(awk_scalar_t cookie, awk_value_t *value);
 Update the value associated with a scalar cookie.  Return false if
-the new value is not of type @code{AWK_STRING}, @code{AWK_REGEX}, or 
@code{AWK_NUMBER}.
+the new value is not of type @code{AWK_STRING}, @code{AWK_STRNUM}, 
@code{AWK_REGEX}, or @code{AWK_NUMBER}.
 Here too, the predefined variables may not be updated.
 @end table
 
@@ -33813,7 +33840,7 @@ is what the routines in this @value{SECTION} let you 
do.  The functions are as f
 @table @code
 @item awk_bool_t create_value(awk_value_t *value, awk_value_cookie_t *result);
 Create a cached string or numeric value from @code{value} for
-efficient later assignment.  Only values of type @code{AWK_NUMBER}, 
@code{AWK_REGEX},
+efficient later assignment.  Only values of type @code{AWK_NUMBER}, 
@code{AWK_REGEX}, @code{AWK_STRNUM},
 and @code{AWK_STRING} are allowed.  Any other type is rejected.
 @code{AWK_UNDEFINED} could be allowed, but doing so would result in
 inferior performance.
@@ -34039,9 +34066,9 @@ The array remains an array, but after calling this 
function, it
 has no elements. This is equivalent to using the @code{delete}
 statement (@pxref{Delete}).
 
address@hidden awk_bool_t flatten_array(awk_array_t a_cookie, awk_flat_array_t 
**data);
address@hidden awk_bool_t flatten_array_typed(awk_array_t a_cookie, 
awk_flat_array_t **data, awk_valtype_t index_type, awk_valtype_t value_type);
 For the array represented by @code{a_cookie}, create an @code{awk_flat_array_t}
-structure and fill it in. Set the pointer whose address is passed as 
@code{data}
+structure and fill it in with indices and values of the requested types. Set 
the pointer whose address is passed as @code{data}
 to point to this structure.
 Return true upon success, or false otherwise.
 @ifset FOR_PRINT
@@ -34053,6 +34080,12 @@ See the next @value{SECTION}
 for a discussion of how to
 flatten an array and work with it.
 
address@hidden awk_bool_t flatten_array(awk_array_t a_cookie, awk_flat_array_t 
**data);
+For the array represented by @code{a_cookie}, create an @code{awk_flat_array_t}
+structure and fill it in with @code{AWK_STRING} indices and
address@hidden values.  This is superseded by @code{flatten_array_typed}
+and retained only for legacy binary compatibility.
+
 @item awk_bool_t release_flattened_array(awk_array_t a_cookie,
 @itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ 
awk_flat_array_t *data);
 When done with a flattened array, release the storage using this function.
@@ -34165,7 +34198,7 @@ to double-check that the count in the 
@code{awk_flat_array_t}
 is the same as the count just retrieved:
 
 @example
-    if (! flatten_array(value2.array_cookie, & flat_array)) @{
+    if (! flatten_array_typed(value2.array_cookie, & flat_array, AWK_STRING, 
AWK_UNDEFINED)) @{
         printf("dump_array_and_delete: could not flatten array\n");
         goto out;
     @}

http://git.sv.gnu.org/cgit/gawk.git/commit/?id=af6f677758c6b873fb3130b34705e2a705270a75

commit af6f677758c6b873fb3130b34705e2a705270a75
Merge: 293b5a8 cd820dc
Author: Arnold D. Robbins <address@hidden>
Date:   Thu Dec 22 17:37:49 2016 +0200

    Merge branch 'feature/regex-to-api' into feature/andy

diff --cc ChangeLog
index 6388bd9,ebe138b..c29c85e
--- a/ChangeLog
+++ b/ChangeLog
@@@ -30,57 -73,20 +73,72 @@@
  
        * dfa.c: Sync with GNULIB.
  
 +2016-12-05         Andrew J. Schorr     <address@hidden>
 +
 +      Add API support for strnum values.
 +      * gawkapi.c (awk_value_to_node): Add AWK_STRNUM.
 +      (assign_string): Add a type argument so we can use this for AWK_STRING
 +      or AWK_STRNUM.
 +      (node_to_awk_value): When AWK_NUMBER is requested, a regex value
 +      should return false, as per the header file documentation.
 +      Add support for AWK_STRNUM requests. When AWK_REGEX is requested,
 +      implement the cases properly instead of always returning true.
 +      Fix AWK_SCALAR logic. For AWK_UNDEFINED, rewrite using a switch
 +      and support AWK_STRNUM.
 +      (api_sym_update): Add AWK_STRNUM.
 +      (api_sym_update_scalar): Add optimized support for updating AWK_STRNUM.
 +      (valid_subscript_type): Add AWK_STRNUM.
 +      (api_create_value): Add AWK_STRNUM.
 +      * gawkapi.h (awk_valtype_t): Add AWK_STRNUM.
 +      (strnum_value): New macro.
 +      (Value fetching table): Updated.
 +
 +2016-12-04         Andrew J. Schorr     <address@hidden>
 +
 +      * gawkapi.c (assign_regex): Do not call assign_string, since we
 +      know that a REGEX value is not an unterminated field string.
 +      * gawkapi.h (make_regex): Delete macro.
 +      (make_const_regex, make_malloced_regex): Add new macros to replace
 +      make_regex with necessary memory management support.
 +
 +2016-12-04         Andrew J. Schorr     <address@hidden>
 +
 +      * awk.h (fixtype): Remove conditional checking if the node type
 +      is Node_val. This is already covered by the assert, and if it's not
 +      true, we have serious bugs.
 +      * builtin.c (do_typeof): Do not treat Node_var the same way as
 +      Node_val, since they are different beasts. In reality, the argument
 +      to this function will never have type Node_var.
 +
 +2016-12-04         Andrew J. Schorr     <address@hidden>
 +
 +      * gawkapi.h (awk_element_t): Remove obsolete comment claiming that
 +      the index will always be a string.
 +      (gawk_api_t): Add new api_flatten_array_typed function and indicate
 +      that api_flatten_array has been superseded.
 +      (flatten_array_typed): New macro to call api_flatten_array_typed.
 +      (flatten_array): Redefine using the new flatten_array_typed macro.
 +      * gawkapi.c (api_flatten_array_typed): New function renamed from
 +      api_flatten_array to flatten an array with the types requested by the
 +      caller. Also update the comments and error messages.
 +      (api_flatten_array): Now a wrapper around api_flatten_array_typed.
 +      (api_impl): Add new api_flatten_array_typed hook.
 +
+ 2016-12-06         Arnold D. Robbins     <address@hidden>
+ 
+       Add minimum required and maximum expected number of arguments
+       to the API.
+ 
+       * awk.h (INSTRUCTION): Add new members min_required and max_expected.
+       * ext.c (make_builtin): Store values from extension function struct
+       into the INSTRUCTION.
+       * gawkapi.h (awk_ext_func): Add min_required args. Make both it and
+       max_expected_args into unsigned short to match type in INSTRUCTION.
+       * interpret.h (Op_ext_builtin): Store min_required and max_expected
+       in instructions. Add checking code and lint checks.
+       (Op_ext_func): Copy min_required and max_expected from function info.
+ 
++
  2016-12-04         Andrew J. Schorr     <address@hidden>
  
        * gawkapi.h (r_make_string_type): New inline function to create strings
diff --cc doc/ChangeLog
index cafced8,68c139a..d3e974c
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@@ -1,19 -1,17 +1,33 @@@
+ 2016-12-17         Arnold D. Robbins     <address@hidden>
+ 
+       * gawktexi.in: Further API clarifications and edits, add a
+       section on backwards compatibility.
+ 
+ 2016-12-16         Arnold D. Robbins     <address@hidden>
+ 
+       * gawktexi.in: Update description of awk_ext_func_t structure,
+       again.
+ 
+ 2016-12-14         Arnold D. Robbins     <address@hidden>
+ 
+       * gawktexi.in: Update description of awk_ext_func_t structure.
+ 
 +2016-12-05         Andrew J. Schorr     <address@hidden>
 +
 +      * gawktexi.in: Document strnum changes as relates to API.
 +      Still stuff left to do -- tables for type conversions need
 +      to be updated to show new strnum and regex rows and columns.
 +
 +2016-12-04         Andrew J. Schorr     <address@hidden>
 +
 +      * gawktexi.in: Remove make_regex and replace it with make_const_regex
 +      and make_malloced_regex.
 +
 +2016-12-04         Andrew J. Schorr     <address@hidden>
 +
 +      * gawktexi.in: Document new flatten_array_typed API function, and
 +      indicate that the old flatten_array function has been superseded.
 +
  2016-11-30         Arnold D. Robbins     <address@hidden>
  
        * gawktexi.in: Document typed regex changes as relates to API.
diff --cc extension/ChangeLog
index f826e54,bf7d3fa..9c647f0
--- a/extension/ChangeLog
+++ b/extension/ChangeLog
@@@ -1,10 -1,46 +1,53 @@@
+ 2016-12-16         Arnold D. Robbins     <address@hidden>
+ 
+       * filefuncs.c: Update func_table again.
+ 
+ 2016-12-14         Arnold D. Robbins     <address@hidden>
+ 
+       * filefuncs.c: Update do_xxx to match new API. Update func_table.
+       * fnmatch.c: Ditto.
+       * fork.c: Ditto.
+       * inplace.c: Ditto.
+       * ordchr.c: Ditto.
+       * readdir.c: Ditto.
+       * readfile.c: Ditto.
+       * revoutput.c: Ditto.
+       * revtwoway.c: Ditto.
+       * rwarray.c: Ditto.
+       * rwarray0.c: Ditto.
+       * testext.c: Ditto.
+       * time.c: Ditto.
+ 
+ 2016-12-12         Arnold D. Robbins     <address@hidden>
+ 
+       * filefuncs.c (func_table): Adjust ordering of min and max
+       for stat.
+ 
+ 2016-12-06         Arnold D. Robbins     <address@hidden>
+ 
+       Add minimum required and maximum expected number of arguments
+       to the API.
+ 
+       * filefuncs.c: Update with max expected value. Remove lint
+       checks since that's now done by gawk.
+       * fnmatch.c: Ditto.
+       * fork.c: Ditto.
+       * inplace.c: Ditto.
+       * ordchr.c: Ditto.
+       * readdir.c: Ditto.
+       * readfile.c: Ditto.
+       * rwarray.c: Ditto.
+       * rwarray0.c: Ditto.
+       * testext.c: Ditto.
+       * time.c: Ditto.
+ 
 +2016-12-05         Andrew J. Schorr     <address@hidden>
 +
 +      * rwarray.c: Adjust to read and write strnum values.
 +      (write_value): When writing a string value, code should use htonl.
 +      There are now 3 string types: string, strnum, and regex.
 +      (read_value): Support 3 string types: string, strnum, and regex.
 +
  2016-11-30         Arnold D. Robbins     <address@hidden>
  
        * rwarray.c: Restore read comparion of major and minor versions

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

Summary of changes:
 ChangeLog           |   81 +++++++
 awk.h               |   11 +-
 awkgram.c           |  666 +++++++++++++++++++++++++--------------------------
 awkgram.y           |   16 +-
 builtin.c           |    9 +-
 doc/ChangeLog       |   21 ++
 doc/gawk.info       |  356 +++++++++++++++------------
 doc/gawk.texi       |  108 ++++++---
 doc/gawktexi.in     |  108 ++++++---
 extension/ChangeLog |   16 ++
 extension/rwarray.c |   42 +++-
 gawkapi.c           |  213 +++++++++++++---
 gawkapi.h           |  116 ++++++---
 node.c              |   21 ++
 test/ChangeLog      |   14 ++
 test/rwarray.awk    |   16 +-
 16 files changed, 1165 insertions(+), 649 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

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