X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=src%2Fmarshal.h;fp=src%2Fmarshal.h;h=bcf987cf5c1e7abf282576cea7d2560a1fff31be;hp=4e2aab4ae52e1c7ad3620f36c6d22e5a6a7d61c1;hb=2f5af21b263403997e154658635d6b6e6eaab453;hpb=898c6dac30d12d7fe56662d66a8e73c340926d64 diff --git a/src/marshal.h b/src/marshal.h index 4e2aab4..bcf987c 100644 --- a/src/marshal.h +++ b/src/marshal.h @@ -1,6 +1,9 @@ #ifndef _PSI_MARSHAL_H #define _PSI_MARSHAL_H +typedef void (*psi_marshal_set)(zval *return_value, set_value *set, impl_val *ret_val); +typedef impl_val *(*psi_marshal_let)(impl_val *tmp, decl_type *type, impl_arg *iarg, void **to_free); + void psi_to_void(zval *return_value, set_value *set, impl_val *ret_val); void psi_to_bool(zval *return_value, set_value *set, impl_val *ret_val); void psi_to_int(zval *return_value, set_value *set, impl_val *ret_val); @@ -13,17 +16,25 @@ void psi_to_zval(zval *return_value, set_value *set, impl_val *ret_val); void *psi_array_to_union(decl_union *u, HashTable *arr); void *psi_array_to_struct(decl_struct *s, HashTable *arr); -void psi_from_zval(impl_val *mem, decl_arg *spec, zval *zv, void **tmp); - -impl_val *psi_let_void(impl_val *tmp, decl_type *type, impl_arg *iarg, void **to_free); -impl_val *psi_let_boolval(impl_val *tmp, decl_type *type, impl_arg *iarg, void **to_free); -impl_val *psi_let_intval(impl_val *tmp, decl_type *type, impl_arg *iarg, void **to_free); -impl_val *psi_let_floatval(impl_val *tmp, decl_type *type, impl_arg *iarg, void **to_free); -impl_val *psi_let_strval(impl_val *tmp, decl_type *type, impl_arg *iarg, void **to_free); -impl_val *psi_let_pathval(impl_val *tmp, decl_type *type, impl_arg *iarg, void **to_free); -impl_val *psi_let_strlen(impl_val *tmp, decl_type *type, impl_arg *iarg, void **to_free); -impl_val *psi_let_arrval(impl_val *tmp, decl_type *type, impl_arg *iarg, void **to_free); -impl_val *psi_let_objval(impl_val *tmp, decl_type *type, impl_arg *iarg, void **to_free); -impl_val *psi_let_zval(impl_val *tmp, decl_type *type, impl_arg *iarg, void **to_free); +typedef void (*psi_marshal_zval)(void *cb_ctx, impl_val **ptr, decl_arg *spec, token_t cast, zval *zv, void **tmp); + +void psi_from_zval_ex(void *cb_ctx, impl_val **ptr, decl_arg *spec, token_t cast, zval *zv, void **tmp); + +void *psi_array_to_struct_ex(decl_struct *s, HashTable *arr, psi_marshal_zval cb, void *cb_ctx); +void *psi_array_to_union_ex(decl_union *u, HashTable *arr, psi_marshal_zval cb, void *cb_ctx); + +impl_val *psi_let_void(impl_val *tmp, decl_type *decl_type, token_t impl_type, impl_val *ivalue, zval *zvalue, void **to_free); +impl_val *psi_let_boolval(impl_val *tmp, decl_type *decl_type, token_t impl_type, impl_val *ivalue, zval *zvalue, void **to_free); +impl_val *psi_let_intval(impl_val *tmp, decl_type *decl_type, token_t impl_type, impl_val *ivalue, zval *zvalue, void **to_free); +impl_val *psi_let_floatval(impl_val *tmp, decl_type *decl_type, token_t impl_type, impl_val *ivalue, zval *zvalue, void **to_free); +impl_val *psi_let_strval(impl_val *tmp, decl_type *decl_type, token_t impl_type, impl_val *ivalue, zval *zvalue, void **to_free); +impl_val *psi_let_pathval(impl_val *tmp, decl_type *decl_type, token_t impl_type, impl_val *ivalue, zval *zvalue, void **to_free); +impl_val *psi_let_strlen(impl_val *tmp, decl_type *decl_type, token_t impl_type, impl_val *ivalue, zval *zvalue, void **to_free); +impl_val *psi_let_arrval(impl_val *tmp, decl_type *decl_type, token_t impl_type, impl_val *ivalue, zval *zvalue, void **to_free); +impl_val *psi_let_objval(impl_val *tmp, decl_type *decl_type, token_t impl_type, impl_val *ivalue, zval *zvalue, void **to_free); +impl_val *psi_let_zval(impl_val *tmp, decl_type *decl_type, token_t impl_type, impl_val *ivalue, zval *zvalue, void **to_free); + + +typedef impl_val *(*psi_let)(impl_val *tmp, decl_type *decl_type, token_t impl_type, impl_val *ivalue, zval *zvalue, void **to_free); #endif