LuaD



template  LuaModule(string modname, alias initFunc)

Generate module entry point for use by Lua's require function.

Parameters
modname module name. Typically this should be the same as the name of the shared library containing this module. Only characters in the set [a-zA-Z_] are allowed. Underscores are used to denote a submodule. The module name must be unique for the current executable.
initFunc module initialization function. Called when the module is loaded. Its return value is returned by require on the Lua side. Its first parameter must be of type luad.state.LuaState, which is the state of the calling environment. Optionally, there may be a second parameter implicitly convertible to the type const(char[]), which is the name of the module to be loaded (useful for submodules).