Guardian Procedure Calls Reference Manual (G06.25+)
Introduction to Guardian Procedure Calls
Guardian Procedure Calls Reference Manual—522629-013
1-12
C Syntax for a Guardian Procedure Call
C Syntax for a Guardian Procedure Call
C syntax is presented in this manual in addition to TAL syntax. Where necessary,
considerations for C programmers are also presented. For further information on
calling Guardian procedures from a C program, refer to the
C/C++ Programmer’s
Guide.
Figure 1-3
shows an example of C syntax. As in TAL syntax, square brackets ([ ])
indicate optional parameters. Detailed descriptions of parameters are not included with
the C syntax; such descriptions accompany the TAL syntax.
Because TAL does not have a string terminator like C, it often requires that you supply
both a string and its length (not counting the null-byte terminator) in two parameters, or
that you supply a string buffer with the maximum string length along with a third
parameter for returning the actual string length (see “String Output Variables,” earlier in
this section).
When calling TAL procedures that use strings in this manner from a C program, you
must also pass the complete set of parameters for handling the string. The TAL
convention of pairing certain string parameters together, joined by colons, is not
supported in C; parameters are always separated by commas.
C Header Files
To support portability from the UNIX environment, the name of a C header file can
contain an internal period (.). The HP C for NonStop Systems compiler accepts both of
the following statements as equivalent:
#include <stdio.h>
#include <stdioh>
Actual C header files are stored on the same subvolume as the C compiler with no
internal periods in their names. If the C compiler on your system is
$SYSTEM.SYSTEM.C, then your system should have the header file
$SYSTEM.SYSTEM.STDIOH.
CEXTDECS in H-Series Systems
In H-series systems, CEXTDECS (through the included file TNSINTH) defines 32-bit
values as the
typedef __int32_t which for TNS and TNS/R compiles is defined as long
and for TNS/E compiles is defined as
int.
Figure 1-3. Sample C Syntax for a Procedure Call
#include <cextdecs(BREAKMESSAGE_SEND_)>
short BREAKMESSAGE_SEND_ ( short *processhandle
,short receiver-filenum
,[ short *breaktag ] );