X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=psi.d%2Fglob.psi;fp=psi.d%2Fglob.psi;h=3f8ee1e37e16f105941f75029ae148a10ae2eea6;hp=0000000000000000000000000000000000000000;hb=22ca720deabdb92ebedf4c9c82d758671c9d5f3d;hpb=61918592ab618c073b9846783ce79fed9f26c5f7 diff --git a/psi.d/glob.psi b/psi.d/glob.psi new file mode 100644 index 0000000..3f8ee1e --- /dev/null +++ b/psi.d/glob.psi @@ -0,0 +1,18 @@ +extern void globfree(glob_t *buf); + +extern int glob(char *pat, int flags, void *err, glob_t *buf); +function psi\glob(string $pattern, int $flags, array &$glob = NULL) : int { + let pat = strval($pattern); + let flags = intval($flags); + let err = NULL; + let buf = arrval($glob); + return to_int(glob); + set $glob = to_array(*buf, + to_int(gl_matchc), + to_int(gl_pathc), + to_int(gl_offs), + to_int(gl_flags), + to_array(**gl_pathv, gl_pathc, gl_offs, to_string(*gl_pathv)) + ); + //free globfree(buf); +}