aboutsummaryrefslogtreecommitdiff
path: root/Src/Plugins/Visualization/vis_avs/evallib/Compiler.h
blob: 2a41d7fd31a6c55ed5896839679f35f94fea0733 (plain) (blame)
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
#ifndef __COMPILER_H
#define __COMPILER_H

#define FN_ASSIGN   0
#define FN_MULTIPLY 1
#define FN_DIVIDE   2
#define FN_MODULO   3
#define FN_ADD      4
#define FN_SUB      5
#define FN_AND      6
#define FN_OR       7
#define FN_UMINUS   8
#define FN_UPLUS    9

#define MATH_SIMPLE 0
#define MATH_FN     1

#ifdef __cplusplus
extern "C" {
#endif
 

int compileCode(char *exp);
void executeCode(int handle, char visdata[2][2][576]);
void freeCode(int handle);



typedef struct {
      char *name;
      void *afunc;
      void *func_e;
      int nParams;
      } functionType;

extern functionType *getFunctionFromTable(int idx);

int createCompiledValue(double value, double *addrValue);
int createCompiledFunction1(int fntype, int fn, int code);
int createCompiledFunction2(int fntype, int fn, int code1, int code2);
int createCompiledFunction3(int fntype, int fn, int code1, int code2, int code3);

#ifdef __cplusplus
}
#endif

#endif