X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=zoom%2Fzoomtst3.c;h=224db5f267bd6079d8f3634b81c2aa38cad43af6;hb=1167a422a06ea4d4a4b0c14a9f6df5042790f99e;hp=d03bd6207571942eef614de40a1e574c5254f534;hpb=69bcd68523a9a8da083faef16887100369152673;p=yaz-moved-to-github.git diff --git a/zoom/zoomtst3.c b/zoom/zoomtst3.c index d03bd62..224db5f 100644 --- a/zoom/zoomtst3.c +++ b/zoom/zoomtst3.c @@ -1,11 +1,13 @@ /* - * $Id: zoomtst3.c,v 1.1 2001-10-23 21:00:20 adam Exp $ + * $Id: zoomtst3.c,v 1.8 2002-06-05 21:09:04 adam Exp $ * * Asynchronous multi-target client doing search and piggyback retrieval */ #include #include +#include +#include #include @@ -14,10 +16,11 @@ 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) { @@ -25,63 +28,77 @@ int main(int argc, char **argv) *argv); exit (1); } + if (argc == 4 && 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"); /* 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