[Top] [Prev] [Next] [Bottom]

ANannlist/afannlist

intn ANannlist(int32 an_id, ann_type annot_type, uint16 obj_tag, uint16 obj_ref, int32 *ann_list)
an_id

IN:

Multifile annotation interface identifier returned by ANstart

annot_type

IN:

Target annotation type

obj_tag

IN:

Tag of the object the target annotation is attached to

obj_ref

IN:

Reference number of the object the target annotation is attached to

ann_list

OUT:

Buffer for the returned annotation identifiers

Purpose

Returns a list of annotation identifiers for the annotations in the file that correspond to the annotation type specified by annot_type, the tag specified by obj_tag and the reference number specified by obj_ref.

Return value

Returns the number of qualifying annotations or FAIL (or -1) otherwise.

Description

The identifiers in the list returned by ANannlist can refer to either data labels or a data descriptions. The returned identifier list is used in conjunction with ANnumann and HDmalloc (or malloc) to specify the size of a buffer that will be used to store the list of identifiers returned by ANannlist - see the example below.

.

Valid values for annot_type are: AN_DATA_LABEL for data labels and AN_DATA_DESC for data descriptions.

Note that only data labels and data descriptions (identified by the AN_DATA_LABEL and AN_DATA_DESC definitions) are supported by ANannlist. To return file labels or file descriptions use ANfileinfo to determine the number of file labels and descriptions, then use ANselect with ANreadann to read them.

Example

This example illustrates the use of ANannlist in returning the list of annoations attached to the second numeric data group object in the file:

#include "hdf.h"

int32 an_id, ann_id, file_id, *ann_list, stat;
ann_type annot_type = AN_DATA_LABEL;
uint16 obj_tag = DFTAG_NDG;
uint16 obj_ref = 2;
int num_ann;

file_id = Hopen("myfile", DFACC_READ, 0);
an_id = ANstart(file_id);
num_ann = ANnumann(an_id, annot_type, obj_tag, obj_ref);
ann_list = HDmalloc(num_ann * sizeof(int32));
num_ann = ANannlist(an_id, annot_type, obj_tag, obj_ref,
				ann_list);
       ...
stat = ANend(an_id);
Hclose(file_id);
 
FORTRAN

integer function afannlist(an_id, annot_type, obj_tag, obj_ref, ann_list)

integer ann_list(*)

integer an_id, obj_tag, obj_ref, annot_type



[Top] [Prev] [Next] [Bottom]

hdfhelp@ncsa.uiuc.edu
HDF User's Reference Manual, Draft 06/01/97, NCSA HDF Development Group.