types refactoring
[m6w6/ext-psi] / src / context.h
1 #ifndef _PSI_CONTEXT_H
2 #define _PSI_CONTEXT_H
3
4 struct psi_context;
5 struct psi_token;
6 struct psi_parser;
7 struct decl_callinfo;
8 struct impl_vararg;
9
10 struct psi_context_ops {
11 void (*init)(struct psi_context *C);
12 void (*dtor)(struct psi_context *C);
13 zend_function_entry *(*compile)(struct psi_context *C);
14 void (*call)(struct psi_context *C, struct decl_callinfo *decl_call, struct impl_vararg *va);
15 };
16
17 #include "data.h"
18
19 struct psi_context {
20 PSI_DATA_MEMBERS;
21 void *context;
22 struct psi_context_ops *ops;
23 zend_function_entry *closures;
24 struct psi_data *data;
25 size_t count;
26 };
27
28 struct psi_context *psi_context_init(struct psi_context *C, struct psi_context_ops *ops, psi_error_cb error, unsigned flags);
29 void psi_context_build(struct psi_context *C, const char *path);
30 int psi_context_validate(struct psi_context *C, struct psi_parser *P);
31 int psi_context_validate_data(struct psi_data *C, struct psi_data *D);
32 zend_function_entry *psi_context_compile(struct psi_context *C);
33 void psi_context_call(struct psi_context *C, struct decl_callinfo *decl_call, struct impl_vararg *va);
34 void psi_context_dump(struct psi_context *C, int fd);
35 void psi_context_dtor(struct psi_context *C);
36 void psi_context_free(struct psi_context **C);
37
38 #endif