Imported Upstream version 2.21.1
[platform/upstream/git.git] / compat / win32 / path-utils.h
1 int win32_has_dos_drive_prefix(const char *path);
2 #define has_dos_drive_prefix win32_has_dos_drive_prefix
3
4 int win32_skip_dos_drive_prefix(char **path);
5 #define skip_dos_drive_prefix win32_skip_dos_drive_prefix
6 static inline int win32_is_dir_sep(int c)
7 {
8         return c == '/' || c == '\\';
9 }
10 #define is_dir_sep win32_is_dir_sep
11 static inline char *win32_find_last_dir_sep(const char *path)
12 {
13         char *ret = NULL;
14         for (; *path; ++path)
15                 if (is_dir_sep(*path))
16                         ret = (char *)path;
17         return ret;
18 }
19 #define find_last_dir_sep win32_find_last_dir_sep
20 int win32_offset_1st_component(const char *path);
21 #define offset_1st_component win32_offset_1st_component