The nexuslua function luastate returns the current Lua State as light user data. It may be used in shared libraries that are called via import and use the Lua C API themselves.