HP C/iX Library Reference Manual (30026-90004)

Chapter 4 31
HP C/iX Library Header Descriptions
Header File Contents
Header File Contents
This section describes the contents of the HP C/iX library header files. All header files
provided by HP C/iX are listed. This includes those headers files that comply with the
ANSI C standard, and those that do not comply with this standard. The non-ANSI headers
files are provided for compatibility with other UNIX-based
1
systems and for interfacing
with the MPE operating system.
Diagnostics <assert.h>
The header assert.h> defines the macro assert. If the expression passed to this function
is false (equal to 0), a message is written and the program is terminated.
Character Handling <ctype.h>
The header ctype.h> declares several macros and external functions useful for testing
and mapping characters. The functions enable you to convert between uppercase and
lowercase and to classify characters as digits, nonprintable characters, uppercase, or
lowercase. In all cases, the argument is an int that must be representable as an unsigned
character or the value of the macro EOF.
Because their syntaxes are identical, the following example can be used for all character
classification macros:
for (i=0; array[i] != 0; i++)) {
if (isprint(array[i]))
putchar(array[i]);
else putchar(' ');
}
The following identifiers are defined in <ctype.h>:
1. UNIX is a registered trademark of The Open Group.
Table 4-1. Character Handling Macros and Functions <ctype.h>
Name Type Description
isalnum() function Tests whether an argument is a letter or a decimal digit.
isalpha() function Tests whether an argument is a letter.
isascii()
a
function Tests whether an argument is in the ASCII character set.
iscntrl() function Tests whether an argument is a control character.
isdigit() function Tests whether an argument is a decimal digit.
isgraph() function Tests whether an argument is any printable non-space character.
islower() function Tests whether an argument is a lowercase letter.