projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bump year
[yaz-moved-to-github.git]
/
zoom
/
zoomtst3.c
diff --git
a/zoom/zoomtst3.c
b/zoom/zoomtst3.c
index
98f797c
..
01499fe
100644
(file)
--- a/
zoom/zoomtst3.c
+++ b/
zoom/zoomtst3.c
@@
-1,15
+1,12
@@
-/* $Id: zoomtst3.c,v 1.13 2007-01-10 13:25:46 adam Exp $ */
-
-/** \file zoomtst3.c
- \brief Asynchronous multi-target client
-
- Performs search and piggyback retrieval of records
-*/
+/* This file is part of the YAZ toolkit.
+ * Copyright (C) 1995-2013 Index Data
+ * See the file LICENSE for details.
+ */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
+#include <yaz/yaz-iconv.h>
#include <yaz/xmalloc.h>
#include <yaz/xmalloc.h>
@@
-30,7
+27,7
@@
int main(int argc, char **argv)
"%s number target query\n", *argv, *argv);
exit (1);
}
"%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;
{
no = atoi(argv[1]);
same_target = 1;
@@
-44,6
+41,7
@@
int main(int argc, char **argv)
/* get first 10 records of result set (using piggyback) */
ZOOM_options_set (o, "count", "10");
/* 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");
/* preferred record syntax */
ZOOM_options_set (o, "preferredRecordSyntax", "usmarc");
@@
-69,11
+67,13
@@
int main(int argc, char **argv)
while ((i = ZOOM_event (no, z)))
{
int peek = ZOOM_connection_peek_event(z[i-1]);
while ((i = ZOOM_event (no, z)))
{
int peek = ZOOM_connection_peek_event(z[i-1]);
- printf ("no = %d peek = %d event = %d\n", i-1,
+ int event = ZOOM_connection_last_event(z[i-1]);
+ printf ("no = %d peek = %d event = %d %s\n", i-1,
peek,
peek,
- ZOOM_connection_last_event(z[i-1]));
+ event,
+ ZOOM_get_event_str(event));
}
}
-
+
/* no more to be done. Inspect results */
for (i = 0; i<no; i++)
{
/* no more to be done. Inspect results */
for (i = 0; i<no; i++)
{
@@
-98,12
+98,7
@@
int main(int argc, char **argv)
ZOOM_resultset_record (r[i], pos), "render", &len);
/* if rec is non-null, we got a record for display */
if (rec)
ZOOM_resultset_record (r[i], pos), "render", &len);
/* if rec is non-null, we got a record for display */
if (rec)
- {
- printf ("%d\n", pos+1);
- if (rec)
- fwrite (rec, 1, len, stdout);
- printf ("\n");
- }
+ printf ("%d\n%.*s\n", pos+1, len, rec);
}
}
}
}
}
}
@@
-119,6
+114,7
@@
int main(int argc, char **argv)
/*
* Local variables:
* c-basic-offset: 4
/*
* Local variables:
* c-basic-offset: 4
+ * c-file-style: "Stroustrup"
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab