d75c19ed829106580848241504575919f7f79402
[m6w6/ext-psi] / src / context.h
1 #ifndef _PSI_CONTEXT_H
2 #define _PSI_CONTEXT_H
3
4 #define PSI_ERROR 16
5 #define PSI_WARNING 32
6 typedef void (*PSI_ContextErrorFunc)(int type, const char *msg, ...);
7
8 typedef struct PSI_ContextOps {
9 void (*init)(struct PSI_Context *C);
10 void (*dtor)(struct PSI_Context *C);
11 zend_function_entry *(*compile)(struct PSI_Context *C, struct PSI_Data *D);
12 } PSI_ContextOps;
13
14 typedef struct PSI_Context {
15 void *opaque;
16 PSI_ContextErrorFunc error;
17 struct PSI_ContextOps *ops;
18 struct PSI_Data *data;
19 zend_function_entry **closures;
20 size_t count;
21 } PSI_Context;
22
23 PSI_Context *PSI_ContextInit(PSI_Context *C, PSI_ContextOps *ops, PSI_ContextErrorFunc error);
24 void PSI_ContextBuild(PSI_Context *C, const char *path);
25 zend_function_entry *PSI_ContextCompile(PSI_Context *C, PSI_Data *D);
26 void PSI_ContextDtor(PSI_Context *C);
27 void PSI_ContextFree(PSI_Context **C);
28
29 #endif