CCL always enabled
[yaz-moved-to-github.git] / client / client.c
index 0c67a87..b1147d6 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (c) 1995-2002, Index Data
  * See the file LICENSE for details.
  *
- * $Id: client.c,v 1.156 2002-06-02 21:34:45 adam Exp $
+ * $Id: client.c,v 1.158 2002-06-10 11:07:57 adam Exp $
  */
 
 #include <stdio.h>
@@ -364,16 +364,24 @@ int cmd_open(char *arg)
             session_mem = NULL;
         }
     }
-    t = tcpip_type;
-    base[0] = '\0';
-    if (sscanf (arg, "%100[^/]/%100s", type_and_host, base) < 1)
-        return 0;
-    
-    if(yazProxy) 
-        conn = cs_create_host(yazProxy, 1, &add);
-    else 
-        conn = cs_create_host(type_and_host, 1, &add);
-    
+       if (strncmp (arg, "unix:", 5) == 0)
+       {
+        base[0] = '\0';
+        conn = cs_create_host(arg, 1, &add);
+       }
+       else
+       {
+               t = tcpip_type;
+               base[0] = '\0';
+               if (sscanf (arg, "%100[^/]/%100s", type_and_host, base) < 1)
+                       return 0;
+               
+               if(yazProxy) 
+                       conn = cs_create_host(yazProxy, 1, &add);
+               else 
+                       conn = cs_create_host(type_and_host, 1, &add);
+               
+    }
     if (!conn)
     {
         printf ("Couldn't create comstack\n");
@@ -1728,7 +1736,6 @@ int send_scanrequest(const char *query, int pp, int num, const char *term)
     Z_APDU *apdu = zget_APDU(out, Z_APDU_scanRequest);
     Z_ScanRequest *req = apdu->u.scanRequest;
     int use_rpn = 1;
-#if YAZ_MODULE_ccl
     int oid[OID_SIZE];
     
     if (queryType == QueryType_CCL2RPN)
@@ -1755,7 +1762,6 @@ int send_scanrequest(const char *query, int pp, int num, const char *term)
         }
         ccl_rpn_delete (rpn);
     }
-#endif
     if (use_rpn && !(req->termListAndStartPoint =
                      p_query_scan(out, protocol, &req->attributeSet, query)))
     {
@@ -2035,18 +2041,14 @@ int cmd_querytype (char *arg)
         queryType = QueryType_CCL;
     else if (!strcmp (arg, "prefix") || !strcmp(arg, "rpn"))
         queryType = QueryType_Prefix;
-#if YAZ_MODULE_ccl
     else if (!strcmp (arg, "ccl2rpn") || !strcmp (arg, "cclrpn"))
         queryType = QueryType_CCL2RPN;
-#endif
     else
     {
         printf ("Querytype must be one of:\n");
         printf (" prefix         - Prefix query\n");
         printf (" ccl            - CCL query\n");
-#if YAZ_MODULE_ccl
         printf (" ccl2rpn        - CCL query converted to RPN\n");
-#endif
         return 0;
     }
     return 1;
@@ -2227,7 +2229,6 @@ int cmd_set_apdufile(char* arg)
 
 int cmd_set_cclfields(char* arg)
 {  
-#if YAZ_MODULE_ccl
     FILE *inf;
 
     REMOVE_TAILING_BLANKS(arg);
@@ -2239,9 +2240,6 @@ int cmd_set_cclfields(char* arg)
         ccl_qual_file (bibset, inf);
         fclose (inf);
     }
-#else 
-    fprintf(stderr,"Not compiled with the yaz ccl module\n");
-#endif
     
     return 1;
 }