libtime++: Date and time calculation
timeutil.h
Go to the documentation of this file.
1 /* this is <timeutil.h>
2  *
3  * this file contains definitions for timeutil.c routines
4  *
5  * Copyright 1997 Thomas Forbriger (IfG Stuttgart)
6  *
7  * This is a pure C pre-version of libtime.f
8  * By now (5/8/2000) it is still included in libtime.a but provides no extra
9  * functionality. It may be removed in the future.
10  *
11  *
12  * ----
13  * libtime is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation; either version 2 of the License, or
16  * (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software
25  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26  * ----
27  *
28  * 15/11/2010 make timeutil deprecated, its functionality duplicates
29  * the functionality presented in libtime.h
30  *
31  */
32 
33 #ifndef _TF_TIMEUTIL_H
34 #define _TF_TIMEUTIL_H
35 
36 #warning "timeutil is deprecated! It may vanish in the near future"
37 
38 /*
39  * define macros
40  * =============
41  */
42 
43 /* number of long ints in structure */
44 #define TIMEUTIL_N_ELEMENTS 9
45 
46 /* first linear element in structure */
47 #define TIMEUTIL_FIRST_LINEAR 5
48 
49 /*S*/
50 
51 /*
52  * define data structures
53  * ======================
54  */
55 
56 /* time data structure */
57 typedef struct {
58  long int year, month, day, doy;
59  long int hour, min, sec, msec, usec;
61 
62 /*
63  * prototypes
64  * ==========
65  */
66 
67 /* clear a time record */
69 
70 /* type out a time record */
72 
73 /* finish a preset time record */
75 
76 /* calculate doy */
78 
79 /* check for leap year */
80 int timeutil_is_leap(long int);
81 
82 /* set date from doy */
83 void timeutil_date(timeutil_Ttime *, long int);
84 
85 /* set elements to correct value range */
87 
88 /* add two time records */
90 
91 /* compare two time records */
93 
94 /*E*/
95 
96 #endif /* _TF_TIMEUTIL_H */
97 
98 /***** END OF timeutil.h *****/
long int timeutil_doy(timeutil_Ttime)
Definition: timeutil.c:108
void timeutil_clear(timeutil_Ttime *)
Definition: timeutil.c:62
char * timeutil_print(timeutil_Ttime)
Definition: timeutil.c:78
void timeutil_norm(timeutil_Ttime *)
Definition: timeutil.c:187
void timeutil_date(timeutil_Ttime *, long int)
Definition: timeutil.c:161
int timeutil_is_leap(long int)
Definition: timeutil.c:137
void timeutil_add(timeutil_Ttime *, timeutil_Ttime, timeutil_Ttime)
Definition: timeutil.c:236
long int usec
Definition: timeutil.h:59
void timeutil_finish(timeutil_Ttime *)
Definition: timeutil.c:95
int timeutil_compare(timeutil_Ttime, timeutil_Ttime)
Definition: timeutil.c:260
long int year
Definition: timeutil.h:58