simplify parser
[m6w6/ext-psi] / php_psi.h
1
2 #ifndef PHP_PSI_H
3 #define PHP_PSI_H
4
5 extern zend_module_entry psi_module_entry;
6 #define phpext_psi_ptr &psi_module_entry
7
8 #define PHP_PSI_VERSION "0.1.0"
9
10 #ifdef PHP_WIN32
11 # define PHP_PSI_API __declspec(dllexport)
12 #elif defined(__GNUC__) && __GNUC__ >= 4
13 # define PHP_PSI_API __attribute__ ((visibility("default")))
14 #else
15 # define PHP_PSI_API
16 #endif
17
18 #ifdef ZTS
19 #include "TSRM.h"
20 #endif
21
22 #include "context.h"
23 #include "parser.h"
24
25 void psi_error(int type, const char *msg, ...);
26
27 size_t psi_t_alignment(token_t t);
28 size_t psi_t_size(token_t t);
29 size_t psi_t_align(token_t t, size_t s);
30
31 int psi_internal_type(impl_type *type);
32 zend_internal_arg_info *psi_internal_arginfo(impl *impl);
33 size_t psi_num_min_args(impl *impl);
34
35 void psi_to_int(zval *return_value, token_t t, impl_val *ret_val, decl_var *var);
36 void psi_to_double(zval *return_value, token_t t, impl_val *ret_val, decl_var *var);
37 void psi_to_string(zval *return_value, token_t t, impl_val *ret_val, decl_var *var);
38
39 ZEND_RESULT_CODE psi_parse_args(zend_execute_data *execute_data, impl *impl);
40 impl_val *psi_do_let(decl_arg *darg);
41 void psi_do_set(zval *return_value, set_func *func, decl_vars *vars);
42 void psi_do_return(impl *impl, impl_val *ret_val, zval *return_value);
43 void psi_do_free(free_stmt *fre);
44 void psi_do_clean(impl *impl);
45
46 ZEND_BEGIN_MODULE_GLOBALS(psi)
47 char *engine;
48 char *directory;
49 PSI_Context context;
50 ZEND_END_MODULE_GLOBALS(psi);
51
52 #define PSI_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(psi, v)
53
54 #if defined(ZTS) && defined(COMPILE_DL_PSI)
55 ZEND_TSRMLS_CACHE_EXTERN();
56 #endif
57
58 #endif /* PHP_PSI_H */
59
60
61 /*
62 * Local variables:
63 * tab-width: 4
64 * c-basic-offset: 4
65 * End:
66 * vim600: noet sw=4 ts=4 fdm=marker
67 * vim<600: noet sw=4 ts=4
68 */