Chapter 3 Terminal Specific Function Library
205
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; /* file handle of the associated DBF file */
int key_number; /* key number of the target IDX file */
long offset; /* offset of new position, sequence number from origin */
int origin; /* constant indicating the position from where to offset */
Example
lseek_DBF (DBF_fd, 1, 1L, 0); /* move to next member */
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
the first index of IDX file
0
current index pointer position
-1
the last index of IDX file
Return
If successful, it returns the sequence number of offset.
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
Interpretation
2
File specified by
DBF_fd
does not exist.
4
File specified by
DBF_fd
is not a DBF file.
7
Invalid file handle.
8
File not opened.
9
Invalid value in argument:
origin
13
Invalid value in argument:
key_number
.
14
IDX file specified by
key_number
does not exist.
15
New position is beyond end-of-file.
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; /* file handle of the target DBF file */
Содержание Optimus R
Страница 1: ...Printed on 20 March 2006 C Programming Guide Version 3 04 02 Optimus S Optimus R...
Страница 6: ......
Страница 8: ...2 C Programming Guide For Optimus S R...
Страница 12: ...6 C Programming Guide For Optimus S R The flow is illustrated as shown below...
Страница 23: ...Chapter 2 Development Environment 17 Different types signed unsigned Different types same size...
Страница 24: ...18 C Programming Guide For Optimus S R...
Страница 220: ...214 C Programming Guide For Optimus S R See Also FlashSize free_memory...
Страница 232: ...226 C Programming Guide For Optimus S R 4 11 Implementation defined Limits limits h float h Refer to limit h and float h...
Страница 238: ...232 C Programming Guide For Optimus S R...