summaryrefslogtreecommitdiffstats
path: root/src/H5Fdeprec.c
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2012-06-15 16:37:15 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2012-06-15 16:37:15 (GMT)
commit381975755dedf3e1fd016daa899527ae24e7547a (patch)
tree5abaa6f3754a144e6ffbeab8615c5e69dc70690a /src/H5Fdeprec.c
parent06bd7c72045ea407f5b5f4de3019734a68f4929d (diff)
downloadhdf5-381975755dedf3e1fd016daa899527ae24e7547a.zip
hdf5-381975755dedf3e1fd016daa899527ae24e7547a.tar.gz
hdf5-381975755dedf3e1fd016daa899527ae24e7547a.tar.bz2
[svn-r22467] update is_accessible implementation
deprecate is_HDF5
Diffstat (limited to 'src/H5Fdeprec.c')
-rw-r--r--src/H5Fdeprec.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/H5Fdeprec.c b/src/H5Fdeprec.c
index e3945ff..ef28e13 100644
--- a/src/H5Fdeprec.c
+++ b/src/H5Fdeprec.c
@@ -169,5 +169,46 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Fget_info1() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5Fis_hdf5
+ *
+ * Purpose: Check the file signature to detect an HDF5 file.
+ *
+ * Bugs: This function is not robust: it only uses the default file
+ * driver when attempting to open the file when in fact it
+ * should use all known file drivers.
+ *
+ * Return: Success: TRUE/FALSE
+ *
+ * Failure: Negative
+ *
+ * Programmer: Unknown
+ *
+ * Modifications:
+ * Robb Matzke, 1999-08-02
+ * Rewritten to use the virtual file layer.
+ *-------------------------------------------------------------------------
+ */
+htri_t
+H5Fis_hdf5(const char *name)
+{
+ htri_t ret_value; /* Return value */
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE1("t", "*s", name);
+
+ /* Check args and all the boring stuff. */
+ if(!name || !*name)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "no file name specified")
+
+ /* Call private routine */
+ if((ret_value = H5F_is_hdf5(name)) < 0)
+ HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to open file")
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Fis_hdf5() */
+
#endif /* H5_NO_DEPRECATED_SYMBOLS */