1 /* -*- buffer-read-only: t -*- vi: set ro: */
2 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
3 /* File names on MS-DOS/Windows systems.
5 Copyright (C) 2000-2001, 2004-2006, 2009-2011 Free Software Foundation, Inc.
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
20 From Paul Eggert and Jim Meyering. */
25 #if (defined _WIN32 || defined __WIN32__ || \
26 defined __MSDOS__ || defined __CYGWIN__ || \
27 defined __EMX__ || defined __DJGPP__)
28 /* This internal macro assumes ASCII, but all hosts that support drive
30 # define _IS_DRIVE_LETTER(C) (((unsigned int) (C) | ('a' - 'A')) - 'a' \
32 # define FILE_SYSTEM_PREFIX_LEN(Filename) \
33 (_IS_DRIVE_LETTER ((Filename)[0]) && (Filename)[1] == ':' ? 2 : 0)
35 # define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 1
37 # define ISSLASH(C) ((C) == '/' || (C) == '\\')
39 # define FILE_SYSTEM_PREFIX_LEN(Filename) 0
40 # define ISSLASH(C) ((C) == '/')
43 #ifndef FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
44 # define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0
47 #if FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
48 # define IS_ABSOLUTE_FILE_NAME(F) ISSLASH ((F)[FILE_SYSTEM_PREFIX_LEN (F)])
50 # define IS_ABSOLUTE_FILE_NAME(F) \
51 (ISSLASH ((F)[0]) || FILE_SYSTEM_PREFIX_LEN (F) != 0)
53 #define IS_RELATIVE_FILE_NAME(F) (! IS_ABSOLUTE_FILE_NAME (F))
55 #endif /* DOSNAME_H_ */