X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=client%2Fclient.c;h=8abd5a282a39801ece38ff6154caab835f09e79c;hb=92a1c29ad9003d7dad229fd5170ed83269c87658;hp=e0ac407dc16222ac6966689a58abb644d681fe42;hpb=d62fb74edd3775095d23f2bffbace2b60cd3c57f;p=yaz-moved-to-github.git diff --git a/client/client.c b/client/client.c index e0ac407..8abd5a2 100644 --- a/client/client.c +++ b/client/client.c @@ -1,20 +1,27 @@ /* - * Copyright (c) 1995-2005, Index Data + * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: client.c,v 1.266 2005-01-09 21:52:48 adam Exp $ + * $Id: client.c,v 1.269 2005-01-16 22:12:39 adam Exp $ */ #include #include #include +#include +#include #if HAVE_LOCALE_H #include #endif - #if HAVE_LANGINFO_H #include #endif +#if HAVE_UNISTD_H +#include +#endif +#if HAVE_SYS_STAT_H +#include +#endif #if HAVE_OPENSSL_SSL_H #include @@ -25,15 +32,11 @@ #include #endif -#include -#include - #ifdef WIN32 #include +#include #define S_ISREG(x) (x & _S_IFREG) #define S_ISDIR(x) (x & _S_IFDIR) -#else -#include #endif #include @@ -62,7 +65,6 @@ #include #endif -#include #include "admin.h" #include "tabcomplete.h" @@ -1253,11 +1255,11 @@ static int send_srw(Z_SRW_PDU *sr) #endif #if HAVE_XML2 -static int send_SRW_scanRequest(const char *arg, int num, int pos) +static int send_SRW_scanRequest(const char *arg, int pos, int num) { Z_SRW_PDU *sr = 0; - /* regular request .. */ + /* regular requestse .. */ sr = yaz_srw_get(out, Z_SRW_scan_request); switch(queryType) @@ -2856,8 +2858,16 @@ int cmd_scan(const char *arg) cmd_open(0); if (!conn) return 0; - if (send_SRW_scanRequest(arg, 20, 0) < 0) - return 0; + if (*arg) + { + if (send_SRW_scanRequest(arg, scan_position, 20) < 0) + return 0; + } + else + { + if (send_SRW_scanRequest(last_scan_line, 1, 20) < 0) + return 0; + } return 2; #else return 0; @@ -3531,6 +3541,8 @@ static void handle_srw_scan_term(Z_SRW_scanTerm *term) printf(" %s", term->whereInList); if (term->value && term->displayTerm) printf(" %s", term->value); + + strcpy(last_scan_line, term->value); printf("\n"); }