49 #pragma warning (disable: 4996)
57 #if defined(_WIN32) || defined(__CYGWIN__)
58 result = strrchr(path,
'\\');
60 result = strrchr(path,
'/');
63 return (result == NULL ? path : result + 1);
73 #if defined(_WIN32) || defined(__CYGWIN__)
74 for (i = l - 1; (i > 0) && !(path[i] ==
'/' || path[i] ==
'\\'); --i);
76 for (i = l - 1; (i > 0) && !(path[i] ==
'/'); --i);
95 for (i = l - 1; (i > 0) && (path[i] !=
'.'); --i);
99 strncpy(root, path, i);
107 #if defined(_WIN32) && !defined(_WIN32_WCE)
111 ((path[0] >=
'A' && path[0] <=
'Z')
112 || (path[0] >=
'a' && path[0] <=
'z'))
114 && (path[2] ==
'/' || path[2] ==
'\\'));
115 #elif defined(_WIN32_WCE)
116 return path[0] ==
'\\' || path[0] ==
'/';
118 return path[0] ==
'/';
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 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...
SPHINXBASE_EXPORT int path_is_absolute(const char *file)
Test whether a pathname is absolute for the current OS.
const SPHINXBASE_EXPORT char * path2basename(const char *path)
Returns the last part of the path, without modifying anything in memory.