libtime.h 1.97 KB
Newer Older
1
2
/* this is <libtime.h>
 * ----------------------------------------------------------------------------
3
4
 * 
 * $Id: libtime.h,v 1.2 2000-08-05 19:52:01 thof Exp $
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
 *
 * 12/08/97 by Thomas Forbriger (IfG Stuttgart)
 *
 * some definitions and prototypes for the C libtime interface
 *
 * REVISIONS and CHANGES
 *    12/08/97   V1.0   Thomas Forbriger
 *
 * ============================================================================
 */

#ifndef _TF_LIBTIME_H
#define _TF_LIBTIME_H

#include <f2c.h>
#include <stdio.h>

/*
 * some macro constants
 */

#define TIME_ISLEAP (1)
#define TIME_ISNOTLEAP (0)

#define TIME_SLEN (35)

/* 
 * time data structure
 */

typedef struct {
  long int year;    /* year  (=0 for relative times)                */
  long int doy;     /* day within yaer (may be 0 for relative times */
  long int hour;    /* hour within day                              */
  long int minute;  /* minute within hour                           */
  long int second;  /* second within minute                         */
  long int milsec;  /* millisecond within second                    */
  long int micsec;  /* microsecond within millisecond               */
} time_Ts;

typedef union {
  long int array[7];
  integer farray[7];
  time_Ts s;
} time_Tu;

/*
 * prototypes
 */

double time_libversion();
long int time_isleapyear(long int);
void time_fullyear(long int *);
void time_setdoy(long int, long int, time_Ts *);
void time_getdate(long int*, long int*, time_Ts);
char *time_sprint(time_Ts);
void time_clear(time_Ts *);
void time_norm(time_Ts *);
void time_add(time_Ts, time_Ts, time_Ts *);
void time_sub(time_Ts, time_Ts, time_Ts *);
void time_copy(time_Ts, time_Ts *);
void time_finish(time_Ts *);
long int time_compare(time_Ts, time_Ts);
void time_mul(time_Ts, time_Ts *, long int);
void time_div(time_Ts, time_Ts *, long int, long int *);
void time_nfit(time_Ts, time_Ts, long int *, time_Ts *);
int time_read(time_Ts *, char *);

#endif /* _TF_LIBTIME_H */

/* ----- END OF libtime.h ----- */