00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 00002 /* 00003 * This file is part of the LibreOffice project. 00004 * 00005 * This Source Code Form is subject to the terms of the Mozilla Public 00006 * License, v. 2.0. If a copy of the MPL was not distributed with this 00007 * file, You can obtain one at http://mozilla.org/MPL/2.0/. 00008 * 00009 * This file incorporates work covered by the following license notice: 00010 * 00011 * Licensed to the Apache Software Foundation (ASF) under one or more 00012 * contributor license agreements. See the NOTICE file distributed 00013 * with this work for additional information regarding copyright 00014 * ownership. The ASF licenses this file to you under the Apache 00015 * License, Version 2.0 (the "License"); you may not use this file 00016 * except in compliance with the License. You may obtain a copy of 00017 * the License at http://www.apache.org/licenses/LICENSE-2.0 . 00018 */ 00019 00020 #ifndef _OSL_TIME_H_ 00021 #define _OSL_TIME_H_ 00022 00023 #include "sal/config.h" 00024 00025 #include "sal/saldllapi.h" 00026 #include "sal/types.h" 00027 00028 #ifdef __cplusplus 00029 extern "C" { 00030 #endif 00031 00032 /****************************************************************************/ 00033 /* TimeValue */ 00034 /****************************************************************************/ 00035 00036 #ifdef SAL_W32 00037 # pragma pack(push, 8) 00038 #endif 00039 00040 /* Time since Jan-01-1970 */ 00041 00042 typedef struct { 00043 sal_uInt32 Seconds; 00044 sal_uInt32 Nanosec; 00045 } TimeValue; 00046 00047 #if defined(SAL_W32) 00048 # pragma pack(pop) 00049 #endif 00050 00051 00052 /****************************************************************************/ 00053 /* oslDateTime */ 00054 /****************************************************************************/ 00055 00056 typedef struct _oslDateTime 00057 { 00058 /*----------------------------------------------------------------------*/ 00061 sal_uInt32 NanoSeconds; 00062 00065 sal_uInt16 Seconds; 00066 00067 /*----------------------------------------------------------------------*/ 00070 sal_uInt16 Minutes; 00071 00072 /*----------------------------------------------------------------------*/ 00075 sal_uInt16 Hours; 00076 00077 /*----------------------------------------------------------------------*/ 00080 sal_uInt16 Day; 00081 00082 /*----------------------------------------------------------------------*/ 00085 sal_uInt16 DayOfWeek; 00086 00087 /*----------------------------------------------------------------------*/ 00090 sal_uInt16 Month; 00091 00092 /*----------------------------------------------------------------------*/ 00095 sal_uInt16 Year; 00096 00097 } oslDateTime; 00098 00099 00103 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_getSystemTime( 00104 TimeValue* pTimeVal ); 00105 00106 00113 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_getDateTimeFromTimeValue( 00114 TimeValue* pTimeVal, oslDateTime* pDateTime ); 00115 00116 00123 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_getTimeValueFromDateTime( 00124 oslDateTime* pDateTime, TimeValue* pTimeVal ); 00125 00126 00133 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_getLocalTimeFromSystemTime( 00134 TimeValue* pSystemTimeVal, TimeValue* pLocalTimeVal ); 00135 00136 00143 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_getSystemTimeFromLocalTime( 00144 TimeValue* pLocalTimeVal, TimeValue* pSystemTimeVal ); 00145 00146 00151 SAL_DLLPUBLIC sal_uInt32 SAL_CALL osl_getGlobalTimer(void); 00152 00153 #ifdef __cplusplus 00154 } 00155 #endif 00156 00157 #endif /* _OSL_TIME_H_ */ 00158 00159 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */