X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=zoom%2Fzoomtst3.c;h=4d1f71778df1c02fe8b23aafafef0b36e276ca01;hp=4b6cf9b35973e1296ca7eb7c074275b05d176af0;hb=d84e4c3cd444d04aee7beeadb5bb0ae061ee24c9;hpb=fb6d99a0c7e07d9cc4a315c447deaf6564a85505 diff --git a/zoom/zoomtst3.c b/zoom/zoomtst3.c index 4b6cf9b..4d1f717 100644 --- a/zoom/zoomtst3.c +++ b/zoom/zoomtst3.c @@ -1,13 +1,12 @@ -/* - * $Id: zoomtst3.c,v 1.9 2005-06-25 15:46:08 adam Exp $ - * - * Asynchronous multi-target client doing search and piggyback retrieval +/* This file is part of the YAZ toolkit. + * Copyright (C) Index Data + * See the file LICENSE for details. */ #include #include #include -#include +#include #include @@ -24,11 +23,11 @@ int main(int argc, char **argv) if (argc < 3) { - fprintf (stderr, "usage:\n%s target1 target2 ... targetN query\n", - *argv); + fprintf (stderr, "usage:\n%s target1 target2 ... targetN query\n" + "%s number target query\n", *argv, *argv); exit (1); } - if (argc == 4 && isdigit(argv[1][0]) && !strchr(argv[1],'.')) + if (argc == 4 && yaz_isdigit(argv[1][0]) && !strchr(argv[1],'.')) { no = atoi(argv[1]); same_target = 1; @@ -42,6 +41,7 @@ int main(int argc, char **argv) /* get first 10 records of result set (using piggyback) */ ZOOM_options_set (o, "count", "10"); + ZOOM_options_set (o, "step", "5"); /* preferred record syntax */ ZOOM_options_set (o, "preferredRecordSyntax", "usmarc"); @@ -66,10 +66,14 @@ int main(int argc, char **argv) /* network I/O. pass number of connections and array of connections */ while ((i = ZOOM_event (no, z))) { - printf ("no = %d event = %d\n", i-1, - ZOOM_connection_last_event(z[i-1])); + int peek = ZOOM_connection_peek_event(z[i-1]); + int event = ZOOM_connection_last_event(z[i-1]); + printf ("no = %d peek = %d event = %d %s\n", i-1, + peek, + event, + ZOOM_get_event_str(event)); } - + /* no more to be done. Inspect results */ for (i = 0; i