-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheli_interface.h
90 lines (79 loc) · 3.82 KB
/
eli_interface.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*!
Copyright 2017-2019, 2021 Maxim Noltmeer (m.noltmeer@gmail.com)
This file is part of Extern Logic Interpreter.
Extern Logic Interpreter is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Extern Logic Interpreter is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Extern Logic Interpreter. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ELI_INTERFACE_H_INCLUDED
#define ELI_INTERFACE_H_INCLUDED
typedef void (__stdcall *func_ptr)(void*); //îïèñûâàåì óêàçàòåëü íà ô-þ èç îñíîâíîãî ïðèëîæåíèÿ
struct ELI_INTERFACE
{
//äîáàâëÿåò ôóíêöèþ â ñòåê
virtual void __stdcall AddFunction(const wchar_t *name, const wchar_t *params, func_ptr fptr) = 0;
//óäàëÿåò ôóíêöèþ èç ñòåêà
virtual void __stdcall DeleteFunction(const wchar_t *name) = 0;
//âûçûâàåò ôóíêöèþ
virtual void __stdcall CallFunction(const wchar_t *name) = 0;
//ïðåîáðàçóåò âîçâðàùàåìîå çíà÷åíèå ôóíêöèè â ñòðîêó è âîçâðàùàåò óêàçàòåëü íà íåå
//â ñëó÷àå îøèáêè âîçâðàùàåò NULL
virtual wchar_t* __stdcall GetFunctionResult(const wchar_t *name) = 0;
//óñòàíàâëèâàåò âîçâðàùàåìîå çíà÷åíèå ôóíêöèè
virtual void __stdcall SetFunctionResult(const wchar_t *name, const wchar_t* result) = 0;
//óñòàíàâëèâàåò íîâîå çíà÷åíèå ïàðàìåòðà èëè äîáàâëÿåò íîâûé ïàðàìåòð
virtual void __stdcall SetParam(const wchar_t *name, const wchar_t *new_val) = 0;
//ïðåîáðàçóåò ïàðàìåòð â integer è âîçâðàùàåò åãî
virtual int __stdcall GetParamToInt(const wchar_t *name) = 0;
//ïðåîáðàçóåò ïàðàìåòð â float è âîçâðàùàåò åãî
virtual float __stdcall GetParamToFloat(const wchar_t *name) = 0;
//ïðåîáðàçóåò ïàðàìåòð â ñòðîêó è âîçâðàùàåò óêàçàòåëü íà íåå
//â ñëó÷àå îøèáêè âîçâðàùàåò NULL
virtual const wchar_t* __stdcall GetParamToStr(const wchar_t *name) = 0;
virtual const wchar_t* __stdcall GetVersion() = 0;
virtual const wchar_t* __stdcall ShowVarStack() = 0;
virtual const wchar_t* __stdcall ShowObjStack() = 0;
virtual const wchar_t* __stdcall ShowClassStack() = 0;
virtual const wchar_t* __stdcall ShowProcStack() = 0;
virtual const wchar_t* __stdcall ShowInfoMessages() = 0;
virtual const wchar_t* __stdcall RunScript(const wchar_t *imptext,
const wchar_t *parameter,
bool log) = 0;
virtual const wchar_t* __stdcall RunScriptFromFile(const wchar_t *filepath,
const wchar_t *parameter,
bool log) = 0;
virtual const wchar_t* __stdcall ShowFuncStack() = 0;
virtual const wchar_t* __stdcall ShowParamStack() = 0;
virtual const wchar_t* __stdcall ShowFragmentStack() = 0;
virtual const wchar_t* __stdcall GetCurrentFuncName() = 0;
virtual void __stdcall SetDebug(bool enable_dbg, bool in_file) = 0;
virtual bool __stdcall DebugEnabled() = 0;
//âîçâðàùàåò ïóòü ê êàòàëîãó, èç êîòîðîãî çàïóùåí ELI
virtual const wchar_t* __stdcall GetInitDir() = 0;
virtual void __stdcall AddToLog(const wchar_t *msg) = 0;
};
//-------------------------------------------------------------------------------
#if defined(BUILD_DLL)
#define DLL_EXPORT __declspec(dllexport)
#else
#if defined(BUILD_APP)
#define DLL_EXPORT __declspec(dllimport)
#else
#define DLL_EXPORT
#endif
#endif
extern "C"
{
DLL_EXPORT int __stdcall GetELIInterface(ELI_INTERFACE **eInterface);
DLL_EXPORT int __stdcall FreeELIInterface(ELI_INTERFACE **eInterface);
}
typedef int (__stdcall *GETELIINTERFACE)(ELI_INTERFACE **eInterface);
typedef int (__stdcall *FREEELIINTERFACE)(ELI_INTERFACE **eInterface);
#endif // ELI_INTERFACE_H_INCLUDED