How I can call the kernel function?

How can I call the kernel function?

for example: ext\kernel\array.c

int zephir_array_append(zval **arr, zval *value, int flags ZEPHIR_DEBUG_PARAMS)


1.0k

Why you need for?



4.0k
edited Jul '16

I want to reference a array. the zephir can't realize,so I want to achieve through C .

function array_to_tree($arr, $fid, $fparent = 'parent_id', $fchildrens = 'childrens', $returnReferences = false)
{
        $pkvRefs = array();
        foreach ($arr as $offset => $row) {
            $pkvRefs[$row[$fid]] =& $arr[$offset];
        }

        $tree = array();
        foreach ($arr as $offset => $row) {
            $parentId = $row[$fparent];
            if ($parentId) {
                if (!isset($pkvRefs[$parentId])) { continue; }
                $parent =& $pkvRefs[$parentId];
                $parent[$fchildrens][] =& $arr[$offset];
            } else {
                $tree[] =& $arr[$offset];
            }
        }
        if ($returnReferences) {
            return array('tree' => $tree, 'refs' => $pkvRefs);
        } else {
            return $tree;
        }
}


1.0k

If you know C then it would not be the problem. Just pass needed arguments to function