2 * Copyright (c) 1995-1998, Index Data.
4 * Permission to use, copy, modify, distribute, and sell this software and
5 * its documentation, in whole or in part, for any purpose, is hereby granted,
8 * 1. This copyright and permission notice appear in all copies of the
9 * software and its documentation. Notices of copyright or attribution
10 * which appear at the beginning of any file must remain unchanged.
12 * 2. The names of Index Data or the individual authors may not be used to
13 * endorse or promote products derived from this software without specific
14 * prior written permission.
16 * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND,
17 * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
18 * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
19 * IN NO EVENT SHALL INDEX DATA BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
20 * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES
21 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR
22 * NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
23 * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
31 #include <yaz/yconfig.h>
37 struct Z_GenericRecord;
38 typedef struct Z_GenericRecord Z_GenericRecord;
40 typedef struct Z_ElementData
43 #define Z_ElementData_octets 0
44 #define Z_ElementData_numeric 1
45 #define Z_ElementData_date 2
46 #define Z_ElementData_ext 3
47 #define Z_ElementData_string 4
48 #define Z_ElementData_trueOrFalse 5
49 #define Z_ElementData_oid 6
50 #define Z_ElementData_intUnit 7
51 #define Z_ElementData_elementNotThere 8
52 #define Z_ElementData_elementEmpty 9
53 #define Z_ElementData_noDataRequested 10
54 #define Z_ElementData_diagnostic 11
55 #define Z_ElementData_subtree 12
66 Odr_null *elementNotThere;
67 Odr_null *elementEmpty;
68 Odr_null *noDataRequested;
69 Z_External *diagnostic;
70 Z_GenericRecord *subtree;
74 typedef struct Z_Order
80 typedef struct Z_Usage
83 #define Z_Usage_redistributable 1
84 #define Z_Usage_restricted 2
85 #define Z_Usage_licensePointer 3
86 char *restriction; /* OPTIONAL */
89 typedef struct Z_HitVector
91 Z_Term *satisfier; /* OPTIONAL */
92 Z_IntUnit *offsetIntoElement; /* OPTIONAL */
93 Z_IntUnit *length; /* OPTIONAL */
94 int *hitRank; /* OPTIONAL */
95 Odr_oct *targetToken; /* OPTIONAL */
98 typedef struct Z_Triple
100 Odr_oid *variantSetId; /* OPTIONAL */
104 #define Z_Triple_integer 0
105 #define Z_Triple_internationalString 1
106 #define Z_Triple_octetString 2
107 #define Z_Triple_oid 3
108 #define Z_Triple_boolean 4
109 #define Z_Triple_null 5
110 #define Z_Triple_unit 6
111 #define Z_Triple_valueAndUnit 7
115 char *internationalString;
116 Odr_oct *octetString;
121 Z_IntUnit *valueAndUnit;
125 typedef struct Z_Variant
127 Odr_oid *globalVariantSetId; /* OPTIONAL */
132 typedef struct Z_TagUnit
134 int *tagType; /* OPTIONAL */
135 Z_StringOrNumeric *tagValue;
136 int *tagOccurrence; /* OPTIONAL */
139 typedef struct Z_TagPath
145 typedef struct Z_ElementMetaData
147 Z_Order *seriesOrder; /* OPTIONAL */
148 Z_Usage *usageRight; /* OPTIONAL */
150 Z_HitVector **hits; /* OPTIONAL */
151 char *displayName; /* OPTIONAL */
152 int num_supportedVariants;
153 Z_Variant **supportedVariants; /* OPTIONAL */
154 char *message; /* OPTIONAL */
155 Odr_oct *elementDescriptor; /* OPTIONAL */
156 Z_TagPath *surrogateFor; /* OPTIONAL */
157 Z_TagPath *surrogateElement; /* OPTIONAL */
158 Z_External *other; /* OPTIONAL */
161 typedef struct Z_TaggedElement
163 int *tagType; /* OPTIONAL */
164 Z_StringOrNumeric *tagValue;
165 int *tagOccurrence; /* OPTIONAL */
166 Z_ElementData *content;
167 Z_ElementMetaData *metaData; /* OPTIONAL */
168 Z_Variant *appliedVariant; /* OPTIONAL */
171 struct Z_GenericRecord
174 Z_TaggedElement **elements;
177 YAZ_EXPORT int z_GenericRecord(ODR o, Z_GenericRecord **p, int opt,
179 YAZ_EXPORT int z_Variant(ODR o, Z_Variant **p, int opt,