YAZ  5.23.1
z-date.h
Go to the documentation of this file.
1 
7 #ifndef z_date_H
8 #define z_date_H
9 
10 #include <yaz/odr.h>
11 #include <yaz/z-core.h>
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 typedef struct Z_DateTime Z_DateTime;
17 YAZ_EXPORT int z_DateTime(ODR o, Z_DateTime **p, int opt, const char *name);
18 
20 YAZ_EXPORT int z_DateMonthAndDay(ODR o, Z_DateMonthAndDay **p, int opt, const char *name);
21 
23 YAZ_EXPORT int z_DateQuarter(ODR o, Z_DateQuarter **p, int opt, const char *name);
24 
25 typedef struct Z_DateSeason Z_DateSeason;
26 YAZ_EXPORT int z_DateSeason(ODR o, Z_DateSeason **p, int opt, const char *name);
27 
28 typedef struct Z_Era Z_Era;
29 YAZ_EXPORT int z_Era(ODR o, Z_Era **p, int opt, const char *name);
30 
31 typedef struct Z_DateFlags Z_DateFlags;
32 YAZ_EXPORT int z_DateFlags(ODR o, Z_DateFlags **p, int opt, const char *name);
33 
34 typedef struct Z_Date Z_Date;
35 YAZ_EXPORT int z_Date(ODR o, Z_Date **p, int opt, const char *name);
36 
37 typedef struct Z_Time Z_Time;
38 YAZ_EXPORT int z_Time(ODR o, Z_Time **p, int opt, const char *name);
39 #ifdef __cplusplus
40 }
41 #endif
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 struct Z_DateTime {
46  Z_Date *date; /* OPT */
47  Z_Time *time; /* OPT */
48 };
49 
52  Odr_int *day; /* OPT */
53 };
54 
55 struct Z_DateQuarter {
56  int which;
57  union {
62 #define Z_DateQuarter_first 1
63 #define Z_DateQuarter_second 2
64 #define Z_DateQuarter_third 3
65 #define Z_DateQuarter_fourth 4
66  } u;
67 };
68 
69 struct Z_DateSeason {
70  int which;
71  union {
76 #define Z_DateSeason_winter 1
77 #define Z_DateSeason_spring 2
78 #define Z_DateSeason_summer 3
79 #define Z_DateSeason_autumn 4
80  } u;
81 };
82 
83 struct Z_Era {
84  int which;
85  union {
89 #define Z_Era_decade 1
90 #define Z_Era_century 2
91 #define Z_Era_millennium 3
92  } u;
93 };
94 
95 struct Z_DateFlags {
96  Odr_null *circa; /* OPT */
97  Z_Era *era; /* OPT */
98 };
99 
100 struct Z_Date {
102  int which;
103  union {
109 #define Z_Date_monthAndDay 1
110 #define Z_Date_julianDay 2
111 #define Z_Date_weekNumber 3
112 #define Z_Date_quarter 4
113 #define Z_Date_season 5
114  } u; /* OPT */
115  Z_DateFlags *flags; /* OPT */
116 };
117 
118 struct Z_Time {
120  Odr_int *minute; /* OPT */
121  Odr_int *second; /* OPT */
123  int which;
124  union {
128 #define Z_Time_local 1
129 #define Z_Time_utc 2
130 #define Z_Time_utcOffset 3
131  } u;
132 };
133 
134 #ifdef __cplusplus
135 }
136 #endif
137 #endif
int z_DateMonthAndDay(ODR o, Z_DateMonthAndDay **p, int opt, const char *name)
Definition: z-date.c:24
Header for ODR (Open Data Representation)
Odr_null * circa
Definition: z-date.h:96
Odr_null * utc
Definition: z-date.h:126
ASN.1 Module Z39-50-APDU-1995.
int z_Time(ODR o, Z_Time **p, int opt, const char *name)
Definition: z-date.c:140
int which
Definition: z-date.h:102
Odr_int * hour
Definition: z-date.h:119
Odr_int * day
Definition: z-date.h:52
int z_Era(ODR o, Z_Era **p, int opt, const char *name)
Definition: z-date.c:80
char * name
Definition: initopt.c:18
int z_Date(ODR o, Z_Date **p, int opt, const char *name)
Definition: z-date.c:112
Odr_int * julianDay
Definition: z-date.h:105
Odr_int * utcOffset
Definition: z-date.h:127
nmem_int_t Odr_int
Definition: odr.h:47
Odr_null * spring
Definition: z-date.h:73
Definition: z-date.h:100
int which
Definition: z-date.h:56
Z_Time * time
Definition: z-date.h:47
Odr_null * local
Definition: z-date.h:125
Odr_null * fourth
Definition: z-date.h:61
Definition: z-date.h:83
Odr_int * month
Definition: z-date.h:51
Odr_null * millennium
Definition: z-date.h:88
int which
Definition: z-date.h:84
Odr_null * winter
Definition: z-date.h:72
Z_DateSeason * season
Definition: z-date.h:108
int z_DateTime(ODR o, Z_DateTime **p, int opt, const char *name)
Definition: z-date.c:12
Z_DateFlags * flags
Definition: z-date.h:115
int z_DateQuarter(ODR o, Z_DateQuarter **p, int opt, const char *name)
Definition: z-date.c:36
Z_DateMonthAndDay * monthAndDay
Definition: z-date.h:104
Odr_null * first
Definition: z-date.h:58
Odr_null * second
Definition: z-date.h:59
int z_DateSeason(ODR o, Z_DateSeason **p, int opt, const char *name)
Definition: z-date.c:58
Odr_null * summer
Definition: z-date.h:74
Definition: odr.h:124
Odr_null * autumn
Definition: z-date.h:75
Z_Era * era
Definition: z-date.h:97
Odr_null * third
Definition: z-date.h:60
int opt
Definition: initopt.c:19
Z_DateQuarter * quarter
Definition: z-date.h:107
Odr_int * minute
Definition: z-date.h:120
Odr_null * century
Definition: z-date.h:87
Z_Date * date
Definition: z-date.h:46
Odr_null * decade
Definition: z-date.h:86
Odr_int * second
Definition: z-date.h:121
Odr_int * weekNumber
Definition: z-date.h:106
Odr_int * year
Definition: z-date.h:101
int z_DateFlags(ODR o, Z_DateFlags **p, int opt, const char *name)
Definition: z-date.c:100
int which
Definition: z-date.h:123
Z_IntUnit * partOfSecond
Definition: z-date.h:122
Definition: z-date.h:118
void Odr_null
Definition: odr.h:105
int which
Definition: z-date.h:70