00001 #ifndef CLASSLIB_SYSAPI_FILENAME_H
00002 # define CLASSLIB_SYSAPI_FILENAME_H
00003
00004
00005
00006 # include "classlib/sysapi/IOTypes.h"
00007 # include <cerrno>
00008 # ifdef _WIN32
00009 # include <windows.h>
00010 # include <direct.h>
00011 # include "classlib/sysapi/WindowsIO.h"
00012 # else
00013 # include <unistd.h>
00014 # include <sys/stat.h>
00015 # include <fcntl.h>
00016 # if HAVE_GLOB
00017 # include <glob.h>
00018 # endif
00019 # endif
00020
00021
00022
00024 # ifdef _WIN32
00025
00027 static const char s_drives [] = ("abcdefghijklmnopqrstuvwxyz"
00028 "ABCDEFGHIJKLMNOPQRSTUVWXYZ");
00029
00031 # define ISDRIVECHR(x) (strchr (s_drives, (x)))
00032
00034 # define ISPATHSEP(p) (*(p) == '\\' || *(p) == '/')
00035
00037 # define ISSHARE(p) (ISPATHSEP(p) && ISPATHSEP(p+1))
00038
00040 # define ISDRIVE(p) (ISDRIVECHR(*(p)) && *((p)+1) == ':')
00041
00043 # define PATHSEP '\\'
00044
00046 # define ISWIN32 true
00047
00048
00049 # define access _access
00050 # define unlink _unlink
00051 # else // ! _WIN32
00052
00054 # define ISPATHSEP(p) (*(p) == '/')
00055
00057 # define ISSHARE(p) false
00058
00060 # define ISDRIVE(p) false
00061
00063 # define PATHSEP '/'
00064
00066 # define ISWIN32 false
00067
00068 # endif // _WIN32
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078 #endif // CLASSLIB_SYSAPI_FILENAME_H