m4-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

m4 ./ChangeLog ./TODO m4/builtin.c m4/ltdl.c m4...


From: Gary V. Vaughan
Subject: m4 ./ChangeLog ./TODO m4/builtin.c m4/ltdl.c m4...
Date: Tue, 12 Aug 2003 11:33:57 -0400

CVSROOT:        /cvsroot/m4
Module name:    m4
Branch:         
Changes by:     Gary V. Vaughan <address@hidden>        03/08/12 11:33:57

Modified files:
        .              : ChangeLog TODO 
        m4             : builtin.c ltdl.c ltdl.h m4module.h module.c 
                         path.c symtab.c 
        modules        : Makefile.am gnu.c m4.c m4.h modtest.c 
        src            : freeze.c 
        tests          : modules.at 
Added files:
        modules        : import.c 

Log message:
        Libltdl already has an excellent mechanism for accessing C symbols
        in modules.  Lets use that!  Remove all the exporting cruft and
        just use lt_dlsym in conjunction with a few conventions to
        simplify module writers' jobs.  Also removed the table address
        caching code and otherwise simplified the module loader quite a
        bit.  To access exported symbols in other modules, first the
        exporting module must name the symbols <modname>_LTX_<symname>,
        and the importing module must define a function type called
        <symname>_func.  The importer then adds
        M4_MODULE_IMPORT(<modname>, <symname>) at the top of any function
        that wishes to call out to the exported functions.  Care must be
        taken that <symname> is non-NULL in the importing module incase
        M4_MODULE_IMPORT fails, but otherwise it can be called as if the
        definition was in the importers source.  Study
        `modules/{gnu.c,m4.{c,h}' for a model example.  At the moment,
        m4_module_import will attempt to automatically load a module
        required for symbol access if it is not loaded already.
        
        * TODO: Removed the items fixed in this delta.
        * m4/ltdl.c (lt_dlhandle_find): New function to find a handle by
        module name.
        * m4/ltdl.h (lt_dlhandle_find): Declare it.
        * m4/module.c (m4_module_unload): Use it.
        * src/freeze.c (reload_frozen_state): Ditto.
        * m4/m4module.h (m4_export): Deleted.  Removed all references.
        (M4_MODULE_IMPORT): New user convenience macro for importing
        arbitrary symbols from other modules.
        * m4/module.c (m4_module_import): New function to service
        M4_MODULE_IMPORT macro.
        (module_data): Removed.  Looking up the tables on demand with
        lt_dlsym, rather than caching their addresses here simplifies the
        code substantially.
        (m4_get_module_builtin_table, m4_get_module_macro_table):
        Removed.  Changed all callers.
        (set_module_macro_table, set_module_builtin_table): Renamed to
        install_macro_table and install_builtin_table respectively, and
        simplified now that the cache is no more.
        * modules/gnu.c (builtin_symbols): Use this new mechanism to
        import m4_dump_symbols from the m4 module.
        (builtin_esyscmd): Likewise for m4_set_sysval and
        m4_sysval_flush.
        * modules/m4.c (m4_export_table): Removed.  Functions are
        addressed with the new mechanism which doesn't need this.
        (m4_set_sysval): New exported accessor function to prevent
        problems with variable access on inferior architectures.
        * modules/m4.h (m4_sysval_flush_func, m4_set_sysval_func)
        (m4_dump_symbols_func): Typedefs required by M4_MODULE_IMPORT so
        that we can have some type safety.
        * modules/modtest.c (export_test): C level exported function for
        testing the new import mechanism.
        * modules/import.c: New file for the import end of the test.
        * modules/Makefile.am (pkglibexec_LTLIBRARIES): Added import.la.
        * tests/modules.at: New test cases for intermodule symbol
        importing.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/m4/m4/ChangeLog.diff?tr1=1.201&tr2=1.202&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/m4/m4/TODO.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/m4/m4/m4/builtin.c.diff?tr1=1.20&tr2=1.21&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/m4/m4/m4/ltdl.c.diff?tr1=1.13&tr2=1.14&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/m4/m4/m4/ltdl.h.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/m4/m4/m4/m4module.h.diff?tr1=1.64&tr2=1.65&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/m4/m4/m4/module.c.diff?tr1=1.26&tr2=1.27&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/m4/m4/m4/path.c.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/m4/m4/m4/symtab.c.diff?tr1=1.42&tr2=1.43&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/m4/m4/modules/import.c?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/m4/m4/modules/Makefile.am.diff?tr1=1.20&tr2=1.21&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/m4/m4/modules/gnu.c.diff?tr1=1.29&tr2=1.30&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/m4/m4/modules/m4.c.diff?tr1=1.51&tr2=1.52&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/m4/m4/modules/m4.h.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/m4/m4/modules/modtest.c.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/m4/m4/src/freeze.c.diff?tr1=1.33&tr2=1.34&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/m4/m4/tests/modules.at.diff?tr1=1.6&tr2=1.7&r1=text&r2=text





reply via email to

[Prev in Thread] Current Thread [Next in Thread]