2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /*******************************************************************************
27 ** static char sccsid[] = "@(#)timeops.h 1.10 94/11/07 Copyr 1991 Sun Microsystems, Inc.";
29 ** $XConsortium: timeops.h /main/3 1995/11/03 10:39:02 rswiston $
31 ** RESTRICTED CONFIDENTIAL INFORMATION:
33 ** The information in this document is subject to special
34 ** restrictions in a confidential disclosure agreement between
35 ** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
36 ** document outside HP, IBM, Sun, USL, SCO, or Univel without
37 ** Sun's specific written approval. This document and all copies
38 ** and derivative works thereof must be returned or destroyed at
41 ** Copyright 1993 Sun Microsystems, Inc. All rights reserved.
43 *******************************************************************************/
46 * (c) Copyright 1993, 1994 Hewlett-Packard Company *
47 * (c) Copyright 1993, 1994 International Business Machines Corp. *
48 * (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
49 * (c) Copyright 1993, 1994 Novell, Inc. *
55 #include <EUSCompat.h>
68 /* use time_t typedef for Tick, not a hardcoded long */
69 typedef time_t Tick; /* tick = seconds since epoch */
71 extern Tick bot; /* beginning of time */
76 extern Tick eot; /* end of time */
78 extern int monthdays[];
79 extern char *months[];
80 extern char *months2[];
81 extern int monthsecs[];
82 extern char *numbers[];
84 extern int days_to_seconds P((int));
85 extern int dom P((Tick));
86 extern int dow P((Tick));
87 extern int fdom P((Tick));
88 extern Tick first_dom P((Tick));
89 extern Tick first_dow P((Tick));
90 extern Tick get_eot P(());
91 extern Tick get_bot P(());
92 extern long gmt_off P(());
93 extern int hour P((Tick));
94 extern int hours_to_seconds P((int));
95 extern void init_time P(());
96 extern Tick jan1 P((Tick));
97 extern Tick last_dom P((Tick));
98 extern Tick last_dow P((Tick));
99 extern Tick last_ndays P((Tick t, int));
100 extern int lastapptofweek P((u_int));
101 extern Tick lastjan1 P((Tick));
102 extern int ldom P((Tick));
103 extern Tick lower_bound P((int, Tick));
104 extern Tick lowerbound P((Tick));
105 extern boolean_t magic_time P((Tick t));
106 extern Tick midnight P(());
107 extern int minutes_to_seconds P((int));
108 extern int minute P((Tick));
109 extern int month P((Tick));
110 extern Tick monthdayyear P((int, int, int));
111 extern int monthlength P((Tick));
112 extern Tick next_ndays P((Tick, int));
113 extern Tick next_nhours P((Tick, int));
114 extern Tick next2weeks P((Tick));
115 extern Tick nextday P((Tick));
116 extern Tick nextjan1 P((Tick));
117 extern Tick nextmonth P((Tick t));
118 extern Tick next_nmonth P((Tick t, int n));
119 extern Tick nextmonth_exactday P((Tick t));
120 extern Tick nextweek P((Tick t));
121 extern Tick nextyear P((Tick));
122 extern Tick nextnyear P((Tick t, int n));
123 extern Tick now P(());
124 extern int ntimes_this_week P((u_int, int));
125 extern int numwks P((Tick));
126 extern Tick prev_nmonth P((Tick t, int n));
127 extern Tick prevmonth_exactday P((Tick));
128 extern Tick previousmonth P((Tick t));
129 extern Tick prevweek P((Tick t));
130 extern Tick prev2weeks P((Tick t));
131 extern Tick prevnyear P((Tick t, int n));
132 extern int seconds P((int n, Unit unit));
133 extern double seconds_dble P((double n, Unit unit));
134 extern int seconds_to_days P((int));
135 extern int seconds_to_hours P((int));
136 extern int seconds_to_minutes P((int));
137 extern int seconds_to_weeks P((int));
138 extern void set_timezone P((char*));
139 extern int timeok P((Tick t));
140 extern Tick upperbound P((Tick));
141 extern int weeks_to_seconds P((int));
142 extern int wom P((Tick));
143 extern boolean_t weekofmonth P((Tick, int*));
144 extern Tick xytoclock P((int, int, Tick));
145 extern int year P((Tick));
146 extern int adjust_dst P((Tick, Tick));
147 extern boolean_t adjust_hour P((int*));
148 extern int leapyr P((int));
149 extern Tick prevday P((Tick));