00001 00002 00003 00004 extern "C" 00005 { 00006 #include <lua.h> 00007 #include <lauxlib.h> 00008 #include <lualib.h> 00009 00010 int luaopen_asc(lua_State* L); // declare the wrapped module 00011 } 00012 00013 #include "luastate.h" 00014 00015 00016 class LuaStatePrivate { 00017 public: 00018 LuaStatePrivate() : myLuaState( NULL ) {}; 00019 lua_State *myLuaState; 00020 }; 00021 00022 00023 LuaState::LuaState() 00024 { 00025 myLuaState = lua_open(); 00026 00027 luaopen_asc(myLuaState); // declare the wrapped module 00028 luaL_openlibs(myLuaState); 00029 } 00030 00031 00032 LuaState::~LuaState() 00033 { 00034 lua_close(myLuaState); 00035 }
1.5.1