diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | extension/ChangeLog | 5 | ||||
-rw-r--r-- | extension/filefuncs.c | 4 | ||||
-rw-r--r-- | extension/testext.c | 6 | ||||
-rw-r--r-- | gawkapi.h | 12 | ||||
-rw-r--r-- | test/ChangeLog | 4 | ||||
-rw-r--r-- | test/testext.ok | 1 |
7 files changed, 29 insertions, 8 deletions
@@ -1,3 +1,8 @@ +2014-09-29 Arnold D. Robbins <arnold@skeeve.com> + + * gawkapi.h: Minor edits to sync with documentation. Does not + influence the behavior of the API. + 2014-09-28 Arnold D. Robbins <arnold@skeeve.com> * command.y (cmdtab): Add "where" as an alias for "backtrace". diff --git a/extension/ChangeLog b/extension/ChangeLog index f324bdeb..c54d3b25 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,8 @@ +2014-09-29 Arnold D. Robbins <arnold@skeeve.com> + + * filefuncs.c: Minor edits to sync with documentation. + * testext.c: Add test to get PROCINFO, expected to fail. + 2014-08-12 Arnold D. Robbins <arnold@skeeve.com> * Makefile.am (RM): Define for makes that don't have it, diff --git a/extension/filefuncs.c b/extension/filefuncs.c index d5249a4e..a20e9ff7 100644 --- a/extension/filefuncs.c +++ b/extension/filefuncs.c @@ -145,7 +145,7 @@ static const char *ext_version = "filefuncs extension: version 1.0"; int plugin_is_GPL_compatible; -/* do_chdir --- provide dynamically loaded chdir() builtin for gawk */ +/* do_chdir --- provide dynamically loaded chdir() function for gawk */ static awk_value_t * do_chdir(int nargs, awk_value_t *result) @@ -448,7 +448,7 @@ fill_stat_array(const char *name, awk_array_t array, struct stat *sbuf) } } - array_set(array, "type", make_const_string(type, strlen(type), &tmp)); + array_set(array, "type", make_const_string(type, strlen(type), & tmp)); return 0; } diff --git a/extension/testext.c b/extension/testext.c index 2dda339f..7462265b 100644 --- a/extension/testext.c +++ b/extension/testext.c @@ -302,6 +302,12 @@ var_test(int nargs, awk_value_t *result) goto out; } + /* look up PROCINFO - should fail */ + if (sym_lookup("PROCINFO", AWK_ARRAY, & value)) + printf("var_test: sym_lookup of PROCINFO failed - got a value!\n"); + else + printf("var_test: sym_lookup of PROCINFO passed - did not get a value\n"); + /* look up a reserved variable - should pass */ if (sym_lookup("ARGC", AWK_NUMBER, & value)) printf("var_test: sym_lookup of ARGC passed - got a value!\n"); @@ -865,17 +865,17 @@ static awk_bool_t (*init_func)(void) = NULL; /* OR: */ static awk_bool_t -init_my_module(void) +init_my_extension(void) { ... } -static awk_bool_t (*init_func)(void) = init_my_module; +static awk_bool_t (*init_func)(void) = init_my_extension; dl_load_func(func_table, some_name, "name_space_in_quotes") #endif -#define dl_load_func(func_table, module, name_space) \ +#define dl_load_func(func_table, extension, name_space) \ int dl_load(const gawk_api_t *const api_p, awk_ext_id_t id) \ { \ size_t i, j; \ @@ -886,7 +886,7 @@ int dl_load(const gawk_api_t *const api_p, awk_ext_id_t id) \ \ if (api->major_version != GAWK_API_MAJOR_VERSION \ || api->minor_version < GAWK_API_MINOR_VERSION) { \ - fprintf(stderr, #module ": version mismatch with gawk!\n"); \ + fprintf(stderr, #extension ": version mismatch with gawk!\n"); \ fprintf(stderr, "\tmy version (%d, %d), gawk version (%d, %d)\n", \ GAWK_API_MAJOR_VERSION, GAWK_API_MINOR_VERSION, \ api->major_version, api->minor_version); \ @@ -898,7 +898,7 @@ int dl_load(const gawk_api_t *const api_p, awk_ext_id_t id) \ if (func_table[i].name == NULL) \ break; \ if (! add_ext_func(name_space, & func_table[i])) { \ - warning(ext_id, #module ": could not add %s\n", \ + warning(ext_id, #extension ": could not add %s\n", \ func_table[i].name); \ errors++; \ } \ @@ -906,7 +906,7 @@ int dl_load(const gawk_api_t *const api_p, awk_ext_id_t id) \ \ if (init_func != NULL) { \ if (! init_func()) { \ - warning(ext_id, #module ": initialization function failed\n"); \ + warning(ext_id, #extension ": initialization function failed\n"); \ errors++; \ } \ } \ diff --git a/test/ChangeLog b/test/ChangeLog index 80b69580..a8a2acdc 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,7 @@ +2014-09-29 Arnold D. Robbins <arnold@skeeve.com> + + * testext.ok: Adjusted after minor code change. + 2014-09-27 Arnold D. Robbins <arnold@skeeve.com> * profile2.ok, profile3.ok, profile4.ok, profile5.ok: diff --git a/test/testext.ok b/test/testext.ok index 5612e92c..9b36bf72 100644 --- a/test/testext.ok +++ b/test/testext.ok @@ -15,6 +15,7 @@ try_modify_environ: set_array_element of ENVIRON failed try_modify_environ: marking element "testext" for deletion try_del_environ() could not delete element - pass try_del_environ() could not add an element - pass +var_test: sym_lookup of PROCINFO passed - did not get a value var_test: sym_lookup of ARGC passed - got a value! var_test: sym_update of ARGC failed - correctly var_test: sym_update("testvar") succeeded |