HP 3000 Manuals

Library Header Files [ HP C/iX Library Reference Manual ] MPE/iX 5.0 Documentation


HP C/iX Library Reference Manual

Library Header Files 

To use many of the facilities of the HP C/iX library, your C source code
should include the preprocessing directive:

     #include <incfile.h>

Enclosing incfile.h in angle brackets tells the preprocessing phase of
the compiler to look for that file in a standard location on the system,
the H group of the SYS account for HP C/iX. For example, if you want to
use the fprintf function, your program should specify:

     #include <stdio.h>

This includes the declaration of fprintf, as well as various types and
variables used by the functions found in the stdio.h header file.  The
standard include file or files that are needed for each function are
specified in the syntax descriptions provided in chapter 5.  The order of
inclusion of the header files using the #include directive makes no
difference, and an error does not occur if you include the same header
file more than once.

The following table lists and describes the HP C/iX library header files:

          Table 1-2.  HP C/iX Library Header Files 

---------------------------------------------------------------------------------------------
|                   |                                                                       |
|      Header       |                              Description                              |
|                   |                                                                       |
---------------------------------------------------------------------------------------------
|                   |                                                                       |
| <assert.h>        | Defines the assert macro.                                             |
|                   |                                                                       |
---------------------------------------------------------------------------------------------
|                   |                                                                       |
| <ctype.h>         | Declares macros and external functions useful for testing and mapping |
|                   | characters.                                                           |
|                   |                                                                       |
---------------------------------------------------------------------------------------------
|                   |                                                                       |
| <errno.h>         | Declares error variables and defines macros useful for obtaining a    |
|                   | more detailed description of a library function error.                |
|                   |                                                                       |
---------------------------------------------------------------------------------------------
|                   |                                                                       |
| <fcntl.h>(1)      | Defines arguments to the open function.                               |
|                   |                                                                       |
---------------------------------------------------------------------------------------------
|                   |                                                                       |
| <float.h>         | Defines macros that describe the floating-point types.                |
|                   |                                                                       |
---------------------------------------------------------------------------------------------
|                   |                                                                       |
| <limits.h>        | Defines several macros that represent basic C data type limits.       |
|                   |                                                                       |
---------------------------------------------------------------------------------------------
|                   |                                                                       |
| <locale.h>        | Used for localization.  Contains macro definitions, function, and     |
|                   | type declarations needed to select the desired locale.                |
|                   |                                                                       |
---------------------------------------------------------------------------------------------
|                   |                                                                       |
| <malloc.h>(1)     | Declares memory management functions, mallopt argument functions, and |
|                   | a structure returned by the mallinfo function.  Memory management     |
|                   | functions are also declared in <stdlib.h>.                            |
|                   |                                                                       |
---------------------------------------------------------------------------------------------
|                   |                                                                       |
| <math.h>          | Contains declarations for the HP C/iX math library functions, as well |
|                   | as functions in the standard library that return floating-point       |
|                   | values.  Also defines the structure and constants used by the matherr |
|                   | error-handling mechanisms.                                            |
|                   |                                                                       |
---------------------------------------------------------------------------------------------
|                   |                                                                       |
| <memory.h>(1)     | Declares several functions useful for manipulating character arrays   |
|                   | and other objects treated as character arrays.  These functions are   |
|                   | also declared in <string.h>.                                          |
|                   |                                                                       |
---------------------------------------------------------------------------------------------
|                   |                                                                       |
| <mpe.h>(1)        | Declares several types, constants, and functions that facilitate      |
|                   | using the MPE/iX operating system interface.  See chapter 4 for       |
|                   | additional information.                                               |
|                   |                                                                       |
---------------------------------------------------------------------------------------------
|                   |                                                                       |
| <search.h>(1)     | Defines the types used with the hsearch and tsearch functions.        |
|                   |                                                                       |
---------------------------------------------------------------------------------------------
|                   |                                                                       |
| <setjmp.h>        | Declares a type and several functions for bypassing the normal        |
|                   | function call and return discipline.                                  |
|                   |                                                                       |
---------------------------------------------------------------------------------------------

          Table 1-2.  HP C/iX Library Header Files (cont.) 

