OSDN Git Service

(split) LDP_man-pages: update original to v3.35.
[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  2011-09-28 "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 terminating null byte (\(aq\e0\(aq).
56 .PP
57 .BR putc ()
58 is equivalent to
59 .BR fputc ()
60 except that it may be implemented as a macro which evaluates
61 .I stream
62 more than once.
63 .PP
64 .BI "putchar(" c );
65 is equivalent to
66 .BI "putc(" c , stdout ).
67 .PP
68 .BR puts ()
69 writes the string
70 .I s
71 and a trailing newline
72 to
73 .IR stdout .
74 .PP
75 Calls to the functions described here can be mixed with each other and with
76 calls to other output functions from the
77 .I stdio
78 library for the same output stream.
79 .PP
80 For nonlocking counterparts, see
81 .BR unlocked_stdio (3).
82 .SH "RETURN VALUE"
83 .BR fputc (),
84 .BR putc ()
85 and
86 .BR putchar ()
87 return the character written as an
88 .I unsigned char
89 cast to an
90 .I int
91 or
92 .B EOF
93 on error.
94 .PP
95 .BR puts ()
96 and
97 .BR fputs ()
98 return a nonnegative number on success, or
99 .B EOF
100 on error.
101 .SH "CONFORMING TO"
102 C89, C99.
103 .SH BUGS
104 It is not advisable to mix calls to output functions from the
105 .I stdio
106 library with low-level calls to
107 .BR write (2)
108 for the file descriptor associated with the same output stream; the results
109 will be undefined and very probably not what you want.
110 .SH "SEE ALSO"
111 .BR write (2),
112 .BR ferror (3),
113 .BR fopen (3),
114 .BR fputwc (3),
115 .BR fputws (3),
116 .BR fseek (3),
117 .BR fwrite (3),
118 .BR gets (3),
119 .BR putwchar (3),
120 .BR scanf (3),
121 .BR unlocked_stdio (3)