Updated information about YAZ.
[yaz-moved-to-github.git] / include / yaz / 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  1999-11-30 13:47:11  adam
12  * Improved installation. Moved header files to include/yaz.
13  *
14  * Revision 1.2  1999/04/20 09:56:48  adam
15  * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun).
16  * Modified all encoders/decoders to reflect this change.
17  *
18  * Revision 1.1  1998/02/10 15:31:52  adam
19  * Implemented date and time structure. Changed the Update Extended
20  * Service.
21  *
22  */
23
24 #ifndef __PRT_DAT_H
25 #define __PRT_DAT_H
26
27 #include <yaz/yconfig.h>
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 typedef struct Z_MonthAndDay
34 {
35     int *month;
36     int *day;                               /* OPTIONAL */
37 } Z_MonthAndDay;
38
39 typedef struct Z_Quarter
40 {
41     int which;
42 #define Z_Quarter_first         0
43 #define Z_Quarter_second        1
44 #define Z_Quarter_third         2
45 #define Z_Quarter_fourth        3
46     union
47     {
48         Odr_null *first;
49         Odr_null *second;
50         Odr_null *third;
51         Odr_null *fourth;
52     } u;
53 } Z_Quarter;
54
55 typedef struct Z_Season
56 {
57     int which;
58 #define Z_Season_winter         0
59 #define Z_Season_spring         1
60 #define Z_Season_summer         2
61 #define Z_Season_autumn         3
62     union
63     {
64         Odr_null *winter;
65         Odr_null *spring;
66         Odr_null *summer;
67         Odr_null *autumn;
68     } u;
69 } Z_Season;
70
71 typedef struct Z_PartOfYear
72 {
73     int which;
74 #define Z_PartOfYear_monthAndDay        0
75 #define Z_PartOfYear_julianDay          1
76 #define Z_PartOfYear_weekNumber         2
77 #define Z_PartOfYear_quarter            3
78 #define Z_PartOfYear_season             4
79     union
80     {
81         Z_MonthAndDay *monthAndDay;
82         int *julianDay; 
83         int *weekNumber; 
84         Z_Quarter *quarter;
85         Z_Season *season;
86     } u;
87 } Z_PartOfYear;
88
89 typedef struct Z_Era
90 {
91     int which;
92 #define Z_Era_decade            0
93 #define Z_Era_century           1
94 #define Z_Era_millennium        2
95     union
96     {
97         Odr_null *decade;
98         Odr_null *century;
99         Odr_null *millennium;
100     } u;
101 } Z_Era;
102
103 typedef struct Z_DateFlags
104 {
105     Odr_null *circa;                        /* OPTIONAL */
106     Z_Era *era;                             /* OPTIONAL */
107 } Z_DateFlags;
108
109 typedef struct Z_Date
110 {
111     int *year;
112     Z_PartOfYear *partOfYear;               /* OPTIONAL */
113     Z_DateFlags *flags;                     /* OPTIONAL */
114 } Z_Date;
115
116 typedef struct Z_Zone
117 {
118     int which;
119 #define Z_Zone_local            0
120 #define Z_Zone_utc              1
121 #define Z_Zone_utcOffset        2
122     union
123     {
124         Odr_null *local;
125         Odr_null *utc;
126         int *utcOffset;
127     } u;
128 } Z_Zone;
129
130 typedef struct Z_Time
131 {
132     int *hour;
133     int *minute;                            /* OPTIONAL */
134     int *second;                            /* OPTIONAL */
135     Z_IntUnit *partOfSecond;                /* OPTIONAL */
136     Z_Zone *zone;                           /* OPTIONAL */
137 } Z_Time;
138
139 typedef struct Z_DateTime
140 {
141     Z_Date *z3950Date;                      /* OPTIONAL */
142     Z_Time *z3950Time;                      /* OPTIONAL */
143 } Z_DateTime;
144
145 YAZ_EXPORT int z_DateTime(ODR o, Z_DateTime **p, int opt, const char *name);
146
147 #ifdef __cplusplus
148 }
149 #endif
150
151 #endif