1 /*******************************************************************************
5 ** static char sccsid[] = "@(#)timeops.h 1.10 94/11/07 Copyr 1991 Sun Microsystems, Inc.";
7 ** $XConsortium: timeops.h /main/3 1995/11/03 10:39:02 rswiston $
9 ** RESTRICTED CONFIDENTIAL INFORMATION:
11 ** The information in this document is subject to special
12 ** restrictions in a confidential disclosure agreement between
13 ** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
14 ** document outside HP, IBM, Sun, USL, SCO, or Univel without
15 ** Sun's specific written approval. This document and all copies
16 ** and derivative works thereof must be returned or destroyed at
19 ** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
21 *******************************************************************************/
24 * (c) Copyright 1993, 1994 Hewlett-Packard Company *
25 * (c) Copyright 1993, 1994 International Business Machines Corp. *
26 * (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
27 * (c) Copyright 1993, 1994 Novell, Inc. *
33 #include <EUSCompat.h>
46 /* use time_t typedef for Tick, not a hardcoded long */
47 typedef time_t Tick; /* tick = seconds since epoch */
49 extern Tick bot; /* beginning of time */
54 extern Tick eot; /* end of time */
56 extern int monthdays[];
57 extern char *months[];
58 extern char *months2[];
59 extern int monthsecs[];
60 extern char *numbers[];
62 extern int days_to_seconds P((int));
63 extern int dom P((Tick));
64 extern int dow P((Tick));
65 extern int fdom P((Tick));
66 extern Tick first_dom P((Tick));
67 extern Tick first_dow P((Tick));
68 extern Tick get_eot P(());
69 extern Tick get_bot P(());
70 extern long gmt_off P(());
71 extern int hour P((Tick));
72 extern int hours_to_seconds P((int));
73 extern void init_time P(());
74 extern Tick jan1 P((Tick));
75 extern Tick last_dom P((Tick));
76 extern Tick last_dow P((Tick));
77 extern Tick last_ndays P((Tick t, int));
78 extern int lastapptofweek P((u_int));
79 extern Tick lastjan1 P((Tick));
80 extern int ldom P((Tick));
81 extern Tick lower_bound P((int, Tick));
82 extern Tick lowerbound P((Tick));
83 extern boolean_t magic_time P((Tick t));
84 extern Tick midnight P(());
85 extern int minutes_to_seconds P((int));
86 extern int minute P((Tick));
87 extern int month P((Tick));
88 extern Tick monthdayyear P((int, int, int));
89 extern int monthlength P((Tick));
90 extern Tick next_ndays P((Tick, int));
91 extern Tick next_nhours P((Tick, int));
92 extern Tick next2weeks P((Tick));
93 extern Tick nextday P((Tick));
94 extern Tick nextjan1 P((Tick));
95 extern Tick nextmonth P((Tick t));
96 extern Tick next_nmonth P((Tick t, int n));
97 extern Tick nextmonth_exactday P((Tick t));
98 extern Tick nextweek P((Tick t));
99 extern Tick nextyear P((Tick));
100 extern Tick nextnyear P((Tick t, int n));
101 extern Tick now P(());
102 extern int ntimes_this_week P((u_int, int));
103 extern int numwks P((Tick));
104 extern Tick prev_nmonth P((Tick t, int n));
105 extern Tick prevmonth_exactday P((Tick));
106 extern Tick previousmonth P((Tick t));
107 extern Tick prevweek P((Tick t));
108 extern Tick prev2weeks P((Tick t));
109 extern Tick prevnyear P((Tick t, int n));
110 extern int seconds P((int n, Unit unit));
111 extern double seconds_dble P((double n, Unit unit));
112 extern int seconds_to_days P((int));
113 extern int seconds_to_hours P((int));
114 extern int seconds_to_minutes P((int));
115 extern int seconds_to_weeks P((int));
116 extern void set_timezone P((char*));
117 extern int timeok P((Tick t));
118 extern Tick upperbound P((Tick));
119 extern int weeks_to_seconds P((int));
120 extern int wom P((Tick));
121 extern boolean_t weekofmonth P((Tick, int*));
122 extern Tick xytoclock P((int, int, Tick));
123 extern int year P((Tick));
124 extern int adjust_dst P((Tick, Tick));
125 extern boolean_t adjust_hour P((int*));
126 extern int leapyr P((int));
127 extern Tick prevday P((Tick));