C/C++ Programmer's Guide (G06.25+)

HP C/C++ Programmer’s Guide for NonStop Systems429301-008
3-1
3
Interfacing to Guardian Procedures
and OSS Functions
Declaring Guardian Procedures on page 3-1
Calling Guardian Procedures on page 3-3
°
Procedures That Return a Return Value on page 3-3
°
Procedures That Return a Condition Code on page 3-4
°
Procedures With 16-Bit Addressable Parameters on page 3-6
°
Procedures That You Cannot Call on page 3-6
Declaring OSS Functions on page 3-6
This section describes how to declare and call Guardian procedures and OSS
functions in C and C++ programs.
You can (and sometimes must) use Guardian procedures when you cannot accomplish
a task with C functions. For example, to get the file code of a Guardian file, you must
use a Guardian file system procedure, such as FILE_GETINFO_ or
FILE_GETINFOBYNAME_. (See also Procedures With 16-Bit Addressable Parameters
on page 3-6.)
For information about Guardian procedures, see the Guardian Procedure Calls
Reference Manual. Some procedures in this manual are described as “superseded” by
other procedures. For example, OPEN is superseded by FILE_OPEN_. Superseded
procedures do not take full advantage of D-series or later features and you should not
use them. They are provided for backward compatibility only.
Declaring Guardian Procedures
Like all functions in a C program, Guardian procedures must be declared before they
can be called. Guardian procedures are declared as external procedures.
The library header files cextdecs (in $SYSTEM.SYSTEM in the Guardian file system)
and cextdecs.h (in /usr/include and its subdirectories in the OSS and PC file
systems) simplify the task of declaring Guardian procedures. These identical header
files contain function prototype declarations for most of the Guardian procedures that
you can call directly from C and C++ programs. These files also correspond to the TAL
and pTAL EXTDECS header file.
Other header files in $SYSTEM.SYSTEM and /usr/include also contain Guardian
procedure declarations. These header files declare Guardian procedures added in D40
or later releases and include the setjmp, tdmsigh, dlaunchh, and histryh header
files.
To determine the header file that declares the procedure, refer to a procedure’s
reference page in the Guardian Procedure Calls Reference Manual. Each procedure’s