Fix some of the things that break compilation on Windows.
[openafs.git] / src / util / ktime.h
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  * 
5  * This software has been released under the terms of the IBM Public
6  * License.  For details, see the LICENSE file in the top-level source
7  * directory or online at http://www.openafs.org/dl/license10.html
8  */
9
10 #ifndef __INCL_KTIME_
11 #define __INCL_KTIME_ 1
12 #undef min      /* XXX */
13 struct ktime_date {
14     afs_int32 mask;             /* mask of valid fields */
15     short year;
16     short month;
17     short day;
18     short hour;
19     short min;
20     short sec;
21 };
22
23 /* could we make these bits the same? */
24
25 #define KTIMEDATE_YEAR          1
26 #define KTIMEDATE_MONTH         2
27 #define KTIMEDATE_DAY           4
28 #define KTIMEDATE_HOUR          8
29 #define KTIMEDATE_MIN           0x10
30 #define KTIMEDATE_SEC           0x20
31 #define KTIMEDATE_NEVER         0x1000  /* special case for never */
32 #define KTIMEDATE_NOW           0x2000  /* special case for now */
33
34 /* note that this if different from the value used by ParcePeriodic (sigh). */
35 #define KTIMEDATE_NEVERDATE     0xffffffff
36
37 struct ktime {
38     int mask;
39     short hour;     /* 0 - 23 */
40     short min;      /* 0 - 60 */
41     short sec;      /* 0 - 60 */
42     short day;      /* 0 is sunday */
43 };
44
45 #define KTIME_HOUR      1       /* hour should match */
46 #define KTIME_MIN       2
47 #define KTIME_SEC       4
48 #define KTIME_TIME      7       /* all times should match */
49 #define KTIME_DAY       8       /* day should match */
50 #define KTIME_NEVER     0x10    /* special case: never */
51 #define KTIME_NOW       0x20    /* special case: right now */
52
53 #define ktime_DateToLong        ktime_DateToInt32       /* XXX */
54 #define ktimeRelDate_ToLong     ktimeRelDate_ToInt32    /* XXX */
55 #define LongTo_ktimeRelDate     Int32To_ktimeRelDate    /* XXX */
56
57 afs_int32 ktime_InterpretDate(struct ktime_date *akdate);
58
59
60 #endif /* __INCL_KTIME_ */