X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=zoom%2Fzoomsh.c;h=cad805f530f127d2209a314d6b25f3ed9239efc8;hb=d57ade59211707b9bcfacc61039e446c9fa3f36f;hp=111f629a9d1bdd3a8576ca997af7a4dab07846a6;hpb=fb6d99a0c7e07d9cc4a315c447deaf6564a85505;p=yaz-moved-to-github.git diff --git a/zoom/zoomsh.c b/zoom/zoomsh.c index 111f629..cad805f 100644 --- a/zoom/zoomsh.c +++ b/zoom/zoomsh.c @@ -2,10 +2,12 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: zoomsh.c,v 1.37 2005-06-25 15:46:08 adam Exp $ + * $Id: zoomsh.c,v 1.40 2006-04-21 10:28:07 adam Exp $ */ -/* ZOOM-C Shell */ +/** \file zoomsh.c + \brief ZOOM C command line tool (shell) +*/ #include #include @@ -122,6 +124,30 @@ static void cmd_get (ZOOM_connection *c, ZOOM_resultset *r, } } +static void cmd_rget(ZOOM_connection *c, ZOOM_resultset *r, + ZOOM_options options, + const char **args) +{ + char key[40]; + if (next_token_copy (args, key, sizeof(key)) < 0) + { + printf ("missing argument for get\n"); + } + else + { + int i; + for (i = 0; i"); + } + } +} + static void cmd_close (ZOOM_connection *c, ZOOM_resultset *r, ZOOM_options options, const char **args) @@ -330,7 +356,7 @@ static void cmd_search (ZOOM_connection *c, ZOOM_resultset *r, int start = ZOOM_options_get_int (options, "start", 0); int count = ZOOM_options_get_int (options, "count", 0); - printf ("%s: %d hits\n", ZOOM_connection_option_get(c[i], "host"), + printf ("%s: %ld hits\n", ZOOM_connection_option_get(c[i], "host"), ZOOM_resultset_size(r[i])); /* and display */ display_records (c[i], r[i], start, count); @@ -488,6 +514,8 @@ static int cmd_parse (ZOOM_connection *c, ZOOM_resultset *r, cmd_set (c, r, options, buf); else if (is_command ("get", cmd_str, cmd_len)) cmd_get (c, r, options, buf); + else if (is_command ("rget", cmd_str, cmd_len)) + cmd_rget (c, r, options, buf); else if (is_command ("connect", cmd_str, cmd_len)) cmd_connect (c, r, options, buf); else if (is_command ("open", cmd_str, cmd_len))