Every library function is declared in an include file. Many library functions use symbolic constants and data types, which are defined in include files. The library functions that are implemented as macros are also located in include files.
The include files required for the use of library functions are components of the CRTE library SYSLIB.CRTE. They are stored there as source program elements (type S) and are copied to the program during compilation on the basis of the preprocessor #include
directive. The C and C++ User Guides provide a detailed description of how this has to be
<ascii_ebcdic.h> | <assert.h> | <bs2cmd.h> | <cglobals.h> | <cont.h> |
<crduc.h> | <ctype.h> | <errno.h> | <float.h> | <ieee_390.h> |
<ilcs.h> | <inttypes.h> | <iso646.h> | <limits.h> | <locale.h> |
<math.h> | <setjmp.h> | <signal.h> | <stdarg.h> | <stddef.h> |
<stdio.h> | <stdlib.h> | <string.h> | <strings.h> | <stxit.h> |
<sys.timeb.h> | <sys.types.h> | <time.h> | <timeb.h> | <wchar.h> |
<wctype.h> |
The following items, among others, may be contained in include files:
Definitions of symbolic constants with the values required for proper execution of the functions, e.g.:
BUFSIZ
standard size of the I/O buffer (8192 bytes), as defined by the operating system
EOF
end-of-file criterion (-1)
WEOF
end-of-file criterion for wide character files (L“-1“)
_NFILE
maximum permissible number of concurrently opened files, including the standard files
stdin
,stdout
andstderr
(2048).NULL
null pointer (0)
Definitions of data types and structures that are used by the functions, e.g.:
FILE
Most I/O functions use a pointer to a structure of type FILE (see also section
“FILE structure” (Basic terms)”)mbstate_t
This data type is used by many of the multibyte functions and corresponds to
the typechar
in this implementation.size_t
This data type is used by many of the string functions and corresponds to the
typeunsigned
in this implementation.ptrdiff_t
This data type is used for the result of a subtraction of pointers and
corresponds to the typeint
in this implementation.wint_t
This data type includes values corresponding to elements of the extended
character set and the value WEOF (end of input) and corresponds to thetype integer
in this implementation.wchar_t
This data type is used by the multibyte functions and corresponds to the type
long
in this implementation.wctrans_t
A scalar data type representing locale-specific character translations.
wctype_t
A scalar data type representing locale-specific character classes;
corresponds to the typelong
in this implementation.clock_t
This data type is used by the clock function and corresponds to the type
int
in this implementation.time_t
This data type is used by many of the time functions and corresponds to the
typelong
in this implementation.va_list
This data type is used by functions that process variable argument lists (e.g.
vprintf).
The prototype declaration of all functions
Before a function is called, the data type must be made known, i.e. declared. This is ensured by incorporating the appropriate include file. In the “ANSI” and “STRICT-ANSI” compilation modes, a warning is issued if the declaration is missing. In the “CPLUSPLUS” compilation mode, an error occurs if the declaration is missing, and no module is created.
The definition of all macros
Some library functions are implemented as macros. In order to be able to use a macro, the appropriate include file must be incorporated into the program.
The include files contain extern “C” declarations for all functions and data so that C library functions can be called from within C++ sources.
Include file iso646.h
The include file iso646.h
contains the following 11 macros, which expand to the adjacent notations and thus serve as alternative notations for the corresponding operators:
and | && |
| compl | ~ |
| or_eq | |= |
and_eq | &= | not | ! | xor | ^ | ||
bitand | & | not_eq | != | xor_eq | ^= | ||
bitor | | | or | | | |