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

parameters. Use the Guardian procedures with 32-bit addressable parameters in new code and
consider converting old code as well.
Parameters located in the user data segment need to be declared and passed properly.
Small-memory model TNS C programs only support 16-bit addressable data so no changes are
required. Large-memory model and 32-bit (or wide) data model TNS C and C++ programs require
you to use the NOXVAR pragma or the _near pointer modifier to denote aggregates that are to
be stored in the user data segment. See XVAR (page 260) or Attribute Specifier (page 55).
Procedures That You Cannot Call
C and C++ programs can call most but not all Guardian procedures. For example, they cannot
call the Guardian INITIALIZER and ARMTRAP procedures. To determine whether a Guardian
procedure can be called from a C or C++ program, see the procedure’s reference page in the
Guardian Procedure Calls Reference Manual.
C and C++ programs cannot directly call Guardian procedures that both return a value and return
a condition code. The subsections TAL Procedures That You Cannot Directly Call (page 105) and
pTAL Procedures That You Cannot Call Directly (page 129) present techniques that enable you to
access procedures in this category.
Declaring OSS Functions
Unlike Guardian procedures that are written in TAL or pTAL, Open System Services (OSS) functions
are written in C. Therefore, to declare OSS functions, you need only to specify library header files
that contain the prototype definitions for OSS functions called from your program. To determine
the correct header files to specify, see the Open System Services System Calls Manual, the Open
System Services Library Calls Manual, or the reference page for a particular function.
C and C++ programs that run in the Guardian environment cannot call all OSS functions. For more
details, see the Open System Services Programmer’s Guide.
70 Interfacing to Guardian Procedures and OSS Functions