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


12.17.5.3 32-bit setters and getters

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

                          lowest memory ------------> highest memory
endianness |    word    | 1st byte | 2nd byte | 3rd byte | 4th byte
-----------+------------+----------+----------+----------+----------
  little   | #xAABBCCDD |   DD     |    CC    |    BB    |    AA
   big     | #xAABBCCDD |   AA     |    BB    |    CC    |    DD
bit offset |            |    0     |     8    |    16    |    24

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; ei-val is a fixnum or bignum 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 4.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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