NAME

stdio.h - standard buffered input/output

SYNOPSIS

#include<stdio.h>

DESCRIPTION

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.
The <stdio.h> header shall define the following macros as positive
integer constant expressions:
BUFSIZ Size of <stdio.h> buffers.
_IOFBF Input/output fully buffered.
_IOLBF Input/output line buffered.
_IONBF Input/output unbuffered.
L_ctermid
Maximum size of character array to hold ctermid() output.
L_tmpnam
Maximum size of character array to hold tmpnam() output.
SEEK_CUR
Seek relative to current position.
SEEK_END
Seek relative to end-of-file.
SEEK_SET
Seek relative to start-of-file.
The following macros shall be defined as positive integer constant
expressions which denote implementation limits:
{FILENAME_MAX}
Maximum size in bytes of the longest filename string that the
implementation guarantees can be opened.
{FOPEN_MAX}
Number of streams which the implementation guarantees can be
open simultaneously. The value is at least eight.
{TMP_MAX}
Minimum number of unique filenames generated by tmpnam().
Maximum number of times an application can call tmpnam()
reliably. The value of {TMP_MAX} is at least 25. On XSI-
conformant systems, the value of {TMP_MAX} is at least 10000.
The following macro name shall be defined as a negative integer
constant expression:
EOF End-of-file return value.
The following macro name shall be defined as a null pointer constant:
NULL Null pointer.
The following macro name shall be defined as a string constant:
P_tmpdir
Default directory prefix for tempnam().
The following shall be defined as expressions of type "pointer to FILE"
that point to the FILE objects associated, respectively, with the
standard error, input, and output streams:
stderr Standard error output stream.
stdin Standard input stream.
stdout Standard output stream.
The following data types shall be defined through typedef:
FILE A structure containing information about a file.
fpos_t A non-array type containing all information needed to specify
uniquely every position within a file.
va_list
As described in <stdarg.h> .
size_t As described in <stddef.h> .
The following shall be declared as functions and may also be defined as
macros. Function prototypes shall be provided.
voidclearerr(FILE*);char*ctermid(char*);intfclose(FILE*);FILE*fdopen(int,constchar*);intfeof(FILE*);intferror(FILE*);intfflush(FILE*);intfgetc(FILE*);intfgetpos(FILE*restrict,fpos_t*restrict);char*fgets(char*restrict,int,FILE*restrict);intfileno(FILE*);voidflockfile(FILE*);FILE*fopen(constchar*restrict,constchar*restrict);intfprintf(FILE*restrict,constchar*restrict,...);intfputc(int,FILE*);intfputs(constchar*restrict,FILE*restrict);size_tfread(void*restrict,size_t,size_t,FILE*restrict);FILE*freopen(constchar*restrict,constchar*restrict,FILE*restrict);intfscanf(FILE*restrict,constchar*restrict,...);intfseek(FILE*,long,int);intfseeko(FILE*,off_t,int);intfsetpos(FILE*,constfpos_t*);longftell(FILE*);off_tftello(FILE*);intftrylockfile(FILE*);voidfunlockfile(FILE*);size_tfwrite(constvoid*restrict,size_t,size_t,FILE*restrict);intgetc(FILE*);intgetchar(void);intgetc_unlocked(FILE*);intgetchar_unlocked(void);char*gets(char*);intpclose(FILE*);voidperror(constchar*);FILE*popen(constchar*,constchar*);intprintf(constchar*restrict,...);intputc(int,FILE*);intputchar(int);intputc_unlocked(int,FILE*);intputchar_unlocked(int);intputs(constchar*);intremove(constchar*);intrename(constchar*,constchar*);voidrewind(FILE*);intscanf(constchar*restrict,...);voidsetbuf(FILE*restrict,char*restrict);intsetvbuf(FILE*restrict,char*restrict,int,size_t);intsnprintf(char*restrict,size_t,constchar*restrict,...);intsprintf(char*restrict,constchar*restrict,...);intsscanf(constchar*restrict,constchar*restrict,int...);char*tempnam(constchar*,constchar*);FILE*tmpfile(void);char*tmpnam(char*);intungetc(int,FILE*);intvfprintf(FILE*restrict,constchar*restrict,va_list);intvfscanf(FILE*restrict,constchar*restrict,va_list);intvprintf(constchar*restrict,va_list);intvscanf(constchar*restrict,va_list);intvsnprintf(char*restrict,size_t,constchar*restrict,va_list;intvsprintf(char*restrict,constchar*restrict,va_list);intvsscanf(constchar*restrict,constchar*restrict,va_listarg);
Inclusion of the <stdio.h> header may also make visible all symbols
from <stddef.h>.
Thefollowingsectionsareinformative.

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 .