1 /*
2  *	Copyright (c) 1986-2000, Hiram Clawson
3  *	All rights reserved.
4  *
5  *	Redistribution and use in source and binary forms, with or
6  *	without modification, are permitted provided that the following
7  *	conditions are met:
8  *
9  *		Redistributions of source code must retain the above
10  *		copyright notice, this list of conditions and the
11  *		following disclaimer.
12  *
13  *		Redistributions in binary form must reproduce the
14  *		above copyright notice, this list of conditions and
15  *		the following disclaimer in the documentation and/or
16  *		other materials provided with the distribution.
17  *
18  *		Neither name of The Museum of Hiram nor the names of
19  *		its contributors may be used to endorse or promote products
20  *		derived from this software without specific prior
21  *		written permission.
22  *
23  *	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
24  *	CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
25  *	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
26  *	MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
27  *	IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
28  *	INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29  *	(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30  *	OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31  *	HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
32  *	STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
33  *	IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
34  *	THE POSSIBILITY OF SUCH DAMAGE.
35  */
36 
37 /**
38  *	@file astime.h
39  *      @brief contains definitions of structures used for time calculations.
40  */
41 
42 #ifndef	_astime_h_
43 #define _astime_h_
44 
45 typedef struct ut_instant {
46 	double	j_date; /**< julian decimal date, 0 = 01 Jan 4713 BC 12 HR UT */
47 	long year;      /**< year, valid range [-4,713, +2,147,483,647] */
48 	int	month;	/**<	[1-12]	*/
49 	int	day;	/**<	[1-31]	*/
50 	int	i_hour;	/**<	[0-23]	*/
51 	int	i_minute;	/**<	[0-59]	*/
52 	int	i_second;	/**<	[0-59]	*/
53 	double	d_hour;		/**< [0.0-23.9999] includes minute and second */
54 	double	d_minute;	/**<	[0.0-59.9999] includes second	*/
55 	double	d_second;	/**<	[0.0-59.9999]	*/
56 	int	weekday;	/**<	[0-6]	*/
57 	int	day_of_year;	/**<	[1-366]	*/
58 } UTinstant, * UTinstantPtr;
59 
60 /*	Functions in caldate.c	*/
61 
62 long caldat( UTinstantPtr );	/** converts julian date to year,mo,da */
63 double juldat( UTinstantPtr );	/** returns julian day from year,mo,da */
64 
65 #endif	/*	_astime_h_	*/
66