---------------------------------------------------------------------------------------------
|                   |                                                                       |
|      Header       |                              Description                              |
|                   |                                                                       |
---------------------------------------------------------------------------------------------
|                   |                                                                       |
| <signal.h>        | Contains declaration used in dealing with conditions that may be      |
|                   | reported during program execution.                                    |
|                   |                                                                       |
---------------------------------------------------------------------------------------------
|                   |                                                                       |
| <stdarg.h>        | Provides a standard method for dealing with variable arguments.       |
|                   |                                                                       |
---------------------------------------------------------------------------------------------
|                   |                                                                       |
| <stddef.h>        | Defines several macros and types used widely in conjunction with the  |
|                   | C library.                                                            |
|                   |                                                                       |
---------------------------------------------------------------------------------------------
|                   |                                                                       |
| <stdio.h>         | Defines a structure, several functions, and macros useful for I/O.    |
|                   |                                                                       |
---------------------------------------------------------------------------------------------
|                   |                                                                       |
| <stdlib.h>        | Declares various general utility functions and macros.                |
|                   |                                                                       |
---------------------------------------------------------------------------------------------
|                   |                                                                       |
| <string.h>        | Declares functions useful for manipulating character arrays and other |
|                   | objects treated as character arrays.                                  |
|                   |                                                                       |
---------------------------------------------------------------------------------------------
|                   |                                                                       |
| <time.h>          | Declares types, global variables, and functions used for manipulating |
|                   | time.                                                                 |
|                   |                                                                       |
---------------------------------------------------------------------------------------------
|                   |                                                                       |
| <times.h>(2)      | Contains the definition of the struct tms, which is used by some      |
|                   | older non-ANSI library functions.                                     |
|                   |                                                                       |
---------------------------------------------------------------------------------------------
|                   |                                                                       |
| <unistd.h>(2)     | Defines macros that are used as arguments to the lseek function.      |
|                   | These macros are also declared in <stdarg.h>.                         |
|                   |                                                                       |
---------------------------------------------------------------------------------------------
|                   |                                                                       |
| <values.h> (2)    | Contains a set of manifest constants, conditionally defined for       |
|                   | particular processor architectures.                                   |
|                   |                                                                       |
---------------------------------------------------------------------------------------------
|                   |                                                                       |
| <varargs.h> (2)   | Declares types and macros for declaring variable argument functions.  |
|                   | See also <stdarg.h>.                                                  |
|                   |                                                                       |
---------------------------------------------------------------------------------------------

(1) These headers are not defined by the ANSI C standard.  Programs using
these headers are likely to be less portable.

(2) These headers are not defined by the ANSI C standard.  Programs using
these headers are likely to be less portable.

Some of the ANSI-defined header files, as implemented in the HP C/iX
library, contain declarations for entities beyond those required by ANSI
C. For example, the header <math.h> contains a macro definition for M_PI,
the value of the mathematical constant pi.  Because M_PI is not a
reserved identifier in C, it is possible that a legal C program might use
that identifier for a different purpose.  Consequently, it is important
that the compiler not process such declarations when compiling in ANSI
mode.

If you have a program that relies on a non-ANSI declaration in one of the
standard header files, and if you want to compile in ANSI mode, you must
explicitly request such declarations to be visible.  You do so by adding
the following directive to your source file before including the standard
header file:

     #define  _MPEXL_SOURCE

This tells the preprocessor that your source program needs the extensions
present in MPE/iX. Alternatively, you could specify this using the
compiler option -D_MPEXL_SOURCE when you invoke the compiler.  For
compatibility with previous releases, this directive is automatically
issued for you if you are not compiling in ANSI mode.



MPE/iX 5.0 Documentation