Files
EgtInterface/API_Lua.cpp
T
Dario Sassi 46c5fce044 EgtInterface 1.5j4 :
- ora si imposta un context corrente anche per le API come per LUA
- il context corrente di LUA coincide con quello delle API.
2014-10-15 15:31:00 +00:00

52 lines
1.6 KiB
C++

//----------------------------------------------------------------------------
// EgalTech 2014-2014
//----------------------------------------------------------------------------
// File : API_LUA.cpp Data : 28.09.14 Versione : 1.5i5
// Contenuto : Funzioni esecuzione LUA per API.
//
//
//
// Modifiche : 28.09.14 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
//--------------------------- Include ----------------------------------------
#include "stdafx.h"
#include "API.h"
#include "LUA.h"
#include "/EgtDev/Include/EInAPI.h"
#include "/EgtDev/Include/EGnStringConverter.h"
using namespace std ;
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtLuaExecLine( const wchar_t* wsLine)
{
// eseguo il comando
return ( LuaExecLine( wstrztoA( wsLine)) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtLuaExecFile( const wchar_t* wsFilePath)
{
// converto nome file
string sFilePath = wstrztoA( wsFilePath) ;
// emetto info
string sInfo = "Exec File = " + sFilePath ;
LOG_INFO( GetLogger(), sInfo.c_str())
// esecuzione script
return ( LuaExecFile( sFilePath) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtLuaGetLastError( wchar_t*& wsError)
{
wsError = _wcsdup( stringtoW( LuaGetLastError())) ;
return (( wsError == nullptr) ? FALSE : TRUE) ;
}