fliush
[m6w6/ext-psi] / src / compiler.c
1 #include <stdlib.h>
2
3 #include <jit/jit.h>
4
5 #include <php.h>
6 #include <Zend/zend_API.h>
7
8 #include "compiler.h"
9
10 PSI_Compiler *PSI_CompilerInit(PSI_Compiler *C, PSI_Validator *V, void *context)
11 {
12 if (!C) {
13 C = malloc(sizeof(*C));
14 }
15 memset(C, 0, sizeof(*C));
16
17 PSI_DataExchange((PSI_Data *) C, (PSI_Data *) V);
18
19 C->context = context;
20
21 return C;
22 }
23
24 void PSI_CompilerDtor(PSI_Compiler *C)
25 {
26 PSI_DataDtor((PSI_Data *) C);
27 }
28
29 void PSI_Compiler_Free(PSI_Compiler **C)
30 {
31 if (*C) {
32 PSI_CompilerDtor(*C);
33 free(*C);
34 *C = NULL;
35 }
36 }
37
38
39 zend_function_entry *PSI_CompilerCompile(PSI_Compiler *C)
40 {
41 }