diff options
Diffstat (limited to 'gl/dirname.h')
-rw-r--r-- | gl/dirname.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gl/dirname.h b/gl/dirname.h index f592350b..fb19508f 100644 --- a/gl/dirname.h +++ b/gl/dirname.h | |||
@@ -1,6 +1,7 @@ | |||
1 | /* Take file names apart into directory and base names. | 1 | /* Take file names apart into directory and base names. |
2 | 2 | ||
3 | Copyright (C) 1998, 2001, 2003-2006 Free Software Foundation, Inc. | 3 | Copyright (C) 1998, 2001, 2003-2006, 2009-2010 Free Software Foundation, |
4 | Inc. | ||
4 | 5 | ||
5 | This program is free software: you can redistribute it and/or modify | 6 | This program is free software: you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 7 | it under the terms of the GNU General Public License as published by |
@@ -34,9 +35,9 @@ | |||
34 | /* This internal macro assumes ASCII, but all hosts that support drive | 35 | /* This internal macro assumes ASCII, but all hosts that support drive |
35 | letters use ASCII. */ | 36 | letters use ASCII. */ |
36 | # define _IS_DRIVE_LETTER(c) (((unsigned int) (c) | ('a' - 'A')) - 'a' \ | 37 | # define _IS_DRIVE_LETTER(c) (((unsigned int) (c) | ('a' - 'A')) - 'a' \ |
37 | <= 'z' - 'a') | 38 | <= 'z' - 'a') |
38 | # define FILE_SYSTEM_PREFIX_LEN(Filename) \ | 39 | # define FILE_SYSTEM_PREFIX_LEN(Filename) \ |
39 | (_IS_DRIVE_LETTER ((Filename)[0]) && (Filename)[1] == ':' ? 2 : 0) | 40 | (_IS_DRIVE_LETTER ((Filename)[0]) && (Filename)[1] == ':' ? 2 : 0) |
40 | # else | 41 | # else |
41 | # define FILE_SYSTEM_PREFIX_LEN(Filename) 0 | 42 | # define FILE_SYSTEM_PREFIX_LEN(Filename) 0 |
42 | # endif | 43 | # endif |
@@ -54,12 +55,16 @@ | |||
54 | # define IS_ABSOLUTE_FILE_NAME(F) ISSLASH ((F)[FILE_SYSTEM_PREFIX_LEN (F)]) | 55 | # define IS_ABSOLUTE_FILE_NAME(F) ISSLASH ((F)[FILE_SYSTEM_PREFIX_LEN (F)]) |
55 | # else | 56 | # else |
56 | # define IS_ABSOLUTE_FILE_NAME(F) \ | 57 | # define IS_ABSOLUTE_FILE_NAME(F) \ |
57 | (ISSLASH ((F)[0]) || 0 < FILE_SYSTEM_PREFIX_LEN (F)) | 58 | (ISSLASH ((F)[0]) || 0 < FILE_SYSTEM_PREFIX_LEN (F)) |
58 | # endif | 59 | # endif |
59 | # define IS_RELATIVE_FILE_NAME(F) (! IS_ABSOLUTE_FILE_NAME (F)) | 60 | # define IS_RELATIVE_FILE_NAME(F) (! IS_ABSOLUTE_FILE_NAME (F)) |
60 | 61 | ||
62 | # if GNULIB_DIRNAME | ||
61 | char *base_name (char const *file); | 63 | char *base_name (char const *file); |
62 | char *dir_name (char const *file); | 64 | char *dir_name (char const *file); |
65 | # endif | ||
66 | |||
67 | char *mdir_name (char const *file); | ||
63 | size_t base_len (char const *file); | 68 | size_t base_len (char const *file); |
64 | size_t dir_len (char const *file); | 69 | size_t dir_len (char const *file); |
65 | char *last_component (char const *file); | 70 | char *last_component (char const *file); |