NAG C Library Function Document

1Purpose

nag_read_line (x04bbc) reads a single line from an external file.

2Specification

 #include #include
 void nag_read_line (Nag_FileID fileid, char *line, Integer linelen, NagError *fail)

3Description

nag_read_line (x04bbc) may be used to read from files opened with nag_open_file (x04acc).

None.

5Arguments

1:    $\mathbf{fileid}$Nag_FileIDInput
On entry: the identifier of the file to be read from. This must have been returned by a call of nag_open_file (x04acc).
2:    $\mathbf{line}$char *Output
A character buffer of length linelen.
On exit: contains a null-terminated character-string read from the file associated with the FileID. If line is too small to hold the entire string, excess characters are discarded.
3:    $\mathbf{linelen}$IntegerInput
On entry: the size of the character buffer line. If ${\mathbf{linelen}}\le 0$, no characters are read and line is unchanged.
4:    $\mathbf{fail}$NagError *Input/Output
The NAG error argument (see Section 3.7 in How to Use the NAG Library and its Documentation).

6Error Indicators and Warnings

NE_READ_ERROR
Error occurred when reading from FileID $〈\mathit{\text{value}}〉$.

Not applicable.

8Parallelism and Performance

nag_read_line (x04bbc) is not threaded in any implementation.

None.

10Example

See Section 10 in nag_open_file (x04acc).