xref: /aoo41x/main/tools/source/fsys/os2.hxx (revision 8b851043)
1*8b851043SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*8b851043SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*8b851043SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*8b851043SAndrew Rist  * distributed with this work for additional information
6*8b851043SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*8b851043SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*8b851043SAndrew Rist  * "License"); you may not use this file except in compliance
9*8b851043SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*8b851043SAndrew Rist  *
11*8b851043SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*8b851043SAndrew Rist  *
13*8b851043SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*8b851043SAndrew Rist  * software distributed under the License is distributed on an
15*8b851043SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*8b851043SAndrew Rist  * KIND, either express or implied.  See the License for the
17*8b851043SAndrew Rist  * specific language governing permissions and limitations
18*8b851043SAndrew Rist  * under the License.
19*8b851043SAndrew Rist  *
20*8b851043SAndrew Rist  *************************************************************/
21*8b851043SAndrew Rist 
22*8b851043SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _os2_hxx
25cdf0e10cSrcweir #define _os2_hxx
26cdf0e10cSrcweir 
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #define INCL_DOSEXCEPTIONS
29cdf0e10cSrcweir #define INCL_DOSFILEMGR
30cdf0e10cSrcweir #define INCL_DOSPROCESS
31cdf0e10cSrcweir #define INCL_DOSDEVICES
32cdf0e10cSrcweir #define INCL_DOSERRORS
33cdf0e10cSrcweir #define INCL_DOSMISC
34cdf0e10cSrcweir #define INCL_DOSNLS   /* National Language Support values */
35cdf0e10cSrcweir #include <svpm.h>
36cdf0e10cSrcweir 
37cdf0e10cSrcweir #include <dirent.h>
38cdf0e10cSrcweir #include <string.h>
39cdf0e10cSrcweir 
40cdf0e10cSrcweir #include <sys\types.h>
41cdf0e10cSrcweir #include <sys\stat.h>
42cdf0e10cSrcweir #include <stdio.h>
43cdf0e10cSrcweir #include <ctype.h>
44cdf0e10cSrcweir #include <emx/syscalls.h>
45cdf0e10cSrcweir 
46cdf0e10cSrcweir #define FSYS_UNIX FALSE
47cdf0e10cSrcweir 
48cdf0e10cSrcweir #define DOS_DIRECT      _A_SUBDIR
49cdf0e10cSrcweir #define DOS_VOLUMEID    _A_VOLID
50cdf0e10cSrcweir 
51cdf0e10cSrcweir #define _mkdir(p)       mkdir(p, 0777)
52cdf0e10cSrcweir 
53cdf0e10cSrcweir const char* TempDirImpl( char *pBuf );
54cdf0e10cSrcweir String ToLowerImpl( const String& );
55cdf0e10cSrcweir 
56cdf0e10cSrcweir #define DEFSTYLE            FSYS_STYLE_OS2
57cdf0e10cSrcweir #define MKDIR( p )          mkdir( (unsigned char*) p )
58cdf0e10cSrcweir #define CMP_LOWER(s) 	( s.ToLowerAscii() )
59cdf0e10cSrcweir 
60cdf0e10cSrcweir #define START_DRV       'a'
61cdf0e10cSrcweir 
62cdf0e10cSrcweir inline BOOL DRIVE_EXISTS( char c )
63cdf0e10cSrcweir {
64cdf0e10cSrcweir     ULONG  nCur, nMap;
65cdf0e10cSrcweir     APIRET nRet = DosQueryCurrentDisk( &nCur, &nMap );
66cdf0e10cSrcweir     return ( nMap & 1 << (c - 'a') ) != 0;
67cdf0e10cSrcweir }
68cdf0e10cSrcweir 
69cdf0e10cSrcweir #include <time.h>
70cdf0e10cSrcweir //#include <datetime.hxx>
71cdf0e10cSrcweir 
72cdf0e10cSrcweir inline Time MsDos2Time( FTIME* aTime )
73cdf0e10cSrcweir {
74cdf0e10cSrcweir     return Time( aTime->hours, aTime->minutes, 2*aTime->twosecs );
75cdf0e10cSrcweir }
76cdf0e10cSrcweir 
77cdf0e10cSrcweir inline Date MsDos2Date( FDATE* aDate )
78cdf0e10cSrcweir {
79cdf0e10cSrcweir     return Date( aDate->day, aDate->month, aDate->year );
80cdf0e10cSrcweir }
81cdf0e10cSrcweir 
82cdf0e10cSrcweir Time MsDos2Time( const time_t *pTimeT );
83cdf0e10cSrcweir 
84cdf0e10cSrcweir Date MsDos2Date( const time_t *pTimeT );
85cdf0e10cSrcweir 
86cdf0e10cSrcweir #define FSysFailOnErrorImpl()
87cdf0e10cSrcweir 
88cdf0e10cSrcweir #endif
89cdf0e10cSrcweir 
90