1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251
|
.\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved
.TH "<stdio.h>" P 2003 POSIX
.\" <stdio.h>
.SH NAME
stdio.h \- standard buffered input/output
.SH SYNOPSIS
.LP
\fB#include <stdio.h>\fP
.SH DESCRIPTION
.LP
Some of the functionality described on this reference page extends
the ISO\ C standard. Applications shall define
the appropriate feature test macro (see the System Interfaces volume
of IEEE\ Std\ 1003.1-2001, Section 2.2, The Compilation Environment)
to enable the visibility of these symbols in this
header.
.LP
The \fI<stdio.h>\fP header shall define the following macros as positive
integer constant expressions:
.TP 7
BUFSIZ
Size of \fI<stdio.h>\fP buffers.
.TP 7
_IOFBF
Input/output fully buffered.
.TP 7
_IOLBF
Input/output line buffered.
.TP 7
_IONBF
Input/output unbuffered.
.TP 7
L_ctermid
Maximum size of character array to hold \fIctermid\fP() output.
.TP 7
L_tmpnam
Maximum size of character array to hold \fItmpnam\fP() output.
.TP 7
SEEK_CUR
Seek relative to current position.
.TP 7
SEEK_END
Seek relative to end-of-file.
.TP 7
SEEK_SET
Seek relative to start-of-file.
.sp
.LP
The following macros shall be defined as positive integer constant
expressions which denote implementation limits:
.TP 7
{FILENAME_MAX}
Maximum size in bytes of the longest filename string that the implementation
guarantees can be opened.
.TP 7
{FOPEN_MAX}
Number of streams which the implementation guarantees can be open
simultaneously. The value is at least eight.
.TP 7
{TMP_MAX}
Minimum number of unique filenames generated by \fItmpnam\fP(). Maximum
number of times
an application can call \fItmpnam\fP() reliably. The value of {TMP_MAX}
is at least 25.
\ On XSI-conformant systems, the value of {TMP_MAX} is at least 10000.
.sp
.LP
The following macro name shall be defined as a negative integer constant
expression:
.TP 7
EOF
End-of-file return value.
.sp
.LP
The following macro name shall be defined as a null pointer constant:
.TP 7
NULL
Null pointer.
.sp
.LP
The following macro name shall be defined as a string constant:
.TP 7
P_tmpdir
Default directory prefix for \fItempnam\fP().
.sp
.LP
The following shall be defined as expressions of type "pointer to
\fBFILE\fP" that point to the \fBFILE\fP objects
associated, respectively, with the standard error, input, and output
streams:
.TP 7
\fIstderr\fP
Standard error output stream.
.TP 7
\fIstdin\fP
Standard input stream.
.TP 7
\fIstdout\fP
Standard output stream.
.sp
.LP
The following data types shall be defined through \fBtypedef\fP:
.TP 7
\fBFILE\fP
A structure containing information about a file.
.TP 7
\fBfpos_t\fP
A non-array type containing all information needed to specify uniquely
every position within a file.
.TP 7
\fBva_list\fP
As described in \fI<stdarg.h>\fP .
.TP 7
\fBsize_t\fP
As described in \fI<stddef.h>\fP .
.sp
.LP
The following shall be declared as functions and may also be defined
as macros. Function prototypes shall be provided.
.sp
.RS
.nf
\fBvoid clearerr(FILE *);
char *ctermid(char *);
int fclose(FILE *);
FILE *fdopen(int, const char *);
int feof(FILE *);
int ferror(FILE *);
int fflush(FILE *);
int fgetc(FILE *);
int fgetpos(FILE *restrict, fpos_t *restrict);
char *fgets(char *restrict, int, FILE *restrict);
int fileno(FILE *);
void flockfile(FILE *);
FILE *fopen(const char *restrict, const char *restrict);
int fprintf(FILE *restrict, const char *restrict, ...);
int fputc(int, FILE *);
int fputs(const char *restrict, FILE *restrict);
size_t fread(void *restrict, size_t, size_t, FILE *restrict);
FILE *freopen(const char *restrict, const char *restrict,
FILE *restrict);
int fscanf(FILE *restrict, const char *restrict, ...);
int fseek(FILE *, long, int);
int fseeko(FILE *, off_t, int);
int fsetpos(FILE *, const fpos_t *);
long ftell(FILE *);
off_t ftello(FILE *);
int ftrylockfile(FILE *);
void funlockfile(FILE *);
size_t fwrite(const void *restrict, size_t, size_t, FILE *restrict);
int getc(FILE *);
int getchar(void);
int getc_unlocked(FILE *);
int getchar_unlocked(void);
char *gets(char *);
int pclose(FILE *);
void perror(const char *);
FILE *popen(const char *, const char *);
int printf(const char *restrict, ...);
int putc(int, FILE *);
int putchar(int);
int putc_unlocked(int, FILE *);
int putchar_unlocked(int);
int puts(const char *);
int remove(const char *);
int rename(const char *, const char *);
void rewind(FILE *);
int scanf(const char *restrict, ...);
void setbuf(FILE *restrict, char *restrict);
int setvbuf(FILE *restrict, char *restrict, int, size_t);
int snprintf(char *restrict, size_t, const char *restrict, ...);
int sprintf(char *restrict, const char *restrict, ...);
int sscanf(const char *restrict, const char *restrict, int ...);
char *tempnam(const char *, const char *);
FILE *tmpfile(void);
char *tmpnam(char *);
int ungetc(int, FILE *);
int vfprintf(FILE *restrict, const char *restrict, va_list);
int vfscanf(FILE *restrict, const char *restrict, va_list);
int vprintf(const char *restrict, va_list);
int vscanf(const char *restrict, va_list);
int vsnprintf(char *restrict, size_t, const char *restrict, va_list;
int vsprintf(char *restrict, const char *restrict, va_list);
int vsscanf(const char *restrict, const char *restrict, va_list arg);
\fP
.fi
.RE
.LP
Inclusion of the \fI<stdio.h>\fP header may also make visible all
symbols from \fI<stddef.h>\fP.
.LP
\fIThe following sections are informative.\fP
.SH APPLICATION USAGE
.LP
None.
.SH RATIONALE
.LP
None.
.SH FUTURE DIRECTIONS
.LP
None.
.SH SEE ALSO
.LP
\fI<stdarg.h>\fP , \fI<stddef.h>\fP , \fI<sys/types.h>\fP , the System
Interfaces volume of IEEE\ Std\ 1003.1-2001, \fIclearerr\fP(), \fIctermid\fP(),
\fIfclose\fP(), \fIfdopen\fP(), \fIfgetc\fP(), \fIfgetpos\fP(), \fIferror\fP(),
\fIfeof\fP(), \fIfflush\fP(), \fIfgets\fP(), \fIfileno\fP(), \fIflockfile\fP(),
\fIfopen\fP(), \fIfputc\fP(), \fIfputs\fP(), \fIfread\fP(), \fIfreopen\fP(),
\fIfseek\fP(), \fIfsetpos\fP(), \fIftell\fP(), \fIfwrite\fP(), \fIgetc\fP(),
\fIgetc_unlocked\fP(), \fIgetwchar\fP(), \fIgetchar\fP(), \fIgetopt\fP(),
\fIgets\fP(), \fIpclose\fP(), \fIperror\fP(), \fIpopen\fP(), \fIprintf\fP(),
\fIputc\fP(), \fIputchar\fP(), \fIputs\fP(), \fIputwchar\fP(), \fIremove\fP(),
\fIrename\fP(), \fIrewind\fP(), \fIscanf\fP(), \fIsetbuf\fP(), \fIsetvbuf\fP(),
\fIsscanf\fP(), \fIstdin\fP, \fIsystem\fP(), \fItempnam\fP(), \fItmpfile\fP(),
\fItmpnam\fP(), \fIungetc\fP(), \fIvfscanf\fP(), \fIvscanf\fP(), \fIvprintf\fP(),
\fIvsscanf\fP()
.SH COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form
from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
-- Portable Operating System Interface (POSIX), The Open Group Base
Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
Electrical and Electronics Engineers, Inc and The Open Group. In the
event of any discrepancy between this version and the original IEEE and
The Open Group Standard, the original IEEE and The Open Group Standard
is the referee document. The original Standard can be obtained online at
http://www.opengroup.org/unix/online.html .
|