diff options
| author | Bernard Xiong <[email protected]> | 2018-07-12 14:15:20 +0800 |
|---|---|---|
| committer | Bernard Xiong <[email protected]> | 2018-07-12 14:15:20 +0800 |
| commit | 60435316ac40c84faa734333870068ba9522e6b2 (patch) | |
| tree | 97c9830849d16202419a0fd852d6d97581d3916b /components/external/lua/exlibs | |
| parent | 5c420c0c6e23de57ba2f308ec3c99b8da19c8311 (diff) | |
[components] remove external folder
Diffstat (limited to 'components/external/lua/exlibs')
| -rw-r--r-- | components/external/lua/exlibs/SConscript | 11 | ||||
| -rw-r--r-- | components/external/lua/exlibs/lexamplelib.c | 75 | ||||
| -rw-r--r-- | components/external/lua/exlibs/lexlibs.h | 26 |
3 files changed, 0 insertions, 112 deletions
diff --git a/components/external/lua/exlibs/SConscript b/components/external/lua/exlibs/SConscript deleted file mode 100644 index c891d565be..0000000000 --- a/components/external/lua/exlibs/SConscript +++ /dev/null @@ -1,11 +0,0 @@ - -import os -from building import * - -cwd = GetCurrentDir() -src = Glob('*.c') -CPPPATH = [cwd, str(Dir('#'))] - -group = DefineGroup('lua', src, depend = ['RT_USING_LUA'], CPPPATH = CPPPATH) - -Return('group') diff --git a/components/external/lua/exlibs/lexamplelib.c b/components/external/lua/exlibs/lexamplelib.c deleted file mode 100644 index f160ae35d8..0000000000 --- a/components/external/lua/exlibs/lexamplelib.c +++ /dev/null @@ -1,75 +0,0 @@ -/** - * example of adding lua external library - */ - -#include "lua.h" -#include "lauxlib.h" - -#include "lexlibs.h" - -#define VERSION 1 - -int example_hello(lua_State *L) -{ - rt_kprintf("Hello, Lua on RT-Thead!\n"); - - return 0; -} - -int example_print(lua_State *L) -{ - int n = lua_gettop(L); - int i; - - for (i=1; i<=n; i++) - { - if (i>1) - rt_kprintf("\t"); - - if (lua_isstring(L,i)) - rt_kprintf("%s",lua_tostring(L,i)); - else if (lua_isnumber(L, i)) - rt_kprintf("%d",lua_tointeger(L,i)); - else if (lua_isnil(L,i)) - rt_kprintf("%s","nil"); - else if (lua_isboolean(L,i)) - rt_kprintf("%s",lua_toboolean(L,i) ? "true" : "false"); - else - rt_kprintf("%s:%p",luaL_typename(L,i),lua_topointer(L,i)); - } - - rt_kprintf("\n"); - - return 0; -} - - -#define MIN_OPT_LEVEL 2 -#include "lrodefs.h" - -const LUA_REG_TYPE example_map[] = -{ - {LSTRKEY("hello"), LFUNCVAL(example_hello)}, - {LSTRKEY("print"), LFUNCVAL(example_print)}, -#if LUA_OPTIMIZE_MEMORY > 0 - {LSTRKEY("version"), LNUMVAL(VERSION)}, -#endif - {LNILKEY, LNILVAL} -}; - -/** - * Open exmaple library - */ -LUALIB_API int luaopen_example(lua_State *L) -{ -#if LUA_OPTIMIZE_MEMORY > 0 - return 0; -#else - luaL_register(L, EXLIB_EXAMPLE, example_map); - lua_pushnumber(L, VERSION); - lua_setfield(L, -2, "version"); - return 1; -#endif -} - - diff --git a/components/external/lua/exlibs/lexlibs.h b/components/external/lua/exlibs/lexlibs.h deleted file mode 100644 index ca179e0f67..0000000000 --- a/components/external/lua/exlibs/lexlibs.h +++ /dev/null @@ -1,26 +0,0 @@ -/** - * External library - */ - -#ifndef __LEXLIBS_H__ -#define __LEXLIBS_H__ - -/* Arduino library source - larduinolib.c is placed in ART's directories */ -#if defined(RT_LUA_USE_ARDUINOLIB) -#define EXLIB_ARDUINO "arduino" -#define ROM_EXLIB_ARDUINO \ - _ROM(EXLIB_ARDUINO, luaopen_arduino, arduino_map) -#else -#define ROM_EXLIB_ARDUINO -#endif - -#define EXLIB_EXAMPLE "example" -#define ROM_EXLIB_EXAMPLE \ - _ROM(EXLIB_EXAMPLE, luaopen_example, example_map) - -#define LUA_EXLIBS_ROM \ - ROM_EXLIB_EXAMPLE \ - ROM_EXLIB_ARDUINO - -#endif - |
