Guardian Native C Library Calls Reference Manual (G06.28+, H06.05+)

Guardian Native C Library Calls (a - e) edfseek(3)
the le.
For absolute positioning (using pos_base value SEEK_SET), pos is the Edit line number multi-
plied by 1000. For example, 23000L corresponds to line 23, and 44120L corresponds to line
44.12.
Using absolute positioning, edfseek() sets the le position to the specied line if and only if the
specied line exists in the le. If the specied line does not exist in the le, edfseek() sets the le
position to the lowest-numbered line whose number exceeds the speci
ed line number. If no
such line exists, edfseek() sets the le position past the end-of-le by selecting the line number
that a subsequent write operation would generate.
For example, assume that a le contains lines 1000, 1500, 2000, 2100. Specifying edfseek(...,
SEEK_SET):
for lines 0..999 sets the position to line 1000.
for lines 1001..1499 sets the position to line 1500.
for line 1500 sets the position to line 1500.
for line 2100 sets the position to line 2100.
for lines 2101 and beyond sets the position to line 3000.
If an Edit le is empty, edfseek(... , SEEK_SET) for any specied line sets the le position to
line 1000.
The purpose of edfseek() with the SEEK_SET option is to set the les current position to a line
that is known to exist: for example, at a line with a location captured by a prior call to edftell().
edfseek(... , SEEK_SET) will not adjust the le position to an arbitrary nonexistent line that the
program intends to generate with a subsequent write. So, if a le contains lines 1000 and 2000,
you cannot use edfseek(fp, 1500, SEEK_SET) to cause fprintf(fp, ... ) to generate a new line
numbered 1500.
RETURN VALUES
Upon successful completion, the value 0 (zero) is returned. Otherwise, edfseek() returns EOF
and sets errno.
ERRORS
If the following condition occurs, the edfseek() function sets errno to the corresponding value:
[EINVAL] The stream is an invalid stream.
For all other error conditions, errno is set to the Guardian le-system error number. Refer to the
Guardian Procedure Errors and Messages Manual for more information about a specic Guar-
dian le-system error.
RELATED INFORMATION
Functions: edftell(3).
STANDARDS CONFORMANCE
The edfseek() function is an HP extension to the XPG4 Version 2 specication.
527192-007 Hewlett-Packard Company 171