Back to index

tetex-bin  3.0
c-pathch.h
Go to the documentation of this file.
00001 /* c-pathch.h: define the characters which separate components of
00002    filenames and environment variable paths.
00003 
00004 Copyright (C) 1992, 93, 95, 97 Free Software Foundation, Inc.
00005 
00006 This library is free software; you can redistribute it and/or
00007 modify it under the terms of the GNU Library General Public
00008 License as published by the Free Software Foundation; either
00009 version 2 of the License, or (at your option) any later version.
00010 
00011 This library is distributed in the hope that it will be useful,
00012 but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 Library General Public License for more details.
00015 
00016 You should have received a copy of the GNU Library General Public
00017 License along with this library; if not, write to the Free Software
00018 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
00019 
00020 #ifndef C_PATHCH_H
00021 #define C_PATHCH_H
00022 
00023 #include <kpathsea/c-ctype.h>
00024 
00025 /* What separates filename components?  */
00026 #ifndef DIR_SEP
00027 #ifdef VMS
00028 #define DIR_SEP ':'
00029 #define DIR_SEP_STRING ":"
00030 #else
00031 #ifdef DOSISH
00032 /* Either \'s or 's work.  Wayne Sullivan's web2pc prefers /, so we'll
00033    go with that.  */
00034 #define DIR_SEP '/'
00035 #define DIR_SEP_STRING "/"
00036 #define IS_DEVICE_SEP(ch) ((ch) == ':')
00037 #define NAME_BEGINS_WITH_DEVICE(name) (*(name) && IS_DEVICE_SEP((name)[1]))
00038 /* On DOS, it's good to allow both \ and / between directories.  */
00039 #define IS_DIR_SEP(ch) ((ch) == '/' || (ch) == '\\')
00040 /* On win32, UNC names are authorized */
00041 #ifdef WIN32
00042 #define IS_UNC_NAME(name) (strlen(name)>=3 && IS_DIR_SEP(*name)  \
00043                             && IS_DIR_SEP(*(name+1)) && isalnum(*(name+2)))
00044 #endif
00045 #else
00046 #ifdef AMIGA
00047 #define DIR_SEP '/'
00048 #define DIR_SEP_STRING "/"
00049 #define IS_DIR_SEP(ch) ((ch) == '/' || (ch) == ':')
00050 #define IS_DEVICE_SEP(ch) ((ch) == ':')
00051 #else
00052 #ifdef VMCMS
00053 #define DIR_SEP ' '
00054 #define DIR_SEP_STRING " "
00055 #else
00056 #define DIR_SEP '/'
00057 #define DIR_SEP_STRING "/"
00058 #endif /* not VM/CMS */
00059 #endif /* not AMIGA */
00060 #endif /* not DOSISH */
00061 #endif /* not VMS */
00062 #endif /* not DIR_SEP */
00063 
00064 #ifndef IS_DIR_SEP
00065 #define IS_DIR_SEP(ch) ((ch) == DIR_SEP)
00066 #endif
00067 #ifndef IS_DEVICE_SEP /* No `devices' on, e.g., Unix.  */
00068 #define IS_DEVICE_SEP(ch) 0 
00069 #endif
00070 #ifndef NAME_BEGINS_WITH_DEVICE
00071 #define NAME_BEGINS_WITH_DEVICE(name) 0 
00072 #endif
00073 #ifndef IS_UNC_NAME /* Unc names are in practice found on Win32 only. */
00074 #define IS_UNC_NAME(name) 0
00075 #endif
00076 
00077 /* What separates elements in environment variable path lists?  */
00078 #ifndef ENV_SEP
00079 #ifdef VMS
00080 #define ENV_SEP ','
00081 #define ENV_SEP_STRING ","
00082 #else
00083 #ifdef DOSISH
00084 #define ENV_SEP ';'
00085 #define ENV_SEP_STRING ";"
00086 #else
00087 #ifdef AMIGA
00088 #define ENV_SEP ';'
00089 #define ENV_SEP_STRING ";"
00090 #else
00091 #ifdef VMCMS
00092 #define ENV_SEP ' '
00093 #define ENV_SEP_STRING " "
00094 #else
00095 #define ENV_SEP ':'
00096 #define ENV_SEP_STRING ":"
00097 #endif /* not VM/CMS */
00098 #endif /* not AMIGA */
00099 #endif /* not DOS */
00100 #endif /* not VMS */
00101 #endif /* not ENV_SEP */
00102 
00103 #ifndef IS_ENV_SEP
00104 #define IS_ENV_SEP(ch) ((ch) == ENV_SEP)
00105 #endif
00106 
00107 #endif /* not C_PATHCH_H */