Metrologic Optimus S Programming Manual page 211

"c" programming guide
Table of Contents

Advertisement

lseek_DBF
Purpose
To reposition the file pointer of an IDX file.
Syntax
long lseek_DBF (int DBF_fd, int key_number, long offset, int origin);
int DBF_fd;
int key_number;
long offset;
int origin;
Example
lseek_DBF (DBF_fd, 1, 1L, 0);
Description
This routine reposition the file pointer of an IDX file (key_number), which is
associated with a DBF file (DBF_fd), by seeking a number specified by the
argument offset from the given position origin.
The value of origin can be one of the three values:
1
0
-1
If successful, it returns the sequence number of offset.
Return
On error, it returns -1L.
An error code is set to the global variable fErrorCode to indicate the error
condition encountered. Below are possible error codes and their interpretation.
Error Code
2
4
7
8
9
13
14
15
See Also
tell_DBF
member_in_DBF
Purpose
To determine how many members exist in a DBF file.
Syntax
long member_in_DBF (int DBF_fd);
int DBF_fd;
Chapter 3 Terminal Specific Function Library
/* offset of new position, sequence number from origin */
/* constant indicating the position from where to offset */
the first index of IDX file
current index pointer position
the last index of IDX file
Interpretation
File specified by DBF_fd does not exist.
File specified by DBF_fd is not a DBF file.
Invalid file handle.
File not opened.
Invalid value in argument: origin
Invalid value in argument: key_number.
IDX file specified by key_number does not exist.
New position is beyond end-of-file.
/* file handle of the associated DBF file */
/* key number of the target IDX file */
/* move to next member */
/* file handle of the target DBF file */
205

Advertisement

Table of Contents
loading

This manual is also suitable for:

Optimus r

Table of Contents