home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / hdf / unix / hdf3_2r2.lha / HDF3.2r2 / src / dfanf.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-10-28  |  20.6 KB  |  635 lines

  1. /***************************************************************************
  2. *
  3. *
  4. *                         NCSA HDF version 3.2r2
  5. *                            October 30, 1992
  6. *
  7. * NCSA HDF Version 3.2 source code and documentation are in the public
  8. * domain.  Specifically, we give to the public domain all rights for future
  9. * licensing of the source code, all resale rights, and all publishing rights.
  10. *
  11. * We ask, but do not require, that the following message be included in all
  12. * derived works:
  13. *
  14. * Portions developed at the National Center for Supercomputing Applications at
  15. * the University of Illinois at Urbana-Champaign, in collaboration with the
  16. * Information Technology Institute of Singapore.
  17. *
  18. * THE UNIVERSITY OF ILLINOIS GIVES NO WARRANTY, EXPRESSED OR IMPLIED, FOR THE
  19. * SOFTWARE AND/OR DOCUMENTATION PROVIDED, INCLUDING, WITHOUT LIMITATION,
  20. * WARRANTY OF MERCHANTABILITY AND WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE
  21. *
  22. ****************************************************************************
  23. */
  24.  
  25. #ifdef RCSID
  26. static char RcsId[] = "@(#)$Revision: 1.2 $";
  27. #endif
  28. /*
  29. $Header: /hdf/hdf/v3.2r2/src/RCS/dfanf.c,v 1.2 1992/09/11 14:15:04 koziol beta koziol $
  30.  
  31. $Log: dfanf.c,v $
  32.  * Revision 1.2  1992/09/11  14:15:04  koziol
  33.  * Changed Fortran stubs' parameter passing to use a new typedef, intf,
  34.  * which should be typed to the size of an INTEGER*4 in whatever Fortran
  35.  * compiler the C functions need to be compatible with.  (This is mostly
  36.  * for the PC and possibly for the Mac)
  37.  *
  38.  * Revision 1.1  1992/08/25  21:40:44  koziol
  39.  * Initial revision
  40.  *
  41. */
  42. /*-----------------------------------------------------------------------------
  43.  * File:    dfanF.c
  44.  * Purpose: Fortran stubs for annotation routines
  45.  * Invokes: dfan.c dfkit.c
  46.  * Contents: 
  47.  *
  48.  *  daiganl_: get length of annotation of tag/ref
  49.  *  daigann_: get annotation of tag/ref
  50.  *  daipann_: put annotation of tag/ref
  51.  *  dailist_: get list of refs and labels for a given tag
  52.  *  dalref_ : return last ref written or read
  53.  *  dfanlastref_: return last ref written or read
  54.  *
  55.  *  dfanaddfds_    : add file description
  56.  *  dfangetfidlen_ : get length of file id  
  57.  *  dfangetfdslen_ : get length of file description  
  58.  *  dfangetfid_    : get file id
  59.  *  dfangetfds_    : get file description
  60.  *  daafds_        : get file description
  61.  *  dagfidl_       : get file id length
  62.  *  dagfdsl_       : get file description length
  63.  *  dagfid_        : get file id
  64.  *  dagfds_        : get file description
  65.  *
  66.  *  daiafid_       : add file id (intermediate routine)
  67.  *---------------------------------------------------------------------------*/
  68.  
  69. #include "dfan.h"
  70. #include "df.h"
  71.  
  72. #ifndef DFAN_FNAMES
  73. #   define  DFAN_FNAMES
  74. #ifdef DF_CAPFNAMES
  75. #   define ndaiganl  FNAME(DAIGANL)
  76. #   define ndaigann  FNAME(DAIGANN)
  77. #   define ndaipann  FNAME(DAIPANN)
  78. #   define ndailist  FNAME(DAILIST)
  79. #   define ndalref   FNAME(DALREF)
  80. #   define ndfanlastref  FNAME(DFANLASTREF)
  81.  
  82. #   define ndfanaddfds      FNAME(DFANADDFDS)
  83. #   define ndfangetfidlen   FNAME(DFANGETFIDLEN)
  84. #   define ndfangetfdslen   FNAME(DFANGETFDSLEN)
  85. #   define ndfangetfid      FNAME(DFANGETFID)
  86. #   define ndfangetfds      FNAME(DFANGETFDS)
  87. #   define ndaafds          FNAME(DAAFDS)
  88. #   define ndagfidl         FNAME(DAGFIDL)
  89. #   define ndagfdsl         FNAME(DAGFDSL)
  90. #   define ndagfid          FNAME(DAGFID)
  91. #   define ndagfds          FNAME(DAGFDS)
  92. #   define ndaiafid         FNAME(DAIAFID)
  93. #else   /* !DF_CAPFNAMES */
  94. #   define ndaiganl  FNAME(daiganl)
  95. #   define ndaigann  FNAME(daigann)
  96. #   define ndaipann  FNAME(daipann)
  97. #   define ndailist  FNAME(dailist)
  98. #   define ndalref   FNAME(dalref)
  99. #   define ndfanlastref  FNAME(dfanlastref)
  100.  
  101. #   define ndfanaddfds      FNAME(dfanaddfds)
  102. #   define ndfangetfidlen   FNAME(dfangetfidlen)
  103. #   define ndfangetfdslen   FNAME(dfangetfdslen)
  104. #   define ndfangetfid      FNAME(dfangetfid)
  105. #   define ndfangetfds      FNAME(dfangetfds)
  106. #   define ndaafds          FNAME(daafds)
  107. #   define ndagfidl         FNAME(dagfidl)
  108. #   define ndagfdsl         FNAME(dagfdsl)
  109. #   define ndagfid          FNAME(dagfid)
  110. #   define ndagfds          FNAME(dagfds)
  111. #   define ndaiafid         FNAME(daiafid)
  112. #endif /* DF_CAPFNAMES */
  113. #endif /* DFAN_FNAMES */
  114.  
  115.  
  116. /* conventions used in forming names of routines:
  117. **
  118. **    dfan: hdf annotation routine (<dfan>addfds)
  119. **    add:  add item to file       dfan<add>fds
  120. **    get:  get item from file     dfan<get>fds
  121. **    f:    file                   dfanadd<f>ds
  122. **    id:   id                     dfanaddf<id>
  123. **    ds:   description            dfanaddf<ds>
  124. **    len:  length                 dfanaddfid<len>
  125. **    l:    length (short forms)   dagfid<l>
  126. **    da:   dfan (short forms)     <da>gfid
  127. **    a:    add (short forms)      da<a>fds
  128. **    g:    get (short forms)      da<g>fds
  129. **    i:    intermediate routine (not in user interface) da<i>afid
  130. **/
  131.  
  132.  
  133.  
  134. /*---------------------------------------------------------------------------
  135. ** Routines for handling tag/ref (not file) annotations
  136.  *-------------------------------------------------------------------------*/
  137.  
  138. /*-----------------------------------------------------------------------------
  139.  * Name:    daiganl
  140.  * Purpose: get length of annotation of tag/ref
  141.  * Inputs:  filename: name of HDF file
  142.  *          tag, ref: tag/ref of item of which we want label
  143.  *          type: DFAN_LABEL if label, DFAN_DESC if description
  144.  *          fnlen: length of filename
  145.  * Returns: length of annotation on success, -1 on failure with DFerror set
  146.  * Users:   HDF HLL users, utilities, other routines
  147.  * Invokes: DFANIgetannlen, HDf2cstring, DFIgetspace, DFIfreespace
  148.  *---------------------------------------------------------------------------*/
  149.  
  150.     FRETVAL(intf)
  151. #ifdef PROTOTYPE
  152. ndaiganl(_fcd filename, intf *tag, intf *ref, intf *type, intf *fnlen)
  153. #else
  154. ndaiganl(filename, tag, ref, type, fnlen)
  155.     _fcd filename;
  156.     intf *tag, *ref;
  157.     intf *fnlen, *type;
  158. #endif /* PROTOTYPE */
  159. {
  160.     char *fn;
  161.     intf ret;
  162.  
  163.     fn = HDf2cstring(filename, *fnlen);
  164.     ret = DFANIgetannlen(fn, (uint16) *tag, (uint16) *ref, *type);
  165.     HDfreespace(fn);
  166.  
  167.     return(ret);
  168. }
  169.  
  170.  
  171. /*-----------------------------------------------------------------------------
  172.  * Name:    daigann
  173.  * Purpose: get annotation of tag/ref
  174.  * Inputs:  filename: name of HDF file
  175.  *          tag, ref: tag/ref of item of which we want label
  176.  *          annotation: space to return label in
  177.  *          maxlen: size of space to return label in
  178.  *          type: DFAN_LABEL if label, DFAN_DESC if description
  179.  *          fnlen: length of filename
  180.  * Returns: 0 on success, -1 on failure with DFerror set
  181.  * Users:   HDF HLL users, utilities, other routines
  182.  * Invokes: DFANIgetann
  183.  *---------------------------------------------------------------------------*/
  184.  
  185.     FRETVAL(intf)
  186. #ifdef PROTOTYPE
  187. ndaigann(_fcd filename, intf *tag, intf *ref, _fcd annotation, intf *maxlen,
  188.      intf *type, intf *fnlen)
  189. #else
  190. ndaigann(filename, tag, ref, annotation, maxlen, type, fnlen)
  191.     _fcd filename, annotation;
  192.     intf *tag, *ref;
  193.     intf *maxlen;
  194.     intf *type, *fnlen;
  195. #endif /* PROTOTYPE */
  196. {
  197.     char *fn;
  198.     intf ret;
  199.  
  200.     fn = HDf2cstring(filename, *fnlen);
  201.     ret = DFANIgetann(fn, (uint16) *tag, (uint16) *ref, 
  202.                       (uint8*)_fcdtocp(annotation), *maxlen, *type);
  203.     HDfreespace(fn);
  204.  
  205.     return(ret);
  206. }
  207.  
  208.  
  209. /*-----------------------------------------------------------------------------
  210.  * Name:    daipann
  211.  * Purpose: put annotation of tag/ref
  212.  * Inputs:  filename: name of HDF file
  213.  *          tag, ref: tag/ref of item of which we want label
  214.  *          annotation: space to return label in
  215.  *          annlen: length of annotation
  216.  *          type: DFAN_LABEL if label, DFAN_DESC if description
  217.  *          fnlen: length of filename
  218.  * Returns: 0 on success, -1 on failure with DFerror set
  219.  * Users:   HDF HLL users, utilities, other routines
  220.  * Invokes: DFANIgetann
  221.  *---------------------------------------------------------------------------*/
  222.  
  223.     FRETVAL(intf)
  224. #ifdef PROTOTYPE
  225. ndaipann(_fcd filename, intf *tag, intf *ref, _fcd annotation,
  226.          intf *annlen, intf *type, intf *fnlen)
  227. #else
  228. ndaipann(filename, tag, ref, annotation, annlen, type, fnlen)
  229.     _fcd filename, annotation;
  230.     intf *tag, *ref;
  231.     intf *annlen;
  232.     intf *type, *fnlen;
  233. #endif /* PROTOTYPE */
  234. {
  235.     char *fn;
  236.     intf ret;
  237.  
  238.     fn = HDf2cstring(filename, *fnlen);
  239.     ret = DFANIputann(fn, (uint16) *tag, (uint16) *ref, 
  240.                       (uint8*)_fcdtocp(annotation), *annlen, *type);
  241.     HDfreespace(fn);
  242.     return(ret);
  243. }
  244.  
  245.  
  246. /*-----------------------------------------------------------------------------
  247.  * Name:    dailist
  248.  * Purpose: Return list of refs and labels for a given tag
  249.  * Inputs:  filename: name of HDF file
  250.  *          tag: tag to get list of refs and labels for
  251.  *          reflist: array to place refs in
  252.  *          labellist: array of strings to place labels in
  253.  *          listsize: size of ref and label lists
  254.  *          maxlen: maximum length allowed for label
  255.  *          startpos: beginning from the startpos'th entry, upto listsize
  256.  *              entries will be returned.
  257.  *          fnlen: length of filename
  258.  * Returns: number of entries on success, -1 on error with DFerror set
  259.  * Users:   HDF users, utilities, other routines
  260.  * Invokes: DFANIlablist
  261.  * Method:  call DFANIlablist
  262.  * Remarks: none
  263.  *---------------------------------------------------------------------------*/
  264.  
  265.     FRETVAL(intf)
  266. #ifdef PROTOTYPE
  267. ndailist(_fcd filename, intf *tag, intf reflist[], _fcd labellist,
  268.     intf *listsize, intf *maxlen, intf *startpos, intf *fnlen)
  269. #else
  270. ndailist(filename, tag, reflist, labellist,listsize, maxlen,startpos,fnlen)
  271.      _fcd filename;
  272.      intf *tag;
  273.      intf reflist[];
  274.      _fcd labellist;
  275.      intf *listsize;
  276.      intf *maxlen, *startpos, *fnlen;
  277. #endif /* PROTOTYPE */
  278. {
  279.     char *fn;
  280.     int i;
  281.     intf nrefs;
  282.     uint16 *tempreflist;
  283.  
  284.     fn = HDf2cstring(filename, *fnlen);
  285.  
  286.     /* create reflist with true uint16s to maintain compatibility
  287.     ** with machines that allocate more than 16 bits per uint16.
  288.     */
  289.     tempreflist = (uint16 *) DFIgetspace( (int32)(*listsize) * sizeof(uint16) );
  290.                                                 /* 1 for isfortran */
  291.     nrefs = DFANIlablist(fn, (uint16) *tag, tempreflist,
  292.                  (uint8*)_fcdtocp(labellist),
  293.                 (int)*listsize, (int)*maxlen, (int)*startpos, 1);
  294.     if (nrefs< 0) return FAIL;
  295.  
  296.     /* move ref numbers into caller's reflist */
  297.     for (i=0; i < *listsize; i++)
  298.         reflist[i] = tempreflist[i];
  299.  
  300.     HDfreespace(fn);
  301.     HDfreespace(tempreflist);
  302.  
  303.     return(nrefs);
  304. }
  305.  
  306.  
  307. /*-----------------------------------------------------------------------------
  308.  * Name:    dalref
  309.  * Purpose: Return last ref written or read
  310.  * Inputs:  none
  311.  * Globals: Lastref
  312.  * Returns: ref on success, -1 on error with DFerror set
  313.  * Users:   HDF users, utilities, other routines
  314.  * Invokes: DFANlastref
  315.  * Remarks: none
  316.  *---------------------------------------------------------------------------*/
  317.  
  318.     FRETVAL(intf)
  319. #ifdef PROTOTYPE
  320. ndalref(void)
  321. #else
  322. ndalref()
  323. #endif /* PROTOTYPE */
  324. {
  325.     return(DFANlastref());
  326. }
  327.  
  328.  
  329.  
  330. /*-----------------------------------------------------------------------------
  331.  * Name:    dfanlastref
  332.  * Purpose: Return last ref written or read
  333.  * Inputs:  none
  334.  * Globals: Lastref
  335.  * Returns: ref on success, -1 on error with DFerror set
  336.  * Users:   HDF users, utilities, other routines
  337.  * Invokes: DFANlastref
  338.  * Remarks: none
  339.  *---------------------------------------------------------------------------*/
  340.  
  341.     FRETVAL(intf)
  342. #ifdef PROTOTYPE
  343. ndfanlastref(void)
  344. #else
  345. ndfanlastref()
  346. #endif /* PROTOTYPE */
  347. {
  348.     return(DFANlastref());
  349. }
  350.  
  351.  
  352.  
  353. /*---------------------------------------------------------------------------
  354. ** Routines for handling file annotations
  355.  *-------------------------------------------------------------------------*/
  356.  
  357. /*-----------------------------------------------------------------------------
  358.  * Name:    dfanaddfds
  359.  * Purpose: add file description (Fortran callable C version)
  360.  * Inputs:  dfile: pointer to HDF file
  361.  *          desc: description to write to file
  362.  *          desclen: length of description
  363.  * Returns: 0 on success, -1 on failure with DFerror set
  364.  * Users:   HDF HLL users, utilities, other routines
  365.  * Invokes: DFANaddfileann
  366.  *---------------------------------------------------------------------------*/
  367.  
  368.     FRETVAL(intf)
  369. #ifdef PROTOTYPE
  370. ndfanaddfds(intf *dfile, _fcd desc, intf *desclen)
  371. #else
  372. ndfanaddfds(dfile, desc, desclen)
  373.     int32 *dfile;
  374.     _fcd  desc;
  375.     intf *desclen;
  376. #endif /* PROTOTYPE */
  377. {
  378.     return ( DFANIaddfann( *dfile, _fcdtocp(desc), *desclen, DFAN_DESC) );
  379. }
  380.  
  381. /*-----------------------------------------------------------------------------
  382.  * Name:    dfangetfidlen
  383.  * Purpose: get length of next file ID (Fortran callable C version)
  384.  * Inputs:  dfile: pointer to HDF file
  385.  *          isfirst: 1: start with first one; 0: get length of next one
  386.  * Returns: On success: length of next file ID; On failure: -1, with DFerror set
  387.  * Users:   HDF HLL users, utilities, other routines
  388.  * Invokes: DFANIgetfannlen
  389.  *---------------------------------------------------------------------------*/
  390.  
  391.     FRETVAL(intf)
  392. #ifdef PROTOTYPE
  393. ndfangetfidlen(intf *dfile, intf *isfirst)
  394. #else
  395. ndfangetfidlen(dfile, isfirst)
  396.     intf *dfile;
  397.     intf *isfirst;
  398. #endif /* PROTOTYPE */
  399. {
  400.      return ( DFANIgetfannlen( *dfile, DFAN_LABEL, *isfirst) );
  401. }
  402.  
  403.  
  404. /*-----------------------------------------------------------------------------
  405.  * Name:    dfangetfdslen
  406.  * Purpose: get length of next file description (Fortran callable C version)
  407.  * Inputs:  dfile: pointer to HDF file
  408.  *          isfirst: 1: start with first one; 0: get length of next one
  409.  * Returns: On success: length of next file ID; On failure: -1, with DFerror set
  410.  * Users:   HDF HLL users, utilities, other routines
  411.  * Invokes: DFANIgetfannlen
  412.  *---------------------------------------------------------------------------*/
  413.  
  414.     FRETVAL(intf)
  415. #ifdef PROTOTYPE
  416. ndfangetfdslen(intf *dfile, intf *isfirst)
  417. #else
  418. ndfangetfdslen(dfile, isfirst)
  419.     intf *dfile;
  420.     intf *isfirst;
  421. #endif /* PROTOTYPE */
  422. {
  423.      return ( DFANIgetfannlen( *dfile, DFAN_DESC, *isfirst) );
  424. }
  425.  
  426.  
  427. /*-----------------------------------------------------------------------------
  428.  * Name:    dfangetfid
  429.  * Purpose: get file ID (Fortran callable C version)
  430.  * Inputs:  dfile: pointer to HDF file
  431.  *          desc: description to write to file
  432.  *          desclen: length of description
  433.  * Returns: 0 on success, -1 on failure with DFerror set
  434.  * Users:   HDF HLL users, utilities, other routines
  435.  * Invokes: DFANgetfann
  436.  *---------------------------------------------------------------------------*/
  437.  
  438.     FRETVAL(intf)
  439. #ifdef PROTOTYPE
  440. ndfangetfid(intf *dfile, _fcd id, intf *maxlen, intf *isfirst)
  441. #else
  442. ndfangetfid(dfile, id, maxlen, isfirst)
  443.     intf *dfile;
  444.     _fcd  id;
  445.     intf *maxlen;
  446.     intf *isfirst;
  447. #endif /* PROTOTYPE */
  448. {
  449.     return( DFANIgetfann( *dfile, _fcdtocp(id), *maxlen, DFAN_LABEL, *isfirst));
  450. }
  451.  
  452.  
  453. /*-----------------------------------------------------------------------------
  454.  * Name:    dfangetfds
  455.  * Purpose: get file description (Fortran callable C version)
  456.  * Inputs:  dfile: pointer to HDF file
  457.  *          desc: description to write to file
  458.  *          desclen: length of description
  459.  * Returns: 0 on success, -1 on failure with DFerror set
  460.  * Users:   HDF HLL users, utilities, other routines
  461.  * Invokes: DFANgetfann
  462.  *---------------------------------------------------------------------------*/
  463.  
  464.     FRETVAL(intf)
  465. #ifdef PROTOTYPE
  466. ndfangetfds(intf *dfile, _fcd id, intf *maxlen, intf *isfirst)
  467. #else
  468. ndfangetfds(dfile, id, maxlen, isfirst)
  469.     intf *dfile;
  470.      _fcd  id;
  471.     intf *maxlen;
  472.     intf *isfirst;
  473. #endif /* PROTOTYPE */
  474. {
  475.     return( DFANIgetfann( *dfile, _fcdtocp(id), *maxlen, DFAN_DESC, *isfirst));
  476. }
  477.  
  478. /*-----------------------------------------------------------------------------
  479. ** Versions with short names
  480. **---------------------------------------------------------------------------*/
  481.  
  482. /*-----------------------------------------------------------------------------
  483.  * Name:    daafds
  484.  * Purpose: add file description (short form of DFANaddfds; Fortran callable)
  485.  * Inputs:  dfile: pointer to HDF file
  486.  *          desc: description to write to file
  487.  *          desclen: length of description
  488.  * Returns: 0 on success, -1 on failure with DFerror set
  489.  * Users:   HDF HLL users, utilities, other routines
  490.  * Invokes: DFANaddfileann
  491.  *---------------------------------------------------------------------------*/
  492.  
  493.     FRETVAL(intf)
  494. #ifdef PROTOTYPE
  495. ndaafds(intf *dfile, _fcd desc, intf *desclen)
  496. #else
  497. ndaafds(dfile, desc, desclen)
  498.     intf *dfile;
  499.     _fcd  desc;
  500.     intf *desclen;
  501. #endif /* PROTOTYPE */
  502. {
  503.     return ( DFANIaddfann( *dfile, _fcdtocp(desc), *desclen, DFAN_DESC) );
  504. }
  505.  
  506.  
  507. /*-----------------------------------------------------------------------------
  508.  * Name:    dagfidl
  509.  * Purpose: get length of next file ID
  510.  * Inputs:  dfile: pointer to HDF file
  511.  *          isfirst: 1: start with first one; 0: get length of next one
  512.  * Returns: On success: length of next file ID; On failure: -1, with DFerror set
  513.  * Users:   HDF HLL users, utilities, other routines
  514.  * Invokes: DFANIgetfannlen
  515.  *---------------------------------------------------------------------------*/
  516.  
  517.     FRETVAL(intf)
  518. #ifdef PROTOTYPE
  519. ndagfidl(intf *dfile, intf *isfirst)
  520. #else
  521. ndagfidl(dfile, isfirst)
  522.     intf *dfile;
  523.     intf *isfirst;
  524. #endif /* PROTOTYPE */
  525. {
  526.      return ( DFANIgetfannlen( *dfile, DFAN_LABEL, *isfirst) );
  527. }
  528.  
  529.  
  530. /*-----------------------------------------------------------------------------
  531.  * Name:    dagfdsl 
  532.  * Purpose: get length of next file description (Fortran callable C version) 
  533.  * Inputs:  dfile: pointer to HDF file
  534.  *          isfirst: 1: start with first one; 0: get length of next one
  535.  * Returns: On success: length of next file ID; On failure: -1, with DFerror set
  536.  * Users:   HDF HLL users, utilities, other routines
  537.  * Invokes: DFANIgetfannlen
  538.  *---------------------------------------------------------------------------*/
  539.  
  540.     FRETVAL(intf)
  541. #ifdef PROTOTYPE
  542. ndagfdsl(intf *dfile, intf *isfirst)
  543. #else
  544. ndagfdsl(dfile, isfirst)
  545.     intf *dfile;
  546.     intf *isfirst;
  547. #endif /* PROTOTYPE */
  548. {
  549.      return ( DFANIgetfannlen( *dfile, DFAN_DESC, *isfirst) );
  550. }
  551.  
  552.  
  553. /*-----------------------------------------------------------------------------
  554.  * Name:    dagfid
  555.  * Purpose: get file ID (short form of DFANgetfid; Fortran callable version)
  556.  * Inputs:  dfile: pointer to HDF file
  557.  *          desc: description to write to file
  558.  *          desclen: length of description
  559.  * Returns: 0 on success, -1 on failure with DFerror set
  560.  * Users:   HDF HLL users, utilities, other routines
  561.  * Invokes: DFANIgetfann
  562.  *---------------------------------------------------------------------------*/
  563.  
  564.     FRETVAL(intf)
  565. #ifdef PROTOTYPE
  566. ndagfid(intf *dfile, _fcd id, intf *maxlen, intf *isfirst)
  567. #else
  568. ndagfid(dfile, id, maxlen, isfirst)
  569.     intf *dfile;
  570.     _fcd  id;
  571.     intf *maxlen;
  572.     intf *isfirst;
  573. #endif /* PROTOTYPE */
  574. {
  575.     return( DFANIgetfann( *dfile, _fcdtocp(id), *maxlen, DFAN_LABEL, *isfirst));
  576. }
  577.  
  578.  
  579. /*-----------------------------------------------------------------------------
  580.  * Name:    dagfds
  581.  * Purpose: get file description 
  582.  *          (short form of DFANgetfds; Fortran callable C version)
  583.  * Inputs:  dfile: pointer to HDF file
  584.  *          desc: description to write to file
  585.  *          desclen: length of description
  586.  * Returns: 0 on success, -1 on failure with DFerror set
  587.  * Users:   HDF HLL users, utilities, other routines
  588.  * Invokes: DFANgetfann
  589.  *---------------------------------------------------------------------------*/
  590.  
  591.     FRETVAL(intf)
  592. #ifdef PROTOTYPE
  593. ndagfds(intf *dfile, _fcd id, intf *maxlen, intf *isfirst)
  594. #else
  595. ndagfds(dfile, id, maxlen, isfirst)
  596.     intf *dfile;
  597.     _fcd  id;
  598.     intf *maxlen;
  599.     intf *isfirst;
  600. #endif /* PROTOTYPE */
  601. {
  602.     return( DFANIgetfann( *dfile, _fcdtocp(id), *maxlen, DFAN_DESC, *isfirst));
  603. }
  604.  
  605.  
  606.  
  607. /*-----------------------------------------------------------------------------
  608. ** Intermediate routines called from user's fortran routines
  609. **---------------------------------------------------------------------------*/
  610.  
  611. /*-----------------------------------------------------------------------------
  612.  * Name:    daiafid
  613.  * Purpose: intermediate routine to add file ID (Fortran callable C version)
  614.  * Inputs:  dfile: pointer to HDF file
  615.  *          id: ID to write to file
  616.  *          idlen: length of ID string
  617.  * Returns: 0 on success, -1 on failure with DFerror set
  618.  * Users:   Fortran user routines DFANaddfid and daafid
  619.  * Invokes: DFANaddfann
  620.  *---------------------------------------------------------------------------*/
  621.  
  622.     FRETVAL(intf)
  623. #ifdef PROTOTYPE
  624. ndaiafid(intf *dfile, _fcd id, intf *idlen)
  625. #else
  626. ndaiafid(dfile, id, idlen)
  627.     intf *dfile;
  628.     _fcd  id;
  629.     intf *idlen;
  630. #endif /* PROTOTYPE */
  631. {
  632.     return(DFANIaddfann( *dfile, _fcdtocp(id),*idlen, DFAN_LABEL));
  633. }
  634.  
  635.