int deleteDesc(int desc) { int32 fid; if ((fid = Hopen(he_file, DFACC_WRITE, 0)) == 0) { HEprint(stderr, 0); return FAIL; } if (Hdeldd(fid, he_desc[desc].tag, he_desc[desc].ref) == FAIL) { HEprint(stderr, 0); return FAIL; } return Hclose(fid); }
/* ** NAME ** DFdel -- delete a data element ** USAGE ** int DFdel(dfile, tag, ref) ** DF *dfile; IN: pointer to open DF file ** uint16 tag; IN: tag of element ** uint16 ref; IN: ref number of element ** RETURNS ** 0 on success, -1 on failure ** DESCRIPTION ** Delete a data element from HDF file. ** GLOBAL VARIABLES ** COMMENTS, BUGS, ASSUMPTIONS ** The data element is not actually deleted; it simply loses its DD. ** EXAMPLES ** REVISION LOG */ int DFdel(DF * dfile, uint16 tag, uint16 ref) { if (DFIcheck(dfile) != 0) { DFerror = DFE_NOTOPEN; return (-1); } else DFerror = DFE_NONE; if (Hdeldd(DFid, tag, ref) != 0) { DFerror = (int)HEvalue(1); return (-1); } else return (0); }