[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gawk-diffs] [SCM] gawk branch, feature/regex-to-api, updated. gawk-4.1.
From: |
Andrew J. Schorr |
Subject: |
[gawk-diffs] [SCM] gawk branch, feature/regex-to-api, updated. gawk-4.1.0-2360-g4bcb4e3 |
Date: |
Sun, 4 Dec 2016 14:44:49 +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, feature/regex-to-api has been updated
via 4bcb4e30c50e95c6fd58b4b418d9fc56bb2d3ce3 (commit)
from 68754e0678e84a30f6ce996cc8550d5bb9b8f5f0 (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=4bcb4e30c50e95c6fd58b4b418d9fc56bb2d3ce3
commit 4bcb4e30c50e95c6fd58b4b418d9fc56bb2d3ce3
Author: Andrew J. Schorr <address@hidden>
Date: Sun Dec 4 09:44:19 2016 -0500
Fix gawkapi.h make_regex implementation.
diff --git a/ChangeLog b/ChangeLog
index e4f91a4..523ac63 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2016-12-04 Andrew J. Schorr <address@hidden>
+
+ * gawkapi.h (r_make_string_type): New inline function to create strings
+ of any type, currently AWK_STRING or AWK_REGEX.
+ (r_make_string): Now a wrapper around r_make_string_type.
+ (make_regex): Convert from an inline function to a macro that
+ calls r_make_string_type.
+
2016-11-30 Arnold D. Robbins <address@hidden>
* dfa.c: Sync with fixes in GNULIB.
diff --git a/gawkapi.h b/gawkapi.h
index 9220b09..e5d1f37 100644
--- a/gawkapi.h
+++ b/gawkapi.h
@@ -827,21 +827,22 @@ typedef struct gawk_api {
/* Constructor functions */
-/* r_make_string --- make a string value in result from the passed-in string */
+/* r_make_string_type --- make a string or regexp value in result from the
passed-in string */
static inline awk_value_t *
-r_make_string(const gawk_api_t *api, /* needed for emalloc */
- awk_ext_id_t *ext_id, /* ditto */
- const char *string,
- size_t length,
- awk_bool_t duplicate,
- awk_value_t *result)
+r_make_string_type(const gawk_api_t *api, /* needed for emalloc */
+ awk_ext_id_t *ext_id, /* ditto */
+ const char *string,
+ size_t length,
+ awk_bool_t duplicate,
+ awk_value_t *result,
+ awk_valtype_t val_type)
{
char *cp = NULL;
memset(result, 0, sizeof(*result));
- result->val_type = AWK_STRING;
+ result->val_type = val_type;
result->str_value.len = length;
if (duplicate) {
@@ -856,8 +857,22 @@ r_make_string(const gawk_api_t *api, /* needed for
emalloc */
return result;
}
+/* r_make_string --- make a string value in result from the passed-in string */
+
+static inline awk_value_t *
+r_make_string(const gawk_api_t *api, /* needed for emalloc */
+ awk_ext_id_t *ext_id, /* ditto */
+ const char *string,
+ size_t length,
+ awk_bool_t duplicate,
+ awk_value_t *result)
+{
+ return r_make_string_type(api, ext_id, string, length, duplicate,
result, AWK_STRING);
+}
+
#define make_const_string(str, len, result) r_make_string(api, ext_id, str,
len, 1, result)
#define make_malloced_string(str, len, result) r_make_string(api, ext_id, str,
len, 0, result)
+#define make_regex(str, len, result) r_make_string_type(api, ext_id, str,
len, 1, result, AWK_REGEX)
/* make_null_string --- make a null string value */
@@ -883,17 +898,6 @@ make_number(double num, awk_value_t *result)
return result;
}
-/* make_regex --- make a regex value in result */
-
-static inline awk_value_t *
-make_regex(const char *string, size_t length, awk_value_t *result)
-{
- make_const_string(str, len, result);
- result->val_type = AWK_REGEX;
-
- return result;
-}
-
/*
* Each extension must define a function with this prototype:
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 8 ++++++++
gawkapi.h | 42 +++++++++++++++++++++++-------------------
2 files changed, 31 insertions(+), 19 deletions(-)
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gawk-diffs] [SCM] gawk branch, feature/regex-to-api, updated. gawk-4.1.0-2360-g4bcb4e3,
Andrew J. Schorr <=