allowing link on input parameters for use with functions like readdir

This commit is contained in:
Alex Shinn 2009-12-22 22:55:46 +09:00
parent 6da435d21c
commit cb1859c683
2 changed files with 7 additions and 3 deletions

View file

@ -25,7 +25,7 @@
(define-c errno (delete-directory "rmdir") (string))
(define-c (free DIR) opendir (string))
(define-c dirent readdir (DIR))
(define-c dirent readdir ((link DIR)))
(define-c int (duplicate-fd "dup") (int))

View file

@ -683,7 +683,7 @@
((type-array ret-type) " tmp = ")
(else " res = ")))
((if (type-array ret-type)
(lambda (t f) (f))
(lambda (t f x) (f))
c->scheme-converter)
ret-type
(lambda ()
@ -709,7 +709,11 @@
arg
(string-append "arg" (type-index-string arg))))))
c-args)
(cat ")")))
(cat ")"))
(cond
((any type-link? (func-c-args func))
=> (lambda (a) (string-append "arg" (type-index-string a))))
(else #f)))
(cat ";\n")
(if (type-array ret-type)
(write-result ret-type))))