lib/srfi/n66.ss
;; TODO: rewrite in terms of rnrs bytevectors
(library (srfi n66)
  (export (rename (bytevector? u8vector?)
		  (make-bytevector make-u8vector)
                  (bytevector=? u8vector=?)
		  (bytevector->u8-list u8vector->list)
		  (u8-list->bytevector list->u8vector)
		  (bytevector-length u8vector-length)
		  (bytevector-u8-ref u8vector-ref)
		  (bytevector-u8-set! u8vector-set!)
		  (bytevector-copy u8vector-copy))
          u8vector
          ;FIXME
	  ;u8vector-compare
	  u8vector-copy!)
  (import (rnrs base)
          (rnrs bytevectors))
		        
  ;; FIXME
  ;(define (u8vector-compare v1 v2)
  ;  (cond ((bytes<? v1 v2) -1)
  ;        ((bytes>? v1 v2)  1)
  ;        (else             0)))
    
  (define (u8vector . u8s)
    (u8-list->bytevector u8s))

  (define (u8vector-copy! src src-start dest dest-start n)
    (bytevector-copy! dest dest-start src src-start (+ src-start n)))

  ) ; end srfi-66