travis trusty
[m6w6/ext-psi] / src / marshal.h
1 #ifndef _PSI_MARSHAL_H
2 #define _PSI_MARSHAL_H
3
4 typedef void (*psi_marshal_set)(zval *return_value, set_value *set, impl_val *ret_val);
5 typedef impl_val *(*psi_marshal_let)(impl_val *tmp, decl_type *decl_type, token_t impl_type, impl_val *ivalue, zval *zvalue, void **to_free);
6
7 void psi_to_void(zval *return_value, set_value *set, impl_val *ret_val);
8 void psi_to_bool(zval *return_value, set_value *set, impl_val *ret_val);
9 void psi_to_int(zval *return_value, set_value *set, impl_val *ret_val);
10 void psi_to_double(zval *return_value, set_value *set, impl_val *ret_val);
11 void psi_to_string(zval *return_value, set_value *set, impl_val *ret_val);
12 void psi_to_recursive(zval *return_value, set_value *set, impl_val *r_val);
13 void psi_to_array(zval *return_value, set_value *set, impl_val *ret_val);
14 void psi_to_object(zval *return_value, set_value *set, impl_val *ret_val);
15 void psi_to_zval(zval *return_value, set_value *set, impl_val *ret_val);
16
17 void *psi_array_to_union(decl_union *u, HashTable *arr);
18 void *psi_array_to_struct(decl_struct *s, HashTable *arr);
19
20 typedef void (*psi_marshal_zval)(void *cb_ctx, impl_val **ptr, decl_arg *spec, token_t cast, zval *zv, void **tmp);
21
22 void psi_from_zval_ex(void *cb_ctx, impl_val **ptr, decl_arg *spec, token_t cast, zval *zv, void **tmp);
23
24 void *psi_array_to_struct_ex(decl_struct *s, HashTable *arr, psi_marshal_zval cb, void *cb_ctx);
25 void *psi_array_to_union_ex(decl_union *u, HashTable *arr, psi_marshal_zval cb, void *cb_ctx);
26
27 impl_val *psi_let_void(impl_val *tmp, decl_type *decl_type, token_t impl_type, impl_val *ivalue, zval *zvalue, void **to_free);
28 impl_val *psi_let_boolval(impl_val *tmp, decl_type *decl_type, token_t impl_type, impl_val *ivalue, zval *zvalue, void **to_free);
29 impl_val *psi_let_intval(impl_val *tmp, decl_type *decl_type, token_t impl_type, impl_val *ivalue, zval *zvalue, void **to_free);
30 impl_val *psi_let_floatval(impl_val *tmp, decl_type *decl_type, token_t impl_type, impl_val *ivalue, zval *zvalue, void **to_free);
31 impl_val *psi_let_strval(impl_val *tmp, decl_type *decl_type, token_t impl_type, impl_val *ivalue, zval *zvalue, void **to_free);
32 impl_val *psi_let_pathval(impl_val *tmp, decl_type *decl_type, token_t impl_type, impl_val *ivalue, zval *zvalue, void **to_free);
33 impl_val *psi_let_strlen(impl_val *tmp, decl_type *decl_type, token_t impl_type, impl_val *ivalue, zval *zvalue, void **to_free);
34 impl_val *psi_let_arrval(impl_val *tmp, decl_type *decl_type, token_t impl_type, impl_val *ivalue, zval *zvalue, void **to_free);
35 impl_val *psi_let_objval(impl_val *tmp, decl_type *decl_type, token_t impl_type, impl_val *ivalue, zval *zvalue, void **to_free);
36 impl_val *psi_let_zval(impl_val *tmp, decl_type *decl_type, token_t impl_type, impl_val *ivalue, zval *zvalue, void **to_free);
37
38 #endif