;;;; Unsafe library bytevector operations (module (unsafe srfi-4) (u8vector-length u16vector-length u32vector-length s8vector-length s16vector-length s32vector-length u64vector-length s64vector-length u8vector-ref u16vector-ref u32vector-ref s8vector-ref s16vector-ref s32vector-ref u64vector-ref s64vector-ref u8vector-set! u16vector-set! u32vector-set! s8vector-set! s16vector-set! s32vector-set! u64vector-set! s64vector-set! f32vector-ref f64vector-ref f32vector-set! f64vector-set! f32vector-length f64vector-length ;; blob->f32vector blob->f32vector/shared blob->f64vector blob->f64vector/shared blob->u8vector blob->u8vector/shared blob->s8vector blob->s8vector/shared blob->u16vector blob->u16vector/shared blob->u16vector blob->s16vector/shared blob->u32vector blob->u32vector/shared blob->s32vector blob->s32vector/shared blob->s64vector blob->s64vector/shared blob->u64vector blob->u64vector/shared f32vector->blob f32vector->blob/shared f64vector->blob f64vector->blob/shared u8vector->blob u8vector->blob/shared s8vector->blob s8vector->blob/shared u16vector->blob u16vector->blob/shared u16vector->blob s16vector->blob/shared u32vector->blob u32vector->blob/shared s32vector->blob s32vector->blob/shared s64vector->blob s64vector->blob/shared u64vector->blob u64vector->blob/shared u8vector s8vector u16vector s16vector u32vector s32vector u64vector s64vector f32vector f64vector u8vector? s8vector? u16vector? s16vector? u32vector? s32vector? f32vector? f64vector? subu8vector subs8vector subu16vector subs16vector subu32vector subs32vector subu64vector subs64vector subf32vector subf64vector u8vector->list s8vector->list u16vector->list s16vector->list u32vector->list s32vector->list u64vector->list s64vector->list f32vector->list f64vector->list list->u8vector list->s8vector list->u16vector list->s16vector list->u32vector list->s32vector list->u64vector list->f32vector list->f64vector make-u8vector make-s8vector make-u16vector make-s16vector make-u32vector make-s32vector make-u64vector make-s64vector make-f32vector make-f64vector number-vector? write-u8vector read-u8vector read-u8vector! release-number-vector ) (import scheme) (import (except srfi-4 u8vector-length u16vector-length u32vector-length s8vector-length s16vector-length s32vector-length u64vector-length s64vector-length u8vector-ref u16vector-ref u32vector-ref s8vector-ref s16vector-ref s32vector-ref u64vector-ref s64vector-ref u8vector-set! u16vector-set! u32vector-set! s8vector-set! s16vector-set! s32vector-set! u64vector-set! s64vector-set! f32vector-ref f64vector-ref f32vector-set! f64vector-set! f32vector-length f64vector-length)) (define (u8vector-length x) (##core#inline "C_u_i_u8vector_length" x)) (define (s8vector-length x) (##core#inline "C_u_i_s8vector_length" x)) (define (u16vector-length x) (##core#inline "C_u_i_u16vector_length" x)) (define (s16vector-length x) (##core#inline "C_u_i_s16vector_length" x)) (define (u32vector-length x) (##core#inline "C_u_i_u32vector_length" x)) (define (s32vector-length x) (##core#inline "C_u_i_s32vector_length" x)) (define (u64vector-length x) (##core#inline "C_u_i_u64vector_length" x)) (define (s64vector-length x) (##core#inline "C_u_i_s64vector_length" x)) (define (f32vector-length x) (##core#inline "C_u_i_f32vector_length" x)) (define (f64vector-length x) (##core#inline "C_u_i_f64vector_length" x)) (define (u8vector-ref x y) (##core#inline "C_u_i_u8vector_ref" x y)) (define (s8vector-ref x y) (##core#inline "C_u_i_s8vector_ref" x y)) (define (u16vector-ref x y) (##core#inline "C_u_i_u16vector_ref" x y)) (define (s16vector-ref x y) (##core#inline "C_u_i_s16vector_ref" x y)) (define (u32vector-ref x y) (##core#inline_allocate ("C_a_u_i_u32vector_ref" 6) x y)) (define (s32vector-ref x y) (##core#inline_allocate ("C_a_u_i_s32vector_ref" 6) x y)) (define (u64vector-ref x y) (##core#inline_allocate ("C_a_u_i_u64vector_ref" 7) x y)) (define (s64vector-ref x y) (##core#inline_allocate ("C_a_u_i_s64vector_ref" 7) x y)) (define (f32vector-ref x y) (##core#inline_allocate ("C_a_u_i_f32vector_ref" 4) x y)) (define (f64vector-ref x y) (##core#inline_allocate ("C_a_u_i_f64vector_ref" 4) x y)) (define (u8vector-set! x y z) (##core#inline "C_u_i_u8vector_set" x y z)) (define (s8vector-set! x y z) (##core#inline "C_u_i_s8vector_set" x y z)) (define (u16vector-set! x y z) (##core#inline "C_u_i_u16vector_set" x y z)) (define (s16vector-set! x y z) (##core#inline "C_u_i_s16vector_set" x y z)) (define (u32vector-set! x y z) (##core#inline "C_u_i_u32vector_set" x y z)) (define (s32vector-set! x y z) (##core#inline "C_u_i_s32vector_set" x y z)) (define (u64vector-set! x y z) (##core#inline "C_u_i_u64vector_set" x y z)) (define (s64vector-set! x y z) (##core#inline "C_u_i_s64vector_set" x y z)) (define (f32vector-set! x y z) (##core#inline "C_u_i_f32vector_set" x y (if (##core#inline "C_i_flonump" z) z (##core#inline_allocate ("C_a_u_i_int_to_flo" 4) z)))) (define (f64vector-set! x y z) (##core#inline "C_u_i_f64vector_set" x y (if (##core#inline "C_i_flonump" z) z (##core#inline_allocate ("C_a_u_i_int_to_flo" 4) z)))) )