diff options
author | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2013-07-02 20:52:25 -0400 |
---|---|---|
committer | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2013-07-02 20:52:25 -0400 |
commit | d8bd9f5261761dd4ffca331d9c6055c48a0a332b (patch) | |
tree | 35815f20253c23df4bca3415dae81f3dd6df5846 /gawkapi.c | |
parent | 9ee8aeb59ad3b3873d52f3c9a2ab80b28c4c2c20 (diff) | |
download | egawk-d8bd9f5261761dd4ffca331d9c6055c48a0a332b.tar.gz egawk-d8bd9f5261761dd4ffca331d9c6055c48a0a332b.tar.bz2 egawk-d8bd9f5261761dd4ffca331d9c6055c48a0a332b.zip |
Remove unused api_lookup_file hook.
Diffstat (limited to 'gawkapi.c')
-rw-r--r-- | gawkapi.c | 28 |
1 files changed, 5 insertions, 23 deletions
@@ -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, }; |