1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef _dosmsc_hxx 25 #define _dosmsc_hxx 26 27 #include <string.h> 28 29 #ifndef ICC 30 #include <io.h> 31 #endif 32 #include <sys\types.h> 33 #include <sys\stat.h> 34 #include <direct.h> 35 36 #include <tools/svwin.h> 37 #ifdef _MSC_VER 38 #pragma warning (push,1) 39 #endif 40 #include <winbase.h> 41 #ifdef _MSC_VER 42 #pragma warning (pop) 43 #endif 44 #include <tools/solar.h> 45 46 #include <tools/string.hxx> 47 48 //-------------------------------------------------------------------- 49 50 #define FSYS_UNIX sal_False 51 52 #define DOS_DIRECT _A_SUBDIR 53 #define DOS_VOLUMEID 0x08 54 #ifndef S_IFBLK 55 #define S_IFBLK 0x6000 56 #endif 57 #define setdrive(n,a) _chdrive(n) 58 #define GETDRIVE(n) (n = _getdrive()) 59 60 #define dirent _WIN32_FIND_DATAA 61 #define d_name cFileName 62 #define d_type dwFileAttributes 63 64 #if defined (TCPP) || defined (tcpp) 65 #define _mkdir mkdir 66 #define _rmdir rmdir 67 #define _chdir chdir 68 #define _unlink unlink 69 #define _getcwd getcwd 70 #define _access access 71 #endif 72 73 typedef struct 74 { 75 _WIN32_FIND_DATAA aDirEnt; 76 HANDLE h; 77 const char *p; 78 } DIR; 79 80 #define PATHDELIMITER ";" 81 #define DEFSTYLE FSYS_STYLE_NTFS 82 #define MKDIR( p ) mkdir( p ) 83 #define CMP_LOWER(s) ( ByteString(s).ToLowerAscii() ) 84 85 #define START_DRV 'a' 86 DRIVE_EXISTS(char c)87inline sal_Bool DRIVE_EXISTS(char c) 88 { 89 ByteString aDriveRoot( c ); 90 aDriveRoot += ":\\"; 91 return GetDriveType( aDriveRoot.GetBuffer() ) > 1; 92 } 93 94 const char* TempDirImpl( char *pBuf ); 95 96 #define FSysFailOnErrorImpl() 97 98 #endif 99