lua-users home
lua-l archive

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


1#
Change:
example2 = require("example2")
to:
require("example2”)

or 2#

LUA_API int luaopen_example2(lua_State *L) {
    static const struct luaL_Reg example2[] = {
      { "get_str", _wrap_get_str },
      { NULL, NULL }
    };
    luaL_newlib(L, example2);
    return 1;
}

On 27 Oct 2016, at 17:28, Ervin Hegedüs <airween@gmail.com> wrote:

void luaopen_example2(lua_State *L) {
    static const struct luaL_Reg example2[] = {
      { "get_str", _wrap_get_str },
      { NULL, NULL }
    };
    luaL_newlib(L, example2);
    lua_setglobal(L, "example2");
}