4 Implementation

The way in which the package is implemented is described here for interest. Programmers should not make use of this information; otherwise portability is compromised.

A reference object is an HDS structure of type REFERENCE_OBJ with two components, FILE and PATH, of type _CHAR*(REF__SZREF). REF__SZREF is defined in the REF_PAR include file.

FILE
contains the name of the container file for the referenced object. This is set to spaces if the reference is internal.
PATH
contains the pathname of the referenced object (as supplied by HDS_TRACE). The name of the top level component of the pathname will not be used in finding the locator for the referenced object. This fact allows structures containing internal references to be copied but the path below the top level must still lead to an appropriate object.

Locators obtained via a reference are flagged as such by being linked to the group $$REFERENCED$ using the subroutine HDS_LINK. This fact is used by REF_ANNUL in determining whether or not HDS_CLOSE should be called for the container file of the object specified by the locator argument. Note that the effect of calling HDS_CLOSE is to counter the HDS_OPEN done in obtaining a locator to the referenced object. The container file will only be physically closed if the container file reference count goes to zero.