mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-21 14:49:18 +02:00
allowing link on input parameters for use with functions like readdir
This commit is contained in:
parent
6da435d21c
commit
cb1859c683
2 changed files with 7 additions and 3 deletions
|
@ -25,7 +25,7 @@
|
||||||
(define-c errno (delete-directory "rmdir") (string))
|
(define-c errno (delete-directory "rmdir") (string))
|
||||||
|
|
||||||
(define-c (free DIR) opendir (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))
|
(define-c int (duplicate-fd "dup") (int))
|
||||||
|
|
||||||
|
|
|
@ -683,7 +683,7 @@
|
||||||
((type-array ret-type) " tmp = ")
|
((type-array ret-type) " tmp = ")
|
||||||
(else " res = ")))
|
(else " res = ")))
|
||||||
((if (type-array ret-type)
|
((if (type-array ret-type)
|
||||||
(lambda (t f) (f))
|
(lambda (t f x) (f))
|
||||||
c->scheme-converter)
|
c->scheme-converter)
|
||||||
ret-type
|
ret-type
|
||||||
(lambda ()
|
(lambda ()
|
||||||
|
@ -709,7 +709,11 @@
|
||||||
arg
|
arg
|
||||||
(string-append "arg" (type-index-string arg))))))
|
(string-append "arg" (type-index-string arg))))))
|
||||||
c-args)
|
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")
|
(cat ";\n")
|
||||||
(if (type-array ret-type)
|
(if (type-array ret-type)
|
||||||
(write-result ret-type))))
|
(write-result ret-type))))
|
||||||
|
|
Loading…
Add table
Reference in a new issue