LibreOffice
LibreOffice 4.2 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
time.h
Go to the documentation of this file.
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 
20 #ifndef _OSL_TIME_H_
21 #define _OSL_TIME_H_
22 
23 #include <sal/config.h>
24 
25 #include <sal/saldllapi.h>
26 #include <sal/types.h>
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 /****************************************************************************/
33 /* TimeValue */
34 /****************************************************************************/
35 
36 #ifdef SAL_W32
37 # pragma pack(push, 8)
38 #endif
39 
40 /* Time since Jan-01-1970 */
41 
42 typedef struct {
43  sal_uInt32 Seconds;
44  sal_uInt32 Nanosec;
45 } TimeValue;
46 
47 #if defined(SAL_W32)
48 # pragma pack(pop)
49 #endif
50 
51 
52 /****************************************************************************/
53 /* oslDateTime */
54 /****************************************************************************/
55 
56 typedef struct _oslDateTime
57 {
58  /*----------------------------------------------------------------------*/
61  sal_uInt32 NanoSeconds;
62 
65  sal_uInt16 Seconds;
66 
67  /*----------------------------------------------------------------------*/
70  sal_uInt16 Minutes;
71 
72  /*----------------------------------------------------------------------*/
75  sal_uInt16 Hours;
76 
77  /*----------------------------------------------------------------------*/
80  sal_uInt16 Day;
81 
82  /*----------------------------------------------------------------------*/
85  sal_uInt16 DayOfWeek;
86 
87  /*----------------------------------------------------------------------*/
90  sal_uInt16 Month;
91 
92  /*----------------------------------------------------------------------*/
95  sal_Int16 Year;
96 
97 } oslDateTime;
98 
99 
104  TimeValue* pTimeVal );
105 
106 
114  const TimeValue* pTimeVal, oslDateTime* pDateTime );
115 
116 
124  const oslDateTime* pDateTime, TimeValue* pTimeVal );
125 
126 
134  const TimeValue* pSystemTimeVal, TimeValue* pLocalTimeVal );
135 
136 
144  const TimeValue* pLocalTimeVal, TimeValue* pSystemTimeVal );
145 
146 
151 SAL_DLLPUBLIC sal_uInt32 SAL_CALL osl_getGlobalTimer(void);
152 
153 #ifdef __cplusplus
154 }
155 #endif
156 
157 #endif /* _OSL_TIME_H_ */
158 
159 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uInt32 Nanosec
Definition: time.h:44
SAL_DLLPUBLIC sal_Bool osl_getDateTimeFromTimeValue(const TimeValue *pTimeVal, oslDateTime *pDateTime)
Get the GMT from a TimeValue and fill a struct oslDateTime.
sal_uInt16 Day
is the day of month (1-31).
Definition: time.h:80
Definition: time.h:42
sal_uInt16 DayOfWeek
is the day of week (0-6 , 0 : Sunday).
Definition: time.h:85
SAL_DLLPUBLIC sal_Bool osl_getLocalTimeFromSystemTime(const TimeValue *pSystemTimeVal, TimeValue *pLocalTimeVal)
Convert GMT to local time.
sal_uInt32 Seconds
Definition: time.h:43
SAL_DLLPUBLIC sal_Bool osl_getTimeValueFromDateTime(const oslDateTime *pDateTime, TimeValue *pTimeVal)
Get the GMT from a oslDateTime and fill a TimeValue.
sal_uInt16 Month
is the month of year (1-12).
Definition: time.h:90
SAL_DLLPUBLIC sal_Bool osl_getSystemTime(TimeValue *pTimeVal)
Get the current system time as TimeValue.
sal_uInt16 Seconds
contains the seconds (0-59).
Definition: time.h:65
Definition: time.h:56
struct _oslDateTime oslDateTime
sal_uInt32 NanoSeconds
contains the nanoseconds .
Definition: time.h:61
unsigned char sal_Bool
Definition: types.h:46
sal_Int16 Year
is the year.
Definition: time.h:95
#define SAL_DLLPUBLIC
Definition: saldllapi.h:30
sal_uInt16 Minutes
contains the minutes (0-59).
Definition: time.h:70
SAL_DLLPUBLIC sal_uInt32 osl_getGlobalTimer(void)
Get the value of the global timer.
sal_uInt16 Hours
contains the hour (0-23).
Definition: time.h:75
SAL_DLLPUBLIC sal_Bool osl_getSystemTimeFromLocalTime(const TimeValue *pLocalTimeVal, TimeValue *pSystemTimeVal)
Convert local time to GMT.