aboutsummaryrefslogtreecommitdiff
path: root/src/lua/modules/_embed/embed.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-09-10 07:17:50 +0800
committerchai <chaifix@163.com>2018-09-10 07:17:50 +0800
commit8339939b7fce5236b1a933eef46e1dd4284a24aa (patch)
treef62c1cefb54e1e8b14fb91564b13d436accff1da /src/lua/modules/_embed/embed.h
parent6decddfd8470b44609e8c3aa144380f198b7b54c (diff)
*update
Diffstat (limited to 'src/lua/modules/_embed/embed.h')
-rw-r--r--src/lua/modules/_embed/embed.h46
1 files changed, 0 insertions, 46 deletions
diff --git a/src/lua/modules/_embed/embed.h b/src/lua/modules/_embed/embed.h
deleted file mode 100644
index 8d0ba85..0000000
--- a/src/lua/modules/_embed/embed.h
+++ /dev/null
@@ -1,46 +0,0 @@
-#ifndef __JIN_LUA_EMBED_H
-#define __JIN_LUA_EMBED_H
-#include <cstring>
-
-namespace jin
-{
-namespace embed
-{
-
-#define embed(L, script, name)\
- if(luax_loadbuffer(L, script, strlen(script), name) == 0)\
- lua_call(L, 0, 0);
-
- /**
- * embed structure.
- */
- struct jin_Embed
- {
- const char* file, *source;
- };
-
- static void boot(lua_State* L)
- {
- // embed scripts
- #include "graphics.lua.h"
- #include "keyboard.lua.h"
- #include "mouse.lua.h"
- #include "boot.lua.h"
-
- // in order
- const jin_Embed scripts[] = {
- { "graphics.lua", graphics_lua },
- { "keyboard.lua", keyboard_lua },
- { "mouse.lua", mouse_lua },
- { "boot.lua", boot_lua },
- { 0, 0 }
- };
-
- for (int i = 0; scripts[i].file; ++i)
- embed(L, scripts[i].source, scripts[i].file);
- }
-
-} // embed
-} // jin
-
-#endif \ No newline at end of file