1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-23 08:15:17 +03:00

Add lua table lib to colorlcd (#7599)

* Add lua table lib to colorlcd
* Allow require on colorlcd
This commit is contained in:
3djc 2020-05-15 14:50:13 +02:00 committed by GitHub
parent 61acd26497
commit 1cad34eb73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 2 deletions

View file

@ -29,6 +29,7 @@ extern const luaL_Reg mathlib[];
extern const luaL_Reg bitlib[];
extern const luaL_Reg iolib[];
extern const luaL_Reg strlib[];
extern const luaL_Reg tab_funcs[];
extern const luaL_Reg opentxLib[];
extern const luaL_Reg lcdLib[];

View file

@ -28,7 +28,9 @@
*/
static const luaL_Reg loadedlibs[] = {
// {"_G", luaopen_base},
// {LUA_LOADLIBNAME, luaopen_package},
#if defined(PCBHORUS)
{LUA_LOADLIBNAME, luaopen_package},
#endif
// {LUA_COLIBNAME, luaopen_coroutine},
// {LUA_TABLIBNAME, luaopen_table},
{LUA_IOLIBNAME, luaopen_io},
@ -51,6 +53,9 @@ const luaR_table lua_rotable[] =
{LUA_STRLIBNAME, strlib, NULL},
{LUA_MATHLIBNAME, mathlib, mathlib_vals},
{LUA_BITLIBNAME, bitlib, NULL},
#if defined(PCBHORUS)
{LUA_TABLIBNAME, tab_funcs, NULL},
#endif
{NULL, NULL, NULL}
};

View file

@ -256,7 +256,7 @@ static int sort (lua_State *L) {
/* }====================================================== */
static const luaL_Reg tab_funcs[] = {
const luaL_Reg tab_funcs[] = {
{"concat", tconcat},
#if defined(LUA_COMPAT_MAXN)
{"maxn", maxn},