The AN routines are listed in Table 10A and are described in more detail in subsequent sections of this chapter.
AN_DATA_LABEL
(or 0
), the AN_DATA_DESC
(or 1
), the AN_FILE_LABEL
(or 2
) and the AN_FILE_DESC
(or 3
) definitions. Several routines in the AN interface require one of these type definitions to be passed in as an argument to designate the kind of annotation to be created or accessed.The AN interface writes file labels, file descriptions, data object labels, and data object descriptions according to the following programming model:
C: file_id = Hopen(filename, file_access_mode, num_dds_block);
an_id = ANstart(file_id);
ann_id = ANcreatef(an_id, annot_type);
OR ann_id = ANcreate(an_id, obj_tag, obj_ref, annot_type);
<Optional operations>
status = ANendaccess(ann_id);
status = ANend(an_id);
status = Hclose(file_id);
FORTRAN: file_id = hopen(filename, file_access_mode, num_dds_block)
an_id = afstart(file_id)
ann_id = affcreate(an_id, annot_type)
OR ann_id = afcreate(an_id, obj_tag, obj_ref, annot_type)
<Optional operations>
status = afendaccess(ann_id)
status = afend(an_id)
status = hclose(file_id)
ANcreatef creates a file label or file description. It takes two parameters: the AN interface identifier, an_id
, returned by ANstart, and the type of the file annotation to be created, annot_type
. The parameter annot_type
must be set to either AN_FILE_LABEL
(or 2
) or AN_FILE_DESC
(or 3
). ANcreatef returns the file annotation identifier (ann_id
) if successful, and FAIL
(or -1
) otherwise.
ANcreate creates a data label or data description. It takes four parameters: an_id
, obj_tag
, obj_ref
, and annot_type
. The parameter an_id
is the AN interface identifier, returned by ANstart. The parameters obj_tag
and obj_ref
are the tag/reference number pair of the object the annotation will be assigned to. The parameter annot_type
specifies the type of the data annotation. It must be set to either AN_DATA_LABEL
(or 0
) or AN_DATA_DESC
(or 1
). The annotation type definitions are defined in the header file "hdf.h".
ANcreate returns the data annotation identifier (ann_id
) if successful and FAIL
(or -1
) otherwise. The parameters of ANcreate, ANcreatef, and ANstart are further defined in Table 10B.
ann_id
, which is returned by ANcreate or ANcreatef. Any subsequent attempts to access this annotation identifier will result in a value of FAIL
being returned. One ANendaccess must be called for every ANcreate, ANcreatef, or ANattach. Each ANendaccess returns either SUCCEED
(or 0
) or FAIL
(or -1
).
ANend terminates access to the AN interface identified by the parameter an_id
, which is returned by ANstart. Any subsequent attempts to access the AN interface identifier or to use AN routines will result in a value of FAIL
being returned.
ANend returns either SUCCEED
(or 0
) or FAIL
(or -1
). The parameters of ANendaccess and ANend are defined in Table 10B.
The HDF file must be closed by Hclose after all calls to ANend have been properly made. Hclose is described in Chapter 2, HDF Fundamentals.