Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * This file is part of the LibreOffice project.
4 : : *
5 : : * This Source Code Form is subject to the terms of the Mozilla Public
6 : : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : : *
9 : : * This file incorporates work covered by the following license notice:
10 : : *
11 : : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : : * contributor license agreements. See the NOTICE file distributed
13 : : * with this work for additional information regarding copyright
14 : : * ownership. The ASF licenses this file to you under the Apache
15 : : * License, Version 2.0 (the "License"); you may not use this file
16 : : * except in compliance with the License. You may obtain a copy of
17 : : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : : */
19 : : #ifndef _unx_hxx
20 : : #define _unx_hxx
21 : :
22 : : #include <string.h>
23 : : #include <sys/types.h>
24 : : #include <sys/stat.h>
25 : : #include <sys/param.h>
26 : : #include <dirent.h>
27 : : #include <unistd.h>
28 : :
29 : : #define DRIVE_EXISTS(c) ( TRUE )
30 : :
31 : : #define _mkdir(p) mkdir(p, 0777)
32 : : #define _rmdir rmdir
33 : : #define _chdir chdir
34 : : #define _unlink unlink
35 : : #define _getcwd getcwd
36 : : #define _access access
37 : :
38 : : #define DEFSTYLE FSYS_STYLE_BSD
39 : :
40 : : #define CMP_LOWER(s) (s)
41 : : #define LOWER(aString) (aString.Lower())
42 : :
43 : : #include <time.h>
44 : :
45 : : inline Time Unx2Time( time_t nTime )
46 : : {
47 : : tm atm;
48 : : tm *pTime;
49 : : pTime = localtime_r( &nTime, &atm );
50 : : return Time( pTime->tm_hour,
51 : : pTime->tm_min,
52 : : pTime->tm_sec );
53 : : }
54 : :
55 : : inline Date Unx2Date( time_t nDate )
56 : : {
57 : : tm atm;
58 : : tm *pTime;
59 : : pTime = localtime_r( &nDate, &atm );
60 : : return Date( pTime->tm_mday,
61 : : pTime->tm_mon + 1,
62 : : pTime->tm_year + 1900 );
63 : : }
64 : :
65 : 27990 : inline void Unx2DateAndTime( time_t nDate, Time& rTime, Date& rDate )
66 : : {
67 : : tm atm;
68 : : tm *pTime;
69 : 27990 : pTime = localtime_r( &nDate, &atm );
70 [ + - ][ + - ]: 27990 : rTime = Time( pTime->tm_hour, pTime->tm_min, pTime->tm_sec );
71 : 27990 : rDate = Date( pTime->tm_mday, pTime->tm_mon + 1, pTime->tm_year + 1900 );
72 : 27990 : }
73 : :
74 : : const char* TempDirImpl( char *pBuf );
75 : :
76 : : #define FSysFailOnErrorImpl()
77 : :
78 : : #endif
79 : :
80 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|