an_id
. The syntax for ANfileinfo is as follows:
C: status = ANfileinfo(an_id, &n_file_labels, &n_file_descs, &n_data_labels, &n_data_descs);
FORTRAN: status = affileinfo(an_id, n_file_labels, n_file_descs, n_data_labels, n_data_descs)The retrieved information will be stored in the parameters
n_file_labels
, n_file_descs
, n_data_labels
, and n_data_descs
, respectively. They can also be used as loop boundaries. ANfileinfo returns either
SUCCEED
(or 0
) or FAIL
(or -1
). The parameters of ANfileinfo are further described in Table 10E.
10.6.2 Getting the Length of an Annotation: ANannlen
ANannlen returns either the length of the annotation, identified by the parameter ann_id
, or FAIL
(or -1
) upon unsuccessful completion. The syntax for ANannlen is as follows:C: ann_len = ANannlen(ann_id);
FORTRAN: ann_len = afannlen(ann_id)
The parameters of ANannlen are further described in Table 10E.
TABLE 10E - ANfileinfo and ANannlen Parameter Lists
annot_type
and that are attached to the object identified by its tag, obj_tag
, and reference number, obj_ref
. The syntax for ANnumann is as follows:
C: ann_num = ANnumann(an_id, annot_type, obj_tag, obj_ref);
FORTRAN: ann_num = afnumann(an_id, annot_type, obj_tag, obj_ref)As this routine is implemented only to obtain the total number of data annotations and not file annotations, the valid values of
annot_type
are AN_DATA_LABEL
(or 0
) and AN_DATA_DESC
(or 1
). To obtain the total number of file annotations or all data annotations, use ANfileinfo.ANnumann returns the total number of qualified annotations or
FAIL
(or -1
). The parameters of ANnumann are further described in Table 10F.
10.6.4 Obtaining the List of Specifically-typed Annotation Identifiers of a Data Object: ANannlist
ANannlist retrieves the annotation identifiers for all of the annotations that are of type annot_type
and belong to the object identified by its tag, obj_tag
, and its reference number, obj_ref
. The syntax for ANannlist is as follows:C: status = ANannlist(an_id, annot_type, obj_tag, obj_ref, ann_list);
FORTRAN: status = afselect(an_id, annot_type, obj_tag, obj_ref, ann_list)
The identifiers of the retrieved annotations are stored in the parameter ann_list
. The routine ANnumann can be used to obtain the number of annotations to be retrieved for dynamic memory allocation.SUCCEED
(or 0
) or FAIL
(or -1
). The parameters of ANannlist are further described in Table 10F.
TABLE 10F - ANnumann and ANannlist Parameter Lists
index
, and by the annotation type, specified by the parameter annot_type
. The syntax for ANget_tagref is as follows:
C: status = ANget_tagref(an_id, index, annot_type, &ann_tag, &ann_ref);
FORTRAN: status = afgettagref(an_id, index, annot_type, ann_tag, ann_ref)The tag is stored in the parameter
ann_tag
and the reference number is stored in the parameter ann_ref
. The parameter index
is a nonnegative value and is less than the total number of annotations of type annot_type
in the file. Use ANfileinfo to obtain the total number of annotations of type annot_type
in the file.The value of
annot_type
can be either AN_DATA_LABEL
(or 0
), AN_DATA_DESC
(or 1
), AN_FILE_LABEL
(or 2
), or AN_FILE_DESC
(or 3
).ANget_tagref returns either
SUCCEED
(or 0
) or FAIL
(or -1
). The parameters of ANget_tagref are further described in Table 10G on page 332.
10.6.6 Obtaining the Tag/Reference Number Pair from a Specified Annotation Identifier: ANid2tagref
ANid2tagref retrieves the tag/reference number pair of the annotation identified by the parameter ann_id
. The syntax for ANid2tagref is as follows:C: status = ANid2tagref(ann_id, &ann_tag, &ann_ref);
FORTRAN: status = afidtagref(ann_id, ann_tag, ann_ref)
ANid2tagref stores the retrieved tag and reference number into the parameters ann_tag
and ann_ref
. Possible values returned in ann_tag
are DFTAG_DIL
(or 104
) for a data label, DFTAG_DIA
(or 105
) for a data description, DFTAG_FID
(or 100
) for a file label, and DFTAG_FD
(or 101
) for a file description. SUCCEED
(or 0
) or FAIL
(or -1
). The parameters of ANid2tagref are further described in Table 10G on page 332.
10.6.7 Obtaining the Annotation Identifier from a Specified Tag/Reference Number Pair: ANtagref2id
ANtagref2id routine returns the identifier of the annotation that is specified by its tag/reference number pair or FAIL
(or -1
). The syntax for ANtagref2id is as follows:C: ann_id = ANtagref2id(an_id, ann_tag, ann_ref);
FORTRAN: ann_id = aftagrefid(an_id, ann_tag, ann_ref)
The parameters of ANtagref2id are further described in Table 10G on page 332.
10.6.8 Obtaining an Annotation Tag from a Specified Annotation Type: ANatype2tag
ANatype2tag returns the tag that corresponds to the annotation type specified by the parameter annot_type
if successful, or DFTAG_NULL
(or 0
) otherwise. The syntax for ANatype2tag is as follows:C: ann_tag = ANatype2tag(annot_type);
FORTRAN: ann_tag = afatypetag(annot_type)
The following table lists the valid values of annot_type
in the left column and the corresponding values for the returned annotation tag on the right.
|
|
---|---|
|
|
|
|
|
|
|
|
The parameters of ANatype2tag are further described in Table 10G.
10.6.9 Obtaining an Annotation Type from a Specified Object Tag: ANtag2atype
ANtag2atype returns the annotation type corresponding to the annotation tag ann_tag
if successful, or AN_UNDEF
(or -1
) otherwise. The syntax for ANtag2atype is as follows:C: annot_type = ANtag2atype(ann_tag);
FORTRAN: annot_type = aftagatype(ann_tag)
The following table lists the valid values of ann_tag
in the left column and the corresponding values of the returned annotation type in the right column.
|
|
---|---|
|
|
|
|
|
|
|
|
The parameters of ANtag2atype are further described in Table 10G.
TABLE 10G - ANget_tagref, ANid2tagref, ANtagref2id, ANatype2tag, and ANtag2atype Parameter Lists
In this example, the program locates the vgroup named "AN Vgroup" that was created in the file "General_HDFobjects.hdf" by Example 1. The program then gets the number of data descriptions that this vgroup has and the list of their identifiers. If there are any identifers in the list, the program displays the corresponding reference numbers. Finally, the program makes two simple conversions, from an annotation type to a tag and from a tag to an annotation type, and displays the results.
C version