Guardian Native C Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
Guardian Native C Library Calls (a - e) edfseek(3)
NAME
edfseek - Sets the file-position indicator of an Edit file opened for ANSI I/O
LIBRARY
G-series Guardian native processes: $SYSTEM.SYSnn.ZCRTLSRL
G-series OSS native processes: /G/system/sysnn/zcrtlsrl
H-series and J-series Guardian native processes: $SYSTEM.ZDLLnnn.ZCRTLDLL
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zcrtldll
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/ycrtldll
SYNOPSIS
#include <stdio.h>
int edfseek(
FILE *stream,
long pos,
int pos_base);
PARAMETERS
stream Denotes an Edit file opened for ANSI I/O.
pos Specifies the desired file position. Depending on pos_base, the file position is
either a line number or a line offset.
pos_base Specifies whether the positioning is absolute or relative. pos is one of the fol-
lowing:
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 (the end of the file). If negative, pos
specifies how many lines to skip backwards.
DESCRIPTION
The edfseek() function sets the file-position indicator of an Edit file opened for ANSI I/O. If the
specified line exists, the file position is set to the beginning of that line. If the line does not exist,
the file position is set to the beginning of a line chosen by edfseek().
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.
The edfseek() function can be called from Guardian modules (modules compiled for the Guar-
dian environment) within Guardian and OSS processes. It cannot be called from OSS modules.
The Edit file must be opened with the fopen() or freopen() Guardian functions variants. Refer
to the fopen(3) or freopen(3) reference pages for details.
The edfseek() function resets the end-of-file (EOF) and errno.
Line numbers are numeric labels that are sorted in numeric order. Because line numbers 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.
527192-018 Hewlett-Packard Company 1−177