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

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. This directive includes only
the process-creation and system-message constant declarations:
#include "$system.zsysdefs.zsysc (process_constant, \
system_messages_constant"
Calling Guardian Procedures
The syntax of a Guardian procedure call determines whether a parameter is required or is optional.
To call procedures with optional parameters, omit the parameter, but must include the comma that
would follow it. For example:
err = FILENAME_SCAN_ (string,length,count,,,options);
A call to a Guardian procedure usually returns either a return value or a condition code. Most
Guardian procedures fall into one of these two categories, and you can call these procedures
directly from a C or C++ program. Those procedures that return both a return value and a condition
code cannot be called directly from a C or C++ program.
Procedures That Return a Return Value
Example 1: Calling a Guardian Procedure That Returns a Return Value shows a C program that
calls the Guardian procedure FILE_GETINFOBYNAME_ to get information about a Guardian file,
which is provided as an input parameter to the procedure. The procedure returns a return value
into retcode.
The integer into which a value is returned, retcode, is declared as a short integer. This is
because the integer data type in Guardian procedures represents a 16-bit word, while the
Note 1
integer data type in large-model and wide-model C and C++ programs represents a 32-bit
word.
You must insert a placeholder comma (,) if you omit optional parameters, unless you omit them
from the end of the list. Omitted optional parameters contain default values, if default values
are defined.
Note 2
Calling Guardian Procedures 67