HP C A.06.05 Reference Manual
Chapter 8 205
8 C Library Functions
The C library (/usr/lib/hpux32/libc.so or /usr/lib/hpux64/libc.so) is divided into
different subsections. Each subsection has a header file that defines the objects found in that
section of the library.
The standard headers are:
<assert.h> <locale.h> <stddef.h>
<ctype.h> <math.h> <stdio.h>
<errno.h> <setjmp.h> <stdlib.h>
<float.h> <signal.h> <string.h>
<limits.h> <stdarg.h> <time.h>
The order of inclusion of these header files using the #include directive makes no difference.
Also, if you include the same header file more than once, an error does not occur.
Function names beginning with an underscore (_) are reserved for library use; you should
not specify identifiers that begin with an underscore.
To use some facilities, the C source code must include the preprocessor directive:
#include <
libraryname
.h>
The preprocessor looks for the particular header file defined in
libraryname
in a standard
location on the system.
The standard location is /usr/include.
The
libraryname
must be enclosed in angle brackets. For example, if you want to use the
fprintf function, which is in the standard I/O library, your program must specify
#include <stdio.h>
because the definition of fprintf, as well as various types and variables used by the I/O
function, are found in the stdio.h header file.
The C library contains both functions and macros. The use of macros improves the execution
speed of certain frequently used operations. One drawback to using macros is that they do not
have an address. For example, if a function expects the address of (a pointer to) another
function as an argument, you cannot use a macro name in that argument. The following
example illustrates the drawback:
#define add1(x) ((x)+=1)
extern f();
main()