lua_loadlib.h

Lightweight C interface to the package loader.

LUAR_MODULE_NOTFOUND

Error code for when a modules is not found.

1
50

The numeric value is chosen so that there is no collision with Lua’s own error codes.

int lua_riot_getloader(lua_State * L, const char * name)

Load a module as a chunk.

This function is a lightweight “require”. It does not require the “package” module to be loaded and does not register the module. Only the builtin tables are searched.

Upon sucessful execution, the compiled chunk will be at the top of the lua stack.

Parameters

L:Initialized Lua interpreter state.
name:Name of the module.

Return values

  • Same as lua_load. If the module is a C-module, then this will always succeed and return LUA_OK.