1fgetwln(3bsd)                        LOCAL                       fgetwln(3bsd)
2

NAME

4     fgetwln — get a line of wide characters from a stream
5

LIBRARY

7     Utility functions from BSD systems (libbsd, -lbsd)
8

SYNOPSIS

10     #include <stdio.h>
11     #include <wchar.h>
12     (See libbsd(7) for include usage.)
13
14     wchar_t *
15     fgetwln(FILE * restrict stream, size_t * restrict len);
16

DESCRIPTION

18     The fgetwln() function returns a pointer to the next line from the stream
19     referenced by stream.  This line is not a standard wide character string
20     as it does not end with a terminating null wide character.  The length of
21     the line, including the final newline, is stored in the memory location
22     to which len points.  (Note, however, that if the line is the last in a
23     file that does not end in a newline, the returned text will not contain a
24     newline.)
25

RETURN VALUES

27     Upon successful completion a pointer is returned; this pointer becomes
28     invalid after the next I/O operation on stream (whether successful or
29     not) or as soon as the stream is closed.  Otherwise, NULL is returned.
30     The fgetwln() function does not distinguish between end-of-file and er‐
31     ror; the routines feof(3) and ferror(3) must be used to determine which
32     occurred.  If an error occurs, the global variable errno is set to indi‐
33     cate the error.  The end-of-file condition is remembered, even on a ter‐
34     minal, and all subsequent attempts to read will return NULL until the
35     condition is cleared with clearerr(3).
36
37     The text to which the returned pointer points may be modified, provided
38     that no changes are made beyond the returned size.  These changes are
39     lost as soon as the pointer becomes invalid.
40

ERRORS

42     [EBADF]            The argument stream is not a stream open for reading.
43
44     The fgetwln() function may also fail and set errno for any of the errors
45     specified for the routines mbrtowc(3), realloc(3), or read(2).
46

SEE ALSO

48     ferror(3), fgetln(3bsd), fgetws(3), fopen(3)
49
50BSD                              July 16, 2004                             BSD
Impressum