initial import
[guile-r6rs-libs.git] / modules / r6rs / bytevector.scm
bloba039f9e6bfe72e02c91772b4f0f4ceb8decca4c0
1 ;;; Guile-R6RS-Libs --- Implementation of R6RS standard libraries.
2 ;;; Copyright (C) 2007  Ludovic Courtès <ludovic.courtes@laas.fr>
3 ;;;
4 ;;; Guile-R6RS-Libs is free software; you can redistribute it and/or
5 ;;; modify it under the terms of the GNU Lesser General Public
6 ;;; License as published by the Free Software Foundation; either
7 ;;; version 2.1 of the License, or (at your option) any later version.
8 ;;;
9 ;;; Guile-R6RS-Libs is distributed in the hope that it will be useful,
10 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 ;;; Lesser General Public License for more details.
13 ;;;
14 ;;; You should have received a copy of the GNU Lesser General Public
15 ;;; License along with Guile-R6RS-Libs; if not, write to the Free Software
16 ;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
18 (define-module (r6rs bytevector)
19   :export-syntax (endianness)
20   :export (native-endianness bytevector?
21            make-bytevector bytevector-length bytevector=? bytevector-fill!
22            bytevector-copy! bytevector-copy bytevector-u8-ref
23            bytevector-s8-ref
24            bytevector-u8-set! bytevector-s8-set! bytevector->u8-list
25            u8-list->bytevector bytevector-uint-ref bytevector-sint-ref))
28 (load-extension "libguile-r6rs-v0" "scm_init_r6rs_bytevector")
30 (define-macro (endianness sym)
31   (if (memq sym '(big little))
32       `,sym
33       (error "unsupported endianness" sym)))
35 ;;; arch-tag: 87dcf8cd-88a6-4489-8370-32ef5b3b1d62