diff options
author | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2012-03-16 00:53:56 (GMT) |
---|---|---|
committer | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2012-03-16 00:53:56 (GMT) |
commit | 29e7e2890bf51bce3120090f740ce1f336c0d6c4 (patch) | |
tree | e01d91aa98559f61a99a0c5a1c777bd495e2a18b /hl/fortran/src/H5LTfc.c | |
parent | f261344af96dc2d41cce61d888cfa3efd8a1c36c (diff) | |
download | hdf5-29e7e2890bf51bce3120090f740ce1f336c0d6c4.zip hdf5-29e7e2890bf51bce3120090f740ce1f336c0d6c4.tar.gz hdf5-29e7e2890bf51bce3120090f740ce1f336c0d6c4.tar.bz2 |
[svn-r22078] New API: H5ltpath_valid
REF: HDFFV-1233
A high-level "H5LTpath_valid" routine for checking if a path is correct
Both Fortran and C version.
Tested: jam (gnu and intel)
Diffstat (limited to 'hl/fortran/src/H5LTfc.c')
-rwxr-xr-x | hl/fortran/src/H5LTfc.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/hl/fortran/src/H5LTfc.c b/hl/fortran/src/H5LTfc.c index 484acf1..c0b7695 100755 --- a/hl/fortran/src/H5LTfc.c +++ b/hl/fortran/src/H5LTfc.c @@ -2124,3 +2124,54 @@ done: return ret_value; } + +/*------------------------------------------------------------------------- +* Function: h5ltpath_valid_c +* +* Purpose: Calls h5ltpath_valid +* +* Return: Success: 0, Failure: -1 +* +* Programmer: M. Scot Breitenfeld +* +* Date: February 18, 2012 +* +* Comments: +* +* Modifications: +* +* +*------------------------------------------------------------------------- +*/ + +int_f +nh5ltpath_valid_c(hid_t_f *loc_id, + _fcd path, + int_f *pathlen, + int_f *check_object_valid_c) +{ + htri_t ret = -1; + char *c_path = NULL; + hbool_t check_object_valid; + + /* + * convert FORTRAN name to C name + */ + if( NULL == (c_path = (char *)HD5f2cstring(path, (int)*pathlen))) + goto done; + + check_object_valid = FALSE; + if(*check_object_valid_c == 1) + check_object_valid = TRUE; + + /* + * call H5LTpath_valid function. + */ + ret = H5LTpath_valid( (hid_t)*loc_id, c_path, check_object_valid ); + +done: + if(c_path != NULL) + free(c_path); + + return (int_f)ret; +} |