From da652b6c2b0a71f78a61b4a6b2ee300008180d2c Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Tue, 14 Jul 2015 15:52:13 +0000 Subject: [PATCH] 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. --- API_GeomDB.cpp | 13 ++++++-- API_Lua.cpp | 84 ++++++++++++++++++++++++++++++++++++++++++++++++ EgtInterface.rc | Bin 11718 -> 11718 bytes 3 files changed, 94 insertions(+), 3 deletions(-) diff --git a/API_GeomDB.cpp b/API_GeomDB.cpp index a4a71d8..1171f6a 100644 --- a/API_GeomDB.cpp +++ b/API_GeomDB.cpp @@ -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) ; } //----------------------------------------------------------------------------- diff --git a/API_Lua.cpp b/API_Lua.cpp index 646ac9a..252de7a 100644 --- a/API_Lua.cpp +++ b/API_Lua.cpp @@ -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) diff --git a/EgtInterface.rc b/EgtInterface.rc index 7b56192589b05e1ca80ad539554b8f6269cf4988..1950dfb4a66d2a2c0880169a2cfa4a38a99accf1 100644 GIT binary patch delta 95 zcmX>WeJpyzH#SD|&2Rb6GEF|hS;LsV*^z5C3s}UJnK6B`BUk!l10J2pcetKxUL~x< X3{$&A5~Nm93as|59ERF1Wg9L4(as{a delta 95 zcmX>WeJpyzH#SDI&2Rb6GEF|hS;LsN*^z5C3s}UJnK5m$BUk!l10J2pcetKxUL~x< X3{$&A5~Nm93as|59ERF1Wg9L4&@v*f