File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / libiconv / srclib / dosname.h
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Wed Mar 17 13:38:46 2021 UTC (3 years, 3 months ago) by misho
Branches: libiconv, MAIN
CVS tags: v1_16p0, HEAD
libiconv 1.16

    1: /* File names on MS-DOS/Windows systems.
    2: 
    3:    Copyright (C) 2000-2001, 2004-2006, 2009-2019 Free Software Foundation, Inc.
    4: 
    5:    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:    the Free Software Foundation; either version 3 of the License, or
    8:    (at your option) any later version.
    9: 
   10:    This program is distributed in the hope that it will be useful,
   11:    but WITHOUT ANY WARRANTY; without even the implied warranty of
   12:    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   13:    GNU General Public License for more details.
   14: 
   15:    You should have received a copy of the GNU General Public License
   16:    along with this program.  If not, see <https://www.gnu.org/licenses/>.
   17: 
   18:    From Paul Eggert and Jim Meyering.  */
   19: 
   20: #ifndef _DOSNAME_H
   21: #define _DOSNAME_H
   22: 
   23: #if (defined _WIN32 || defined __CYGWIN__ \
   24:      || defined __EMX__ || defined __MSDOS__ || defined __DJGPP__)
   25:    /* This internal macro assumes ASCII, but all hosts that support drive
   26:       letters use ASCII.  */
   27: # define _IS_DRIVE_LETTER(C) (((unsigned int) (C) | ('a' - 'A')) - 'a'  \
   28:                               <= 'z' - 'a')
   29: # define FILE_SYSTEM_PREFIX_LEN(Filename) \
   30:           (_IS_DRIVE_LETTER ((Filename)[0]) && (Filename)[1] == ':' ? 2 : 0)
   31: # ifndef __CYGWIN__
   32: #  define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 1
   33: # endif
   34: # define ISSLASH(C) ((C) == '/' || (C) == '\\')
   35: #else
   36: # define FILE_SYSTEM_PREFIX_LEN(Filename) 0
   37: # define ISSLASH(C) ((C) == '/')
   38: #endif
   39: 
   40: #ifndef FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
   41: # define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0
   42: #endif
   43: 
   44: #if FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
   45: #  define IS_ABSOLUTE_FILE_NAME(F) ISSLASH ((F)[FILE_SYSTEM_PREFIX_LEN (F)])
   46: # else
   47: #  define IS_ABSOLUTE_FILE_NAME(F)                              \
   48:      (ISSLASH ((F)[0]) || FILE_SYSTEM_PREFIX_LEN (F) != 0)
   49: #endif
   50: #define IS_RELATIVE_FILE_NAME(F) (! IS_ABSOLUTE_FILE_NAME (F))
   51: 
   52: #endif /* DOSNAME_H_ */

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>