diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2012-06-12 23:11:37 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2012-06-12 23:11:37 +0300 |
commit | 8ce87087172ee5be4ee72a1513daad3821185bf7 (patch) | |
tree | 5073b5de1171bd71fea21adea7e8944a18e57999 /ext.c | |
parent | 820b6a2ccb7859e15ade36af6ac1d0d08c1da4b1 (diff) | |
download | egawk-8ce87087172ee5be4ee72a1513daad3821185bf7.tar.gz egawk-8ce87087172ee5be4ee72a1513daad3821185bf7.tar.bz2 egawk-8ce87087172ee5be4ee72a1513daad3821185bf7.zip |
More API implementations and testext improvements.
Diffstat (limited to 'ext.c')
-rw-r--r-- | ext.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -60,7 +60,7 @@ do_ext(int nargs) NODE * load_ext(const char *lib_name, const char *init_func) { - int (*func)(const gawk_api_t *const, awk_ext_id_t); + int (*install_func)(const gawk_api_t *const, awk_ext_id_t); void *dl; int flags = RTLD_LAZY; int *gpl_compat; @@ -80,12 +80,13 @@ load_ext(const char *lib_name, const char *init_func) if (gpl_compat == NULL) fatal(_("load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n"), lib_name, dlerror()); - func = (int (*)(const gawk_api_t *const, awk_ext_id_t)) dlsym(dl, init_func); - if (func == NULL) + install_func = (int (*)(const gawk_api_t *const, awk_ext_id_t)) + dlsym(dl, init_func); + if (install_func == NULL) fatal(_("load_ext: library `%s': cannot call function `%s' (%s)\n"), lib_name, init_func, dlerror()); - if ((*func)(& api_impl, NULL /* ext_id */) == 0) { + if (install_func(& api_impl, NULL /* ext_id */) == 0) { warning(_("load_ext: library `%s' initialization routine `%s' failed\n"), lib_name, init_func); return make_number(-1); |