diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2012-06-06 22:14:32 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2012-06-06 22:14:32 +0300 |
commit | 21a01e3ad4e2e77dccf73e8fd069370749880757 (patch) | |
tree | f3b17367552ef7831c2a67bfa27dc3193ae83356 | |
parent | dab3a678b3f65ae4cde21ca4b1d4fd24e8a71918 (diff) | |
download | egawk-21a01e3ad4e2e77dccf73e8fd069370749880757.tar.gz egawk-21a01e3ad4e2e77dccf73e8fd069370749880757.tar.bz2 egawk-21a01e3ad4e2e77dccf73e8fd069370749880757.zip |
Hook in extension at_exit functions.
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | awk.h | 2 | ||||
-rw-r--r-- | msg.c | 4 |
3 files changed, 9 insertions, 0 deletions
@@ -8,6 +8,9 @@ * eval.c (set_LINT): Call update_ext_api() at the end. * gawkapi.h: Document that do_XXX could change on the fly. + * awk.h (run_ext_exit_handlers): Add declaration. + * msg.c (gawk_exit): Call it. + 2012-06-05 Arnold D. Robbins <arnold@skeeve.com> * ext.c (load_ext): Remove use of RTLD_GLOBAL. Not needed in new @@ -707,10 +707,12 @@ struct break_point; #if 1 #include "gawkapi.h" +/* gawkapi.c: */ extern gawk_api_t api_impl; extern void init_ext_api(void); extern void update_ext_api(void); extern NODE *awk_value_to_node(const awk_value_t *); +extern void run_ext_exit_handlers(int exitval); #endif typedef struct exp_instruction { @@ -158,5 +158,9 @@ gawk_exit(int status) exit_val = status; longjmp(fatal_tag, 1); } + + /* run any extension exit handlers */ + run_ext_exit_handlers(status); + exit(status); } |