69 #pragma warning (disable: 4996)
80 #if defined(_WIN32) || defined(__CYGWIN__)
81 for (i = l - 1; (i >= 0) && !(path[i] ==
'/' || path[i] ==
'\\'); --i);
83 for (i = l - 1; (i >= 0) && !(path[i] ==
'/'); --i);
85 strcpy(base, path + i + 1);
95 #if defined(_WIN32) || defined(__CYGWIN__)
96 for (i = l - 1; (i >= 0) && !(path[i] ==
'/' || path[i] ==
'\\'); --i);
98 for (i = l - 1; (i >= 0) && !(path[i] ==
'/'); --i);
103 memcpy(dir, path, i);
116 for (i = l - 1; (i >= 0) && (path[i] !=
'.'); --i);
120 strncpy(root, path, i);
128 #if defined(_WIN32) && !defined(_WIN32_WCE)
132 ((path[0] >=
'A' && path[0] <=
'Z')
133 || (path[0] >=
'a' && path[0] <=
'z'))
135 && (path[2] ==
'/' || path[2] ==
'\\'));
136 #elif defined(_WIN32_WCE)
137 return path[0] ==
'\\' || path[0] ==
'/';
139 return path[0] ==
'/';
SPHINXBASE_EXPORT void path2basename(const char *path, char *base)
Strip off leading path components from the given path and copy the base into base.
SPHINXBASE_EXPORT void strip_fileext(const char *file, char *root)
Strip off the smallest trailing file-extension suffix and copy the rest into the given root argument...
File names related operation.
SPHINXBASE_EXPORT int path_is_absolute(const char *file)
Test whether a pathname is absolute for the current OS.
SPHINXBASE_EXPORT void path2dirname(const char *path, char *dir)
Strip off filename from the given path and copy the directory name into dir Caller must have allocate...