lua-users home
lua-l archive

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



I don't have much to add or comment to Roberto's proposal; it seems almost valid as it is (to me).

But here's an idea about module identification as used in LuaX. The purpose is to be able to get 'about' info on modules, both in source form and at runtime. The fields are essentially packed into namespace._info table, which allows one to i.e. browse through the used modules to make sure no commercial or GPL'ed licenses are there. Or other such stuff. :)

Module info in C code (off gpib_module.c):

//----------------------
//
GLUA_MODULE( my_path, my_tbl )
{
	...

    GLUA_DECL( my_tbl )
        {
        glua_info( "MODULE",    "GPIB communications" ),
        glua_info( "AUTHOR",    "asko.kauppi@sci.fi" ),
        glua_info( "LICENSE",   "LGPL (links to proprietary drivers)" ),
        glua_info( "PLATFORM",  "Win32, Linux, OS X" ),
        glua_info( "DEPENDENCIES",  "NI GPIB drivers (proprietary)" ),
        glua_info( "LINKS",     "http://www.ni.com/downloads"; ),

        glua_func( open ),
        glua_func( close ),
        glua_func( send ),
        glua_func( receive ),
        //
        glua_tag( "GpibDev", &tag_dev ),
        glua_tagmethod( tag_dev, "gc", close ),   // Garbage Collection
        }
    GLUA_DECL_END
}
GLUA_MODULE_END


Or in Lua wrapper (Scripts/dirtools.lua):

local m= { _info= { MODULE= "Dirlist (and other file system tools)",
                    AUTHOR= "asko.kauppi@sci.fi",
                    LICENSE= "LGPL" } }