flush
[m6w6/ext-psi] / src / engine.c
index d14bac727bbe0f32ad699480afc10b8bd58ff241..a86cd0b62460e598d782912cb59dd6368fcbd99d 100644 (file)
@@ -29,7 +29,6 @@ size_t psi_t_alignment(token_t t)
                return ALIGNOF_DOUBLE;
        case PSI_T_POINTER:
        case PSI_T_FUNCTION:
-       case PSI_T_STRUCT:
                return ALIGNOF_VOID_P;
        case PSI_T_ENUM:
                return ALIGNOF_INT;
@@ -64,21 +63,6 @@ size_t psi_t_size(token_t t)
        return 0;
 }
 
-size_t psi_t_align(token_t t, size_t s)
-{
-       size_t a = psi_t_alignment(t);
-       return ((s - 1) | (a - 1)) + 1;
-}
-
-size_t psi_offset_padding(size_t diff, size_t alignment)
-{
-       if (diff && diff <= ((diff - 1) | (alignment -1)) + 1) {
-               diff = 0;
-       }
-
-       return diff;
-}
-
 int psi_internal_type(impl_type *type)
 {
        switch (type->type) {
@@ -209,6 +193,8 @@ static inline ZEND_RESULT_CODE psi_parse_args(zend_execute_data *execute_data, i
                        Z_PARAM_PROLOGUE(0);
                } else if (PSI_T_MIXED == iarg->type->type) {
                        Z_PARAM_PROLOGUE(0);
+               } else if (PSI_T_CALLABLE == iarg->type->type) {
+                       Z_PARAM_FUNC_EX(iarg->val.zend.cb.fci, iarg->val.zend.cb.fcc, 1, 0);
                } else {
                        error_code = ZPP_ERROR_FAILURE;
                        break;
@@ -339,6 +325,11 @@ static inline impl_val *psi_let_val(token_t let_func, impl_arg *iarg, impl_val *
                        arg_val->ptr = obj->data;
                }
                break;
+       case PSI_T_CBVAL:
+               if (iarg->type->type == PSI_T_CALLABLE) {
+                       
+               }
+               break;
        EMPTY_SWITCH_DEFAULT_CASE();
        }
        return arg_val;