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

32 Chapter4
HP C/iX Library Header Descriptions
Header File Contents
Error Handling <errno.h>
The header <errno.h> defines several macros, all relating to the reporting of error
conditions.
When an error occurs in a HP C/iX library function, an error is usually signalled to the
caller through the function return value. The error is signalled by an otherwise impossible
return value, usually -1 or NULL. To provide more information about the cause of the error,
several functions in the standard library and math library set the external variable errno
to a non-zero value when an error occurs.
The external variable errno is declared in this header file. This file also defines many
macro expressions for the various possible values of errno. The value of errno is zero at
program startup, but is never reset to zero by the library functions.
Programs that use errno for error checking should reset errno to zero before a library
function call, then inspect errno after the function call.
Some functions in the standard library call one or more underlying functions to perform
specific tasks. For example, the fopen function calls the open function. In these cases, the
underlying functions may set errno. The errno return values of the underlying functions
are not documented here.
The following is a list of the common error names and their values. The POSIX/iX library
provides additional error names and values. These errors are described in the MPE/iX
Developer's Kit Reference Manual.
isprint() function Tests whether an argument is any printable character including the
space character (octal values 040 through 0176).
ispunct() function Tests whether an argument is any printable character that is not a
space, a digit, or a letter.
isspace() function Tests whether an argument is a white space character.
isupper() function Tests whether an argument is an uppercase letter.
isxdigit() function Tests whether an argument is a hexadecimal digit.
toascii()
b
function Converts an integer to 7-bit ASCII.
_tolower() macro Converts an uppercase letter to lowercase.
_toupper() macro Converts a lowercase letter to uppercase.
tolower() function Converts an uppercase letter to lowercase.
toupper() function Converts a lowercase letter to uppercase.
a. These identifiers are not defined by the ANSI C standard. Programs using these
identifiers are likely to be less portable.
b. These identifiers are not defined by the ANSI C standard. Programs using these
identifiers are likely to be less portable.
Table 4-1. Character Handling Macros and Functions <ctype.h>
Name Type Description