-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathfunction_module.h
More file actions
38 lines (30 loc) · 1.05 KB
/
function_module.h
File metadata and controls
38 lines (30 loc) · 1.05 KB
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
/*
* File: function_module.h
* Author: m79lol
*
*/
#ifndef FUNCTION_MODULE_H
#define FUNCTION_MODULE_H
class FunctionModule {
protected:
FunctionModule() {}
public:
//init
virtual const char *getUID() = 0;
virtual void prepare(colorPrintf_t *colorPrintf_p, colorPrintfVA_t *colorPrintfVA_p) = 0;
//compiler only
virtual FunctionData** getFunctions(unsigned int *count_functions) = 0;
virtual void *writePC(unsigned int *buffer_length) = 0;
//intepreter - program
virtual FunctionResult* executeFunction(system_value function_index, void **args) = 0;
virtual int startProgram(int uniq_index, void *buffer, unsigned int buffer_length) = 0;
virtual int endProgram(int uniq_index) = 0;
//destructor
virtual void destroy() = 0;
virtual ~FunctionModule() {}
};
typedef FunctionModule* (*getFunctionModuleObject_t)();
extern "C" {
PREFIX_FUNC_DLL FunctionModule* getFunctionModuleObject();
}
#endif /* FUNCTION_MODULE_H */