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

DFANaddfds/daafds

intn DFANaddfds(int32 file_id, char *description, int32 desc_len)
file_id

IN:

File identifier returned by Hopen

description

IN:

Sequence of ASCII characters (may include NULL or '\0')

desc_len

IN:

Length of the description

Purpose

Adds a file description to a file.

Return value

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

Description

These annotations are associated with the file, not with any particular object within the file. The parameter description can contain any sequence of ASCII characters. It does not have to be a string. Use the general purpose routines Hopen and Hclose to manage file access as the file annotation routines will not open and close HDF files.

Example

This example illustrates the use of DFANaddfid and DFANaddfds to write a file label and description to an HDF file.

	#include "hdf.h"
	#define MAXLABLEN 80
	#define MAXDESCLEN 1000
	     ...
	int32 file_id;
	char label[MAXLABLEN+1], description[MAXDESCLEN+1];

	file_id = Hopen("myfile", DFACC_WRITE, 0);

	/* store a file label in the file */
	strcpy(label, "File #1");
	DFANaddfid(file_id, label);

	/* store description in file */
	DFANaddfds(file_id, description, desc_len(description));

	Hclose(file_id);
	     ...
 
FORTRAN

integer function daafds(file_id, description, desc_len)

integer file_id, desc_len

character* (*) description



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

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