00001
00007 #ifndef z_grs_H
00008 #define z_grs_H
00009
00010 #include <yaz/odr.h>
00011 #include <yaz/z-core.h>
00012 #ifdef __cplusplus
00013 extern "C" {
00014 #endif
00015
00016 typedef struct Z_GenericRecord Z_GenericRecord;
00017 YAZ_EXPORT int z_GenericRecord (ODR o, Z_GenericRecord **p, int opt, const char *name);
00018
00019 typedef struct Z_TaggedElement Z_TaggedElement;
00020 YAZ_EXPORT int z_TaggedElement (ODR o, Z_TaggedElement **p, int opt, const char *name);
00021
00022 typedef struct Z_ElementData Z_ElementData;
00023 YAZ_EXPORT int z_ElementData (ODR o, Z_ElementData **p, int opt, const char *name);
00024
00025 typedef struct Z_ElementMetaData Z_ElementMetaData;
00026 YAZ_EXPORT int z_ElementMetaData (ODR o, Z_ElementMetaData **p, int opt, const char *name);
00027
00028 typedef struct Z_TagPath_s Z_TagPath_s;
00029 YAZ_EXPORT int z_TagPath_s (ODR o, Z_TagPath_s **p, int opt, const char *name);
00030
00031 typedef struct Z_TagPath Z_TagPath;
00032 YAZ_EXPORT int z_TagPath (ODR o, Z_TagPath **p, int opt, const char *name);
00033
00034 typedef struct Z_Order Z_Order;
00035 YAZ_EXPORT int z_Order (ODR o, Z_Order **p, int opt, const char *name);
00036
00037 typedef struct Z_Usage Z_Usage;
00038 YAZ_EXPORT int z_Usage (ODR o, Z_Usage **p, int opt, const char *name);
00039
00040 typedef struct Z_HitVector Z_HitVector;
00041 YAZ_EXPORT int z_HitVector (ODR o, Z_HitVector **p, int opt, const char *name);
00042
00043 typedef struct Z_Triple Z_Triple;
00044 YAZ_EXPORT int z_Triple (ODR o, Z_Triple **p, int opt, const char *name);
00045
00046 typedef struct Z_Variant Z_Variant;
00047 YAZ_EXPORT int z_Variant (ODR o, Z_Variant **p, int opt, const char *name);
00048 #ifdef __cplusplus
00049 }
00050 #endif
00051 #ifdef __cplusplus
00052 extern "C" {
00053 #endif
00054 struct Z_GenericRecord {
00055 int num_elements;
00056 Z_TaggedElement **elements;
00057 };
00058
00059 struct Z_TaggedElement {
00060 int *tagType;
00061 Z_StringOrNumeric *tagValue;
00062 int *tagOccurrence;
00063 Z_ElementData *content;
00064 Z_ElementMetaData *metaData;
00065 Z_Variant *appliedVariant;
00066 };
00067
00068 struct Z_ElementData {
00069 int which;
00070 union {
00071 Odr_oct *octets;
00072 int *numeric;
00073 char *date;
00074 Z_External *ext;
00075 Z_InternationalString *string;
00076 bool_t *trueOrFalse;
00077 Odr_oid *oid;
00078 Z_IntUnit *intUnit;
00079 Odr_null *elementNotThere;
00080 Odr_null *elementEmpty;
00081 Odr_null *noDataRequested;
00082 Z_External *diagnostic;
00083 Z_GenericRecord *subtree;
00084 #define Z_ElementData_octets 1
00085 #define Z_ElementData_numeric 2
00086 #define Z_ElementData_date 3
00087 #define Z_ElementData_ext 4
00088 #define Z_ElementData_string 5
00089 #define Z_ElementData_trueOrFalse 6
00090 #define Z_ElementData_oid 7
00091 #define Z_ElementData_intUnit 8
00092 #define Z_ElementData_elementNotThere 9
00093 #define Z_ElementData_elementEmpty 10
00094 #define Z_ElementData_noDataRequested 11
00095 #define Z_ElementData_diagnostic 12
00096 #define Z_ElementData_subtree 13
00097 } u;
00098 };
00099
00100 struct Z_ElementMetaData {
00101 Z_Order *seriesOrder;
00102 Z_Usage *usageRight;
00103 int num_hits;
00104 Z_HitVector **hits;
00105 Z_InternationalString *displayName;
00106 int num_supportedVariants;
00107 Z_Variant **supportedVariants;
00108 Z_InternationalString *message;
00109 Odr_oct *elementDescriptor;
00110 Z_TagPath *surrogateFor;
00111 Z_TagPath *surrogateElement;
00112 Z_External *other;
00113 };
00114
00115 struct Z_TagPath_s {
00116 int *tagType;
00117 Z_StringOrNumeric *tagValue;
00118 int *tagOccurrence;
00119 };
00120
00121 struct Z_TagPath {
00122 int num;
00123 Z_TagPath_s **elements;
00124 };
00125
00126 struct Z_Order {
00127 bool_t *ascending;
00128 int *order;
00129 };
00130
00131 struct Z_Usage {
00132 #define Z_Usage_redistributable 1
00133 #define Z_Usage_restricted 2
00134 #define Z_Usage_licensePointer 3
00135 int *type;
00136 Z_InternationalString *restriction;
00137 };
00138
00139 struct Z_HitVector {
00140 Z_Term *satisfier;
00141 Z_IntUnit *offsetIntoElement;
00142 Z_IntUnit *length;
00143 int *hitRank;
00144 Odr_oct *targetToken;
00145 };
00146
00147 struct Z_Triple {
00148 Odr_oid *variantSetId;
00149 int *zclass;
00150 int *type;
00151 int which;
00152 union {
00153 int *integer;
00154 Z_InternationalString *internationalString;
00155 Odr_oct *octetString;
00156 Odr_oid *objectIdentifier;
00157 bool_t *boolean;
00158 Odr_null *null;
00159 Z_Unit *unit;
00160 Z_IntUnit *valueAndUnit;
00161 #define Z_Triple_integer 1
00162 #define Z_Triple_internationalString 2
00163 #define Z_Triple_octetString 3
00164 #define Z_Triple_objectIdentifier 4
00165 #define Z_Triple_boolean 5
00166 #define Z_Triple_null 6
00167 #define Z_Triple_unit 7
00168 #define Z_Triple_valueAndUnit 8
00169 } value;
00170 };
00171
00172 struct Z_Variant {
00173 Odr_oid *globalVariantSetId;
00174 int num_triples;
00175 Z_Triple **triples;
00176 };
00177
00178 #ifdef __cplusplus
00179 }
00180 #endif
00181 #endif