Fixed: variable_parser compilation
This commit is contained in:
parent
c637ff51df
commit
62df2526cf
6 changed files with 364 additions and 434 deletions
|
@ -27,6 +27,7 @@
|
||||||
#endif // _MSC_VER > 1000
|
#endif // _MSC_VER > 1000
|
||||||
|
|
||||||
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
|
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
|
||||||
|
#define NOMINMAX
|
||||||
|
|
||||||
#include <afxwin.h> // MFC core and standard components
|
#include <afxwin.h> // MFC core and standard components
|
||||||
#include <afxext.h> // MFC extensions
|
#include <afxext.h> // MFC extensions
|
||||||
|
|
|
@ -23,20 +23,14 @@
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
#ifdef max
|
|
||||||
# undef max
|
|
||||||
#endif
|
|
||||||
#include "lualib.h"
|
#include "lualib.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef NL_OS_WINDOWS
|
// to get rid of you_must_not_use_assert___use_nl_assert___read_debug_h_file messages
|
||||||
# ifndef NL_EXTENDED_FOR_SCOPE
|
#include <cassert>
|
||||||
# undef for
|
#undef assert
|
||||||
# endif
|
#define assert nlassert
|
||||||
#endif
|
|
||||||
#undef new
|
|
||||||
#include <luabind/luabind.hpp>
|
#include <luabind/luabind.hpp>
|
||||||
#define new NL_NEW
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace NLMISC;
|
using namespace NLMISC;
|
||||||
|
@ -58,25 +52,86 @@ void CLuaStackChecker::decrementExceptionContextCounter()
|
||||||
-- _ExceptionContextCounter;
|
-- _ExceptionContextCounter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef LUA_NEVRAX_VERSION
|
||||||
|
ILuaIDEInterface *LuaDebuggerIDE = NULL;
|
||||||
|
static bool LuaDebuggerVisible = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef NL_OS_WINDOWS
|
||||||
|
HMODULE LuaDebuggerModule = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void luaDebuggerMainLoop()
|
||||||
|
{
|
||||||
|
#ifdef LUA_NEVRAX_VERSION
|
||||||
|
if (!LuaDebuggerIDE) return;
|
||||||
|
if (!LuaDebuggerVisible)
|
||||||
|
{
|
||||||
|
LuaDebuggerIDE->showDebugger(true);
|
||||||
|
LuaDebuggerIDE->expandProjectTree();
|
||||||
|
LuaDebuggerIDE->sortFiles();
|
||||||
|
LuaDebuggerVisible = true;
|
||||||
|
}
|
||||||
|
LuaDebuggerIDE->doMainLoop();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static std::allocator<uint8> l_stlAlloc;
|
||||||
|
|
||||||
|
|
||||||
|
static void l_free_func(void *block, int oldSize)
|
||||||
|
{
|
||||||
|
l_stlAlloc.deallocate((uint8 *) block, oldSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void *l_realloc_func(void *b, int os, int s)
|
||||||
|
{
|
||||||
|
if (os == s) return b;
|
||||||
|
void *newB = l_stlAlloc.allocate(s);
|
||||||
|
memcpy(newB, b, std::min(os, s));
|
||||||
|
l_free_func(b, os);
|
||||||
|
return newB;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const int MinGCThreshold = 128; // min value at which garbage collector will be triggered (in kilobytes)
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
CLuaState::CLuaState()
|
CLuaState::CLuaState()
|
||||||
{
|
{
|
||||||
|
_State = NULL;
|
||||||
|
|
||||||
#ifdef LUA_NEVRAX_VERSION
|
#ifdef LUA_NEVRAX_VERSION
|
||||||
_State = lua_open(NULL, NULL);
|
_GCThreshold = MinGCThreshold;
|
||||||
#else
|
|
||||||
_State = lua_open();
|
|
||||||
#endif
|
#endif
|
||||||
nlassert(_State);
|
|
||||||
|
if (!_State)
|
||||||
|
{
|
||||||
|
#ifdef LUA_NEVRAX_VERSION
|
||||||
|
_State = lua_open(l_realloc_func, l_free_func);
|
||||||
|
#else
|
||||||
|
_State = lua_open();
|
||||||
|
#endif
|
||||||
|
nlassert(_State);
|
||||||
|
}
|
||||||
|
|
||||||
// *** Load base libs
|
// *** Load base libs
|
||||||
{
|
{
|
||||||
CLuaStackChecker lsc(this);
|
CLuaStackChecker lsc(this);
|
||||||
|
#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501
|
||||||
|
luaL_openlibs(_State);
|
||||||
|
#else
|
||||||
luaopen_base (_State);
|
luaopen_base (_State);
|
||||||
luaopen_table (_State);
|
luaopen_table (_State);
|
||||||
luaopen_io (_State);
|
luaopen_io (_State);
|
||||||
luaopen_string (_State);
|
luaopen_string (_State);
|
||||||
luaopen_math (_State);
|
luaopen_math (_State);
|
||||||
luaopen_debug (_State);
|
luaopen_debug (_State);
|
||||||
|
#endif
|
||||||
|
|
||||||
// open are buggy????
|
// open are buggy????
|
||||||
clear();
|
clear();
|
||||||
}
|
}
|
||||||
|
@ -122,11 +177,43 @@ CLuaStackRestorer::~CLuaStackRestorer()
|
||||||
_State->setTop(_FinalSize);
|
_State->setTop(_FinalSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef NL_OS_WINDOWS
|
||||||
|
static int NoOpReportHook( int /* reportType */, char * /* message */, int * /* returnValue */ )
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
CLuaState::~CLuaState()
|
CLuaState::~CLuaState()
|
||||||
{
|
{
|
||||||
nlassert(_State);
|
nlassert(_State);
|
||||||
lua_close(_State);
|
|
||||||
|
#ifdef LUA_NEVRAX_VERSION
|
||||||
|
if (!LuaDebuggerIDE)
|
||||||
|
#else
|
||||||
|
if (1)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
lua_close(_State);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
#ifdef LUA_NEVRAX_VERSION
|
||||||
|
LuaDebuggerIDE->stopDebug(); // this will also close the lua state
|
||||||
|
LuaDebuggerIDE = NULL;
|
||||||
|
LuaDebuggerVisible = false;
|
||||||
|
#ifdef NL_OS_WINDOWS
|
||||||
|
nlassert(LuaDebuggerModule)
|
||||||
|
_CrtSetReportHook(NoOpReportHook); // prevent dump of memory leaks at this point
|
||||||
|
//::FreeLibrary(LuaDebuggerModule); // don't free the library now (seems that it destroy, the main window, causing
|
||||||
|
// a crash when the app window is destroyed for real...
|
||||||
|
// -> FreeLibrary will be called when the application is closed
|
||||||
|
LuaDebuggerModule = 0;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
// Clear Small Script Cache
|
// Clear Small Script Cache
|
||||||
_SmallScriptPool= 0;
|
_SmallScriptPool= 0;
|
||||||
|
@ -161,9 +248,10 @@ struct CLuaReader
|
||||||
|
|
||||||
void CLuaState::loadScript(const std::string &code, const std::string &dbgSrc)
|
void CLuaState::loadScript(const std::string &code, const std::string &dbgSrc)
|
||||||
{
|
{
|
||||||
|
if (code.empty()) return;
|
||||||
struct CHelper
|
struct CHelper
|
||||||
{
|
{
|
||||||
static const char *luaChunkReaderFromString(lua_State *L, void *ud, size_t *sz)
|
static const char *luaChunkReaderFromString(lua_State * /* L */, void *ud, size_t *sz)
|
||||||
{
|
{
|
||||||
CLuaReader *rd = (CLuaReader *) ud;
|
CLuaReader *rd = (CLuaReader *) ud;
|
||||||
if (!rd->Done)
|
if (!rd->Done)
|
||||||
|
@ -182,6 +270,7 @@ void CLuaState::loadScript(const std::string &code, const std::string &dbgSrc)
|
||||||
CLuaReader rd;
|
CLuaReader rd;
|
||||||
rd.Str = &code;
|
rd.Str = &code;
|
||||||
rd.Done = false;
|
rd.Done = false;
|
||||||
|
|
||||||
int result = lua_load(_State, CHelper::luaChunkReaderFromString, (void *) &rd, dbgSrc.c_str());
|
int result = lua_load(_State, CHelper::luaChunkReaderFromString, (void *) &rd, dbgSrc.c_str());
|
||||||
if (result !=0)
|
if (result !=0)
|
||||||
{
|
{
|
||||||
|
@ -241,6 +330,15 @@ bool CLuaState::executeFile(const std::string &pathName)
|
||||||
if(!inputFile.open(pathName))
|
if(!inputFile.open(pathName))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
#ifdef LUA_NEVRAX_VERSION
|
||||||
|
if (LuaDebuggerIDE)
|
||||||
|
{
|
||||||
|
std::string path = NLMISC::CPath::getCurrentPath() + "/" + pathName.c_str();
|
||||||
|
path = CPath::standardizeDosPath(path);
|
||||||
|
LuaDebuggerIDE->addFile(path.c_str());
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// load the script text
|
// load the script text
|
||||||
string script;
|
string script;
|
||||||
/*
|
/*
|
||||||
|
@ -253,7 +351,7 @@ bool CLuaState::executeFile(const std::string &pathName)
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
script.resize(NLMISC::CFile::getFileSize(pathName));
|
script.resize(NLMISC::CFile::getFileSize(pathName));
|
||||||
inputFile.serialBuffer((uint8 *) &script[0], script.size());
|
inputFile.serialBuffer((uint8 *) &script[0], (uint)script.size());
|
||||||
|
|
||||||
|
|
||||||
// execute the script text, with dbgSrc==filename (use @ for lua internal purpose)
|
// execute the script text, with dbgSrc==filename (use @ for lua internal purpose)
|
||||||
|
@ -265,6 +363,7 @@ bool CLuaState::executeFile(const std::string &pathName)
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
void CLuaState::executeSmallScript(const std::string &script)
|
void CLuaState::executeSmallScript(const std::string &script)
|
||||||
{
|
{
|
||||||
|
if (script.empty()) return;
|
||||||
// *** if the small script has not already been called before, parse it now
|
// *** if the small script has not already been called before, parse it now
|
||||||
TSmallScriptCache::iterator it= _SmallScriptCache.find(script);
|
TSmallScriptCache::iterator it= _SmallScriptCache.find(script);
|
||||||
if(it==_SmallScriptCache.end())
|
if(it==_SmallScriptCache.end())
|
||||||
|
@ -311,7 +410,6 @@ void CLuaState::executeSmallScript(const std::string &script)
|
||||||
// Stack: 1:NelTable
|
// Stack: 1:NelTable
|
||||||
pop(); // ....
|
pop(); // ....
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
|
@ -528,7 +626,8 @@ CLuaStackChecker::~CLuaStackChecker()
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
void ELuaWrappedFunctionException::init(CLuaState *ls, const std::string &reason)
|
void ELuaWrappedFunctionException::init(CLuaState *ls, const std::string &reason)
|
||||||
{
|
{
|
||||||
/* // Print first Lua Stack Context
|
// Print first Lua Stack Context
|
||||||
|
/*
|
||||||
CInterfaceManager *pIM= CInterfaceManager::getInstance();
|
CInterfaceManager *pIM= CInterfaceManager::getInstance();
|
||||||
if(ls)
|
if(ls)
|
||||||
{
|
{
|
||||||
|
@ -536,9 +635,9 @@ void ELuaWrappedFunctionException::init(CLuaState *ls, const std::string &reason
|
||||||
// enclose with cool colors
|
// enclose with cool colors
|
||||||
pIM->formatLuaStackContext(_Reason);
|
pIM->formatLuaStackContext(_Reason);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
// Append the reason
|
// Append the reason
|
||||||
_Reason+= reason;*/
|
_Reason+= reason;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
|
@ -556,8 +655,72 @@ ELuaWrappedFunctionException::ELuaWrappedFunctionException(CLuaState *luaState,
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
ELuaWrappedFunctionException::ELuaWrappedFunctionException(CLuaState *luaState, const char *format, ...)
|
ELuaWrappedFunctionException::ELuaWrappedFunctionException(CLuaState *luaState, const char *format, ...)
|
||||||
{
|
{
|
||||||
|
//H_AUTO(Lua_ELuaWrappedFunctionException_ELuaWrappedFunctionException)
|
||||||
std::string reason;
|
std::string reason;
|
||||||
NLMISC_CONVERT_VARGS (reason, format, NLMISC::MaxCStringSize);
|
NLMISC_CONVERT_VARGS (reason, format, NLMISC::MaxCStringSize);
|
||||||
init(luaState, reason);
|
init(luaState, reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
void CLuaState::newTable()
|
||||||
|
{
|
||||||
|
nlverify( lua_checkstack(_State, 1) );
|
||||||
|
lua_newtable(_State);
|
||||||
|
}
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
int CLuaState::getGCCount()
|
||||||
|
{
|
||||||
|
return lua_getgccount(_State);
|
||||||
|
}
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
int CLuaState::getGCThreshold()
|
||||||
|
{
|
||||||
|
//H_AUTO(Lua_CLuaState_getGCThreshold)
|
||||||
|
#ifdef LUA_NEVRAX_VERSION
|
||||||
|
return _GCThreshold;
|
||||||
|
#else
|
||||||
|
# if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501
|
||||||
|
return lua_gc(_State, LUA_GCCOUNT, 0);
|
||||||
|
# else
|
||||||
|
return lua_getgcthreshold(_State);
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
void CLuaState::setGCThreshold(int kb)
|
||||||
|
{
|
||||||
|
//H_AUTO(Lua_CLuaState_setGCThreshold)
|
||||||
|
#ifdef LUA_NEVRAX_VERSION
|
||||||
|
_GCThreshold = kb;
|
||||||
|
handleGC();
|
||||||
|
#else
|
||||||
|
# if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501
|
||||||
|
lua_gc(_State, LUA_GCCOLLECT, kb);
|
||||||
|
# else
|
||||||
|
lua_setgcthreshold(_State, kb);
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
void CLuaState::handleGC()
|
||||||
|
{
|
||||||
|
//H_AUTO(Lua_CLuaState_handleGC)
|
||||||
|
#ifdef LUA_NEVRAX_VERSION
|
||||||
|
// must handle gc manually with the refcounted version
|
||||||
|
int gcCount = getGCCount();
|
||||||
|
if (gcCount >= _GCThreshold)
|
||||||
|
{
|
||||||
|
nlwarning("Triggering GC : memory in use = %d kb, current threshold = %d kb", gcCount, _GCThreshold);
|
||||||
|
lua_setgcthreshold(_State, 0);
|
||||||
|
gcCount = getGCCount();
|
||||||
|
_GCThreshold = std::max(MinGCThreshold, gcCount * 2);
|
||||||
|
nlwarning("After GC : memory in use = %d kb, threshold = %d kb", gcCount, _GCThreshold);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ private:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//**************************************************************************
|
// **************************************************************************
|
||||||
/** Helper class to restore the lua stack to the desired size when this object goes out of scope
|
/** Helper class to restore the lua stack to the desired size when this object goes out of scope
|
||||||
*/
|
*/
|
||||||
class CLuaStackRestorer
|
class CLuaStackRestorer
|
||||||
|
@ -74,7 +74,7 @@ class ELuaError : public NLMISC::Exception
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ELuaError() { CLuaStackChecker::incrementExceptionContextCounter(); }
|
ELuaError() { CLuaStackChecker::incrementExceptionContextCounter(); }
|
||||||
virtual ~ELuaError() { CLuaStackChecker::decrementExceptionContextCounter(); }
|
virtual ~ELuaError() throw() { CLuaStackChecker::decrementExceptionContextCounter(); }
|
||||||
ELuaError(const std::string &reason) : Exception(reason) { CLuaStackChecker::incrementExceptionContextCounter(); }
|
ELuaError(const std::string &reason) : Exception(reason) { CLuaStackChecker::incrementExceptionContextCounter(); }
|
||||||
// what(), plus append the Reason
|
// what(), plus append the Reason
|
||||||
virtual std::string luaWhat() const throw() {return NLMISC::toString("LUAError: %s", what());}
|
virtual std::string luaWhat() const throw() {return NLMISC::toString("LUAError: %s", what());}
|
||||||
|
@ -86,11 +86,12 @@ class ELuaParseError : public ELuaError
|
||||||
public:
|
public:
|
||||||
ELuaParseError() {}
|
ELuaParseError() {}
|
||||||
ELuaParseError(const std::string &reason) : ELuaError(reason) {}
|
ELuaParseError(const std::string &reason) : ELuaError(reason) {}
|
||||||
|
virtual ~ELuaParseError() throw() { }
|
||||||
// what(), plus append the Reason
|
// what(), plus append the Reason
|
||||||
virtual std::string luaWhat() const throw() {return NLMISC::toString("ELuaParseError: %s", what());}
|
virtual std::string luaWhat() const throw() {return NLMISC::toString("ELuaParseError: %s", what());}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Exception thrown when something when wrong inside a wrapped function called by lua
|
/** Exception thrown when something went wrong inside a wrapped function called by lua
|
||||||
*/
|
*/
|
||||||
class ELuaWrappedFunctionException : public ELuaError
|
class ELuaWrappedFunctionException : public ELuaError
|
||||||
{
|
{
|
||||||
|
@ -98,7 +99,8 @@ public:
|
||||||
ELuaWrappedFunctionException(CLuaState *luaState);
|
ELuaWrappedFunctionException(CLuaState *luaState);
|
||||||
ELuaWrappedFunctionException(CLuaState *luaState, const std::string &reason);
|
ELuaWrappedFunctionException(CLuaState *luaState, const std::string &reason);
|
||||||
ELuaWrappedFunctionException(CLuaState *luaState, const char *format, ...);
|
ELuaWrappedFunctionException(CLuaState *luaState, const char *format, ...);
|
||||||
virtual const char *what() const {return _Reason.c_str();}
|
virtual ~ELuaWrappedFunctionException() throw() { }
|
||||||
|
virtual const char *what() const throw() {return _Reason.c_str();}
|
||||||
protected:
|
protected:
|
||||||
void init(CLuaState *ls, const std::string &reason);
|
void init(CLuaState *ls, const std::string &reason);
|
||||||
protected:
|
protected:
|
||||||
|
@ -111,6 +113,7 @@ class ELuaExecuteError : public ELuaError
|
||||||
public:
|
public:
|
||||||
ELuaExecuteError() {}
|
ELuaExecuteError() {}
|
||||||
ELuaExecuteError(const std::string &reason) : ELuaError(reason) {}
|
ELuaExecuteError(const std::string &reason) : ELuaError(reason) {}
|
||||||
|
virtual ~ELuaExecuteError() throw() { }
|
||||||
// what(), plus append the Reason
|
// what(), plus append the Reason
|
||||||
virtual std::string luaWhat() const throw() {return NLMISC::toString("ELuaExecuteError: %s", what());}
|
virtual std::string luaWhat() const throw() {return NLMISC::toString("ELuaExecuteError: %s", what());}
|
||||||
};
|
};
|
||||||
|
@ -147,6 +150,8 @@ typedef int (* TLuaWrappedFunction) (CLuaState &ls);
|
||||||
class CLuaState : public NLMISC::CRefCount
|
class CLuaState : public NLMISC::CRefCount
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
typedef NLMISC::CRefPtr<CLuaState> TRefPtr;
|
||||||
|
|
||||||
// Create a new environement
|
// Create a new environement
|
||||||
CLuaState();
|
CLuaState();
|
||||||
~CLuaState();
|
~CLuaState();
|
||||||
|
@ -179,7 +184,6 @@ public:
|
||||||
bool executeScriptNoThrow(const std::string &code, int numRet = 0);
|
bool executeScriptNoThrow(const std::string &code, int numRet = 0);
|
||||||
|
|
||||||
/** Load a Script from a File (maybe in a BNP), and execute it
|
/** Load a Script from a File (maybe in a BNP), and execute it
|
||||||
* The script is executed, so it may contains only function/variable declaration
|
|
||||||
* \return false if file not found
|
* \return false if file not found
|
||||||
* \throw ELuaParseError, ELuaExecuteError
|
* \throw ELuaParseError, ELuaExecuteError
|
||||||
*/
|
*/
|
||||||
|
@ -241,7 +245,7 @@ public:
|
||||||
const void *toPointer(int index = -1);
|
const void *toPointer(int index = -1);
|
||||||
/** Helper functions : get value of the wanted type in the top table after conversion
|
/** Helper functions : get value of the wanted type in the top table after conversion
|
||||||
* A default value is used if the stack entry is NULL.
|
* A default value is used if the stack entry is NULL.
|
||||||
* If conversion fails then an exception is thrown (with optionnal msg)
|
* If conversion fails then an exception is thrown (with optional msg)
|
||||||
*/
|
*/
|
||||||
bool getTableBooleanValue(const char *name, bool defaultValue= false);
|
bool getTableBooleanValue(const char *name, bool defaultValue= false);
|
||||||
double getTableNumberValue(const char *name, double defaultValue= 0);
|
double getTableNumberValue(const char *name, double defaultValue= 0);
|
||||||
|
@ -258,7 +262,8 @@ public:
|
||||||
void pushLightUserData(void *); // push a light user data (use newUserData to push a full userdata)
|
void pushLightUserData(void *); // push a light user data (use newUserData to push a full userdata)
|
||||||
// metatables
|
// metatables
|
||||||
bool getMetaTable(int index = -1);
|
bool getMetaTable(int index = -1);
|
||||||
bool setMetaTable(int index = -1);
|
bool setMetaTable(int index = -1); // set the metatable at top of stack to the object at 'index' (usually -2), then pop the metatable
|
||||||
|
// even if asignment failed
|
||||||
// comparison
|
// comparison
|
||||||
bool equal(int index1, int index2);
|
bool equal(int index1, int index2);
|
||||||
bool rawEqual(int index1, int index2);
|
bool rawEqual(int index1, int index2);
|
||||||
|
@ -311,7 +316,10 @@ public:
|
||||||
// Garbage collector
|
// Garbage collector
|
||||||
int getGCCount(); // get memory in use in KB
|
int getGCCount(); // get memory in use in KB
|
||||||
int getGCThreshold(); // get max memory in KB
|
int getGCThreshold(); // get max memory in KB
|
||||||
void setGCThreshold(int kb); // set max memory in KB
|
void setGCThreshold(int kb); // set max memory in KB (no-op with ref-counted version)
|
||||||
|
|
||||||
|
// handle garbage collector for ref-counted version of lua (no-op with standard version, in which case gc handling is automatic)
|
||||||
|
void handleGC();
|
||||||
|
|
||||||
/** For Debug: get the Stack context of execution (filename / line)
|
/** For Debug: get the Stack context of execution (filename / line)
|
||||||
* \param stackLevel: get the context of execution of the given stackLevel.
|
* \param stackLevel: get the context of execution of the given stackLevel.
|
||||||
|
@ -327,6 +335,7 @@ public:
|
||||||
|
|
||||||
// for debug : dump the current content of the stack (no recursion)
|
// for debug : dump the current content of the stack (no recursion)
|
||||||
void dumpStack();
|
void dumpStack();
|
||||||
|
static void dumpStack(lua_State *ls);
|
||||||
void getStackAsString(std::string &dest);
|
void getStackAsString(std::string &dest);
|
||||||
|
|
||||||
|
|
||||||
|
@ -341,13 +350,20 @@ private:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// this object isn't intended to be copied
|
// this object isn't intended to be copied
|
||||||
CLuaState(const CLuaState &other) { nlassert(0); }
|
CLuaState(const CLuaState &/* other */):NLMISC::CRefCount() { nlassert(0); }
|
||||||
CLuaState &operator=(const CLuaState &other) { nlassert(0); return *this; }
|
CLuaState &operator=(const CLuaState &/* other */) { nlassert(0); return *this; }
|
||||||
|
|
||||||
void executeScriptInternal(const std::string &code, const std::string &dbgSrc, int numRet = 0);
|
void executeScriptInternal(const std::string &code, const std::string &dbgSrc, int numRet = 0);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Access to lua function
|
||||||
|
// one should not include lua.h directly because if a debugger is present, lua
|
||||||
|
// function pointer will be taken from a dynamic library.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//=============================================================================================
|
//=============================================================================================
|
||||||
// include implementation
|
// include implementation
|
||||||
#define RZ_INCLUDE_LUA_HELPER_INLINE
|
#define RZ_INCLUDE_LUA_HELPER_INLINE
|
||||||
|
|
|
@ -347,36 +347,11 @@ inline void CLuaState::concat(int numElem)
|
||||||
lua_concat(_State, numElem);
|
lua_concat(_State, numElem);
|
||||||
}
|
}
|
||||||
|
|
||||||
//================================================================================
|
|
||||||
inline int CLuaState::getGCCount()
|
|
||||||
{
|
|
||||||
return lua_getgccount(_State);
|
|
||||||
}
|
|
||||||
|
|
||||||
//================================================================================
|
|
||||||
inline int CLuaState::getGCThreshold()
|
|
||||||
{
|
|
||||||
return lua_getgcthreshold(_State);
|
|
||||||
}
|
|
||||||
|
|
||||||
//================================================================================
|
|
||||||
inline void CLuaState::setGCThreshold(int kb)
|
|
||||||
{
|
|
||||||
lua_setgcthreshold(_State, kb);
|
|
||||||
}
|
|
||||||
|
|
||||||
//================================================================================
|
|
||||||
inline void CLuaState::newTable()
|
|
||||||
{
|
|
||||||
nlverify( lua_checkstack(_State, 1) );
|
|
||||||
lua_newtable(_State);
|
|
||||||
}
|
|
||||||
|
|
||||||
//================================================================================
|
//================================================================================
|
||||||
inline void CLuaState::getTable(int index)
|
inline void CLuaState::getTable(int index)
|
||||||
{
|
{
|
||||||
checkIndex(index);
|
checkIndex(index);
|
||||||
nlassert(isTable(index));
|
nlassert(isTable(index) || isUserData(index));
|
||||||
lua_gettable(_State, index);
|
lua_gettable(_State, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -406,6 +381,7 @@ inline void CLuaState::rawSet(int index)
|
||||||
//================================================================================
|
//================================================================================
|
||||||
inline bool CLuaState::next(int index)
|
inline bool CLuaState::next(int index)
|
||||||
{
|
{
|
||||||
|
//H_AUTO(Lua_CLuaState_next)
|
||||||
checkIndex(index);
|
checkIndex(index);
|
||||||
return lua_next(_State, index) != 0;
|
return lua_next(_State, index) != 0;
|
||||||
}
|
}
|
||||||
|
@ -413,6 +389,7 @@ inline bool CLuaState::next(int index)
|
||||||
//================================================================================
|
//================================================================================
|
||||||
inline void CLuaState::rawSetI(int index, int n)
|
inline void CLuaState::rawSetI(int index, int n)
|
||||||
{
|
{
|
||||||
|
//H_AUTO(Lua_CLuaState_rawSetI)
|
||||||
checkIndex(index);
|
checkIndex(index);
|
||||||
lua_rawseti(_State, index, n);
|
lua_rawseti(_State, index, n);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
<?xml version="1.0" encoding="Windows-1252"?>
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
<VisualStudioProject
|
<VisualStudioProject
|
||||||
ProjectType="Visual C++"
|
ProjectType="Visual C++"
|
||||||
Version="9.00"
|
Version="9,00"
|
||||||
Name="variable_parser"
|
Name="variable_parser"
|
||||||
ProjectGUID="{294FC08E-91F1-4838-AA4D-13A457E227E9}"
|
ProjectGUID="{294FC08E-91F1-4838-AA4D-13A457E227E9}"
|
||||||
RootNamespace="variable_parser"
|
RootNamespace="variable_parser"
|
||||||
Keyword="MFCProj"
|
|
||||||
TargetFrameworkVersion="131072"
|
|
||||||
>
|
>
|
||||||
<Platforms>
|
<Platforms>
|
||||||
<Platform
|
<Platform
|
||||||
|
@ -40,20 +38,10 @@
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCWebServiceProxyGeneratorTool"
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
|
||||||
Name="VCMIDLTool"
|
|
||||||
PreprocessorDefinitions="NDEBUG"
|
|
||||||
MkTypLibCompatible="true"
|
|
||||||
SuppressStartupBanner="true"
|
|
||||||
TargetEnvironment="1"
|
|
||||||
TypeLibraryName=".\Release/variable_parser.tlb"
|
|
||||||
HeaderFileName=""
|
|
||||||
/>
|
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="2"
|
Optimization="2"
|
||||||
InlineFunctionExpansion="1"
|
InlineFunctionExpansion="1"
|
||||||
AdditionalIncludeDirectories="../../../../../code/nel/include"
|
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
|
||||||
StringPooling="true"
|
StringPooling="true"
|
||||||
RuntimeLibrary="2"
|
RuntimeLibrary="2"
|
||||||
|
@ -61,10 +49,6 @@
|
||||||
RuntimeTypeInfo="true"
|
RuntimeTypeInfo="true"
|
||||||
UsePrecompiledHeader="2"
|
UsePrecompiledHeader="2"
|
||||||
PrecompiledHeaderThrough="stdafx.h"
|
PrecompiledHeaderThrough="stdafx.h"
|
||||||
PrecompiledHeaderFile=".\Release/variable_parser.pch"
|
|
||||||
AssemblerListingLocation=".\Release/"
|
|
||||||
ObjectFile=".\Release/"
|
|
||||||
ProgramDataBaseFileName=".\Release/"
|
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
SuppressStartupBanner="true"
|
SuppressStartupBanner="true"
|
||||||
/>
|
/>
|
||||||
|
@ -85,7 +69,6 @@
|
||||||
OutputFile="variable_parser_r.exe"
|
OutputFile="variable_parser_r.exe"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
SuppressStartupBanner="true"
|
SuppressStartupBanner="true"
|
||||||
ProgramDatabaseFile=".\Release/variable_parser_r.pdb"
|
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
RandomizedBaseAddress="1"
|
RandomizedBaseAddress="1"
|
||||||
DataExecutionPrevention="0"
|
DataExecutionPrevention="0"
|
||||||
|
@ -100,107 +83,6 @@
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCXDCMakeTool"
|
Name="VCXDCMakeTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
|
||||||
Name="VCBscMakeTool"
|
|
||||||
SuppressStartupBanner="true"
|
|
||||||
OutputFile=".\Release/variable_parser.bsc"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCFxCopTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCAppVerifierTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCPostBuildEventTool"
|
|
||||||
/>
|
|
||||||
</Configuration>
|
|
||||||
<Configuration
|
|
||||||
Name="Debug|Win32"
|
|
||||||
OutputDirectory=".\Debug"
|
|
||||||
IntermediateDirectory=".\Debug"
|
|
||||||
ConfigurationType="1"
|
|
||||||
UseOfMFC="2"
|
|
||||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
|
||||||
CharacterSet="2"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCPreBuildEventTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCCustomBuildTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCXMLDataGeneratorTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCWebServiceProxyGeneratorTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCMIDLTool"
|
|
||||||
PreprocessorDefinitions="_DEBUG"
|
|
||||||
MkTypLibCompatible="true"
|
|
||||||
SuppressStartupBanner="true"
|
|
||||||
TargetEnvironment="1"
|
|
||||||
TypeLibraryName=".\Debug/variable_parser.tlb"
|
|
||||||
HeaderFileName=""
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
Optimization="0"
|
|
||||||
AdditionalIncludeDirectories="../../../../../code/nel/include"
|
|
||||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
|
||||||
MinimalRebuild="true"
|
|
||||||
BasicRuntimeChecks="3"
|
|
||||||
RuntimeLibrary="3"
|
|
||||||
UsePrecompiledHeader="2"
|
|
||||||
PrecompiledHeaderThrough="stdafx.h"
|
|
||||||
PrecompiledHeaderFile=".\Debug/variable_parser.pch"
|
|
||||||
AssemblerListingLocation=".\Debug/"
|
|
||||||
ObjectFile=".\Debug/"
|
|
||||||
ProgramDataBaseFileName=".\Debug/"
|
|
||||||
WarningLevel="3"
|
|
||||||
SuppressStartupBanner="true"
|
|
||||||
DebugInformationFormat="4"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCManagedResourceCompilerTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCResourceCompilerTool"
|
|
||||||
PreprocessorDefinitions="_DEBUG"
|
|
||||||
Culture="1033"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCPreLinkEventTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCLinkerTool"
|
|
||||||
AdditionalDependencies="nlmisc_d.lib"
|
|
||||||
OutputFile="variable_parser_d.exe"
|
|
||||||
LinkIncremental="2"
|
|
||||||
SuppressStartupBanner="true"
|
|
||||||
GenerateDebugInformation="true"
|
|
||||||
ProgramDatabaseFile=".\Debug/variable_parser_d.pdb"
|
|
||||||
SubSystem="2"
|
|
||||||
RandomizedBaseAddress="1"
|
|
||||||
DataExecutionPrevention="0"
|
|
||||||
TargetMachine="1"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCALinkTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCManifestTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCXDCMakeTool"
|
|
||||||
/>
|
|
||||||
<Tool
|
|
||||||
Name="VCBscMakeTool"
|
|
||||||
SuppressStartupBanner="true"
|
|
||||||
OutputFile=".\Debug/variable_parser.bsc"
|
|
||||||
/>
|
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCFxCopTool"
|
Name="VCFxCopTool"
|
||||||
/>
|
/>
|
||||||
|
@ -232,33 +114,22 @@
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCWebServiceProxyGeneratorTool"
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
|
||||||
Name="VCMIDLTool"
|
|
||||||
PreprocessorDefinitions="NDEBUG"
|
|
||||||
MkTypLibCompatible="true"
|
|
||||||
SuppressStartupBanner="true"
|
|
||||||
TargetEnvironment="3"
|
|
||||||
TypeLibraryName=".\Release/variable_parser.tlb"
|
|
||||||
HeaderFileName=""
|
|
||||||
/>
|
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="2"
|
Optimization="3"
|
||||||
InlineFunctionExpansion="1"
|
InlineFunctionExpansion="2"
|
||||||
AdditionalIncludeDirectories="../../../../../code/nel/include"
|
EnableIntrinsicFunctions="true"
|
||||||
|
FavorSizeOrSpeed="1"
|
||||||
|
OmitFramePointers="true"
|
||||||
|
EnableFiberSafeOptimizations="true"
|
||||||
|
AdditionalIncludeDirectories=""
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
|
||||||
StringPooling="true"
|
StringPooling="true"
|
||||||
RuntimeLibrary="2"
|
RuntimeLibrary="2"
|
||||||
EnableFunctionLevelLinking="true"
|
BufferSecurityCheck="false"
|
||||||
RuntimeTypeInfo="true"
|
|
||||||
UsePrecompiledHeader="2"
|
UsePrecompiledHeader="2"
|
||||||
PrecompiledHeaderThrough="stdafx.h"
|
PrecompiledHeaderThrough="stdafx.h"
|
||||||
PrecompiledHeaderFile=".\Release/variable_parser.pch"
|
|
||||||
AssemblerListingLocation=".\Release/"
|
|
||||||
ObjectFile=".\Release/"
|
|
||||||
ProgramDataBaseFileName=".\Release/"
|
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
SuppressStartupBanner="true"
|
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
@ -273,14 +144,10 @@
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
AdditionalDependencies="nlmisc_r.lib"
|
|
||||||
OutputFile="variable_parser_r.exe"
|
OutputFile="variable_parser_r.exe"
|
||||||
LinkIncremental="1"
|
|
||||||
SuppressStartupBanner="true"
|
|
||||||
ProgramDatabaseFile=".\Release/variable_parser_r.pdb"
|
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
RandomizedBaseAddress="1"
|
OptimizeReferences="2"
|
||||||
DataExecutionPrevention="0"
|
EnableCOMDATFolding="2"
|
||||||
TargetMachine="17"
|
TargetMachine="17"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
|
@ -293,9 +160,76 @@
|
||||||
Name="VCXDCMakeTool"
|
Name="VCXDCMakeTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCBscMakeTool"
|
Name="VCFxCopTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCAppVerifierTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"
|
||||||
|
/>
|
||||||
|
</Configuration>
|
||||||
|
<Configuration
|
||||||
|
Name="Debug|Win32"
|
||||||
|
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||||
|
IntermediateDirectory="$(ConfigurationName)"
|
||||||
|
ConfigurationType="1"
|
||||||
|
UseOfMFC="2"
|
||||||
|
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||||
|
CharacterSet="2"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"
|
||||||
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
||||||
|
MinimalRebuild="true"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
RuntimeLibrary="3"
|
||||||
|
UsePrecompiledHeader="2"
|
||||||
|
PrecompiledHeaderThrough="stdafx.h"
|
||||||
|
WarningLevel="3"
|
||||||
SuppressStartupBanner="true"
|
SuppressStartupBanner="true"
|
||||||
OutputFile=".\Release/variable_parser.bsc"
|
DebugInformationFormat="4"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
PreprocessorDefinitions="_DEBUG"
|
||||||
|
Culture="1033"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
OutputFile="variable_parser_d.exe"
|
||||||
|
LinkIncremental="2"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
|
SubSystem="2"
|
||||||
|
TargetMachine="1"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCALinkTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManifestTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXDCMakeTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCFxCopTool"
|
Name="VCFxCopTool"
|
||||||
|
@ -328,29 +262,15 @@
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCWebServiceProxyGeneratorTool"
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
|
||||||
Name="VCMIDLTool"
|
|
||||||
PreprocessorDefinitions="_DEBUG"
|
|
||||||
MkTypLibCompatible="true"
|
|
||||||
SuppressStartupBanner="true"
|
|
||||||
TargetEnvironment="3"
|
|
||||||
TypeLibraryName=".\Debug/variable_parser.tlb"
|
|
||||||
HeaderFileName=""
|
|
||||||
/>
|
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
AdditionalIncludeDirectories="../../../../../code/nel/include"
|
|
||||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
||||||
MinimalRebuild="true"
|
MinimalRebuild="true"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
RuntimeLibrary="3"
|
RuntimeLibrary="3"
|
||||||
UsePrecompiledHeader="2"
|
UsePrecompiledHeader="2"
|
||||||
PrecompiledHeaderThrough="stdafx.h"
|
PrecompiledHeaderThrough="stdafx.h"
|
||||||
PrecompiledHeaderFile=".\Debug/variable_parser.pch"
|
|
||||||
AssemblerListingLocation=".\Debug/"
|
|
||||||
ObjectFile=".\Debug/"
|
|
||||||
ProgramDataBaseFileName=".\Debug/"
|
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
SuppressStartupBanner="true"
|
SuppressStartupBanner="true"
|
||||||
DebugInformationFormat="3"
|
DebugInformationFormat="3"
|
||||||
|
@ -368,12 +288,10 @@
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
AdditionalDependencies="nlmisc_d.lib"
|
|
||||||
OutputFile="variable_parser_d.exe"
|
OutputFile="variable_parser_d.exe"
|
||||||
LinkIncremental="2"
|
LinkIncremental="2"
|
||||||
SuppressStartupBanner="true"
|
SuppressStartupBanner="true"
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
ProgramDatabaseFile=".\Debug/variable_parser_d.pdb"
|
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
RandomizedBaseAddress="1"
|
RandomizedBaseAddress="1"
|
||||||
DataExecutionPrevention="0"
|
DataExecutionPrevention="0"
|
||||||
|
@ -388,11 +306,6 @@
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCXDCMakeTool"
|
Name="VCXDCMakeTool"
|
||||||
/>
|
/>
|
||||||
<Tool
|
|
||||||
Name="VCBscMakeTool"
|
|
||||||
SuppressStartupBanner="true"
|
|
||||||
OutputFile=".\Debug/variable_parser.bsc"
|
|
||||||
/>
|
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCFxCopTool"
|
Name="VCFxCopTool"
|
||||||
/>
|
/>
|
||||||
|
@ -414,42 +327,6 @@
|
||||||
<File
|
<File
|
||||||
RelativePath="lua_helper.cpp"
|
RelativePath="lua_helper.cpp"
|
||||||
>
|
>
|
||||||
<FileConfiguration
|
|
||||||
Name="Release|Win32"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
AdditionalIncludeDirectories=""
|
|
||||||
PreprocessorDefinitions=""
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Debug|Win32"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
AdditionalIncludeDirectories=""
|
|
||||||
PreprocessorDefinitions=""
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Release|x64"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
AdditionalIncludeDirectories=""
|
|
||||||
PreprocessorDefinitions=""
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Debug|x64"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
AdditionalIncludeDirectories=""
|
|
||||||
PreprocessorDefinitions=""
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="StdAfx.cpp"
|
RelativePath="StdAfx.cpp"
|
||||||
|
@ -465,7 +342,7 @@
|
||||||
/>
|
/>
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
<FileConfiguration
|
<FileConfiguration
|
||||||
Name="Debug|Win32"
|
Name="Release|x64"
|
||||||
>
|
>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
|
@ -475,7 +352,7 @@
|
||||||
/>
|
/>
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
<FileConfiguration
|
<FileConfiguration
|
||||||
Name="Release|x64"
|
Name="Debug|Win32"
|
||||||
>
|
>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
|
@ -498,118 +375,14 @@
|
||||||
<File
|
<File
|
||||||
RelativePath="variable_parser.cpp"
|
RelativePath="variable_parser.cpp"
|
||||||
>
|
>
|
||||||
<FileConfiguration
|
|
||||||
Name="Release|Win32"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
AdditionalIncludeDirectories=""
|
|
||||||
PreprocessorDefinitions=""
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Debug|Win32"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
AdditionalIncludeDirectories=""
|
|
||||||
PreprocessorDefinitions=""
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Release|x64"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
AdditionalIncludeDirectories=""
|
|
||||||
PreprocessorDefinitions=""
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Debug|x64"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
AdditionalIncludeDirectories=""
|
|
||||||
PreprocessorDefinitions=""
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="variable_parser.rc"
|
RelativePath="variable_parser.rc"
|
||||||
>
|
>
|
||||||
<FileConfiguration
|
|
||||||
Name="Release|Win32"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCResourceCompilerTool"
|
|
||||||
PreprocessorDefinitions=""
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Debug|Win32"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCResourceCompilerTool"
|
|
||||||
PreprocessorDefinitions=""
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Release|x64"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCResourceCompilerTool"
|
|
||||||
PreprocessorDefinitions=""
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Debug|x64"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCResourceCompilerTool"
|
|
||||||
PreprocessorDefinitions=""
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="variable_parserDlg.cpp"
|
RelativePath="variable_parserDlg.cpp"
|
||||||
>
|
>
|
||||||
<FileConfiguration
|
|
||||||
Name="Release|Win32"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
AdditionalIncludeDirectories=""
|
|
||||||
PreprocessorDefinitions=""
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Debug|Win32"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
AdditionalIncludeDirectories=""
|
|
||||||
PreprocessorDefinitions=""
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Release|x64"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
AdditionalIncludeDirectories=""
|
|
||||||
PreprocessorDefinitions=""
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Debug|x64"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
AdditionalIncludeDirectories=""
|
|
||||||
PreprocessorDefinitions=""
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
</File>
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
|
|
|
@ -198,7 +198,7 @@ void CVariableParserDlg::OnLUABrowse()
|
||||||
|
|
||||||
void CleanString( CSString &str )
|
void CleanString( CSString &str )
|
||||||
{
|
{
|
||||||
int i = str.size();
|
int i = (int)str.size();
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
|
|
||||||
while ( !ok && ( i > 0 ) )
|
while ( !ok && ( i > 0 ) )
|
||||||
|
@ -288,7 +288,7 @@ void CVariableParserDlg::BuildParseParameters( ParseParameters& params, uint lig
|
||||||
params.push_back( "" );
|
params.push_back( "" );
|
||||||
CString str = m_variables[colonne][0].c_str();
|
CString str = m_variables[colonne][0].c_str();
|
||||||
|
|
||||||
for ( uint j=m_nomVariables.size(); j>0; j-- )
|
for ( uint j=(uint)m_nomVariables.size(); j>0; j-- )
|
||||||
{
|
{
|
||||||
str.Replace( toString( "C%d", j-1 ).c_str(), params[j-1].c_str() );
|
str.Replace( toString( "C%d", j-1 ).c_str(), params[j-1].c_str() );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue