modules: remove support for module unload and refcount.
commitaeb92bcb25e253b55650961f341640f93ec3b54e
authorGary V. Vaughan <gary@gnu.org>
Fri, 20 Sep 2013 05:00:02 +0000 (20 12:00 +0700)
committerGary V. Vaughan <gary@gnu.org>
Fri, 20 Sep 2013 08:57:49 +0000 (20 15:57 +0700)
treeee8d364c67cc33c342aa8d181918709fe9fcb557
parent9114cb2e988dabdf4c8561f62eb448aa24117574
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>
15 files changed:
Makefile.am
doc/m4.texi
m4/builtin.c
m4/m4module.h
m4/m4private.h
m4/module.c
modules/gnu.c
modules/load.c [deleted file]
modules/m4.c
modules/modtest.c
modules/shadow.c
src/freeze.c
src/main.c
tests/modules.at
tests/options.at