Comment.
[yaz-moved-to-github.git] / src / diagbib1.c
1 /*
2  * Copyright (c) 1995-2003, Index Data
3  * See the file LICENSE for details.
4  * Sebastian Hammer, Adam Dickmeiss
5  *
6  * $Id: diagbib1.c,v 1.1 2003-10-27 12:21:30 adam Exp $
7  */
8
9 #include <stdio.h>
10
11 #include <yaz/diagbib1.h>
12
13 static struct {
14     int code;
15     char *msg;
16 } msg_tab[] = {
17 { 1, "Permanent system error" },
18 { 2, "Temporary system error" },
19 { 3, "Unsupported search" },
20 { 4, "Terms only exclusion (stop) words" },
21 { 5, "Too many argument words" },
22 { 6, "Too many boolean operators" },
23 { 7, "Too many truncated words" },
24 { 8, "Too many incomplete subfields" },
25 { 9, "Truncated words too short" },
26 { 10, "Invalid format for record number (search term)" },
27 { 11, "Too many characters in search statement" },
28 { 12, "Too many records retrieved" },
29 { 13, "Present request out of range" },
30 { 14, "System error in presenting records" },
31 { 15, "Record no authorized to be sent intersystem" },
32 { 16, "Record exceeds Preferred-message-size" },
33 { 17, "Record exceeds Maximum-record-size" },
34 { 18, "Result set not supported as a search term" },
35 { 19, "Only single result set as search term supported" },
36 { 20, "Only ANDing of a single result set as search term supported" },
37 { 21, "Result set exists and replace indicator off" },
38 { 22, "Result set naming not supported" },
39 { 23, "Combination of specified databases not supported" },
40 { 24, "Element set names not supported" },
41 { 25, "Specified element set name not valid for specified database" },
42 { 26, "Only a single element set name supported" },
43 { 27, "Result set no longer exists - unilaterally deleted by target" },
44 { 28, "Result set is in use" },
45 { 29, "One of the specified databases is locked" },
46 { 30, "Specified result set does not exist" },
47 { 31, "Resources exhausted - no results available" },
48 { 32, "Resources exhausted - unpredictable partial results available" },
49 { 33, "Resources exhausted - valid subset of results available" },
50 { 100, "Unspecified error" },
51 { 101, "Access-control failure" },
52 { 102, "Security challenge required but could not be issued -"
53 " request terminated" },
54 { 103, "Security challenge required but could not be issued -"
55 " record not included" },
56 { 104, "Security challenge failed - record not included" },
57 { 105, "Terminated by negative continue response" },
58 { 106, "No abstract syntaxes agreed to for this record" },
59 { 107, "Query type not supported" },
60 { 108, "Malformed query" },
61 { 109, "Database unavailable" },
62 { 110, "Operator unsupported" },
63 { 111, "Too many databases specified" },
64 { 112, "Too many result sets created" },
65 { 113, "Unsupported attribute type" },
66 { 114, "Unsupported Use attribute" },
67 { 115, "Unsupported value for Use attribute" },
68 { 116, "Use attribute required but not supplied" },
69 { 117, "Unsupported Relation attribute" },
70 { 118, "Unsupported Structure attribute" },
71 { 119, "Unsupported Position attribute" },
72 { 120, "Unsupported Truncation attribute" },
73 { 121, "Unsupported Attribute Set" },
74 { 122, "Unsupported Completeness attribute" },
75 { 123, "Unsupported attribute combination" },
76 { 124, "Unsupported coded value for term" },
77 { 125, "Malformed search term" },
78 { 126, "Illegal term value for attribute" },
79 { 127, "Unparsable format for un-normalized value" },
80 { 128, "Illegal result set name" },
81 { 129, "Proximity search of sets not supported" },
82 { 130, "Illegal result set in proximity search" },
83 { 131, "Unsupported proximity relation" },
84 { 132, "Unsupported proximity unit code" },
85 { 201, "Proximity not supported with this attribute combination" },
86 { 202, "Unsupported distance for proximity" },
87 { 203, "Ordered flag not supported for proximity" },
88 { 205, "Only zero step size supported for Scan" },
89 { 206, "Specified step size not supported for Scan" },
90 { 207, "Cannot sort according to sequence" },
91 { 208, "No result set name supplied on Sort" },
92 { 209, "Generic sort not supported (database-specific sort only supported)" },
93 { 210, "Database specific sort not supported" },
94 { 211, "Too many sort keys" },
95 { 212, "Duplicate sort keys" },
96 { 213, "Unsupported missing data action" },
97 { 214, "Illegal sort relation" },
98 { 215, "Illegal case value" },
99 { 216, "Illegal missing data action" },
100 { 217, "Segmentation: Cannot guarantee records will fit in specified segments"
101 },
102 { 218, "ES: Package name already in use" },
103 { 219, "ES: no such package, on modify/delete" },
104 { 220, "ES: quota exceeded" },
105 { 221, "ES: extended service type not supported" },
106 { 222, "ES: permission denied on ES - id not authorized" },
107 { 223, "ES: permission denied on ES - cannot modify or delete" },
108 { 224, "ES: immediate execution failed" },
109 { 225, "ES: immediate execution not supported for this service" },
110 { 226, "ES: immediate execution not supported for these parameters" },
111 { 227, "No data available in requested record syntax" },
112 { 228, "Scan: malformed scan" },
113 { 229, "Term type not supported" },
114 { 230, "Sort: too many input results" },
115 { 231, "Sort: incompatible record formats" },
116 { 232, "Scan: term list not supported" },
117 { 233, "Scan: unsupported value of position-in-response" },
118 { 234, "Too many index terms processed" },
119 { 235, "Database does not exist" },
120 { 236, "Access to specified database denied" },
121 { 237, "Sort: illegal sort" },
122 { 238, "Record not available in requested syntax" },
123 { 239, "Record syntax not supported" },
124 { 240, "Scan: Resources exhausted looking for satisfying terms" },
125 { 241, "Scan: Beginning or end of term list" },
126 { 242, "Segmentation: max-segment-size too small to segment record" },
127 { 243, "Present:  additional-ranges parameter not supported" },
128 { 244, "Present:  comp-spec parameter not supported" },
129 { 245, "Type-1 query: restriction ('resultAttr') operand not supported" },
130 { 246, "Type-1 query: 'complex' attributeValue not supported" },
131 { 247, "Type-1 query: 'attributeSet' as part of AttributeElement not supported" },
132 { 1001, "Malformed APDU"}, 
133 { 1002, "ES: EXTERNAL form of Item Order request not supported" },
134 { 1003, "ES: Result set item form of Item Order request not supported" },
135 { 1004, "ES: Extended services not supported unless access control is in effect" },
136 { 1005, "Response records in Search response not supported" },
137 { 1006, "Response records in Search response not possible for specified database (or database combination)" },
138 { 1007, "No Explain server. Addinfo: pointers to servers that have a surrogate Explain database for this server" },
139 { 1008, "ES: missing mandatory parameter for specified function. Addinfo: parameter" },
140 { 1009, "ES: Item Order, unsupported OID in itemRequest. Addinfo: OID" },
141 { 1010, "Init/AC: Bad Userid" },
142 { 1011, "Init/AC: Bad Userid and/or Password" },
143 { 1012, "Init/AC: No searches remaining (pre-purchased searches exhausted)" },
144 { 1013, "Init/AC: Incorrect interface type (specified id valid only when used with a particular access method or client)" },
145 { 1014, "Init/AC: Authentication System error" },
146 { 1015, "Init/AC: Maximum number of simultaneous sessions for Userid" },
147 { 1016, "Init/AC: Blocked network address"},
148 { 1017, "Init/AC: No databases available for specified userId"},
149 { 1018, "Init/AC: System temporarily out of resources"},
150 { 1019, "Init/AC: System not available due to maintenance" },
151 { 1020, "Init/AC: System temporarily unavailable (Addinfo: when it's expected back up)"},
152 { 1021, "Init/AC: Account has expired"},
153 { 1022, "Init/AC: Password has expired so a new one must be supplied"},
154 { 1023, "Init/AC: Password has been changed by an administrator so a new one must be supplied"},
155 { 1024, "Unsupported Attribute" },
156 { 1025, "Service not supported for this database" },
157 { 1026, "Record cannot be opened because it is locked"},
158 { 1027, "SQL error" },
159 { 1028, "Record deleted" },
160 { 1029, "Scan: too many terms requested. Addinfo: max terms supported" },
161 /* 1030 - 1039 /currently unnassigned */
162     
163 /* The following, 1040 - 1047, were approved at the June 1998 ZIG meeting.
164    These were originally proposed for addition to the Extended Services
165    diagnostic set. */
166 { 1040, "ES: Invalid function" },
167 { 1041, "ES: Error in retention time" },
168 { 1042, "ES: Permissions data not understood" },
169 { 1043, "ES: Invalid OID for task specific parameters" },
170 { 1044, "ES: Invalid action" },
171 { 1045, "ES: Unknown schema" },
172 { 1046, "ES: Too many records in package" },
173 { 1047, "ES: Invalid wait action" },
174 /* The following, 1048 - 1053, were approved at the October 1998 ZIG
175    meeting. */
176 { 1048, "ES: Cannot create task package -- exceeds maximum permissable size"},
177 { 1049, "ES: Cannot return task package -- exceeds maximum permissable size"},
178 { 1050, "ES: Extended services request too large"},
179 { 1051, "Scan: Attribute set id required -- not supplied"},
180 { 1052, "ES: Cannot process task package record -- exceeds maximum "
181       "permissible record size for ES" },
182 { 1053, "ES: Cannot return task package record -- exceeds maximum "
183       "permissible record size for ES response" },
184 /* The following, 1054 - 1057, were approved at the March 1999 ZIG
185    meeting. 1054 and 1055 are added for support of the Model for Z39.50
186    Negotiation During Initialization
187    <http://lcweb.loc.gov/z3950/agency/nego.html>. 1056 was added in
188    conjunction with the clarification Single-PDU, Multi-database Searching
189    -- Status <http://lcweb.loc.gov/z3950/agency/clarify/db-status.html> */
190 { 1054, "Init: Required negotiation record not included"},
191 { 1055, "Init: negotiation option required"},
192 { 1056, "Attribute not supported for database" },
193 { 1057, "ES: Unsupported value of task package parameter"},
194 /* The following, 1058 - 1066, were approved at the August 1999 ZIG
195    meeting. 1058 through 1065 are added for support of the Z39.50 Duplicate
196    Detection Service <http://lcweb.loc.gov/z3950/agency/amend/dedup.html>. */
197 { 1058, "Duplicate Detection: Cannot dedup on requested record portion" },  
198 { 1059, "Duplicate Detection: Requested detection criterion not supported" },
199 { 1060, "Duplicate Detection: Requested level of match not supported" },
200 { 1061, "Duplicate Detection: Requested regular expression not supported" },
201 { 1062, "Duplicate Detection: Cannot do clustering" },
202 { 1063, "Duplicate Detection: Retention criterion not supported"},
203 { 1064, "Duplicate Detection: Requested number (or percentage) of entries "
204       "for retention too large" },
205 { 1065, "Duplicate Detection: Requested sort criterion not supported" },
206 { 1066, "CompSpec: Unknown schema, or schema not supported."},
207 /* The following, 1067 - 1069, were approved at the January 2000 ZIG
208    meeting. 1067 and 1068 are added for support of encapsulation
209    <http://lcweb.loc.gov/z3950/agency/amend/encapsulation.html> . */
210 { 1067, "Encapsulation: Encapsulated sequence of PDUs not supported" },
211 { 1068, "Encapsulation: Base operation (and encapsulated PDUs) not executed "
212       "based on pre-screening analysis" },
213 { 1069, "No syntaxes available for this request" },
214 /* The following, 1070-1071, were approved at the July 2000 ZIG meeting.
215    These are defined in conjunction with the clarification Server Selected
216    Record Syntax <http://lcweb.loc.gov/z3950/agency/clarify/altsyntax.html> */
217 { 1070, "user not authorized to receive record(s) in requested syntax" },
218 { 1071, "preferredRecordSyntax not supplied" },
219 /* The following diagnostic was approved at the October 2001 ZIG meeting.
220    See http://lists.w3.org/Archives/Public/www-zig/2001Jun/0006.html */
221 { 1072, "Query term includes characters that do not translate into the "
222       "target character set"},
223 { 0, NULL} 
224 };
225
226 const char *diagbib1_str (int code)
227 {
228     int i;
229     for (i=0; msg_tab[i].msg; i++)
230         if (msg_tab[i].code == code)
231             return msg_tab[i].msg;
232     return "Unknown error";
233 }