forked from iskinmike/math_function_module
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmath_function_module.h
More file actions
60 lines (47 loc) · 1.37 KB
/
math_function_module.h
File metadata and controls
60 lines (47 loc) · 1.37 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
* File: math_function_module.h
* Author: m79lol, iskinmike
*
*/
#ifndef MATH_FUNCTION_MODULE_H
#define MATH_FUNCTION_MODULE_H
class MathFunctionModule : public FunctionModule {
FunctionData **math_functions;
#if MODULE_API_VERSION > 000
ModuleInfo *mi;
#endif
public:
MathFunctionModule();
// init
#if MODULE_API_VERSION > 000
const struct ModuleInfo &getModuleInfo();
#else
const char *getUID();
#endif
void prepare(colorPrintfModule_t *colorPrintf_p,
colorPrintfModuleVA_t *colorPrintfVA_p){};
// compiler only
FunctionData **getFunctions(unsigned int *count_functions);
void *writePC(unsigned int *buffer_length);
// intepreter - devices
#if MODULE_API_VERSION > 100
int init();
void final() {};
// intepreter - program & lib
int readPC(int pc_index, void *buffer, unsigned int buffer_length);
// intepreter - program
int startProgram(int run_index, int pc_index);
FunctionResult *executeFunction(int run_index, system_value function_index, void **args);
#else
// intepreter - program & lib
void readPC(void *buffer, unsigned int buffer_length) {};
// intepreter - program
int startProgram(int run_index);
FunctionResult *executeFunction(system_value function_index, void **args);
#endif
int endProgram(int run_index);
// destructor
void destroy();
~MathFunctionModule(){};
};
#endif /* MATH_FUNCTION_MODULE_H */