diff options
Diffstat (limited to 'src/00-misc/main.cpp')
| -rw-r--r-- | src/00-misc/main.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/00-misc/main.cpp b/src/00-misc/main.cpp new file mode 100644 index 0000000..d55dac8 --- /dev/null +++ b/src/00-misc/main.cpp @@ -0,0 +1,43 @@ +#include "../configure.h" +#if BUILD_TEST == TEST_0 + +extern "C" { +#include "../lua51/lua.h" +#include "../lua51/lualib.h" +#include "../lua51/lauxlib.h" +} + +#include <windows.h> +#include <time.h> +#include <conio.h> + +luaL_reg fns[] = { + { 0, 0 } +}; + +void openlibs(lua_State* L) +{ + luaL_openlibs(L); + //luaL_register(L, NULL, fns); + luaL_reg* fn; + int i = 0; + for (fn = &fns[0]; fn->name != 0; fn = &fns[++i]) + { + lua_pushcfunction(L, fn->func); + lua_setglobal(L, fn->name); + } +} + +int main(int args, char* argv[]) +{ + lua_State* L = luaL_newstate(); + openlibs(L); + + luaL_dofile(L, "00-misc/misc.lua"); + + lua_close(L); + getchar(); + return 0; +} + +#endif
\ No newline at end of file |
