Next: , Previous: , Up: syslib bytevectors accessors   [Index]


12.17.5.2 16-bit setters and getters

About 16-bit words, we have to remember the following memory layouts:

           |            | lowest memory | highest memory
endianness |    word    | location      | location
-----------+------------+---------------+--------------
  little   |   #xHHLL   |     LL        |     HH
   big     |   #xHHLL   |     HH        |     LL

For these operations: the argument bv is a bytevector object; the argument fx-idx is a non–negative fixnum representing an octet index in the bytevector; fx-val is a fixnum representing a value to be stored in a bytevector.

NOTE For these operations: the index fx-idx does not need to be aligned to a multiple of 2.

Function: $bytevector-u16l-ref bv fx-idx
Function: $bytevector-u16l-set! bv fx-idx fx-val

Setter and getter for unsigned little–endian 16-bit words.

Function: $bytevector-u16b-ref bv fx-idx
Function: $bytevector-u16b-set! bv fx-idx fx-val

Setter and getter for unsigned big–endian 16-bit words.

Function: $bytevector-u16n-ref bv fx-idx
Function: $bytevector-u16n-set! bv fx-idx fx-val

Setter and getter for unsigned native–endian 16-bit words.

Function: $bytevector-s16l-ref bv fx-idx
Function: $bytevector-s16l-set! bv fx-idx fx-val

Setter and getter for signed little–endian 16-bit words.

Function: $bytevector-s16b-ref bv fx-idx
Function: $bytevector-s16b-set! bv fx-idx fx-val

Setter and getter for signed big–endian 16-bit words.

Function: $bytevector-s16n-ref bv fx-idx
Function: $bytevector-s16n-set! bv fx-idx fx-val

Setter and getter for signed native–endian 16-bit words.

Function: $bytevector-u16-ref bv fx-idx endianness
Function: $bytevector-u16-set! bv fx-idx fx-val endianness

Setter and getter for unsigned 16-bit words. endianness must be a symbol among: ‘big’, ‘little’, ‘native’.

Function: $bytevector-s16-ref bv fx-idx endianness
Function: $bytevector-s16-set! bv fx-idx fx-val endianness

Setter and getter for signed 16-bit words. endianness must be a symbol among: ‘big’, ‘little’, ‘native’.


Next: , Previous: , Up: syslib bytevectors accessors   [Index]