Use SHARED-INITIALIZE instead of INITIALIZE-INSTANCE for FILE-DEVICEs.
[iolib.git] / io.streams / zeta / misc.lisp
blob0d65dd739f706b8b7994bac205e822fb4b698e11
1 (in-package :io.zeta-streams)
3 (defun device-write-string (device string)
4 (let ((octets (babel:string-to-octets string :encoding :utf-8)))
5 (device-write device octets)))
7 (defun device-terpri (device)
8 (device-write device #.(coerce #(#xA) 'ub8-simple-vector)))
10 (defun device-write-line (device string)
11 (device-write-string device string)
12 (device-terpri device))
14 (defun device-read-char (device)
15 (let ((vector (make-iobuf-data-vector 1)))
16 (device-read device vector)
17 (code-char (aref vector 0))))