#include "LuaState.h"
#include <list>
#include <string>
#include <algorithm>
#include <stdio.h>
#include <string.h>
#include "LuaStateFunctions.h"
#include "lualib.h"
Go to the source code of this file.
Functions | |
LUALIB_API int | lua_baselibopen (lua_State *L) |
LUALIB_API int | lua_iolibopen (lua_State *L) |
LUALIB_API int | lua_strlibopen (lua_State *L) |
LUALIB_API int | lua_mathlibopen (lua_State *L) |
LUALIB_API int | lua_dblibopen (lua_State *L) |
int | LS_LOG (LuaState state) |
int | LS_WriteLuaObject (LuaState state) |
int | LS_WriteLuaFile (LuaState state) |
int | LS_WriteLuaGlobalsFile (LuaState state) |
void | FatalError () |
void | LSLock (void *data) |
void | LSUnlock (void *data) |
int | lua_dumplibopen (lua_State *L) |
void | IndentFile (LuaStateOutFile &file, unsigned int indentLevel) |
void | luaI_addquotedbinary (LuaStateOutFile &file, lua_State *L, const char *s, int l) |
void | luaI_addquotedwidebinary (LuaStateOutFile &file, lua_State *L, const wchar_t *s, int l) |
|
Definition at line 146 of file LuaState.cpp. 00149 { |
|
Adds [indentLevel] number of spaces to the file. Definition at line 342 of file LuaState.cpp. 00342 { 00343 case l_c('"'): case l_c('\\'): 00344 file.Print("\\%c", *s); 00345 break; 00346 case l_c('\a'): file.Print("\\a"); break; 00347 case l_c('\b'): file.Print("\\b"); break; 00348 case l_c('\f'): file.Print("\\f"); break; 00349 case l_c('\n'): file.Print("\\n"); break; 00350 case l_c('\r'): file.Print("\\r"); break; |
|
Definition at line 154 of file LuaState.cpp. |
|
Definition at line 163 of file LuaState.cpp. 00163 { 00164 m_state = lua_newthread(script, stackSize); 00165 Init(initStandardLibrary, stackSize); 00166 } 00167 |
|
Definition at line 57 of file LuaState.cpp. 00068 { |
|
Definition at line 95 of file LuaState.cpp. 00100 { 00101 LPCSTR fileName = state.ToString(1); 00102 LuaObject writeAllObj(state, 2); 00103 LuaObject alphabeticalObj(state, 3); 00104 LuaObject maxIndentLevelObj(state, 4); 00105 bool writeAll = !writeAllObj.IsNil() && writeAllObj.GetInteger() != 0; 00106 bool alphabetical = !alphabeticalObj.IsNil() && alphabeticalObj.GetInteger() != 0; 00107 int maxIndentLevel = maxIndentLevelObj.IsNumber() ? maxIndentLevelObj.GetInteger() : 0xFFFFFFFF; 00108 00109 state.WriteLuaGlobalsFile(fileName, writeAll, alphabetical, false, maxIndentLevel); 00110 00111 state.PushBool(true); 00112 return 1; 00113 } 00114 00115 00118 static void FatalError() 00119 { 00120 throw -1; 00121 } 00122 |
|
Definition at line 127 of file LuaState.cpp. 00127 { 00128 CRITICAL_SECTION* cs = (CRITICAL_SECTION*)data; 00129 ::EnterCriticalSection(cs); 00130 } 00131 00132 00135 static void LSUnlock(void* data) 00136 { 00137 CRITICAL_SECTION* cs = (CRITICAL_SECTION*)data; 00138 ::LeaveCriticalSection(cs); 00139 } 00140 00141 |
|
Definition at line 72 of file LuaState.cpp. 00072 { 00073 state.PushBool(false); 00074 return 1; 00075 } 00076 LuaObject nameObj(state, 2); 00077 LuaObject valueObj(state, 3); 00078 LuaObject indentLevelObj(state, 4); 00079 LuaObject writeAllObj(state, 5); 00080 LuaObject alphabeticalObj(state, 6); 00081 LuaObject maxIndentLevelObj(state, 7); 00082 bool writeAll = !writeAllObj.IsNil() && writeAllObj.GetInteger() != 0; 00083 bool alphabetical = !alphabeticalObj.IsNil() && alphabeticalObj.GetInteger() != 0; 00084 int maxIndentLevel = maxIndentLevelObj.IsNumber() ? maxIndentLevelObj.GetInteger() : 0xFFFFFFFF; 00085 00086 LuaStateOutFile stdFile; 00087 stdFile.Assign(file); 00088 state.WriteLuaObject(stdFile, nameObj.GetString(), valueObj, 00089 indentLevelObj.GetInteger(), writeAll, alphabetical, false, maxIndentLevel); 00090 fclose(file); |
|
Definition at line 364 of file LuaState.cpp. 00368 { 00369 file.Print("L\""); 00370 while (l--) 00371 { 00372 switch (*s) 00373 { 00374 case l_uc('"'): 00375 case l_uc('\\'): 00376 file.Print("\\%c", *s); 00377 break; 00378 case l_uc('\a'): file.Print("\\a"); break; 00379 case l_uc('\b'): file.Print("\\b"); break; 00380 case l_uc('\f'): file.Print("\\f"); break; 00381 case l_uc('\n'): file.Print("\\n"); break; 00382 case l_uc('\r'): file.Print("\\r"); break; 00383 case l_uc('\t'): file.Print("\\t"); break; 00384 case l_uc('\v'): file.Print("\\v"); break; 00385 default: 00386 if (*s < 256 && isprint((BYTE)*s)) 00387 { 00388 file.Print("%c", *s); 00389 } 00390 else 00391 { 00392 file.Print("\\x%04x", (DWORD)*s); |
|
Definition at line 395 of file LuaState.cpp. 00407 { 00408 LuaState script = value; 00409 00410 // If there is nothing in the variable, then don't write it. 00411 if (value.IsNil()) 00412 return false; 00413 00414 // If the variable is user data or a function, then don't write it. 00415 if (value.IsUserData() || value.IsFunction() || value.IsCFunction()) 00416 { 00417 if (writeAll && name) 00418 { 00419 if (value.IsUserData()) 00420 file.Print("-- %s = '!!!USERDATA!!!'\n", name); 00421 else if (value.IsFunction()) 00422 { 00423 lua_Debug ar; 00424 PushValue(value); 00425 lua_getinfo(m_state, ">S", &ar); 00426 // printf("%d\n", ar.linedefined); |
|
|
|
|
|
|
|
|
|
|
|
|