Previous: , Up: iklib pointers   [Index]


6.45.9 Peeking values from arrays

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

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: array-ref-c-sint8 memory index
Function: array-ref-c-uint8 memory index

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

Function: array-ref-c-sint16 memory index
Function: array-ref-c-uint16 memory index

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

Function: array-ref-c-sint32 memory index
Function: array-ref-c-uint32 memory index

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

Function: array-ref-c-sint64 memory index
Function: array-ref-c-uint64 memory index

Peek the 64 bits located at index 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: array-ref-c-signed-char memory index
Function: array-ref-c-signed-char memory index

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

Function: array-ref-c-signed-short memory index
Function: array-ref-c-unsigned-short memory index

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

Function: array-ref-c-signed-int memory index
Function: array-ref-c-unsigned-int memory index

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

Function: array-ref-c-signed-long memory index
Function: array-ref-c-unsigned-long memory index

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

Function: array-ref-c-signed-long-long memory index
Function: array-ref-c-unsigned-long-long memory index

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

Function: array-ref-c-size_t memory index

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

Function: array-ref-c-ssize_t memory index

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

Function: array-ref-c-off_t memory index

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

Function: array-ref-c-ptrdiff_t memory index

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

Peeking floating point numbers

Function: array-ref-c-float memory index

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

Function: array-ref-c-double memory index

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

Function: array-ref-c-double-complex memory index

Return a cflonum composed by the two eight–byte floats (represented as IEEE 754 double precision floating point numbers) stored at index from memory.

Peeking pointers

Function: array-ref-c-pointer memory index

Return the pointer stored at index 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.


Previous: , Up: iklib pointers   [Index]