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
yaz-iconv: fix typos
[yaz-moved-to-github.git]
/
zoom
/
zoomtst2.c
diff --git
a/zoom/zoomtst2.c
b/zoom/zoomtst2.c
index
59f85f2
..
7ce456b
100644
(file)
--- a/
zoom/zoomtst2.c
+++ b/
zoom/zoomtst2.c
@@
-1,7
+1,6
@@
-/*
- * $Id: zoomtst2.c,v 1.4 2002-09-24 08:00:32 adam Exp $
- *
- * Asynchronous single-target client performing search (no retrieval)
+/* This file is part of the YAZ toolkit.
+ * Copyright (C) Index Data
+ * See the file LICENSE for details.
*/
#include <stdio.h>
*/
#include <stdio.h>
@@
-14,19
+13,22
@@
int main(int argc, char **argv)
ZOOM_connection z;
ZOOM_resultset r;
int error;
ZOOM_connection z;
ZOOM_resultset r;
int error;
- const char *errmsg, *addinfo;
+ const char *errmsg, *addinfo, *diagset;
if (argc < 3)
{
if (argc < 3)
{
- fprintf (stderr, "usage:\n%s target query\n", *argv);
- fprintf (stderr,
- "Verify: asynchronous single-target client\n");
- exit (1);
+ fprintf (stderr, "usage:\n%s target query\n", *argv);
+ fprintf (stderr,
+ "Verify: asynchronous single-target client\n");
+ exit (1);
}
/* create connection (don't connect yet) */
z = ZOOM_connection_create(0);
}
/* create connection (don't connect yet) */
z = ZOOM_connection_create(0);
+ /* option: set sru/get operation (only applicable if http: is used) */
+ ZOOM_connection_option_set (z, "sru", "post");
+
/* option: set async operation */
ZOOM_connection_option_set (z, "async", "1");
/* option: set async operation */
ZOOM_connection_option_set (z, "async", "1");
@@
-38,17
+40,27
@@
int main(int argc, char **argv)
/* block here: only one connection */
while (ZOOM_event (1, &z))
/* block here: only one connection */
while (ZOOM_event (1, &z))
- ;
+ ;
/* see if any error occurred */
/* see if any error occurred */
- if ((error = ZOOM_connection_error(z, &errmsg, &addinfo)))
+ if ((error = ZOOM_connection_error_x(z, &errmsg, &addinfo, &diagset)))
{
{
- fprintf (stderr, "Error: %s (%d) %s\n", errmsg, error, addinfo);
- exit (2);
+ fprintf (stderr, "Error: %s: %s (%d) %s\n", diagset, errmsg, error,
+ addinfo);
+ exit (2);
}
else /* OK print hit count */
}
else /* OK print hit count */
- printf ("Result count: %d\n", ZOOM_resultset_size(r));
+ printf ("Result count: %ld\n", (long) ZOOM_resultset_size(r));
ZOOM_resultset_destroy (r);
ZOOM_connection_destroy (z);
exit (0);
}
ZOOM_resultset_destroy (r);
ZOOM_connection_destroy (z);
exit (0);
}
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * c-file-style: "Stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
+