00001 #ifndef __TIME_H 00002 #define __TIME_H 00003 00004 /* 00005 * Copyright (C) 2001-2003 by egnite Software GmbH. All rights reserved. 00006 * 00007 * Redistribution and use in source and binary forms, with or without 00008 * modification, are permitted provided that the following conditions 00009 * are met: 00010 * 00011 * 1. Redistributions of source code must retain the above copyright 00012 * notice, this list of conditions and the following disclaimer. 00013 * 2. Redistributions in binary form must reproduce the above copyright 00014 * notice, this list of conditions and the following disclaimer in the 00015 * documentation and/or other materials provided with the distribution. 00016 * 3. Neither the name of the copyright holders nor the names of 00017 * contributors may be used to endorse or promote products derived 00018 * from this software without specific prior written permission. 00019 * 00020 * THIS SOFTWARE IS PROVIDED BY EGNITE SOFTWARE GMBH AND CONTRIBUTORS 00021 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00022 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 00023 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL EGNITE 00024 * SOFTWARE GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 00025 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 00026 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 00027 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 00028 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00029 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 00030 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00031 * SUCH DAMAGE. 00032 * 00033 * For additional information see http://www.ethernut.de/ 00034 * 00035 */ 00036 /* 00037 * $Log: time.h,v $ 00038 * Revision 1.7 2008/08/11 06:59:58 haraldkipp 00039 * BSD types replaced by stdint types (feature request #1282721). 00040 * 00041 * Revision 1.6 2005/01/19 17:03:35 freckle 00042 * forget to check in other cygwin fixes 00043 * 00044 * Revision 1.5 2004/04/07 12:13:57 haraldkipp 00045 * Matthias Ringwald's *nix emulation added 00046 * 00047 * Revision 1.4 2004/03/16 16:48:27 haraldkipp 00048 * Added Jan Dubiec's H8/300 port. 00049 * 00050 * Revision 1.3 2003/12/19 22:24:25 drsung 00051 * Dox written. 00052 * 00053 * Revision 1.2 2003/11/26 11:15:34 haraldkipp 00054 * Portability issues 00055 * 00056 * Revision 1.1 2003/11/24 18:11:03 drsung 00057 * first release 00058 * 00059 * 00060 */ 00061 00066 #include <compiler.h> 00067 #include <sys/types.h> 00068 00074 __BEGIN_DECLS 00078 typedef struct _tm tm; 00079 00089 struct _tm { 00090 int tm_sec; 00091 int tm_min; 00092 int tm_hour; 00093 int tm_mday; 00094 int tm_mon; 00095 int tm_year; 00096 int tm_wday; 00097 int tm_yday; 00098 int tm_isdst; 00099 }; 00100 00105 #if !defined(__APPLE__) && !defined(__CYGWIN__) 00106 typedef long time_t; 00107 #endif 00108 00109 #ifdef __linux__ 00110 /* make compiler on linux gcc-2.95 happy */ 00111 struct timespec; 00112 #endif 00113 00114 time_t time(time_t * timer); 00115 int gmtime_r(CONST time_t * timer, tm * theTime); 00116 tm *gmtime(CONST time_t * timer); 00117 int localtime_r(CONST time_t * timer, tm * theTime); 00118 tm *localtime(CONST time_t * timer); 00119 00120 int stime(time_t * timer); 00121 time_t mktime(tm * timeptr); 00122 time_t _mkgmtime(tm * timeptr); 00123 00132 extern int _daylight; 00133 00146 extern long _timezone; 00147 00156 extern long _dstbias; 00157 00158 __END_DECLS 00160 #endif