OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[linuxjm/LDP_man-pages.git] / original / man3 / puts.3
1 .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
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 .\" Modified Sat Jul 24 18:42:59 1993 by Rik Faith (faith@cs.unc.edu)
24 .TH PUTS 3  1993-04-04 "GNU" "Linux Programmer's Manual"
25 .SH NAME
26 fputc, fputs, putc, putchar, puts \- output of characters and strings
27 .SH SYNOPSIS
28 .nf
29 .B #include <stdio.h>
30 .sp
31 .BI "int fputc(int " c ", FILE *" stream );
32
33 .BI "int fputs(const char *" "s" ", FILE *" "stream" );
34
35 .BI "int putc(int " c ", FILE *" stream );
36
37 .BI "int putchar(int " c );
38
39 .BI "int puts(const char *" "s" );
40 .fi
41 .SH DESCRIPTION
42 .BR fputc ()
43 writes the character
44 .IR c ,
45 cast to an
46 .IR "unsigned char" ,
47 to
48 .IR stream .
49 .PP
50 .BR fputs ()
51 writes the string
52 .I s
53 to
54 .IR stream ,
55 without its trailing
56 .BR \(aq\e0\(aq .
57 .PP
58 .BR putc ()
59 is equivalent to
60 .BR fputc ()
61 except that it may be implemented as a macro which evaluates
62 .I stream
63 more than once.
64 .PP
65 .BI "putchar(" c );
66 is equivalent to
67 .BI "putc(" c , stdout ).
68 .PP
69 .BR puts ()
70 writes the string
71 .I s
72 and a trailing newline
73 to
74 .IR stdout .
75 .PP
76 Calls to the functions described here can be mixed with each other and with
77 calls to other output functions from the
78 .I stdio
79 library for the same output stream.
80 .PP
81 For nonlocking counterparts, see
82 .BR unlocked_stdio (3).
83 .SH "RETURN VALUE"
84 .BR fputc (),
85 .BR putc ()
86 and
87 .BR putchar ()
88 return the character written as an
89 .I unsigned char
90 cast to an
91 .I int
92 or
93 .B EOF
94 on error.
95 .PP
96 .BR puts ()
97 and
98 .BR fputs ()
99 return a nonnegative number on success, or
100 .B EOF
101 on error.
102 .SH "CONFORMING TO"
103 C89, C99.
104 .SH BUGS
105 It is not advisable to mix calls to output functions from the
106 .I stdio
107 library with low-level calls to
108 .BR write (2)
109 for the file descriptor associated with the same output stream; the results
110 will be undefined and very probably not what you want.
111 .SH "SEE ALSO"
112 .BR write (2),
113 .BR ferror (3),
114 .BR fopen (3),
115 .BR fputwc (3),
116 .BR fputws (3),
117 .BR fseek (3),
118 .BR fwrite (3),
119 .BR gets (3),
120 .BR putwchar (3),
121 .BR scanf (3),
122 .BR unlocked_stdio (3)