OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / original / man3 / getw.3
1 .\" Copyright (c) 1995 by Jim Van Zandt <jrv@vanzandt.mv.com>
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\" License.
23 .TH GETW 3  2007-12-20 "GNU" "Linux Programmer's Manual"
24 .SH NAME
25 getw, putw \- input and output of words (ints)
26 .SH SYNOPSIS
27 .nf
28 .B #include <stdio.h>
29 .sp
30 .BI "int getw(FILE *" stream );
31
32 .BI "int putw(int " w ", FILE *" stream );
33 .fi
34 .SH DESCRIPTION
35 .BR getw ()
36 reads a word (that is, an \fIint\fP) from \fIstream\fP.
37 It's provided for compatibility with SVr4.
38 We recommend you use
39 .BR fread (3)
40 instead.
41 .P
42 .BR putw ()
43 writes the word \fIw\fP (that is,
44 an \fIint\fP) to \fIstream\fP.
45 It is provided for compatibility with SVr4, but we recommend you use
46 .BR fwrite (3)
47 instead.
48 .SH "RETURN VALUE"
49 Normally,
50 .BR getw ()
51 returns the word read, and
52 .BR putw ()
53 returns 0.
54 On error, they return \fBEOF\fP.
55 .SH "CONFORMING TO"
56 SVr4, SUSv2.  Not present in POSIX.1-2001.
57 .SH BUGS
58 The value returned on error is also a legitimate data value.
59 .BR ferror (3)
60 can be used to distinguish between the two cases.
61 .SH "SEE ALSO"
62 .BR ferror (3),
63 .BR fread (3),
64 .BR fwrite (3),
65 .BR getc (3),
66 .BR putc (3)