summaryrefslogtreecommitdiff
path: root/src/win32/w32_util.h
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@microsoft.com>2014-04-21 23:32:31 -0400
committerPhilip Kelley <phkelley@hotmail.com>2014-04-22 00:28:27 -0400
commit65477db1660273c453c590b8e3b97a4f7c41df61 (patch)
tree667f296f7e4ac27ba31fbf3e96446792e7ca5f45 /src/win32/w32_util.h
parentc2c8161541e54689926ec1f463569d5d1b975503 (diff)
downloadlibgit2-65477db1660273c453c590b8e3b97a4f7c41df61.tar.gz
Handle win32 reparse points properly
Diffstat (limited to 'src/win32/w32_util.h')
-rw-r--r--src/win32/w32_util.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/win32/w32_util.h b/src/win32/w32_util.h
index cd02bd7b2..acdee3d69 100644
--- a/src/win32/w32_util.h
+++ b/src/win32/w32_util.h
@@ -10,6 +10,11 @@
#include "utf-conv.h"
+GIT_INLINE(bool) git_win32__isalpha(wchar_t c)
+{
+ return ((c >= L'A' && c <= L'Z') || (c >= L'a' && c <= L'z'));
+}
+
/**
* Creates a FindFirstFile(Ex) filter string from a UTF-8 path.
* The filter string enumerates all items in the directory.
@@ -28,4 +33,22 @@ bool git_win32__findfirstfile_filter(git_win32_path dest, const char *src);
*/
int git_win32__sethidden(const char *path);
+/**
+ * Removes any trailing backslashes from a path, except in the case of a drive
+ * letter path (C:\, D:\, etc.). This function cannot fail.
+ *
+ * @param path The path which should be trimmed.
+ * @return The length of the modified string (<= the input length)
+ */
+size_t git_win32__path_trim_end(wchar_t *str, size_t len);
+
+/**
+ * Removes any of the following namespace prefixes from a path,
+ * if found: "\??\", "\\?\", "\\?\UNC\". This function cannot fail.
+ *
+ * @param path The path which should be converted.
+ * @return The length of the modified string (<= the input length)
+ */
+size_t git_win32__to_dos(wchar_t *str, size_t len);
+
#endif