#ifdef RCSID static char RcsId??(??) = "@(#)$Revision: 1.1 $"; #endif /* $Header: /pita/work/HDF/dev/RCS/test/annotations/get1an.c,v 1.1 90/06/26 16:48:06 mfolk beta $ $Log: get1an.c,v $ * Revision 1.1 90/06/26 16:48:06 mfolk * Initial revision * */ /*************************************************************************** * * get1an.c: Test program to get second SDS label and description from file * * Mike Folk 6/5/90 ***************************************************************************/ #include #include "df.h" extern uint16 DFfindnextref(); main() { int desclen; uint16 ref; char label??(20??), *s; DF *dfile; /* HDF file pointer */ dfile = DFopen("dd:myfile", DFACC_READ, -1); /* JES 90 */ /* find ref of second SDS in file */ ref = 0; ref = DFfindnextref(dfile, (unsigned short) DFTAG_SDG, ref); ref = DFfindnextref(dfile, (unsigned short) DFTAG_SDG, ref); if (ref < 0) { printf("Unable to find second scientific data set.\n"); exit(1); } DFclose(dfile); daglab("dd:myfile", (uint16) DFTAG_SDG, ref, label, 11); /* JES 90 */ printf("Label: %s\n", label); desclen = dagdlen("dd:myfile", (uint16) DFTAG_SDG, ref); /* JES 90 */ s = malloc( desclen+1); dagdesc("dd:myfile", (uint16) DFTAG_SDG, ref, s, desclen); /* JES 90 */ printf("Description: %s\n", s); }