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

GRfileinfo/mgfinfo

intn GRfileinfo(int32 gr_id, int32 *n_datasets, int32 *n_file_attrs)
gr_id

IN:

General raster interface identifier returned by GRstart

n_datasets

OUT:

Number of datasets in the file

n_file_attrs

OUT:

Number of global attributes in the file

Purpose

Reports general information about the number of datasets and global attributes for the GR interface.

Return value

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

Description

This routine is generally used to find the range of acceptable indices for GRselect calls.

Example

This example illustrates the use of GRfileinfo to search through the general raster image datasets in a file:

     #include "hdf.h"

     int32 gr_id, n_datasets, n_file_attrs, gr_index;

         ...
     stat = GRgetfileinfo(gr_id, &n_datasets, &n_file_attrs);
     for(gr_index = 0; gr_index < n_datasets; gr_index++) {
         ri_id = GRselect(gr_id, gr_index);
         ...
     }
         
FORTRAN

integer function mgfinfo(gr_id, n_datasets, n_file_attrs)

integer gr_id, n_datasets, n_file_attrs



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

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