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 7b56192..1950dfb 100644 Binary files a/EgtInterface.rc and b/EgtInterface.rc differ