CCL: add two new diagnostics for unsupported masking
authorAdam Dickmeiss <adam@indexdata.dk>
Fri, 24 Feb 2012 10:23:46 +0000 (11:23 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Fri, 24 Feb 2012 10:23:46 +0000 (11:23 +0100)
The new diagnostics are: "Embedded truncation not supported"
and "Single charcacter mask not supported".

include/yaz/ccl.h
src/cclerrms.c
src/cclfind.c

index f9b6b85..70194e5 100644 (file)
@@ -91,6 +91,8 @@ YAZ_BEGIN_CDECL
 #define CCL_ERR_TRUNC_NOT_LEFT   10
 #define CCL_ERR_TRUNC_NOT_BOTH   11
 #define CCL_ERR_TRUNC_NOT_RIGHT  12
 #define CCL_ERR_TRUNC_NOT_LEFT   10
 #define CCL_ERR_TRUNC_NOT_BOTH   11
 #define CCL_ERR_TRUNC_NOT_RIGHT  12
+#define CCL_ERR_TRUNC_NOT_EMBED  13
+#define CCL_ERR_TRUNC_NOT_SINGLE 14
     
 /** \brief attribute node (type, value) pair as used in RPN */
 struct ccl_rpn_attr {
     
 /** \brief attribute node (type, value) pair as used in RPN */
 struct ccl_rpn_attr {
index cff96cc..e9b6a87 100644 (file)
@@ -28,7 +28,9 @@ static char *err_msg_array[] = {
     "Bad relation",
     "Left truncation not supported",
     "Both left - and right truncation not supported",
     "Bad relation",
     "Left truncation not supported",
     "Both left - and right truncation not supported",
-    "Right truncation not supported"
+    "Right truncation not supported",
+    "Embedded truncation not supported",
+    "Single charcacter mask not supported"
 };
 
 const char *ccl_err_msg(int ccl_errno)
 };
 
 const char *ccl_err_msg(int ccl_errno)
index 072fdab..caceeea 100644 (file)
@@ -442,7 +442,7 @@ static struct ccl_rpn_node *search_term_x(CCL_parser cclp,
                         right_trunc = 1;
                     else
                     {
                         right_trunc = 1;
                     else
                     {
-                        cclp->error_code = CCL_ERR_TRUNC_NOT_BOTH;
+                        cclp->error_code = CCL_ERR_TRUNC_NOT_EMBED;
                         ccl_rpn_delete(p);
                         return NULL;
                     }
                         ccl_rpn_delete(p);
                         return NULL;
                     }
@@ -461,7 +461,7 @@ static struct ccl_rpn_node *search_term_x(CCL_parser cclp,
                     }
                     else
                     {
                     }
                     else
                     {
-                        cclp->error_code = CCL_ERR_TRUNC_NOT_BOTH;
+                        cclp->error_code = CCL_ERR_TRUNC_NOT_SINGLE;
                         ccl_rpn_delete(p);
                         return NULL;
                     }
                         ccl_rpn_delete(p);
                         return NULL;
                     }