X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=zoom%2Fzoomtst3.c;h=4d1f71778df1c02fe8b23aafafef0b36e276ca01;hp=f393f916b991e7c7317fe6c2ef7ce20f524d4bbe;hb=d84e4c3cd444d04aee7beeadb5bb0ae061ee24c9;hpb=d00666d5391066b1acba398090170d3766ec7e4f diff --git a/zoom/zoomtst3.c b/zoom/zoomtst3.c index f393f91..4d1f717 100644 --- a/zoom/zoomtst3.c +++ b/zoom/zoomtst3.c @@ -1,12 +1,12 @@ -/* - * $Id: zoomtst3.c,v 1.3 2001-11-15 08:58:29 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 @@ -15,85 +15,108 @@ int main(int argc, char **argv) { int i; + int same_target = 0; int no = argc-2; - Z3950_connection z[500]; /* allow at most 500 connections */ - Z3950_resultset r[500]; /* and result sets .. */ - Z3950_options o = Z3950_options_create (); + ZOOM_connection z[500]; /* allow at most 500 connections */ + ZOOM_resultset r[500]; /* and result sets .. */ + ZOOM_options o = ZOOM_options_create (); if (argc < 3) { - fprintf (stderr, "usage:\n%s target1 target2 ... targetN query\n", - *argv); - exit (1); + fprintf (stderr, "usage:\n%s target1 target2 ... targetN query\n" + "%s number target query\n", *argv, *argv); + exit (1); + } + if (argc == 4 && yaz_isdigit(argv[1][0]) && !strchr(argv[1],'.')) + { + no = atoi(argv[1]); + same_target = 1; } + if (no > 500) no = 500; /* async mode */ - Z3950_options_set (o, "async", "1"); + ZOOM_options_set (o, "async", "1"); /* get first 10 records of result set (using piggyback) */ - Z3950_options_set (o, "count", "10"); + ZOOM_options_set (o, "count", "10"); + ZOOM_options_set (o, "step", "5"); /* preferred record syntax */ - Z3950_options_set (o, "preferredRecordSyntax", "usmarc"); - Z3950_options_set (o, "elementSetName", "F"); + ZOOM_options_set (o, "preferredRecordSyntax", "usmarc"); + ZOOM_options_set (o, "elementSetName", "F"); /* connect to all */ for (i = 0; i