X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=client%2Fclient.c;h=6be4576c8dd16a2fa6f423598a13ee956c6f796a;hp=f251ae21db510da6756be33c08ac6ace6646c321;hb=26bc83eeda2418e09c32f2ca4c9327901568fe98;hpb=20973de252eaeb5367d3c86f64b3db43fd9581d2 diff --git a/client/client.c b/client/client.c index f251ae2..6be4576 100644 --- a/client/client.c +++ b/client/client.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: client.c,v 1.293 2005-06-30 08:34:01 adam Exp $ + * $Id: client.c,v 1.296 2005-08-24 11:25:34 heikki Exp $ */ #include @@ -133,6 +133,7 @@ static int scan_stepSize = 0; static int scan_position = 1; static int scan_size = 20; static char cur_host[200]; +static int last_hit_count = 0; typedef enum { QueryType_Prefix, @@ -405,7 +406,7 @@ static int process_initResponse(Z_InitResponse *res) if (oid->value == VAL_OCLCUI) { Z_OCLC_UserInformation *oclc_ui; ODR decode = odr_createmem(ODR_DECODE); - odr_setbuf(decode, sat->buf, sat->len, 0); + odr_setbuf(decode, (char *) sat->buf, sat->len, 0); if (!z_OCLC_UserInformation(decode, &oclc_ui, 0, 0)) printf ("Bad OCLC UserInformation:\n"); else @@ -1668,6 +1669,7 @@ static int process_searchResponse(Z_SearchResponse *res) else printf("Search was a bloomin' failure.\n"); printf("Number of hits: %d", *res->resultCount); + last_hit_count = *res->resultCount; if (setnumber >= 0) printf (", setno %d", setnumber); printf ("\n"); @@ -2558,7 +2560,15 @@ static void parse_show_args(const char *arg_c, char *setstring, *p = '\0'; } if (*arg) - *start = atoi(arg); + { + if (!strcmp(arg, "all")) + { + *number = last_hit_count; + *start = 1; + } + else + *start = atoi(arg); + } if (p && (p=strchr(p+1, '+'))) strcpy (setstring, p+1); else if (setnumber >= 0) @@ -2666,6 +2676,7 @@ static void close_session (void) odr_reset(out); odr_reset(in); odr_reset(print); + last_hit_count = 0; } void process_close(Z_Close *req) @@ -4234,6 +4245,7 @@ static struct { } cmd_array[] = { {"open", cmd_open, "('tcp'|'ssl')':[':'][/]",NULL,0,NULL}, {"quit", cmd_quit, "",NULL,0,NULL}, + {"exit", cmd_quit, "",NULL,0,NULL}, {"find", cmd_find, "",NULL,0,NULL}, {"delete", cmd_delete, "",NULL,0,NULL}, {"base", cmd_base, "",NULL,0,NULL},