X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=psi.d%2Fglob.psi;h=19aa6cb951b02676eda1b74c3ba3ec99bec9c810;hb=2f08002ac0b6de75b0ecb6fe57cbbc70cb2424ae;hp=ce6f5a72c3510a2758c63e5533e3203b545952d3;hpb=cfebc76ed7426836f21296cca9a14b422bfa04cf;p=m6w6%2Fext-psi diff --git a/psi.d/glob.psi b/psi.d/glob.psi index ce6f5a7..19aa6cb 100644 --- a/psi.d/glob.psi +++ b/psi.d/glob.psi @@ -1,8 +1,11 @@ -function psi\glob(string $pattern, int $flags, array &$glob = NULL) : int { +function psi\glob(string $pattern, int $flags, array &$glob = NULL, callable $errfn = NULL) : int { let path = strval($pattern); let flags = intval($flags); - let err = NULL; - let buf = arrval($glob); + let err = callback intval($errfn( + to_string(epath), + to_int(eerrno) + )); + let buf = &arrval($glob); return to_int(glob); set $glob = to_array(*buf, to_int(gl_matchc),