stdio.h — Standard input and output
The stdio.h
header file declares functions that deal with standard
input and output. One of these functions, fdopen()
, is supported only in a POSIX
program.
The stdio.h header file also declares these functions:
clearerr() | clrmemf() | fclose() | fdelrec() | feof() |
ferror() | fflush() | fgetc() | fgetpos() | fgets() |
fldata() | flocate() | fopen() | fprintf() | fputc() |
fputs() | fread() | freopen() | fscanf() | fseek() |
fseeko() | fsetpos() | ftell() | ftello() | fupdate() |
fwrite() | getc() | getchar() | gets() | perror() |
printf() | putc() | putchar() | puts() | remove() |
rename() | rewind() | scanf() | setbuf() | setvbuf() |
sprintf() | sscanf() | svc99() | tmpfile() | tmpnam() |
ungetc() | vfprintf() | vprintf() | vsprintf() |
Defined types in stdio.h
The FILE
type is defined in stdio.h. Stream functions use a pointer to the
FILE
type to get access to a given stream. The system uses the information in the
FILE
structure to maintain the stream. The C standard streams
stdin
, stdout
, and stderr
are also defined in
stdio.h.
The type fpos_t
is defined in stdio.h for use with fgetpos()
and fsetpos()
.
The types __S99parms
, __S99rbx_t
, and
__S99emparms_t
are defined in stdio.h for use with the svc99() function.
The type fldata_t
is defined in stdio.h for use with the
fldata()
function.
The types __amrc_type
and __amrc2_type
are defined in stdio.h
for use in determining error information when I/O functions fail.
Macros defined in stdio.h
BUFSIZ
- Specifies the buffer size to be used by the
setbuf()
library function when you are allocating buffers for stream I/O. This value is the expected size of the user’s buffer supplied tosetbuf()
. If a larger buffer is required, for example, if blocksize is larger than BUFSIZ, or if special buffer attributes are required, z/OS® XL C/C++ applications will not use the user's buffer. EOF
- The value returned by an I/O function when the End Of File (EOF) (or in some cases, an error) is found.
FOPEN_MAX
- The maximum number of files that can be open simultaneously.
FILENAME_MAX
- The maximum number of characters in a filename. Can be used in the size specification of an array (for example, to hold the filename returned by fldata()).
L_tmpnam
- The size of the longest temporary name that can be generated by the tmpnam() function.
L_ctermid
- Maximum size of a character array for ctermid() output. This macro is supported only in a POSIX program.
- NULL
- A pointer which never points to a data object.
TMP_MAX
- The minimum number of unique file names that can be generated by the tmpnam() function.
The macros SEEK_CUR
,
SEEK_END
, and SEEK_SET
expand to integral constant expressions and
can be used as the third argument to fseek().
The
macros _IOFBF
, _IOLBF
, and _IONBF
expand to
integral constant expressions with distinct values suitable for use as the third argument to the
setvbuf() function.
The following macros expand to integer constant expressions suitable for
interpreting values returned by fldata(), in the fldata_t
structure.
__APPEND | __BINARY | __BLOCKED | __DISK |
__DUMMY | __ESDS | __ESDS_PATH | __HFS |
__HIPERSPACE | __KSDS | __KSDS_PATH | __MEMORY |
__MSGFILE | __NORLS | __NOTVSAM | __OTHER |
__PRINTER | __READ | __RECORD | __RLS |
__RSDS | __TAPE | __TDQ | __TERMINAL |
__TEXT | __UPDATE | __WRITE |
The following macros expand to integral constant expressions suitable for use as the fourth argument to the flocate() function.
__KEY_EQ | __KEY_EQ_BWD | __KEY_FIRST | __KEY_GE |
__KEY_LAST | __RBA_EQ | __RBA_EQ_BWD |
The following macros expand to integral constant expressions suitable for use as the argument to the function clrmemf().
__CURRENT | __CURRENT_LOWER | __LOWER |
The following macros expand to integral constant expressions suitable for use to
determine the last operation reported in the __amrc_type
structure. All these
macros are described in z/OS XL C/C++ Programming Guide.
__BSAM_BLDL | __BSAM_CLOSE | __BSAM_CLOSE_T |
__BSAM_NOTE | __BSAM_OPEN | __BSAM_POINT |
__BSAM_READ | __BSAM_STOW | __BSAM_WRITE |
__C_CANNOT_EXTEND | __C_DBCS_SI_TRUNCATE | __C_DBCS_SO_TRUNCATE |
__C_DBCS_TRUNCATE | __C_DBCS_UNEVEN | __C_FCBCHECK |
__C_TRUNCATE | __CELMSGF_WRITE | __CICS_WRITEQ_TD |
__HSP_CREATE | __HSP_DELETE | __HSP_EXTEND |
__HSP_READ | __HSP_WRITE | __INTERCEPT_READ |
__INTERCEPT_WRITE | __IO_CATALOG | __IO_DEVTYPE |
__IO_INIT | __IO_LOCATE | __IO_OBTAIN |
__IO_RDJFCB | __IO_RENAME | __IO_SCRATCH |
__IO_TRKCALC | __IO_UNCATALOG | __LFS_CLOSE |
__LFS_FSTAT | __LFS_LSEEK | __LFS_OPEN |
__LFS_READ | __LFS_WRITE | __NOSEEK_REWIND |
__OS_CLOSE | __OS_OPEN | __QSAM_FREEPOOL |
__QSAM_GET | __QSAM_PUT | __QSAM_RELSE |
__QSAM_TRUNC | __SVC99_ALLOC | __SVC99_ALLOC_NEW |
__SVC99_UNALLOC | __TGET_READ | __TPUT_WRITE |
__VSAM_CLOSE | __VSAM_ENDREQ | __VSAM_ERASE |
__VSAM_GENCB | __VSAM_GET | __VSAM_MODCB |
__VSAM_OPEN_ESDS | __VSAM_OPEN_ESDS_PATH | __VSAM_OPEN_FAIL |
__VSAM_OPEN_KSDS | __VSAM_OPEN_KSDS_PATH | __VSAM_OPEN_RRDS |
__VSAM_POINT | __VSAM_PUT | __VSAM_SHOWCB |
__VSAM_TESTCB |