diff options
author | Gary V. Vaughan <gary@gnu.org> | 2013-09-20 12:00:02 +0700 |
---|---|---|
committer | Gary V. Vaughan <gary@gnu.org> | 2013-09-20 15:57:49 +0700 |
commit | aeb92bcb25e253b55650961f341640f93ec3b54e (patch) | |
tree | ee8d364c67cc33c342aa8d181918709fe9fcb557 /src | |
parent | 9114cb2e988dabdf4c8561f62eb448aa24117574 (diff) | |
download | m4-aeb92bcb25e253b55650961f341640f93ec3b54e.tar.gz |
modules: remove support for module unload and refcount.
Module management is horrifically more complex than it needs to
be for the simple purpose of providing a means to implement new
builtins using C. Fussing about reference counting or needing to
maintain and test a facility to unload modules is an easy 600
lines to cut as a start at simplification.
* src/main.c (main): Don't call m4__module_exit to unload all
modules just prior to exiting the application.
* m4/m4private.h (FINISH_SYMBOL, m4_module:refcount)
(m4__module_exit, m4_module_refcount): Remove.
(m4__module_next): Rename from this...
* m4/m4module.h (m4_module_next): ...to this. Adjust all callers.
(M4FINISH_HANDLER, m4_module_finish_func, m4_module_makeresident)
(m4_module_refcount, m4_module_unload, m4_module_exit): Remove.
* m4/m4module.c (m4__module_next): Rename from this...
(m4_module_next): ...to this.
(module_remove, m4_module_makeresident, m4_module_unload)
(m4_module_exit, m4_module_refcount): Remove.
* modules/load.c: Remove.
(m4modules): Move from here...
* modules/gnu.c (m4modules): ...to here. Update all callers.
(M4FINISH_HANDLER(gnu)): Remove.
* modules/m4.c (M4INIT_HANDLER(m4)): Remove.
* modules/modtest.c (M4FINISH_HANDLER(modtest)): Remove.
* modules/shadow.c (M4INIT_HANDLER(shadow)): Rewrite to work
without refcount.
* Makefile.am (pkglib_LTLIBRARIES): Remove modules/load.la.
(modules_load_la_LDFLAGS, modules_load_la_LIBADD): Remove.
* tests/modules.at: Remove references to load module, and
tests of unload builtin.
* tests/options.at: Remove obsolute finish hook and module unload
trace output.
* doc/m4.texi (Unload, Refcount): Remove.
(M4modules): Change module reference from load to gnu.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/freeze.c | 4 | ||||
-rw-r--r-- | src/main.c | 1 |
2 files changed, 2 insertions, 3 deletions
diff --git a/src/freeze.c b/src/freeze.c index 9f36e8cc..5ac913d8 100644 --- a/src/freeze.c +++ b/src/freeze.c @@ -156,7 +156,7 @@ produce_module_dump (FILE *file, m4_module *module) const char *name = m4_get_module_name (module); size_t len = strlen (name); - module = m4__module_next (module); + module = m4_module_next (module); if (module) produce_module_dump (file, module); @@ -322,7 +322,7 @@ produce_frozen_state (m4 *context, const char *name) produce_debugmode_state (file, m4_get_debug_level_opt (context)); /* Dump all loaded modules. */ - produce_module_dump (file, m4__module_next (NULL)); + produce_module_dump (file, m4_module_next (NULL)); /* Dump all symbols. */ produce_symbol_dump (context, file, M4SYMTAB); @@ -744,7 +744,6 @@ main (int argc, char *const *argv, char *const *envp) Strictly, we don't need to do this, but it makes leak detection a whole lot easier! */ - m4__module_exit (context); m4_output_exit (); m4_input_exit (); |