Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > M

model(4)

TO BE OBSOLETED
HP-UX 11i Version 3: February 2007
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

model — HP-UX machine identification

SYNOPSIS

#include <model.h>

DESCRIPTION

There are certain inevitable distinctions between HP-UX implementations due to hardware differences. Where such distinctions exist, conditional compilation or other definitions can be used to isolate the differences. Flags and typedefs to resolve these distinctions are collected in the <model.h> header file which contains constants identifying various HP-UX implementations.

For example, header file model.h contains the following constants whose values are defined in <sys/magic.h>:

#define HP_S_500 HP9000_ID #define HP_S_200 HP98x6_ID #define HP_S_300 CPU_HP_MC68020 #define HP_S_800 CPU_PA_RISC1_0 #define HP_S_700 CPU_PA_RISC1_1

Other such constants are added as appropriate when HP-UX extends to other machines in subsequent releases.

In addition, model.h has a statement defining the preprocessor constant MYSYS to represent the specific implementation for which compilation is desired. MYSYS is always equal to one of the constants above.

Conditional compilation can be used to adapt a single file for execution on more than one HP-UX implementation if the file contains implementation- or architecture-dependent features. For example, the code segment:

#if MYSYS==HP_S_400 <statements> #endif

causes statements following the if statement to be compiled only if the system processor is an HP 9000 Series 400 machine.

model.h also contains typedefs for several predefined types to enhance portability of certain types of code and files.

These typedef declarations have been replaced by the header file inttypes.h

int8, u_int8

Signed and unsigned 8-bit integral type.

int16, u_int16

Signed and unsigned 16-bit integral type.

int32, u_int32

Signed and unsigned 32-bit integral type.

machptr, u_machptr

Signed and unsigned integral type large enough to hold a pointer.

To port code to use inttypes.h instead of model.h, these are the corresponding definitions contained in intypes.h

int8_t, uint8_t

Signed and unsigned 8-bit integral types.

int16_t, uint16_t

Signed and unsigned 16-bit integral types.

int32_t, uint32_t

Signed and unsigned 32-bit integral types.

intptr_t, uintptr_T

Signed and unsigned integral large enough to hold a pointer.

Certain C preprocessor conditional compilation variables are defined to aid in implementation-dependent code. See cpp(1).

SEE ALSO

cc(1), cpp(1), inttypes(5), magic(4).

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.