gawk-diffs
[Top][All Lists]
Advanced

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

[gawk-diffs] [SCM] gawk branch, select, updated. gawk-4.1.0-1057-ge36300


From: Andrew J. Schorr
Subject: [gawk-diffs] [SCM] gawk branch, select, updated. gawk-4.1.0-1057-ge36300b
Date: Fri, 02 Jan 2015 21:44:44 +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, select has been updated
       via  e36300be4deb7bbdeff17c8e896ac2f727e1477e (commit)
      from  b97472e2be3aa040e59ac9ca4e54a7639be067ff (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=e36300be4deb7bbdeff17c8e896ac2f727e1477e

commit e36300be4deb7bbdeff17c8e896ac2f727e1477e
Author: Andrew J. Schorr <address@hidden>
Date:   Fri Jan 2 16:44:33 2015 -0500

    Remove api_get_file typelen argument.

diff --git a/ChangeLog b/ChangeLog
index c5f29f4..baa7c00 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2015-01-02         Andrew J. Schorr     <address@hidden>
+
+       * gawkapi.h (gawk_api): Modify api_get_file to remove the typelen
+       argument.
+       (get_file): Remove typelen argument from the macro.
+       * gawkapi.c (api_get_file): Remove typelen argument.
+
 2014-12-24         Arnold D. Robbins     <address@hidden>
 
        * profile.c (pprint): Be sure to set ip2 in all paths
diff --git a/extension/ChangeLog b/extension/ChangeLog
index e8fa12f..5543880 100644
--- a/extension/ChangeLog
+++ b/extension/ChangeLog
@@ -1,5 +1,10 @@
 2015-01-02         Andrew J. Schorr     <address@hidden>
 
+       * testext.c (test_get_file): The get_file hook no longer takes a
+       typelen argument.
+
+2015-01-02         Andrew J. Schorr     <address@hidden>
+
        Remove the select extension, since it will be part of gawkextlib.
        * select.c, siglist.h: Deleted.
        * Makefile.am (pkgextension_LTLIBRARIES): Remove select.la.
diff --git a/extension/testext.c b/extension/testext.c
index f00ced7..a10c925 100644
--- a/extension/testext.c
+++ b/extension/testext.c
@@ -790,7 +790,7 @@ test_get_file(int nargs, awk_value_t *result)
                printf("%s: open(%s) failed\n", "test_get_file", 
filename.str_value.str);
                return make_number(-1.0, result);
        }
-       if (! get_file(alias.str_value.str, strlen(alias.str_value.str), "<", 
1, fd, &ibuf, &obuf)) {
+       if (! get_file(alias.str_value.str, strlen(alias.str_value.str), "<", 
fd, &ibuf, &obuf)) {
                printf("%s: get_file(%s) failed\n", "test_get_file", 
alias.str_value.str);
                return make_number(-1.0, result);
        }
diff --git a/gawkapi.c b/gawkapi.c
index e2c0b1a..a693621 100644
--- a/gawkapi.c
+++ b/gawkapi.c
@@ -1043,7 +1043,7 @@ api_release_value(awk_ext_id_t id, awk_value_cookie_t 
value)
 /* api_get_file --- return a handle to an existing or newly opened file */
 
 static awk_bool_t
-api_get_file(awk_ext_id_t id, const char *name, size_t namelen, const char 
*filetype, size_t typelen, int fd, const awk_input_buf_t **ibufp, const 
awk_output_buf_t **obufp)
+api_get_file(awk_ext_id_t id, const char *name, size_t namelen, const char 
*filetype, int fd, const awk_input_buf_t **ibufp, const awk_output_buf_t 
**obufp)
 {
        const struct redirect *f;
        int flag;       /* not used, sigh */
@@ -1080,24 +1080,24 @@ api_get_file(awk_ext_id_t id, const char *name, size_t 
namelen, const char *file
                return awk_true;
        }
        redirtype = redirect_none;
-       switch (typelen) {
-       case 1:
-               switch (*filetype) {
-               case '<':
+       switch (filetype[0]) {
+       case '<':
+               if (filetype[1] == '\0')
                        redirtype = redirect_input;
-                       break;
-               case '>':
+               break;
+       case '>':
+               switch (filetype[1]) {
+               case '\0':
                        redirtype = redirect_output;
                        break;
-               }
-               break;
-       case 2:
-               switch (*filetype) {
                case '>':
-                       if (filetype[1] == '>')
+                       if (filetype[2] == '\0')
                                redirtype = redirect_append;
                        break;
-               case '|':
+               }
+               break;
+       case '|':
+               if (filetype[2] == '\0') {
                        switch (filetype[1]) {
                        case '>':
                                redirtype = redirect_pipe;
@@ -1109,8 +1109,8 @@ api_get_file(awk_ext_id_t id, const char *name, size_t 
namelen, const char *file
                                redirtype = redirect_twoway;
                                break;
                        }
-                       break;
                }
+               break;
        }
        if (redirtype == redirect_none) {
                warning(_("cannot open unrecognized file type `%s' for `%s'"),
diff --git a/gawkapi.h b/gawkapi.h
index 65f1dfc..22b3be3 100644
--- a/gawkapi.h
+++ b/gawkapi.h
@@ -678,8 +678,8 @@ typedef struct gawk_api {
         /*
         * Look up a file.  If the name is NULL or name_len is 0, it returns
         * data for the currently open input file corresponding to FILENAME
-        * (and it will not access the filetype or typelen arguments, so those
-        * may be undefined).  
+        * (and it will not access the filetype argument, so that may be
+        * undefined).  
         * If the file is not already open, it tries to open it.
         * The "filetype" argument should be one of:
         *    ">", ">>", "<", "|>", "|<", and "|&"
@@ -700,7 +700,7 @@ typedef struct gawk_api {
                        const char *name,
                        size_t name_len,
                        const char *filetype,
-                       size_t typelen, int fd,
+                       int fd,
                        /*
                         * Return values (on success, one or both should
                         * be non-NULL):
@@ -789,8 +789,8 @@ typedef struct gawk_api {
 #define release_value(value) \
        (api->api_release_value(ext_id, value))
 
-#define get_file(name, namelen, filetype, typelen, fd, ibuf, obuf) \
-       (api->api_get_file(ext_id, name, namelen, filetype, typelen, fd, ibuf, 
obuf))
+#define get_file(name, namelen, filetype, fd, ibuf, obuf) \
+       (api->api_get_file(ext_id, name, namelen, filetype, fd, ibuf, obuf))
 
 #define register_ext_version(version) \
        (api->api_register_ext_version(ext_id, version))

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

Summary of changes:
 ChangeLog           |    7 +++++++
 extension/ChangeLog |    5 +++++
 extension/testext.c |    2 +-
 gawkapi.c           |   28 ++++++++++++++--------------
 gawkapi.h           |   10 +++++-----
 5 files changed, 32 insertions(+), 20 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

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