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


6.45.6 Poking values

With all the following functions: the memory argument must be a valid pointer object or memory-block instance; the offset 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 not scale the offset to the size of the poked value; pointer arithmetics is performed with byte offsets.

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: pointer-set-c-sint8! memory offset value
Function: pointer-set-c-uint8! memory offset value

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

Function: pointer-set-c-sint16! memory offset value
Function: pointer-set-c-uint16! memory offset value

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

Function: pointer-set-c-sint32! memory offset value
Function: pointer-set-c-uint32! memory offset value

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

Function: pointer-set-c-sint64! memory offset value
Function: pointer-set-c-uint64! memory offset value

Set to value the eigth bytes of memory located at offset 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: pointer-set-c-signed-char! memory offset value
Function: pointer-set-c-unsigned-char! memory offset value

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

Function: pointer-set-c-signed-short! memory offset value
Function: pointer-set-c-unsigned-short! memory offset value

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

Function: pointer-set-c-signed-int! memory offset value
Function: pointer-set-c-unsigned-int! memory offset value

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

Function: pointer-set-c-signed-long! memory offset value
Function: pointer-set-c-unsigned-long! memory offset value

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

Function: pointer-set-c-signed-long-long! memory offset value
Function: pointer-set-c-unsigned-long-long! memory offset value

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

Function: pointer-set-c-size_t! memory offset value

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

Function: pointer-set-c-ssize_t! memory offset value

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

Function: pointer-set-c-off_t! memory offset value

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

Function: pointer-set-c-ptrdiff_t! memory offset value

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

Poking floating point numbers

Function: pointer-set-c-float! memory offset 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 offset from memory.

Function: pointer-set-c-double! memory offset flonum

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

Function: pointer-set-c-double-complex! memory offset cflonum

Store the double precision IEEE 754 floating point values composing the Scheme cflonum in the 16 bytes at offset from memory, real part at the lowest address.

Poking pointers

Function: pointer-set-c-pointer! memory offset value

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


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