mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-20 14:19:18 +02:00
27 lines
1 KiB
Text
27 lines
1 KiB
Text
|
|
(define-c non-null-string (%read-line "fgets")
|
|
((result (array char arg1)) int (default (current-input-port) input-port)))
|
|
|
|
(define-c size_t (%read-string "fread")
|
|
((result (array char arg2)) (value 1 size_t) size_t (default (current-input-port) input-port)))
|
|
|
|
(define-c size_t (%read-string! "fread")
|
|
(string (value 1 size_t) size_t (default (current-input-port) input-port)))
|
|
|
|
(define-c size_t (write-string "fwrite")
|
|
(string (value 1 size_t) size_t (default (current-output-port) output-port)))
|
|
|
|
(define-c-const int (seek/set "SEEK_SET"))
|
|
(define-c-const int (seek/cur "SEEK_CUR"))
|
|
(define-c-const int (seek/end "SEEK_END"))
|
|
|
|
(define-c long (file-position "ftell") (port))
|
|
(define-c long (set-file-position! "fseek") (port long int))
|
|
|
|
(c-include "port.c")
|
|
|
|
(define-c sexp (%make-custom-input-port "sexp_make_custom_input_port")
|
|
((value ctx sexp) (value self sexp) sexp sexp sexp))
|
|
|
|
(define-c sexp (%make-custom-output-port "sexp_make_custom_output_port")
|
|
((value ctx sexp) (value self sexp) sexp sexp sexp))
|