Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/compat/win32/path-utils.h # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / compat / win32 / path-utils.h` 37 lines ยท 1207 bytes Raw Blame History 1 #ifndef WIN32_PATH_UTILS_H 2 #define WIN32_PATH_UTILS_H 3 4 int win32_has_dos_drive_prefix(const char *path); 5 #define has_dos_drive_prefix win32_has_dos_drive_prefix 6 7 int win32_skip_dos_drive_prefix(char **path); 8 #define skip_dos_drive_prefix win32_skip_dos_drive_prefix 9 #define is_dir_sep is_xplatform_dir_sep 10 static inline char *win32_find_last_dir_sep(const char *path) 11 { 12 char *ret = NULL; 13 for (; *path; ++path) 14 if (is_dir_sep(*path)) 15 ret = (char *)path; 16 return ret; 17 } 18 #define find_last_dir_sep win32_find_last_dir_sep 19 static inline int win32_has_dir_sep(const char *path) 20 { 21 /* 22 * See how long the non-separator part of the given path is, and 23 * if and only if it covers the whole path (i.e. path[len] is NUL), 24 * there is no separator in the path---otherwise there is a separator. 25 */ 26 size_t len = strcspn(path, "/\\"); 27 return !!path[len]; 28 } 29 #define has_dir_sep(path) win32_has_dir_sep(path) 30 int win32_offset_1st_component(const char *path); 31 #define offset_1st_component win32_offset_1st_component 32 int win32_fspathcmp(const char *a, const char *b); 33 #define fspathcmp win32_fspathcmp 34 int win32_fspathncmp(const char *a, const char *b, size_t count); 35 #define fspathncmp win32_fspathncmp 36 37 #endif