Next: , Previous: , Up: iklib pointers   [Index]


6.45.8 Poking values into arrays

With all the following functions: the memory argument must be a valid pointer object or memory-block instance; the index argument must be an exact integer in the range of the C language type ptrdiff_t. When adding an offset to a pointer: all the following functions do scale the index to the size of the poked value.

The following bindings are exported by the libraries (vicare) and (vicare system $foreign) and reexported by the library (vicare ffi).

Poking bitwise sized exact integers

The following functions store signed and unsigned exact integers in raw memory location selecting the size with the number of bits required to represent the value.

Function: array-set-c-sint8! memory index value
Function: array-set-c-uint8! memory index value

Set to value the single byte of memory located at index from memory. VALUE must be an exact integer in the range representable by 8 bits.

Function: array-set-c-sint16! memory index value
Function: array-set-c-uint16! memory index value

Set to value the two bytes of memory located at index from memory. VALUE must be an exact integer in the range representable by 16 bits.

Function: array-set-c-sint32! memory index value
Function: array-set-c-uint32! memory index value

Set to value the four bytes of memory located at index from memory. VALUE must be an exact integer in the range representable by 32 bits.

Function: array-set-c-sint64! memory index value
Function: array-set-c-uint64! memory index value

Set to value the eight bytes of memory located at index from memory. VALUE must be an exact integer in the range representable by 64 bits.

Poking C language exact integers

The following functions store signed and unsigned exact integers in raw memory locations selecting the size according to the one used by the C language implementation.

Function: array-set-c-signed-char! memory index value
Function: array-set-c-unsigned-char! memory index value

Set to value a number of bytes corresponding to the signed char or unsigned char type located at index from memory.

Function: array-set-c-signed-short! memory index value
Function: array-set-c-unsigned-short! memory index value

Set to value a number of bytes corresponding to the signed short int or unsigned short int type located at index from memory.

Function: array-set-c-signed-int! memory index value
Function: array-set-c-unsigned-int! memory index value

Set to value a number of bytes corresponding to the signed int or unsigned int type located at index from memory.

Function: array-set-c-signed-long! memory index value
Function: array-set-c-unsigned-long! memory index value

Set to value a number of bytes corresponding to the signed long or unsigned long type located at index from memory.

Function: array-set-c-signed-long-long! memory index value
Function: array-set-c-unsigned-long-long! memory index value

Set to value a number of bytes corresponding to the signed long long or unsigned long long type located at index from memory.

Function: array-set-c-size_t! memory index value

Set to value a number of bytes corresponding to the size_t type located at index from memory.

Function: array-set-c-ssize_t! memory index value

Set to value a number of bytes corresponding to the ssize_t type located at index from memory.

Function: array-set-c-off_t! memory index value

Set to value a number of bytes corresponding to the off_t type located at index from memory.

Function: array-set-c-ptrdiff_t! memory index value

Set to value a number of bytes corresponding to the ptrdiff_t type located at index from memory.

Poking floating point numbers

Function: array-set-c-float! memory index flonum

Convert the Scheme floating point number flonum (represented in Vicare as an IEEE 754 double precision floating point number) to a float (an IEEE 754 single precision floating point number) and store the result in the four bytes at index from memory.

Function: array-set-c-double! memory index flonum

Store the double precision IEEE 754 floating point value of the Scheme flonum in the eight bytes at index from memory.

Function: array-set-c-double-complex! memory index cflonum

Store the double precision IEEE 754 floating point values composing the Scheme cflonum in the 16 bytes at index from memory.

Poking pointers

Function: array-set-c-pointer! memory index value

Store address of the raw memory location referenced by the pointer value at index from memory.


Next: , Previous: , Up: iklib pointers   [Index]