eufon

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

lua_compat.h (688B)


      1 /* Copyright (c), Niclas Meyer <niclas@countingsort.com>
      2  *
      3  * This Source Code Form is subject to the terms of the Mozilla Public
      4  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
      5  * You can obtain one at https://mozilla.org/MPL/2.0/.
      6  */
      7 
      8 #ifndef KIWMI_LUAK_LUA_COMPAT_H
      9 #define KIWMI_LUAK_LUA_COMPAT_H
     10 
     11 #include <lauxlib.h>
     12 #include <lua.h>
     13 
     14 #define luaC_newlibtable(L, l)                                                 \
     15     lua_createtable(L, 0, sizeof(l) / sizeof((l)[0]) - 1)
     16 
     17 #define luaC_newlib(L, l) (luaC_newlibtable(L, l), luaC_setfuncs(L, l, 0))
     18 
     19 void luaC_setfuncs(lua_State *L, const luaL_Reg *l, int nup);
     20 
     21 #endif /* KIWMI_LUAK_LUA_COMPAT_H */