Started a test setup
[AXE.git] / src / parsedate.h
1
2 /* Data structure returned by "parseddate".
3  *
4  * A value of NULL for "error" means that no syntax errors were detected
5  * in the argument value.  A non-NULL value points to the byte position
6  * within the argument string at which it was discovered that an error
7  * existed.
8  *
9  * A value of -1 means that the field was never given a value, or that
10  * the value supplied was invalid.  (A side effect of this convention is
11  * that a time zone offset of -1 -- i.e., one minute west of GMT -- is
12  * indistinguishable from an invalid or unspecified time zone offset.
13  * Since the likelihood of "-0001" being a legitimate time zone is nil,
14  * banning it is a small price to pay for the uniformity of using -1 as
15  * a "missing/invalid" indication for all fields.)
16  */
17
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21
22 struct parseddate
23 {
24         long unixtime;  /* UNIX internal representation of time */
25         char *error;    /* NULL = OK; non-NULL = error */
26         int year;       /* year (1600 on) */
27         int month;      /* month (1-12) */
28         int day;        /* day of month (1-31) */
29         int hour;       /* hour (0-23) */
30         int minute;     /* minute (0-59) */
31         int second;     /* second (0-59) */
32         int zone;       /* time zone offset in minutes -- "+" or "-" */
33         int dst;        /* daylight savings time (0 = no, 1 = yes) */
34         int weekday;    /* real day of week (0-6; 0 = Sunday) */
35         int c_weekday;  /* claimed day of week (0-6; 0 = Sunday) */
36 };
37
38 struct parseddate *parsedate(char *date);
39
40 #ifdef __cplusplus
41 }
42 #endif
43