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.6 2005/01/19 17:03:35 freckle 00039 * forget to check in other cygwin fixes 00040 * 00041 * Revision 1.5 2004/04/07 12:13:57 haraldkipp 00042 * Matthias Ringwald's *nix emulation added 00043 * 00044 * Revision 1.4 2004/03/16 16:48:27 haraldkipp 00045 * Added Jan Dubiec's H8/300 port. 00046 * 00047 * Revision 1.3 2003/12/19 22:24:25 drsung 00048 * Dox written. 00049 * 00050 * Revision 1.2 2003/11/26 11:15:34 haraldkipp 00051 * Portability issues 00052 * 00053 * Revision 1.1 2003/11/24 18:11:03 drsung 00054 * first release 00055 * 00056 * 00057 */ 00058 00063 #include <compiler.h> 00064 #include <sys/types.h> 00065 00071 __BEGIN_DECLS 00075 typedef struct _tm tm; 00076 00086 struct _tm { 00087 int tm_sec; 00088 int tm_min; 00089 int tm_hour; 00090 int tm_mday; 00091 int tm_mon; 00092 int tm_year; 00093 int tm_wday; 00094 int tm_yday; 00095 int tm_isdst; 00096 }; 00097 00102 #if !defined(__APPLE__) && !defined(__CYGWIN__) 00103 typedef long time_t; 00104 #endif 00105 00106 #ifdef __linux__ 00107 /* make compiler on linux gcc-2.95 happy */ 00108 struct timespec; 00109 #endif 00110 00111 time_t time(time_t * timer); 00112 int gmtime_r(CONST time_t * timer, tm * theTime); 00113 tm *gmtime(CONST time_t * timer); 00114 int localtime_r(CONST time_t * timer, tm * theTime); 00115 tm *localtime(CONST time_t * timer); 00116 00117 int stime(time_t * timer); 00118 time_t mktime(tm * timeptr); 00119 time_t _mkgmtime(tm * timeptr); 00120 00129 extern u_char _daylight; 00130 00143 extern long _timezone; 00144 00153 extern long _dstbias; 00154 00155 __END_DECLS 00157 #endif