Guardian Programmer's Guide

Table Of Contents
Using DEFINEs
Guardian Programmer’s Guide 421922-014
7 - 6
CLASS DEFAULTS DEFINEs
(Although swap space is handled by the Kernel-Managed Swap Facility (KMSF), a
swap file name can still be passed in the =_DEFAULTS DEFINE. This feature
supports programs that use the swap file name to determine the volume on which to
create temporary files.)
The following example sets up the =_DEFAULTS DEFINE with the subvolume
$OURVOL.ACCOUNTS. These default values are automatically passed on to child
processes:
ATTRIBUTE^NAME ':=' "CLASS ";
ATTRIBUTE^VALUE ':=' "DEFAULTS";
ATTRIBUTE^LENGTH := 8;
ERROR := DEFINESETATTR(ATTRIBUTE^NAME,
ATTRIBUTE^VALUE,
ATTRIBUTE^LENGTH,
DEFAULT^NAMES);
IF ERROR <> 0 THEN ...
ATTRIBUTE^NAME ':=' "VOLUME ";
ATTRIBUTE^VALUE ':=' "$OURVOL.ACCOUNTS";
ATTRIBUTE^LENGTH := 16;
ERROR := DEFINESETATTR(ATTRIBUTE^NAME,
ATTRIBUTE^VALUE,
ATTRIBUTE^LENGTH,
DEFAULT^NAMES);
IF ERROR <> 0 THEN ...
=_DEFAULTS is a special case of DEFINE and should be handled differently from
other DEFINEs. Specifically:
Your application need not reference the =_DEFAULTS DEFINE. Many procedures
use the default values specified in the =_DEFAULTS DEFINE; see the Guardian
Procedure Calls Reference Manual to check which procedures use the defaults
and which do not.
The file system automatically modifies the =_DEFAULTS DEFINE of a process
when the process receives its Startup message from the command interpreter.
The file system assigns values from this Startup message to the VOLUME attribute
of the DEFINE. This often has no effect because, for example, if TACL sends the
Startup message, it will have ensured that the DEFINE and the Startup message
contain the same default volume. However, programs other than TACL might
behave differently. See Section 8, Communicating With a TACL Process, for
details about the startup sequence.
The =_DEFAULTS DEFINE cannot be deleted.
The name of the =_DEFAULTS DEFINE cannot be changed.
The =_DEFAULTS DEFINE is always propagated to other processes regardless of
the setting of the DEFINE mode. See Section 16, Creating and Managing
Processes, for a discussion on how DEFINEs are propagated.