The ifx_lo_readwithseek() function

The ifx_lo_readwithseek() function performs a seek operation and then reads a specified number of bytes of data from an open smart large object.

Syntax

mint ifx_lo_readwithseek(LO_fd, buf, nbytes, offset, whence, error)
   char *buf;
   mint nbytes;
   ifx_int8_t *offset;
   mint whence;
   mint *error;
LO_fd
The LO file descriptor for the smart large object from which to read.
buf
A pointer to a character buffer that contains the data that ifx_lo_readwithseek() reads from the smart large object.
nbytes
The size, in bytes, of the buf character buffer. This value cannot exceed 2 gigabytes.
offset
A pointer to the 8-byte integer (INT8) offset from the starting seek position.
whence
A mint value that identifies the starting seek position.
error
A pointer to a mint that contains the error code that ifx_lo_readwithseek() sets.

Usage

The ifx_lo_readwithseek() function reads nbytes of data from the open smart large object that the LO_fd file descriptor identifies.

The read begins at the seek position of LO_fd that the offset and whence arguments indicate, as follows:
  • The whence argument identifies the position from which to start the seek.
    Valid values include the following constants, which the locator.h header file defines.
    Whence constant
    Starting seek position
    LO_SEEK_SET
    The start of the smart large object
    LO_SEEK_CUR
    The current seek position in the smart large object
    LO_SEEK_END
    The end of the smart large object
    • The offset argument identifies the offset, in bytes, from the starting seek position (that the whence argument specifies) to which the seek position is be set.

The function reads this data into the user-defined buffer to which buf points. The size of the buf buffer must be less than 2 GB. To read smart large objects that are larger than 2 GB, read them in 2-GB chunks.

Return codes

>=0
The number of bytes that the function has read from the smart large object into the buf character buffer.
-1
The function was not successful; examine the error for a detailed error code.