*** empty log message ***
[yaz-moved-to-github.git] / include / prt-dat.h
1 /*
2  * This file is part of the YAZ toolkit:
3  * Copyright (c) 1998, Index Data.
4  * See the file LICENSE for details.
5  * Sebastian Hammer, Adam Dickmeiss
6  *
7  * Contribution by Ronald van Der Meer (RVDM):
8  *  Databasix Information Systems B.V., Utrecht, The Netherlands.
9  *
10  * $Log: prt-dat.h,v $
11  * Revision 1.1  1998-02-10 15:31:52  adam
12  * Implemented date and time structure. Changed the Update Extended
13  * Service.
14  *
15  */
16
17 #ifndef __PRT_DAT_H
18 #define __PRT_DAT_H
19
20 #include <yconfig.h>
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 typedef struct Z_MonthAndDay
27 {
28     int *month;
29     int *day;                               /* OPTIONAL */
30 } Z_MonthAndDay;
31
32 typedef struct Z_Quarter
33 {
34     int which;
35 #define Z_Quarter_first         0
36 #define Z_Quarter_second        1
37 #define Z_Quarter_third         2
38 #define Z_Quarter_fourth        3
39     union
40     {
41         Odr_null *first;
42         Odr_null *second;
43         Odr_null *third;
44         Odr_null *fourth;
45     } u;
46 } Z_Quarter;
47
48 typedef struct Z_Season
49 {
50     int which;
51 #define Z_Season_winter         0
52 #define Z_Season_spring         1
53 #define Z_Season_summer         2
54 #define Z_Season_autumn         3
55     union
56     {
57         Odr_null *winter;
58         Odr_null *spring;
59         Odr_null *summer;
60         Odr_null *autumn;
61     } u;
62 } Z_Season;
63
64 typedef struct Z_PartOfYear
65 {
66     int which;
67 #define Z_PartOfYear_monthAndDay        0
68 #define Z_PartOfYear_julianDay          1
69 #define Z_PartOfYear_weekNumber         2
70 #define Z_PartOfYear_quarter            3
71 #define Z_PartOfYear_season             4
72     union
73     {
74         Z_MonthAndDay *monthAndDay;
75         int *julianDay; 
76         int *weekNumber; 
77         Z_Quarter *quarter;
78         Z_Season *season;
79     } u;
80 } Z_PartOfYear;
81
82 typedef struct Z_Era
83 {
84     int which;
85 #define Z_Era_decade            0
86 #define Z_Era_century           1
87 #define Z_Era_millennium        2
88     union
89     {
90         Odr_null *decade;
91         Odr_null *century;
92         Odr_null *millennium;
93     } u;
94 } Z_Era;
95
96 typedef struct Z_DateFlags
97 {
98     Odr_null *circa;                        /* OPTIONAL */
99     Z_Era *era;                             /* OPTIONAL */
100 } Z_DateFlags;
101
102 typedef struct Z_Date
103 {
104     int *year;
105     Z_PartOfYear *partOfYear;               /* OPTIONAL */
106     Z_DateFlags *flags;                     /* OPTIONAL */
107 } Z_Date;
108
109 typedef struct Z_Zone
110 {
111     int which;
112 #define Z_Zone_local            0
113 #define Z_Zone_utc              1
114 #define Z_Zone_utcOffset        2
115     union
116     {
117         Odr_null *local;
118         Odr_null *utc;
119         int *utcOffset;
120     } u;
121 } Z_Zone;
122
123 typedef struct Z_Time
124 {
125     int *hour;
126     int *minute;                            /* OPTIONAL */
127     int *second;                            /* OPTIONAL */
128     Z_IntUnit *partOfSecond;                /* OPTIONAL */
129     Z_Zone *zone;                           /* OPTIONAL */
130 } Z_Time;
131
132 typedef struct Z_DateTime
133 {
134     Z_Date *z3950Date;                      /* OPTIONAL */
135     Z_Time *z3950Time;                      /* OPTIONAL */
136 } Z_DateTime;
137
138 YAZ_EXPORT int z_DateTime(ODR o, Z_DateTime **p, int opt);
139
140 #ifdef __cplusplus
141 }
142 #endif
143
144 #endif