C/C++ Programmer's Guide (G06.27+, H06.08+, J06.03+)

Visual Inspect Symbolic Debugger........................................................................................42
TNS/E Native Object File Tool (enoft Utility)..........................................................................42
NonStop SQL/MP Compiler and NonStop SQL/MX Compiler.................................................42
TNS/E Native C and C++ Migration Tool.............................................................................43
TNS/E Code Profiling Utilities..............................................................................................43
Features of TNS/E Native C and C++..................................................................................43
Writing Portable Programs.......................................................................................................45
Complying With Standards.................................................................................................45
Following Good Programming Practices................................................................................46
Porting Programs to HP C and C++ for NonStop Systems.............................................................47
Porting Without Data Alignment Problems..................................................................................47
Guardian and OSS Environment Interoperability.........................................................................47
2 C and C++ Extensions..............................................................................49
Keywords..............................................................................................................................49
Declarations..........................................................................................................................49
Storage Class Specifier.......................................................................................................50
Export Attribute (Native C and C++ Only)............................................................................51
Type Specifier....................................................................................................................53
Type Qualifier...................................................................................................................55
Attribute Specifier..............................................................................................................55
Pointer Modifiers....................................................................................................................59
Pointer for C Programming Language...................................................................................59
Ptr-operator for C++ Programming Language ........................................................................60
Usage Guidelines..............................................................................................................60
Operators..............................................................................................................................61
_arg_present() ..................................................................................................................62
_bitlength()........................................................................................................................62
_optional()........................................................................................................................62
Data Types............................................................................................................................63
decimal............................................................................................................................64
long long..........................................................................................................................64
unsigned long long............................................................................................................64
signed char.......................................................................................................................64
Size of Type int..................................................................................................................64
3 Interfacing to Guardian Procedures and OSS Functions.................................66
Declaring Guardian Procedures................................................................................................66
Calling Guardian Procedures...................................................................................................67
Procedures That Return a Return Value..................................................................................67
Procedures That Return a Condition Code.............................................................................68
Procedures With 16-Bit Addressable Parameters.....................................................................69
Procedures That You Cannot Call.........................................................................................70
Declaring OSS Functions.........................................................................................................70
4 Using the C Run-Time Library.....................................................................71
Versions of the C Run-Time Library............................................................................................71
Input/Output Models..............................................................................................................71
Logical File Types...............................................................................................................72
Physical File Types..............................................................................................................73
ANSI-Model I/O...............................................................................................................74
Alternate-Model I/O..........................................................................................................74
Mathematical Functions ..........................................................................................................74
IEEE Floating-Point Arithmetic...............................................................................................75
Active Backup Programming Functions.......................................................................................76
Environment-Specific Functions..................................................................................................77
4 Contents