1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: unx.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
35 #include <sys/types.h>
37 #include <sys/param.h>
40 /* #include <sysent.h> */
42 #define FSYS_UNIX TRUE
43 #define DRIVE_EXISTS(c) ( TRUE )
45 #define _mkdir(p) mkdir(p, 0777)
48 #define _unlink unlink
49 #define _getcwd getcwd
50 #define _access access
53 #define DEFSTYLE FSYS_STYLE_SYSV
55 #define DEFSTYLE FSYS_STYLE_BSD
58 #define CMP_LOWER(s) (s)
59 #define TEMPNAME() tmpnam(0)
60 #define LOWER(aString) (aString.Lower())
63 #include <tools/datetime.hxx>
65 inline Time
Unx2Time( time_t nTime
)
69 pTime
= localtime_r( &nTime
, &atm
);
70 return Time( pTime
->tm_hour
,
75 inline Date
Unx2Date( time_t nDate
)
79 pTime
= localtime_r( &nDate
, &atm
);
80 return Date( pTime
->tm_mday
,
82 pTime
->tm_year
+ 1900 );
85 inline void Unx2DateAndTime( time_t nDate
, Time
& rTime
, Date
& rDate
)
89 pTime
= localtime_r( &nDate
, &atm
);
90 rTime
= Time( pTime
->tm_hour
, pTime
->tm_min
, pTime
->tm_sec
);
91 rDate
= Date( pTime
->tm_mday
, pTime
->tm_mon
+ 1, pTime
->tm_year
+ 1900 );
94 const char* TempDirImpl( char *pBuf
);
96 #define FSysFailOnErrorImpl()