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-64-gd8bd9f5


From: Andrew J. Schorr
Subject: [gawk-diffs] [SCM] gawk branch, select, updated. gawk-4.1.0-64-gd8bd9f5
Date: Wed, 03 Jul 2013 00:52:39 +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  d8bd9f5261761dd4ffca331d9c6055c48a0a332b (commit)
      from  9ee8aeb59ad3b3873d52f3c9a2ab80b28c4c2c20 (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=d8bd9f5261761dd4ffca331d9c6055c48a0a332b

commit d8bd9f5261761dd4ffca331d9c6055c48a0a332b
Author: Andrew J. Schorr <address@hidden>
Date:   Tue Jul 2 20:52:25 2013 -0400

    Remove unused api_lookup_file hook.

diff --git a/ChangeLog b/ChangeLog
index c209f33..5d293bf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2013-07-02         Andrew J. Schorr     <address@hidden>
 
+       * gawkapi.h (gawk_api): Remove unused api_lookup_file hook.
+       (lookup_file): Remove associated macro.
+       * gawkapi.c (api_lookup_file): Remove unused function.
+       (api_impl):  Remove unused api_lookup_file hook.
+
+2013-07-02         Andrew J. Schorr     <address@hidden>
+
        * awkgram.y (main_beginfile): Declare new global INSTRUCTION *.
        (parse_program): Set main_beginfile to point to the BEGINFILE
        instruction block.
diff --git a/gawkapi.c b/gawkapi.c
index e12e55d..ac46624 100644
--- a/gawkapi.c
+++ b/gawkapi.c
@@ -25,7 +25,10 @@
 
 #include "awk.h"
 
-extern IOBUF *curfile; /* required by api_lookup_file and api_get_file */
+/* Declare some globals used by api_get_file: */
+extern IOBUF *curfile;
+extern INSTRUCTION *main_beginfile;
+extern int currule;
 
 static awk_bool_t node_to_awk_value(NODE *node, awk_value_t *result, 
awk_valtype_t wanted);
 
@@ -1035,28 +1038,8 @@ api_release_value(awk_ext_id_t id, awk_value_cookie_t 
value)
        return true;
 }
 
-/* api_lookup_file --- return a handle to an open file */
-
-static const awk_input_buf_t *
-api_lookup_file(awk_ext_id_t id, const char *name, size_t namelen)
-{
-       const struct redirect *f;
-
-       if ((name == NULL) || (namelen == 0)) {
-               if (curfile == NULL)
-                       return NULL;
-               return &curfile->public;
-       }
-       if ((f = getredirect(name, namelen)) == NULL)
-               return NULL;
-       return &f->iop->public;
-}
-
 /* api_get_file --- return a handle to an existing or newly opened file */
 
-extern INSTRUCTION *main_beginfile;
-extern int currule;
-
 static const awk_input_buf_t *
 api_get_file(awk_ext_id_t id, const char *name, size_t namelen, const char 
*filetype, size_t typelen)
 {
@@ -1215,8 +1198,7 @@ gawk_api_t api_impl = {
        api_flatten_array,
        api_release_flattened_array,
 
-       /* Find/get open files */
-       api_lookup_file,
+       /* Find/open a file */
        api_get_file,
 };
 
diff --git a/gawkapi.h b/gawkapi.h
index 8121700..687147e 100644
--- a/gawkapi.h
+++ b/gawkapi.h
@@ -667,15 +667,7 @@ typedef struct gawk_api {
                        awk_flat_array_t *data);
 
        /*
-        * Look up a currently open file.  If the name is NULL, it returns
-        * data for the currently open input file corresponding to FILENAME.
-        * If the file is not found, it returns NULL.
-        */
-       const awk_input_buf_t *(*api_lookup_file)(awk_ext_id_t id,
-                                                       const char *name,
-                                                       size_t name_len);
-       /*
-        * Look up a file.  If the name is NULL, it returns
+        * 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.
         * If the file is not already open, it tries to open it.
         * The "filetype" argument should be one of:
@@ -763,9 +755,6 @@ typedef struct gawk_api {
 #define release_value(value) \
        (api->api_release_value(ext_id, value))
 
-#define lookup_file(name, namelen) \
-       (api->api_lookup_file(ext_id, name, namelen))
-
 #define get_file(name, namelen, filetype, typelen) \
        (api->api_get_file(ext_id, name, namelen, filetype, typelen))
 

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

Summary of changes:
 ChangeLog |    7 +++++++
 gawkapi.c |   28 +++++-----------------------
 gawkapi.h |   13 +------------
 3 files changed, 13 insertions(+), 35 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

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