EgtInterface 1.6g3 :

- EgtInitGeomDB diventata EgtInitContext
- aggiunta EgtDeleteContext
- aggiunte funzioni per leggere e scrivere variabili globali Lua
- aggiunta funzione per resettare variabili globali Lua
- aggiunta funzione per creare tavole globali Lua.
This commit is contained in:
Dario Sassi
2015-07-14 15:52:13 +00:00
parent c2af8621bc
commit da652b6c2b
3 changed files with 94 additions and 3 deletions
+84
View File
@@ -20,6 +20,90 @@
using namespace std ;
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtLuaSetGlobBoolVar( const wchar_t* wsVar, BOOL bVal)
{
return ( ExeLuaSetGlobBoolVar( wstrztoA( wsVar), ( bVal != FALSE ? true : false)) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtLuaSetGlobIntVar( const wchar_t* wsVar, int nVal)
{
return ( ExeLuaSetGlobIntVar( wstrztoA( wsVar), nVal) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtLuaSetGlobNumVar( const wchar_t* wsVar, double dVal)
{
return ( ExeLuaSetGlobNumVar( wstrztoA( wsVar), dVal) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtLuaSetGlobStringVar( const wchar_t* wsVar, const wchar_t* wsVal)
{
return ( ExeLuaSetGlobStringVar( wstrztoA( wsVar), wstrztoA( wsVal)) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtLuaGetGlobBoolVar( const wchar_t* wsVar, BOOL* pbVal)
{
bool bVal ;
if ( ! ExeLuaGetGlobBoolVar( wstrztoA( wsVar), &bVal))
return FALSE ;
if ( pbVal != nullptr)
*pbVal = ( bVal ? TRUE : FALSE) ;
return TRUE ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtLuaGetGlobIntVar( const wchar_t* wsVar, int* pnVal)
{
return ( ExeLuaGetGlobIntVar( wstrztoA( wsVar), pnVal) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtLuaGetGlobNumVar( const wchar_t* wsVar, double* pdVal)
{
return ( ExeLuaGetGlobNumVar( wstrztoA( wsVar), pdVal) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtLuaGetGlobStringVar( const wchar_t* wsVar, wchar_t*& wsVal)
{
// verifico parametro di ritorno
if ( &wsVal == nullptr)
return FALSE ;
// recupero il valore della variabile
string sVal ;
if ( ! ExeLuaGetGlobStringVar( wstrztoA( wsVar), sVal))
return FALSE ;
// alloco buffer di ritorno ed eseguo copia
wsVal = _wcsdup( stringtoW( sVal)) ;
return (( wsVal == nullptr) ? FALSE : TRUE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtLuaResetGlobVar( const wchar_t* wsVar)
{
return ( ExeLuaResetGlobVar( wstrztoA( wsVar)) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtLuaCreateGlobTable( const wchar_t* wsVar)
{
return ( ExeLuaCreateGlobTable( wstrztoA( wsVar)) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtLuaEvalNumExpr( const wchar_t* wsExpr, double* pdVal)