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


6.45.7 Peeking values

With all the following functions: the memory argument must be a valid pointer object; 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 peeked 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).

Peeking bitwise sized exact integers

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

Function: pointer-ref-c-sint8 memory offset
Function: pointer-ref-c-uint8 memory offset

Peek the 8 bits located at offset from memory and return them as signed or unsigned exact integer.

Function: pointer-ref-c-sint16 memory offset
Function: pointer-ref-c-uint16 memory offset

Peek the 16 bits located at offset from memory and return them as signed or unsigned exact integer.

Function: pointer-ref-c-sint32 memory offset
Function: pointer-ref-c-uint32 memory offset

Peek the 32 bits located at offset from memory and return them as signed or unsigned exact integer.

Function: pointer-ref-c-sint64 memory offset
Function: pointer-ref-c-uint64 memory offset

Peek the 64 bits located at offset from memory and return them as signed or unsigned exact integer.

Peeking C language exact integers

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

Function: pointer-ref-c-signed-char memory offset
Function: pointer-ref-c-signed-char memory offset

Peek the signed char or unsigned char integer located at offset from memory and return it as signed or unsigned exact integer.

Function: pointer-ref-c-signed-short memory offset
Function: pointer-ref-c-unsigned-short memory offset

Peek the signed short int or unsigned short int integer located at offset from memory and return it as signed or unsigned exact integer.

Function: pointer-ref-c-signed-int memory offset
Function: pointer-ref-c-unsigned-int memory offset

Peek the signed int or unsigned int integer located at offset from memory and return it as signed or unsigned exact integer.

Function: pointer-ref-c-signed-long memory offset
Function: pointer-ref-c-unsigned-long memory offset

Peek the signed long or unsigned long integer located at offset from memory and return it as signed or unsigned exact integer.

Function: pointer-ref-c-signed-long-long memory offset
Function: pointer-ref-c-unsigned-long-long memory offset

Peek the signed long long or unsigned long long integer located at offset from memory and return it as signed or unsigned exact integer.

Function: pointer-ref-c-size_t memory offset

Peek the size_t integer located at offset from memory and return it as exact integer.

Function: pointer-ref-c-ssize_t memory offset

Peek the ssize_t integer located at offset from memory and return it as exact integer.

Function: pointer-ref-c-off_t memory offset

Peek the off_t integer located at offset from memory and return it as exact integer.

Function: pointer-ref-c-ptrdiff_t memory offset

Peek the ptrdiff_t integer located at offset from memory and return it as exact integer.

Peeking floating point numbers

Function: pointer-ref-c-float memory offset

Return the four–byte float (represented as IEEE 754 single precision floating point number) stored at offset from memory. The value is extended to an IEEE 754 double precision floating point number that Vicare uses to represent inexact numbers.

Function: pointer-ref-c-double memory offset

Return the eight–byte float (represented as IEEE 754 double precision floating point number) stored at offset from memory.

Function: pointer-ref-c-double-complex memory offset

Return a cflonum built from the two eight–byte floats (represented as IEEE 754 double precision floating point numbers) stored at offset from memory, real part at the lowest address.

Peeking pointers

Function: pointer-ref-c-pointer memory offset

Return the pointer stored at offset from memory. The size of the pointer (also the number of bytes loaded) depends on the architecture: it is 4 bytes on 32-bit systems and 8 bytes on 64-bit systems.


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