Deprecated log.h and created a new ylog.h
[yaz-moved-to-github.git] / client / client.c
index 444aa96..be42824 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (c) 1995-2004, Index Data
  * See the file LICENSE for details.
  *
- * $Id: client.c,v 1.252 2004-09-22 13:21:37 adam Exp $
+ * $Id: client.c,v 1.256 2004-11-18 15:18:10 heikki Exp $
  */
 
 #include <stdio.h>
@@ -51,6 +51,7 @@
 #include <yaz/srw.h>
 #include <yaz/yaz-ccl.h>
 #include <yaz/cql.h>
+#include <yaz/ylog.h>
 
 #if HAVE_READLINE_READLINE_H
 #include <readline/readline.h>
@@ -3710,6 +3711,20 @@ int cmd_set_otherinfo(const char* args)
     return 0;
 }
 
+int cmd_sleep(const char* args ) 
+{
+    int sec=atoi(args);
+    if( sec > 0 ) {
+#ifdef WIN32
+       Sleep(sec*1000);
+#else
+       sleep(sec);
+#endif
+       printf("Done sleeping %d seconds\n", sec);      
+    }
+    return 1;    
+}
+
 int cmd_list_otherinfo(const char* args)
 {
     int i;        
@@ -3896,7 +3911,8 @@ static struct {
     {"set_cclfile", cmd_set_cclfile," <filename>",NULL,1,NULL},
     {"set_cqlfile", cmd_set_cqlfile," <filename>",NULL,1,NULL},
     {"set_auto_reconnect", cmd_set_auto_reconnect," on|off",complete_auto_reconnect,1,NULL},
-       {"set_otherinfo", cmd_set_otherinfo,"<otherinfoinddex> <oid> <string>",NULL,0,NULL},
+    {"set_otherinfo", cmd_set_otherinfo,"<otherinfoinddex> <oid> <string>",NULL,0,NULL},
+    {"sleep", cmd_sleep,"<seconds>",NULL,0,NULL},
     {"register_oid", cmd_register_oid,"<name> <class> <oid>",NULL,0,NULL},
     {"push_command", cmd_push_command,"<command>",command_generator,0,NULL},
     {"register_tab", cmd_register_tab,"<commandname> <tab>",command_generator,0,NULL},