Source restructure. yaz-marcdump part of installation
[yaz-moved-to-github.git] / src / cqlstrer.c
1 /* $Id: cqlstrer.c,v 1.1 2003-10-27 12:21:30 adam Exp $
2    Copyright (C) 2002-2003
3    Index Data Aps
4
5 This file is part of the YAZ toolkit.
6
7 See the file LICENSE.
8 */
9
10 #include <yaz/cql.h>
11
12 /*
13  * The error-messages associated with these codes are taken from
14  * the SRW diagnostic specifications at
15  *      http://www.loc.gov/srw/diagnostic-list.html
16  */
17 const char *cql_strerror(int code) {
18     static char buf[80];
19     switch (code) {
20     case 10: return "Illegal query";
21     case 11: return "Unsupported query type (XCQL vs CQL)";
22     case 12: return "Too many characters in query";
23     case 13: return "Unbalanced or illegal use of parentheses";
24     case 14: return "Unbalanced or illegal use of quotes";
25     case 15: return "Illegal or unsupported index set";
26     case 16: return "Illegal or unsupported index";
27     case 17: return "Illegal or unsupported combination of index and index set";
28     case 18: return "Illegal or unsupported combination of indexes";
29     case 19: return "Illegal or unsupported relation";
30     case 20: return "Illegal or unsupported relation modifier";
31     case 21: return "Illegal or unsupported combination of relation modifers";
32     case 22: return "Illegal or unsupported combination of relation and index";
33     case 23: return "Too many characters in term";
34     case 24: return "Illegal combination of relation and term";
35     case 25: return "Special characters not quoted in term";
36     case 26: return "Non special character escaped in term";
37     case 27: return "Empty term unsupported";
38     case 28: return "Masking character not supported";
39     case 29: return "Masked words too short";
40     case 30: return "Too many masking characters in term";
41     case 31: return "Anchoring character not supported";
42     case 32: return "Anchoring character in illegal or unsupported position";
43     case 33: return "Combination of proximity/adjacency and masking characters not supported";
44     case 34: return "Combination of proximity/adjacency and anchoring characters not supported";
45     case 35: return "Terms only exclusion (stop) words";
46     case 36: return "Term in invalid format for index or relation";
47     case 37: return "Illegal or unsupported boolean operator";
48     case 38: return "Too many boolean operators in query";
49     case 39: return "Proximity not supported";
50     case 40: return "Illegal or unsupported proximity relation";
51     case 41: return "Illegal or unsupported proximity distance";
52     case 42: return "Illegal or unsupported proximity unit";
53     case 43: return "Illegal or unsupported proximity ordering";
54     case 44: return "Illegal or unsupported combination of proximity modifiers";
55     case 45: return "Index set name (prefix) assigned to multiple identifiers";
56     default: break;
57     }
58
59     sprintf(buf, "Unknown CQL error #%d", code);
60     return buf;
61 }