Guardian Programmer's Guide

Table Of Contents
Using DEFINEs
Guardian Programmer’s Guide 421922-014
7 - 12
Setting Attributes in the Working Set
Setting Attributes in the Working Set
The primary method for setting attributes in the working set is the DEFINESETATTR
procedure. The DEFINESETLIKE and DEFINERESTORE procedures, however, also
have the effect of setting working set attributes.
The following paragraphs describe each of these procedures.
Setting Attributes Using the DEFINESETATTR Procedure
The DEFINESETATTR procedure assigns a value to an individual attribute in the
working set.
When assigning a value to any attribute, you must supply DEFINESETATTR with the
name of the attribute you want to assign a value to, the actual attribute value, and the
length of the value string.
In addition to the name, value, and length of the attribute, if the attribute type is
filename, subvolname, or volname, you should also supply the default-names
parameter to supply values for the node name, volume name, and subvolume name to
be used to convert the attribute value into an internal form. A convenient way of
obtaining these values is by reading them from the Startup message; Section 8,
Communicating With a TACL Process, describes how to do this.
Assign a value to the CLASS attribute first. When you do this, the file system initializes
all defaulted attributes for that DEFINE CLASS with default values. The following
example assigns the value “MAP” to the CLASS attribute:
DEFAULT^VALUES ':=' "$VOL SUBVOL ";
.
.
ATTRIBUTE^NAME ':=' "CLASS ";
ATTRIBUTE^VALUE ':=' "MAP" -> @S^PTR;
ATTRIBUTE^LENGTH := @S^PTR '-' @ATTRIBUTE^VALUE;
ERROR := DEFINESETATTR(ATTRIBUTE^NAME,
ATTRIBUTE^VALUE,
ATTRIBUTE^LENGTH);
IF ERROR <> 0 THEN ...
For a complete list of the error conditions that this procedure might return, see the
Guardian Procedure Calls Reference Manual.
After assigning a value to the CLASS attribute, use additional DEFINESETATTR calls
to assign values to other attributes:
ATTRIBUTE^NAME ':=' "FILE ";
ATTRIBUTE^VALUE ':=' "MYFILE" -> @S^PTR;
ATTRIBUTE^LENGTH := @S^PTR '-' @ATTRIBUTE^VALUE;
ERROR := DEFINESETATTR(ATTRIBUTE^NAME,
ATTRIBUTE^VALUE,
ATTRIBUTE^LENGTH,
DEFAULT^VALUES);
IF ERROR <> 0 THEN ...