I think this now supports CCL in scan, but I've not tested it.
authorMike Taylor <mike@indexdata.com>
Tue, 13 Jun 2006 16:27:23 +0000 (16:27 +0000)
committerMike Taylor <mike@indexdata.com>
Tue, 13 Jun 2006 16:27:23 +0000 (16:27 +0000)
src/zoom-c.c

index 3149464..05371be 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 1995-2005, Index Data ApS
  * See the file LICENSE for details.
  *
  * Copyright (C) 1995-2005, Index Data ApS
  * See the file LICENSE for details.
  *
- * $Id: zoom-c.c,v 1.75 2006-06-13 16:21:42 mike Exp $
+ * $Id: zoom-c.c,v 1.76 2006-06-13 16:27:23 mike Exp $
  */
 /**
  * \file zoom-c.c
  */
 /**
  * \file zoom-c.c
@@ -1180,7 +1180,7 @@ static zoom_ret ZOOM_connection_send_init (ZOOM_connection c)
         ZOOM_options_get(c->options, "implementationName"),
         odr_prepend(c->odr_out, "ZOOM-C", ireq->implementationName));
 
         ZOOM_options_get(c->options, "implementationName"),
         odr_prepend(c->odr_out, "ZOOM-C", ireq->implementationName));
 
-    version = odr_strdup(c->odr_out, "$Revision: 1.75 $");
+    version = odr_strdup(c->odr_out, "$Revision: 1.76 $");
     if (strlen(version) > 10)   /* check for unexpanded CVS strings */
         version[strlen(version)-2] = '\0';
     ireq->implementationVersion = odr_prepend(c->odr_out,
     if (strlen(version) > 10)   /* check for unexpanded CVS strings */
         version[strlen(version)-2] = '\0';
     ireq->implementationVersion = odr_prepend(c->odr_out,
@@ -2465,11 +2465,10 @@ ZOOM_connection_scan1 (ZOOM_connection c, ZOOM_query q)
 
     /*
      * We need to check the query-type, so we can recognise CQL and
 
     /*
      * We need to check the query-type, so we can recognise CQL and
-     * compile it into a form that we can use here.  The ZOOM_query
-     * structure has no explicit `type' member, but inspection of the
-     * ZOOM_query_prefix() and ZOOM_query_cql() functions shows how
-     * the structure is set up in each case.
-     * ### should add support for CCL here
+     * CCL and compile them into a form that we can use here.  The
+     * ZOOM_query structure has no explicit `type' member, but
+     * inspection of the ZOOM_query_prefix() and ZOOM_query_cql()
+     * functions shows how the structure is set up in each case.
      */
     if (q->z_query->which == Z_Query_type_1) {
         yaz_log(log_api, "%p ZOOM_connection_scan1 q=%p PQF '%s'",
      */
     if (q->z_query->which == Z_Query_type_1) {
         yaz_log(log_api, "%p ZOOM_connection_scan1 q=%p PQF '%s'",
@@ -2481,6 +2480,12 @@ ZOOM_connection_scan1 (ZOOM_connection c, ZOOM_query q)
         start = freeme = cql2pqf(c, q->query_string);
         if (start == 0)
             return 0;
         start = freeme = cql2pqf(c, q->query_string);
         if (start == 0)
             return 0;
+    } else if (q->z_query->which == Z_Query_type_2) {
+        yaz_log(log_api, "%p ZOOM_connection_scan1 q=%p CCL '%s'",
+                c, q, q->query_string);
+        start = freeme = ccl2pqf(c, q->query_string);
+        if (start == 0)
+            return 0;
     } else {
         yaz_log(YLOG_FATAL, "%p ZOOM_connection_scan1 q=%p unknown type '%s'",
                 c, q, q->query_string);
     } else {
         yaz_log(YLOG_FATAL, "%p ZOOM_connection_scan1 q=%p unknown type '%s'",
                 c, q, q->query_string);