Up | Previous | Next | Title Page | Contents

4.2 Image Label Access API

This Section describes the subroutines that make up the programmer's interface for label processing.

4.2.1 x/zladd—Add information to an existing label item

call xladd(unit, type, key, value, status, <optionals>, ' ')
status = zladd(unit, type, key, value, <optionals>, 0);
x/zladd adds label items or values to multi-valued label items to a label. Strings in the image label are delimited by single quotes ( '). A single quote in an input string will be repeated before being put in the label. On output (from x/zlget), the pair will be returned as one single quote. In other words, the repeating of quotes is transparent to the application program.

Arguments:

Optional arguments:

The three values are independent of each other. Thus 'SA' will cause a system message to be printed and the program to abort if an error occurs. If ERR_ACT consists only of blanks, an error will cause routine to return an error number in STATUS.
If ERR_ACT is not specified, then the action defaults to the value of the LAB_ACT optional to x/zvopen (the default for LAB_ACT is specified by x/zveaction).

FORMAT is required. If the value in the FORMAT optional does not match the format of the currently existing label item, the label item is changed to match the optional. If this is not possible (i.e., a non-numeric string being changed to an integer), an error is returned.

4.2.2 x/zldel—Remove a label item

call xldel(unit, type, key, status, <optionals>, ' ')
status = zldel(unit, type, key, <optionals>, 0);
x/zldel removes a label item from a file that the user owns (an output file on a command line) or for which the user has update privilege. x/zldel permits the partial deletion of values in a multi-value label item.

Arguments:

Optional arguments:

The three values are independent of each other. Thus 'SA' will cause a system message to be printed and the program to abort if an error occurs. If ERR_ACT consists only of blanks, an error will cause routine to return an error number in STATUS.
If ERR_ACT is not specified, then the action defaults to the value of the LAB_ACT optional to x/zvopen (the default for LAB_ACT is specified by x/zveaction).

4.2.3 x/zlget—Return the value of a label item

call xlget(unit, type, key, value, status, <optionals>, ' ')
status = zlget(unit, type, key, value, <optionals>, 0);
x/zlget returns the value or values associated with a label item key word. VALUE may be an array; the optional argument NELEMENT will indicate the dimension of VALUE.

Arguments:

For example, if you wanted to have a string array capable of handling 10 elements, with 80 characters in each element, this is how you would declare it in C:
char value[10][80];
The standard C null string terminator is always returned in the string, so the above array could only hold 79 characters. You would still pass in the length (via ULEN) as 80.
From C, ULEN is required for multivalued strings (string arrays), as it specifies the inner dimension of the array. For scalar strings (not an array), ULEN is not strictly required as the length of the string is not required. BUT, you will have no protection against overflowing the buffer. Specifying ULEN for a scalar string ensures that an exceptionally long string value will not exceed the size of your buffer. So it is a good idea to always specify ULEN from C, although it's only really required for a string array.
In FORTRAN you use a CHARACTER array: CHARACTER*80 VALUE (10) 
In this case ULEN is not required, as the character descriptor contains the length of each string. The space after the string itself is filled with blanks.

Optional arguments:

The three values are independent of each other. Thus 'SA' will cause a system message to be printed and the program to abort if an error occurs. If ERR_ACT consists only of blanks, an error will cause routine to return an error number in STATUS.
If ERR_ACT is not specified, then the action defaults to the value of the LAB_ACT optional to x/zvopen (the default for LAB_ACT is specified by x/zveactiion).

In the present implementation, FORMAT is required. If the format does not match the format of the currently existing label item, the label item is changed to match what is given in this optional. If this is not possible (i.e., a non-numeric string being changed to an integer), an error is returned.

4.2.4 x/zlhinfo—Return history label information

call xlhinfo(unit, tasks, instances, nhist, status, <optionals>, ' ')
status = zlhinfo(unit, tasks, instances, nhist, <optionals>, 0);
A history label is partitioned into subsets, one for each processing task that has 'read' or 'written' the data in the file described by the label. x/zlhinfo returns the names and instances of the history label subsets for the file associated with UNIT.

Arguments:

Optional arguments:

The three values are independent of each other. Thus 'SA' will cause a system message to be printed and the program to abort if an error occurs. If ERR_ACT consists only of blanks, an error will cause routine to return an error number in STATUS.
If ERR_ACT is not specified, then the action defaults to the value of the LAB_ACT optional to x/zvopen (the default for LAB_ACT is specified by x/zveaction).

4.2.5 x/zlinfo—Return information about a single label item

call xlinfo(unit,type,key,format,maxlen,nelement,status,<optionals>,' ')
status = zlinfo(unit,type,key,format,maxlen,nelement,<optionals>, 0);
x/zlinfo will return certain information about a single label item of given TYPE and KEY.

Arguments:

Optional arguments:

4.2.6 x/zlninfo—Return name of next key

call xlninfo(unit,key,format,maxlength,nelement,status,<optionals>,' ')
status = zlninfo(unit,key,format,maxlength,nelement,<optionals>, 0);

x/zlninfo operates much like the routine x/zlinfo except that x/zlninfo does not expect an input for KEY. Instead, x/zlninfo will return a string in KEY which holds the next label item key word in the sequence of label items for the given TYPE. In addition, x/zlninfo will return the same information as x/zlinfo. If the last available label item has already been returned then that condition will be indicated in STATUS.

Arguments:

Optional arguments:

4.2.7 x/zlpinfo—Returns the names of property subsets in the given file

call xlpinfo(unit, properties, nprop, status, <optionals>, ' ')
status = zlpinfo(unit, properties, nprop, <optionals>, 0);
Returns the names of property subsets in the given file. Property labels are broken up into subsets, each with a property name. This routine returns a list of all property names in the file specified by UNIT, which must be open. This routine is identical to xlhinfo, except that it returns property names instead of task names and instances.

Arguments:

Optional Arguments:

The three values are independent of each other. Thus, “SA” will cause a system error message to be printed and the program to abort if an error occurs. If ERR_ACT is empty or contains only blanks, no action will be taken on error, and the error code will be returned in STATUS.
If ERR_ACT is not specified, then the action defaults to the value of the LAB_ACT optional to x/zvopen . The default for LAB_ACT is specified by x/zveaction.


Up | Previous | Next | Title Page | Contents