Recognise yet ANOTHER location where docbookx.dtd may be found -- this
[yaz-moved-to-github.git] / client / client.c
index f13e144..a79c51c 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (c) 1995-2004, Index Data
  * See the file LICENSE for details.
  *
- * $Id: client.c,v 1.260 2004-12-09 09:25:44 adam Exp $
+ * $Id: client.c,v 1.264 2005-01-02 20:31:39 adam Exp $
  */
 
 #include <stdio.h>
@@ -32,6 +32,8 @@
 #include <io.h>
 #define S_ISREG(x) (x & _S_IFREG)
 #define S_ISDIR(x) (x & _S_IFDIR)
+#else
+#include <unistd.h>
 #endif
 
 #include <yaz/yaz-util.h>
 #include <yaz/srw.h>
 #include <yaz/yaz-ccl.h>
 #include <yaz/cql.h>
-#include <yaz/ylog.h>
+#include <yaz/log.h>
 
 #if HAVE_READLINE_READLINE_H
 #include <readline/readline.h>
-#include <unistd.h>
 #endif
 #if HAVE_READLINE_HISTORY_H
 #include <readline/history.h>
@@ -104,6 +105,8 @@ static char *esPackageName = 0;
 static char *yazProxy = 0;
 static int kilobytes = 1024;
 static char *negotiationCharset = 0;
+static int  negotiationCharsetRecords = 1;
+static int  negotiationCharsetVersion = 3;
 static char *outputCharset = 0;
 static char *marcCharset = 0;
 static char* yazLang = 0;
@@ -327,7 +330,8 @@ static void send_initRequest(const char* type_and_host)
                    out,
                    (const char**)&negotiationCharset, 
                    negotiationCharset ? 1 : 0,
-                   (const char**)&yazLang, yazLang ? 1 : 0, 1);
+                   (const char**)&yazLang, yazLang ? 1 : 0, 
+                   negotiationCharsetRecords);
        }
     }
     
@@ -3034,18 +3038,24 @@ int cmd_negcharset(const char *arg)
     char l1[30];
 
     *l1 = 0;
-    if (sscanf(arg, "%29s", l1) < 1)
+    if (sscanf(arg, "%29s %d %d", l1, &negotiationCharsetRecords,
+              &negotiationCharsetVersion) < 1)
     {
        printf("Current negotiation character set is `%s'\n", 
-               negotiationCharset ? negotiationCharset: "none");
-       return 1;
+               negotiationCharset ? negotiationCharset: "none");  
+       printf("Records in charset %s\n", negotiationCharsetRecords ? 
+              "yes" : "no");
+       printf("Charneg version %d\n", negotiationCharsetVersion);
     }
-    xfree (negotiationCharset);
-    negotiationCharset = NULL;
-    if (*l1 && strcmp(l1, "-") && strcmp(l1, "none"))
+    else
     {
-        negotiationCharset = xstrdup(l1);
-        printf ("Character set negotiation : %s\n", negotiationCharset);
+       xfree (negotiationCharset);
+       negotiationCharset = NULL;
+       if (*l1 && strcmp(l1, "-") && strcmp(l1, "none"))
+       {
+           negotiationCharset = xstrdup(l1);
+           printf ("Character set negotiation : %s\n", negotiationCharset);
+       }
     }
     return 1;
 }