C/C++ Programmer's Guide (G06.27+, H06.08+, J06.03+)
4 Using the C Run-Time Library
Versions of the C Run-Time Library
There are four versions of the C run-time library:
• Guardian TNS C run-time library
• Open System Services (OSS) G-series TNS C run-time library
• Guardian and OSS TNS/R native C run-time library
• Guardian and OSS TNS/E native C run-time library
The library version used depends on the environment (NonStop) and mode (TNS or native) of a
program.
Each library version provides the complete set of functions specified by the ISO/ANSI C standard.
The ISO/ANSI C standard allows implementations to vary in specific instances. For more details,
see Appendix A: HP C Implementation-Defined Behavior.
The OSS TNS and OSS native library versions and the Guardian native library versions support
additional functions specified by the XPG4 and XPG4 Version 2 specifications. For more details
on standards compliance, see Complying With Standards (page 45).
Regardless of the data model of a Guardian module, you can call ISO C standard functions and
HP extension functions. From Guardian modules using the 32-bit (wide) data model, you can call
many functions also specified in the XPG4 Version 1 or Version 2 specifications (X/OPEN UNIX95)
or the POSIX standard. From Guardian modules using the 16-bit data model, you cannot call
functions in the XPG4 specifications or the POSIX standard that are not also in the ISO C standard.
(The ISO C standard is a subset of the XPG4 specifications and the POSIX standard.)
The C run-time libraries also include HP extension functions for input and output, fault-tolerant
programming, SQL data-type conversion, EDIT file manipulation, and process startup information
retrieval.
Complete semantics and syntax of functions and macros in each version of the C run-time library
are documented in these manuals:
ManualVersion
Guardian TNS C Library Calls Reference ManualGuardian TNS C run-time library
D30 edition of the Open System Services Library Calls
Reference Manual
OSS TNS C G-series run-time library
Guardian Native C Library Calls Reference ManualGuardian native C run-time libraries
Open System Services Library Calls Reference ManualOSS native C run-time libraries
Input/Output Models
The C run-time library provides direct input and output access to several types of physical files:
• C disk files, which are odd-unstructured files and have a file code of 180
• EDIT disk files, which have a file code of 101
• Processes
• Terminals
To provide uniform access to these various types of physical files, the C run-time library uses two
logical file types, binary and text, to characterize and interpret the data found in a given file.
In addition, the C run-time library provides two sets of input and output functions. Each set has its
own method of tracking, maintaining, and referring to a file. These methods, called file-reference
Versions of the C Run-Time Library 71