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