C/C++ Programmer's Guide (G06.25+)
Interfacing to Guardian Procedures and OSS
Functions
HP C/C++ Programmer’s Guide for NonStop Systems—429301-008
3-2
Declaring Guardian Procedures
reference page includes its C declaration syntax; however, do not use this syntax to
declare Guardian procedures. Include the appropriate header file instead.
The header files specify the C names for the Guardian procedures in uppercase
characters and provide a section for each procedure using the SECTION pragma.
The declarations provided by the header files follow the guidelines for declaring TAL
procedures in Section 7, Mixed-Language Programming for TNS Programs, and for
declaring pTAL procedures in Section 8, Mixed-Language Programming for TNS/R and
TNS/E Native Programs.
To access declarations in the header files, use the #include directive, specifying as
section names the names of the Guardian procedures you want to include. The
following example includes the declarations of the PROCESS_GETINFOLIST_ and
FILENAME_FINDNEXT_ procedures:
#include <cextdecs(PROCESS_GETINFOLIST_, FILENAME_FINDNEXT_)>
Many Guardian procedures are written in TAL or pTAL. The header file declarations
use the _tal language-specifier to identify external routines. Native C and C++
programs that call Guardian procedures must specify the EXTENSIONS pragma,
because _tal is an HP extension.
Guardian procedures that use condition codes are declared as procedures returning
_cc_status. Consequently, you must include the header talh (in the Guardian file
system) or tal.h (in the OSS file system) before you call such a Guardian procedure.
The $SYSTEM.ZSYSDEFS.ZSYSC file contains a set of declarations, consisting
mainly of named constants (literals) and data structure definitions, that can be used for
parameters to Guardian procedures. Like the Guardian procedure header files, the
ZSYSC file is divided into sections that allow you to include only those declarations
that your program needs. The following directive includes only the process-creation
and system-message constant declarations:
#include "$system.zsysdefs.zsysc (process_constant, \
system_messages_constant"