]> git.proxmox.com Git - libgit2.git/blobdiff - src/win32/path_w32.h
New upstream version 1.0.0+dfsg.1
[libgit2.git] / src / win32 / path_w32.h
index afd0aa1550c3844b6a6ffff03751a335229579b8..dab8b96fa79d2fe28d540c7c3ec18f300af21a92 100644 (file)
@@ -11,7 +11,9 @@
 #include "vector.h"
 
 /**
- * Create a Win32 path (in UCS-2 format) from a UTF-8 string.
+ * Create a Win32 path (in UCS-2 format) from a UTF-8 string.  If the given
+ * path is relative, then it will be turned into an absolute path by having
+ * the current working directory prepended.
  *
  * @param dest The buffer to receive the wide string.
  * @param src The UTF-8 string to convert.
  */
 extern int git_win32_path_from_utf8(git_win32_path dest, const char *src);
 
+/**
+ * Create a Win32 path (in UCS-2 format) from a UTF-8 string.  If the given
+ * path is relative, then it will not be turned into an absolute path.
+ *
+ * @param dest The buffer to receive the wide string.
+ * @param src The UTF-8 string to convert.
+ * @return The length of the wide string, in characters (not counting the NULL terminator), or < 0 for failure
+ */
+extern int git_win32_path_relative_from_utf8(git_win32_path dest, const char *src);
+
 /**
  * Canonicalize a Win32 UCS-2 path so that it is suitable for delivery to the
  * Win32 APIs: remove multiple directory separators, squashing to a single one,
@@ -26,6 +38,9 @@ extern int git_win32_path_from_utf8(git_win32_path dest, const char *src);
  * canonical (always backslashes, never forward slashes) and process any
  * directory entries of '.' or '..'.
  *
+ * Note that this is intended to be used on absolute Windows paths, those
+ * that start with `C:\`, `\\server\share`, `\\?\`, etc.
+ *
  * This processes the buffer in place.
  *
  * @param path The buffer to process