diff --git a/scsh/bytio/README b/scsh/bytio/README new file mode 100644 index 0000000..10d23dd --- /dev/null +++ b/scsh/bytio/README @@ -0,0 +1,37 @@ +sunterlib/scsh/bytio -- Byte I/O + +Procedures + +(read-byte [inport]) --> n in [0:256) +(peek-byte [inport]) --> n in [0:256) +(write-byte n [outport]) --> unspec + +Synopsis: Obvious byte analogues to Scheme's character readers and +writers. [ Presently these are only wrappers around the char procs. +That means, the system reads octets, cooks them into characters, that +we rever to raw numeric meat, small integers in [0:256). ] + + * + +(read-bytes n [fd/port]) --> bytes or #f +(read-bytes/partial n [fd/port]) --> bytes pr #f + +(read-bytes! bytes [fd/port start end]) --> nread or #f +(read-bytes!/partial bytes [fd/port start end]) --> nread or #f + +(write-bytes bytes [fd/port start end]) --> unspec + +Synopsis: Obvious byte analogues of the corresponding string procs +documented in the scsh manual, with byte-vectors BYTES replacing +strings. (String arguments BYTES work, too.) + +Notes: +* Byte-vector constructors etc. are in structure BYTE-VECTORS. +* The present implementation avoids allocating temp buffers by not + always reading very much ... +* The procedures aren't tested well, yet. + + 0Oo + + + diff --git a/scsh/bytio/packages.scm b/scsh/bytio/packages.scm index 8c28b41..e801cbf 100644 --- a/scsh/bytio/packages.scm +++ b/scsh/bytio/packages.scm @@ -4,13 +4,16 @@ ;; byte (rather than character) i/o (define-structure bytio bytio-face (open krims ; assert - scheme + sequence-lib ; subsequence sequence-length byte-vectors + let-opt ; let-optionals + srfi-23 ; error + scsh ; fdes & port stuff, bitwise-and + scheme ascii ; char<->ascii i/o ; read-block ports ; port-buffer primitives ; copy-bytes! - let-opt ; let-optionals ) (files rw-bytes))