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
+10 -3
View File
@@ -7,7 +7,7 @@
//
//
// Modifiche : 01.09.14 DS Creazione modulo.
//
// 09.07.15 DS EgtInitGeomDB diventa EgtInitContext, aggiunta EgtDeleteContext.
//
//----------------------------------------------------------------------------
@@ -22,9 +22,16 @@ using namespace std ;
//-----------------------------------------------------------------------------
int
__stdcall EgtInitGeomDB( void)
__stdcall EgtInitContext( void)
{
return ExeInitGeomDB() ;
return ExeInitContext() ;
}
//-----------------------------------------------------------------------------
int
__stdcall EgtDeleteContext( int nGseCtx)
{
return ExeDeleteContext( nGseCtx) ;
}
//-----------------------------------------------------------------------------
+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)
BIN
View File
Binary file not shown.