9103 opengroup acknowledgement should be properly formatted in man pages
[unleashed.git] / usr / src / man / man3c / getws.3c
blobc1485a06878ed3839ce82d29b9f0937a3761d317
1 '\" te
2 .\" Copyright (c) 2003, Sun Microsystems, Inc.  All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH GETWS 3C "Oct 15, 2003"
7 .SH NAME
8 getws, fgetws \- get a wide-character string from a stream
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <stdio.h>
13 include <widec.h>
15 \fBwchar_t *\fR\fBgetws\fR(\fBwchar_t *\fR\fIws\fR);
16 .fi
18 .LP
19 .nf
20 #include <stdio.h>
21 include <wchar.h>
23 \fBwchar_t *\fR\fBfgetws\fR(\fBwchar_t *restrict\fR \fIws\fR, \fBint\fR \fIn\fR, \fBFILE *restrict\fR \fIstream\fR);
24 .fi
26 .SH DESCRIPTION
27 .sp
28 .LP
29 The \fBgetws()\fR function reads a string of characters from the standard input
30 stream, \fBstdin\fR, converts these characters to the corresponding
31 wide-character codes, and writes them to the array pointed to by \fIws\fR,
32 until a newline character is read, converted and transferred to \fIws\fR or an
33 end-of-file condition is encountered. The wide-character string, \fIws\fR, is
34 then terminated with a null wide-character code.
35 .sp
36 .LP
37 The \fBfgetws()\fR function reads characters from the \fIstream\fR, converts
38 them to the corresponding wide-character codes,  and places them in the
39 \fBwchar_t\fR array pointed to by \fIws\fR until \fIn\fR\(mi1 characters are
40 read, or until a newline character is read, converted and transferred to
41 \fIws\fR, or an end-of-file condition is encountered. The wide-character
42 string, \fIws\fR, is then terminated with a null wide-character code.
43 .sp
44 .LP
45 If an error occurs, the resulting value of the file position indicator for the
46 stream is indeterminate.
47 .sp
48 .LP
49 The \fBfgetws()\fR function may mark the \fBst_atime\fR field of the file
50 associated with \fIstream\fR for update. The \fBst_atime\fR field will be
51 marked for update by the first successful execution of \fBfgetc\fR(3C),
52 \fBfgets\fR(3C), \fBfgetwc\fR(3C), \fBfgetws()\fR, \fBfread\fR(3C),
53 \fBfscanf\fR(3C), \fBgetc\fR(3C), \fBgetchar\fR(3C), \fBgets\fR(3C), or
54 \fBscanf\fR(3C) using \fIstream\fR that returns data not supplied by a prior
55 call to \fBungetc\fR(3C) or \fBungetwc\fR(3C).
56 .SH RETURN VALUES
57 .sp
58 .LP
59 Upon successful completion, \fBgetws()\fR and \fBfgetws()\fR return \fIws\fR.
60 If the stream is at end-of-file, the end-of-file indicator for the stream is
61 set and \fBfgetws()\fR returns a null pointer. For standard-conforming (see
62 \fBstandards\fR(5)) applications, if the end-of-file indicator for the stream
63 is set, \fBfgetws()\fR returns a null pointer whether or not the stream is at
64 end-of-file. If a read error occurs, the error indicator for the stream is set
65 and \fBfgetws()\fR returns a null pointer and sets \fBerrno\fR to indicate the
66 error.
67 .SH ERRORS
68 .sp
69 .LP
70 See \fBfgetwc\fR(3C) for the conditions that will cause \fBfgetws()\fR to fail.
71 .SH ATTRIBUTES
72 .sp
73 .LP
74 See \fBattributes\fR(5) for descriptions of the following attributes:
75 .sp
77 .sp
78 .TS
79 box;
80 c | c
81 l | l .
82 ATTRIBUTE TYPE  ATTRIBUTE VALUE
84 Interface Stability     \fBfgetws()\fR is Standard.
86 MT-Level        MT-Safe
87 .TE
89 .SH SEE ALSO
90 .sp
91 .LP
92 \fBferror\fR(3C), \fBfgetwc\fR(3C), \fBfread\fR(3C), \fBgetwc\fR(3C),
93 \fBputws\fR(3C), \fBscanf\fR(3C), \fBungetc\fR(3C),
94 \fBungetwc\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)