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

ANreadann/afreadann

intn ANreadann(int32 ann_id, char* textbuf, int32 textbuf_length)
ann_id

IN:

Annotation identifier returned by ANcreate, ANcreatef or ANselect

textbuf

OUT:

Buffer for the returned annotation text

textbuf_length

IN:

Length, in bytes, of textbuf

Purpose

Reads the annotation identified by the annotation identifier ann_id.

Return value

Returns SUCCEED (or 0) if successful and FAIL (or -1) otherwise.

Description

ANreadann reads the annotation specified by ann_id and places it into textbuf. The textbuf_length parameter is the size of textbuf. A null termination is added to the buffer as necessary - therefore, the buffer should be sized to accomodate this null termination.

Example

This example illustrates the use of ANreadann using a statically-sized buffer:

#include "hdf.h"

int32 an_id, ann_id, file_id, stat;
int32 index = 0;
char textbuf[20];
ann_type annot_type = AN_FILE_DESC;

file_id = Hopen("myfile", DFACC_READ, 0);
an_id = ANstart(file_id);
ann_id = ANselect(an_id, index, annot_type);
       ...
/* Read a 17 character annotation text string, */
/*  plus a null termination cha                */
stat = ANreadann(ann_id, textbuf, 18);
       ...
stat = ANendaccess(ann_id);
stat = ANend(an_id);
Hclose(file_id);
     

 FORTRAN	integer function afreadann(ann_id, buf, buf_length)

integer ann_id, buf_length

character* (*) buf



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

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