xref: /aoo41x/main/tools/source/fsys/os2.hxx (revision cdf0e10c)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir #ifndef _os2_hxx
29*cdf0e10cSrcweir #define _os2_hxx
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir 
32*cdf0e10cSrcweir #define INCL_DOSEXCEPTIONS
33*cdf0e10cSrcweir #define INCL_DOSFILEMGR
34*cdf0e10cSrcweir #define INCL_DOSPROCESS
35*cdf0e10cSrcweir #define INCL_DOSDEVICES
36*cdf0e10cSrcweir #define INCL_DOSERRORS
37*cdf0e10cSrcweir #define INCL_DOSMISC
38*cdf0e10cSrcweir #define INCL_DOSNLS   /* National Language Support values */
39*cdf0e10cSrcweir #include <svpm.h>
40*cdf0e10cSrcweir 
41*cdf0e10cSrcweir #include <dirent.h>
42*cdf0e10cSrcweir #include <string.h>
43*cdf0e10cSrcweir 
44*cdf0e10cSrcweir #include <sys\types.h>
45*cdf0e10cSrcweir #include <sys\stat.h>
46*cdf0e10cSrcweir #include <stdio.h>
47*cdf0e10cSrcweir #include <ctype.h>
48*cdf0e10cSrcweir #include <emx/syscalls.h>
49*cdf0e10cSrcweir 
50*cdf0e10cSrcweir #define FSYS_UNIX FALSE
51*cdf0e10cSrcweir 
52*cdf0e10cSrcweir #define DOS_DIRECT      _A_SUBDIR
53*cdf0e10cSrcweir #define DOS_VOLUMEID    _A_VOLID
54*cdf0e10cSrcweir 
55*cdf0e10cSrcweir #define _mkdir(p)       mkdir(p, 0777)
56*cdf0e10cSrcweir 
57*cdf0e10cSrcweir const char* TempDirImpl( char *pBuf );
58*cdf0e10cSrcweir String ToLowerImpl( const String& );
59*cdf0e10cSrcweir 
60*cdf0e10cSrcweir #define DEFSTYLE            FSYS_STYLE_OS2
61*cdf0e10cSrcweir #define MKDIR( p )          mkdir( (unsigned char*) p )
62*cdf0e10cSrcweir #define CMP_LOWER(s) 	( s.ToLowerAscii() )
63*cdf0e10cSrcweir 
64*cdf0e10cSrcweir #define START_DRV       'a'
65*cdf0e10cSrcweir 
66*cdf0e10cSrcweir inline BOOL DRIVE_EXISTS( char c )
67*cdf0e10cSrcweir {
68*cdf0e10cSrcweir     ULONG  nCur, nMap;
69*cdf0e10cSrcweir     APIRET nRet = DosQueryCurrentDisk( &nCur, &nMap );
70*cdf0e10cSrcweir     return ( nMap & 1 << (c - 'a') ) != 0;
71*cdf0e10cSrcweir }
72*cdf0e10cSrcweir 
73*cdf0e10cSrcweir #include <time.h>
74*cdf0e10cSrcweir //#include <datetime.hxx>
75*cdf0e10cSrcweir 
76*cdf0e10cSrcweir inline Time MsDos2Time( FTIME* aTime )
77*cdf0e10cSrcweir {
78*cdf0e10cSrcweir     return Time( aTime->hours, aTime->minutes, 2*aTime->twosecs );
79*cdf0e10cSrcweir }
80*cdf0e10cSrcweir 
81*cdf0e10cSrcweir inline Date MsDos2Date( FDATE* aDate )
82*cdf0e10cSrcweir {
83*cdf0e10cSrcweir     return Date( aDate->day, aDate->month, aDate->year );
84*cdf0e10cSrcweir }
85*cdf0e10cSrcweir 
86*cdf0e10cSrcweir Time MsDos2Time( const time_t *pTimeT );
87*cdf0e10cSrcweir 
88*cdf0e10cSrcweir Date MsDos2Date( const time_t *pTimeT );
89*cdf0e10cSrcweir 
90*cdf0e10cSrcweir #define FSysFailOnErrorImpl()
91*cdf0e10cSrcweir 
92*cdf0e10cSrcweir #endif
93*cdf0e10cSrcweir 
94