[MPlayer-cvslog] r32731 - in trunk: path.c path.h
cboesch
subversion at mplayerhq.hu
Sat Dec 25 00:09:08 CET 2010
Author: cboesch
Date: Sat Dec 25 00:09:08 2010
New Revision: 32731
Log:
Add mp_path_is_absolute function.
Modified:
trunk/path.c
trunk/path.h
Modified: trunk/path.c
==============================================================================
--- trunk/path.c Sat Dec 25 00:05:49 2010 (r32730)
+++ trunk/path.c Sat Dec 25 00:09:08 2010 (r32731)
@@ -233,3 +233,15 @@ char *mp_dirname(const char *path)
dirname[len] = '\0';
return dirname;
}
+
+/**
+ * @brief Indicates weither the path is absolute or not.
+ */
+int mp_path_is_absolute(const char *path)
+{
+#if HAVE_DOS_PATHS
+ return path[0] && path[1] == ':';
+#else
+ return path[0] == '/';
+#endif
+}
Modified: trunk/path.h
==============================================================================
--- trunk/path.h Sat Dec 25 00:05:49 2010 (r32730)
+++ trunk/path.h Sat Dec 25 00:09:08 2010 (r32731)
@@ -28,5 +28,6 @@ void set_path_env(void);
void set_codec_path(const char *path);
const char *mp_basename(const char *path);
char *mp_dirname(const char *path);
+int mp_path_is_absolute(const char *path);
#endif /* MPLAYER_PATH_H */
More information about the MPlayer-cvslog
mailing list