"Fossies" - the Fresh Open Source Software Archive

Member "txr-217/tests/017/glob-zarray.tl" (10 Jun 2019, 1033 Bytes) of package /linux/misc/txr-217.tar.bz2:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 (load "../common")
    2 
    3 (defstruct glob-t nil
    4   pathc pathv (reserve 0))
    5 
    6 (caseq (os-symbol)
    7   (:macos
    8     (deffi-type glob-t (struct glob-t
    9                          (pathc size-t)
   10                          (nil int)
   11                          (nil size-t)
   12                          (nil int)
   13 			 (pathv (ptr-out-d (zarray str-d)))
   14                          (nil (array 4 cptr)))))
   15   ((:cygnal :cygwin)
   16     (deffi-type glob-t (struct glob-t
   17                          (pathc size-t)
   18 			 (nil size-t)
   19 			 (nil size-t)
   20 			 (nil int)
   21 			 (pathv (ptr-out-d (zarray str-d)))
   22 			 (nil (array 6 cptr)))))
   23   (t (deffi-type glob-t (struct glob-t
   24                           (pathc size-t)
   25 			  (pathv (ptr-out-d (zarray str-d)))
   26                           (reserve size-t)
   27                           (nil (array 5 cptr))))))
   28 
   29 (with-dyn-lib (libc)
   30   (deffi globb "glob" int (str int closure (ptr-out glob-t)))
   31   (deffi-cb glob-cb int (str int) -1))
   32 
   33 (let* ((g (new glob-t)))
   34   (prinl (globb "tests/001/*.txr" 0 (glob-cb (lambda (path err))) g))
   35   (prinl g))