summaryrefslogtreecommitdiffstats
path: root/src/H5system.c
diff options
context:
space:
mode:
authorScot Breitenfeld <brtnfld@hdfgroup.org>2008-04-30 19:23:26 (GMT)
committerScot Breitenfeld <brtnfld@hdfgroup.org>2008-04-30 19:23:26 (GMT)
commit5773fd34bc5adf59b4530d95ac9f0c0585902803 (patch)
tree456ad239799382e1f083fb7fc74399e43b471912 /src/H5system.c
parent0138995d1ce2068db1f790503435a2121132d3ad (diff)
downloadhdf5-5773fd34bc5adf59b4530d95ac9f0c0585902803.zip
hdf5-5773fd34bc5adf59b4530d95ac9f0c0585902803.tar.gz
hdf5-5773fd34bc5adf59b4530d95ac9f0c0585902803.tar.bz2
[svn-r14902] Merged fortran_1_8 branch changes r14505:14901 into the trunk. New fortran wrappers added.
Diffstat (limited to 'src/H5system.c')
-rw-r--r--src/H5system.c98
1 files changed, 0 insertions, 98 deletions
diff --git a/src/H5system.c b/src/H5system.c
index 4a49d71..5eae11d 100644
--- a/src/H5system.c
+++ b/src/H5system.c
@@ -35,8 +35,6 @@
#include "H5private.h" /* Generic Functions */
#include "H5Fprivate.h" /* File access */
#include "H5MMprivate.h" /* Memory management */
-#include "H5Eprivate.h"
-
/****************/
@@ -580,100 +578,4 @@ HDremove_all(const char *fname)
}
#endif
-
-/*
- *-------------------------------------------------------------------------
- *
- * Function: H5_build_extpath
- *
- * Purpose: To build the path for later searching of target file for external link.
- * This path can be either:
- * 1. The absolute path of NAME
- * or
- * 2. The current working directory + relative path of NAME
- *
- * Return: Success: 0
- * Failure: -1
- *
- * Programmer: Vailin Choi
- * April 2, 2008
- *-------------------------------------------------------------------------
- */
-#define MAX_PATH_LEN 1024
-
-herr_t
-H5_build_extpath(const char *name, char **extpath/*out*/)
-{
- char *full_path=NULL, *ptr=NULL;
- char *retcwd=NULL, *cwdpath=NULL, *new_name=NULL;
- int drive;
- size_t cwdlen, path_len;
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI_NOINIT(H5_build_extpath)
-
- *extpath = NULL;
-
- /*
- * Unix: name[0] is a "/"
- * Windows: name[0-2] is "<drive letter>:\" or "<drive-letter>:/"
- */
- if (CHECK_ABSOLUTE(name)) {
- if ((full_path=H5MM_strdup(name)) == NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
- } else { /* relative pathname */
- if ((cwdpath=H5MM_malloc(MAX_PATH_LEN)) == NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
- if ((new_name=H5MM_strdup(name)) == NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
-
- /*
- * Windows: name[0-1] is "<drive-letter>:"
- * Get current working directory on the drive specified in NAME
- * Unix: does not apply
- */
- if (CHECK_ABS_DRIVE(name)) {
- drive = name[0] - 'A' + 1;
- retcwd = HDgetdcwd(drive, cwdpath, MAX_PATH_LEN);
- HDstrcpy(new_name, &name[2]);
- /*
- * Windows: name[0] is a '/' or '\'
- * Get current drive
- * Unix: does not apply
- */
- } else if (CHECK_ABS_PATH(name) && (drive=HDgetdrive())) {
- sprintf(cwdpath, "%c:%c", (drive+'A'-1), name[0]);
- retcwd = cwdpath;
- HDstrcpy(new_name, &name[1]);
- } else /* totally relative for both Unix and Windows: get current working directory */
- retcwd = HDgetcwd(cwdpath, MAX_PATH_LEN);
-
- if (retcwd != NULL) {
- cwdlen = HDstrlen(cwdpath);
- HDassert(cwdlen);
- path_len = cwdlen + HDstrlen(new_name) + 2;
- if ((full_path=H5MM_malloc(path_len)) == NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
-
- HDstrcpy(full_path, cwdpath);
- if (!CHECK_DELIMITER(cwdpath[cwdlen-1]))
- HDstrcat(full_path, DIR_SEPS);
- HDstrcat(full_path, new_name);
- }
- }
-
- /* strip out the last component (the file name itself) from the path */
- if (full_path) {
- GET_LAST_DELIMITER(full_path, ptr)
- HDassert(ptr);
- *++ptr = '\0';
- *extpath = full_path;
- }
-done:
- if (cwdpath)
- H5MM_xfree(cwdpath);
- if (new_name)
- H5MM_xfree(new_name);
- FUNC_LEAVE_NOAPI(ret_value)
-} /* H5_build_extpath() */