LZSeek

  LONG LZSeek(hFile, lOffset, iOrigin)    
  INT hFile; /* handle identifying file */
  LONG lOffset; /* number of bytes to move */
  INT iOrigin; /* original position */

The LZSeek function moves a file pointer from the position specified by iOrigin to a new position specified by lOffset.

Parameters

hFile

Identifies the source file.

lOffset

Specifies the number of bytes by which the file pointer should be moved.

iOrigin

Specifies the starting position of the pointer. This argument must be one of the following values:

Value Meaning

0  
  Move the file pointer lOffset bytes from the beginning of the file.
1  
  Move the file pointer lOffset bytes from the current position.
2  
  Move the file pointer lOffset bytes from the end of the file.

Return Value

If the function is successful, the return value specifies the offset from the beginning of the file to the new pointer position; if an error occurs, the return value is less than zero. The following list identifies possible error return values and their meaning:

Value Meaning

LZERROR_BADINHANDLE The handle identifying the source file was not valid.
LZERROR_GLOBLOCK The handle identifying the initialization data is not valid.
LZERROR_BADVALUE One of the arguments exceeds the range of acceptable values.

Comments

If the file is not compressed, LZSeek calls _llseek and moves the file pointer by the specified offset.

If the file is compressed, LZSeek emulates _llseek on an expanded image of the file.

See Also

_llseek