Open Garden  0.10.1-21
time.h
Go to the documentation of this file.
1 /* time.h - stdlib time conversion routines
2 
3  Written By - Johan Knol, johan.knol@iduna.nl
4 
5  This program is free software; you can redistribute it and/or modify it
6  under the terms of the GNU General Public License as published by the
7  Free Software Foundation; either version 2, or (at your option) any
8  later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 
19  In other words, you are welcome to use, share and improve this program.
20  You are forbidden to forbid anyone else to use, share and improve
21  what you give them. Help stamp out software-hoarding!
22  */
23 
24 /* Modified by Enrico Rossi */
25 
31 #ifndef TIME_H
32 #define TIME_H
33 
34 #include "rtc.h"
35 
39 #define LEAP_YEAR(year) ((year%4)==0)
40 
42 struct tm {
44  unsigned char tm_sec;
46  unsigned char tm_min;
48  unsigned char tm_hour;
50  unsigned char tm_mday;
52  unsigned char tm_mon;
54  int tm_year;
56  unsigned char tm_wday;
58  int tm_yday;
59 };
60 
62 typedef unsigned long time_t;
63 
64 void settimeofday(const time_t seconds);
65 time_t gettimeofday(void);
66 time_t time(time_t *t);
67 struct tm *gmtime(time_t *timep);
68 time_t mktime(struct tm *timeptr);
69 char *asctime(struct tm *timeptr);
70 char *ctime(time_t *timep);
71 
72 #endif
low lever real time clock handler.
unsigned char tm_mon
Definition: time.h:52
struct tm * gmtime(time_t *timep)
Definition: time.c:85
unsigned char tm_sec
Definition: time.h:44
int tm_year
Definition: time.h:54
time_t time(time_t *t)
Definition: time.c:49
time_t mktime(struct tm *timeptr)
Definition: time.c:146
time_t gettimeofday(void)
Definition: time.c:44
void settimeofday(const time_t seconds)
Definition: time.c:39
unsigned char tm_hour
Definition: time.h:48
Definition: time.h:42
unsigned char tm_min
Definition: time.h:46
char * asctime(struct tm *timeptr)
Definition: time.c:71
unsigned long time_t
Definition: time.h:62
int tm_yday
Definition: time.h:58
char * ctime(time_t *timep)
Definition: time.c:141
unsigned char tm_wday
Definition: time.h:56
unsigned char tm_mday
Definition: time.h:50