UbixOS V2  2.0
time.h
Go to the documentation of this file.
1 /*-
2  * Copyright (c) 2002-2018 The UbixOS Project.
3  * All rights reserved.
4  *
5  * This was developed by Christopher W. Olsen for the UbixOS Project.
6  *
7  * Redistribution and use in source and binary forms, with or without modification, are permitted
8  * provided that the following conditions are met:
9  *
10  * 1) Redistributions of source code must retain the above copyright notice, this list of
11  * conditions, the following disclaimer and the list of authors.
12  * 2) Redistributions in binary form must reproduce the above copyright notice, this list of
13  * conditions, the following disclaimer and the list of authors in the documentation and/or
14  * other materials provided with the distribution.
15  * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to
16  * endorse or promote products derived from this software without specific prior written
17  * permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
20  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
22  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
26  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 #ifndef _UBIXOS_TIME_H
30 #define _UBIXOS_TIME_H
31 
32 #include <sys/types.h>
33 #include <sys/_timespec.h>
34 #include <sys/io.h>
35 
36 typedef long suseconds_t;
37 
38 #define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10)
39 
40 #define MINUTE 60
41 #define HOUR (60*MINUTE)
42 #define DAY (24*HOUR)
43 #define YEAR (365*DAY)
44 
45 
46 struct timeStruct {
47  int sec;
48  int min;
49  int hour;
50  int day;
51  int mon;
52  int year;
53 };
54 
55 struct timezone {
56  int tz_minuteswest; /* minutes west of Greenwich */
57  int tz_dsttime; /* type of dst correction */
58 };
59 
60 int gettimeofday(struct timeval *tp, struct timezone *tzp);
61 
62 int time_init();
63 uInt32 timeMake(struct timeStruct *time);
64 
65 #endif
66 
67 /***
68  $Log: time.h,v $
69  Revision 1.1.1.1 2006/06/01 12:46:14 reddawg
70  ubix2
71 
72  Revision 1.2 2005/10/12 00:13:37 reddawg
73  Removed
74 
75  Revision 1.1.1.1 2005/09/26 17:23:56 reddawg
76  no message
77 
78  Revision 1.4 2004/07/09 13:37:30 reddawg
79  time: timeInit to time_init
80  Adjusted initialization routines
81 
82  Revision 1.3 2004/06/29 11:41:44 reddawg
83  Fixed some global variables
84 
85  Revision 1.2 2004/05/21 15:20:00 reddawg
86  Cleaned up
87 
88  END
89  ***/
timezone
Definition: time.h:55
_timespec.h
uInt32
unsigned long int uInt32
Definition: objgfx30.h:49
timeStruct::year
int year
Definition: time.h:52
timeStruct::min
int min
Definition: time.h:48
timeMake
uInt32 timeMake(struct timeStruct *time)
Definition: time.c:87
types.h
suseconds_t
long suseconds_t
Definition: time.h:36
gettimeofday
int gettimeofday(struct timeval *tp, struct timezone *tzp)
Definition: time.c:110
timeStruct::sec
int sec
Definition: time.h:47
timeStruct::hour
int hour
Definition: time.h:49
timezone::tz_dsttime
int tz_dsttime
Definition: time.h:57
timeStruct
Definition: time.h:46
timeStruct::day
int day
Definition: time.h:50
timeval
Definition: _timeval.h:17
io.h
timeStruct::mon
int mon
Definition: time.h:51
timezone::tz_minuteswest
int tz_minuteswest
Definition: time.h:56
time_init
int time_init()
Definition: time.c:52