I have a Lua module, which returns an export table (i.e. not using the deprecated module directive). Also, I have a script which wants to load that module via "require" function. Now I load both files to lua state from C code like this:
luaL_loadstring(lua, someScript);
lua_pcall(lua, 0, LUA_MULTRET, 0);
luaL_loadstring(lua, someModule);
lua_pcall(lua, 0, LUA_MULTRET, 0);
The require call fails, because it looks for the file, rather than the code, which is already loaded. Is it possible to somehow require someModule from someScript in this situation?