Home | Previous Page | Next Page   Function Descriptions >

mi_stream_seek( )

The mi_stream_seek( ) function sets the stream seek position for the next read or write operation on an open stream.

Syntax

mi_integer mi_stream_seek(strm_desc, offset, whence)
   MI_STREAM *strm_desc;
   mi_int8 *offset;
   mi_integer whence;
strm_desc
is a pointer to a stream descriptor for an open stream.
offset
is a pointer to a positive or negative byte offset from the whence seek position.
whence
is a constant that specifies the position from which to start the seek operation to the offset position.
Valid in Client LIBMI Application? Valid in User-Defined Routine?
No Yes
Important:
Enterprise Replication does not support this function.

Usage

The mi_stream_seek( ) function uses the whence and offset arguments to determine the new seek position of the stream that strm_desc references, as follows:

Use the associated stream-open function to obtain the stream descriptor for one of these data streams. You can then pass this stream descriptor to mi_stream_seek( ) to set the seek position on any of these streams. You can also implement an mi_stream_seek( ) function for your own user-defined stream. For more information, see the IBM Informix: DataBlade API Programmer's Guide.

On success, mi_stream_seek( ) returns MI_OK. To obtain the new stream seek position, use mi_stream_tell( ).

Return Values

MI_OK
indicates that the new stream seek position has been set to the combination of whence and offset.
MI_STREAM_EBADARG
indicates that the stream descriptor that strm_desc references or the offset value is invalid, or that the specified seek position is past the end of the data.
MI_STREAM_ENIMPL
indicates that the stream class does not implement the seek position.
MI_ERROR
indicates that the function was not successful.
MI_STREAM_EWHENCE
indicates that the whence value is invalid.

Related Topics

See also the descriptions of mi_stream_open_fio( ), mi_stream_open_mi_lvarchar( ), mi_stream_open_str( ), mi_stream_read( ), mi_stream_setpos( ), mi_stream_tell( ), and mi_stream_write( ).

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]