Guardian C Library Calls Reference Manual
edfseek (supplementary)
3-28 128833—Guardian TNS C Library Calls Reference Manual
Reference to Library Calls
pos_base
is one of the following alternatives:
•
SEEK_SET indicates that pos is a line number. The file is positioned at the first line
whose line number is greater than or equal to the line number requested.
•
SEEK_CUR indicates that pos is the number of lines from the file-position
indicator; pos can be positive or negative.
•
SEEK_END indicates that pos is the number of lines from the end of the file; pos
can be either zero or negative. If zero, the file is positioned at the next line to be
written–that is, at the end of the file. If negative, pos specifies how many lines to
skip backwards.
Return Value
is zero if the operation is successful; otherwise, edfseek returns EOF and sets errno
to the Guardian error number.
Usage Guidelines
•
The edfseek function resets the end-of-file and error indicators.
•
If you specify a line beyond the last line in the file, the file is positioned at the
beginning of the next line to be written to the file.
•
If you specify a line before the first line in the file, the file is positioned at the
beginning of the first line.
•
Line numbers are numeric labels that are sorted in numeric order. Because they are
not sequence numbers, a requested line number might not be in the file. This is not
an error, and the line number (the next higher line number in the file), rather than -1,
is returned.
•
Relative positioning (using pos_base values SEEK_CUR or SEEK_END) is slower
than absolute positioning (using pos_base value SEEK_SET) because it requires
sequential scanning of the file.
•
For absolute positioning (using pos_base value SEEK_SET), pos is the Edit line
number multiplied by 1000. For example, 23000L corresponds to line 23, and
44120L corresponds to line 44.12.