mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 21:59:17 +02:00
72 lines
3 KiB
Text
72 lines
3 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 (result 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)))
|
|
|
|
(c-include-verbatim "port.c")
|
|
|
|
(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 off_t (file-position "ftell") (port))
|
|
;; (define-c off_t (set-file-position! "fseek") (port off_t int))
|
|
|
|
(define-c sexp (file-position "sexp_tell")
|
|
((value ctx sexp) (value self sexp) sexp))
|
|
(define-c sexp (set-file-position! "sexp_seek")
|
|
((value ctx sexp) (value self sexp) sexp off_t int))
|
|
|
|
(define-c boolean (is-a-socket? "sexp_is_a_socket_p") (fileno))
|
|
|
|
(define-c errno (%send-file "sexp_send_file")
|
|
(fileno fileno off_t (default 0 off_t) (result off_t)))
|
|
|
|
(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))
|
|
|
|
(define-c sexp (%make-custom-binary-input-port "sexp_make_custom_binary_input_port")
|
|
((value ctx sexp) (value self sexp) sexp sexp sexp))
|
|
|
|
(define-c sexp (%make-custom-binary-output-port "sexp_make_custom_binary_output_port")
|
|
((value ctx sexp) (value self sexp) sexp sexp sexp))
|
|
|
|
(define-c sexp (open-input-bytevector "sexp_open_input_bytevector")
|
|
((value ctx sexp) (value self sexp) sexp))
|
|
(define-c sexp (open-output-bytevector "sexp_open_output_bytevector")
|
|
((value ctx sexp) (value self sexp)))
|
|
(define-c sexp (get-output-bytevector "sexp_get_output_bytevector")
|
|
((value ctx sexp) (value self sexp) sexp))
|
|
|
|
(define-c sexp (string-count-chars "sexp_string_count")
|
|
((value ctx sexp) (value self sexp) sexp sexp sexp (default NULL sexp)))
|
|
(define-c sexp (%string->utf8 "sexp_string_to_utf8")
|
|
((value ctx sexp) (value self sexp) sexp))
|
|
(define-c sexp (string->utf8! "sexp_string_to_utf8_x")
|
|
((value ctx sexp) (value self sexp) sexp))
|
|
(define-c sexp (string-offset "sexp_string_offset_op")
|
|
((value ctx sexp) (value self sexp) sexp))
|
|
(define-c sexp (utf8->string! "sexp_utf8_to_string_x")
|
|
((value ctx sexp) (value self sexp) sexp sexp sexp))
|
|
|
|
(define-c sexp (utf8-ref "sexp_utf8_ref")
|
|
((value ctx sexp) (value self sexp) sexp sexp))
|
|
(define-c sexp (utf8-next "sexp_utf8_next")
|
|
((value ctx sexp) (value self sexp) sexp sexp sexp))
|
|
(define-c sexp (utf8-prev "sexp_utf8_prev")
|
|
((value ctx sexp) (value self sexp) sexp sexp sexp))
|
|
|
|
(define-c sexp (write-u8 "sexp_write_u8")
|
|
((value ctx sexp) (value self sexp) sexp (default (current-output-port) sexp)))
|
|
(define-c sexp (read-u8 "sexp_read_u8")
|
|
((value ctx sexp) (value self sexp) (default (current-input-port) sexp)))
|
|
(define-c sexp (peek-u8 "sexp_peek_u8")
|
|
((value ctx sexp) (value self sexp) (default (current-input-port) sexp)))
|