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
clone_z_type: fix leak; occurred for enc failures
[yaz-moved-to-github.git]
/
zoom
/
zoomtst3.c
diff --git
a/zoom/zoomtst3.c
b/zoom/zoomtst3.c
index
085b6ca
..
340d3bf
100644
(file)
--- a/
zoom/zoomtst3.c
+++ b/
zoom/zoomtst3.c
@@
-1,7
+1,6
@@
-/*
- * $Id: zoomtst3.c,v 1.10 2006-04-19 09:05:09 adam Exp $
- *
- * Asynchronous multi-target client doing search and piggyback retrieval
+/* This file is part of the YAZ toolkit.
+ * Copyright (C) 1995-2009 Index Data
+ * See the file LICENSE for details.
*/
#include <stdio.h>
*/
#include <stdio.h>
@@
-66,7
+65,9
@@
int main(int argc, char **argv)
/* network I/O. pass number of connections and array of connections */
while ((i = ZOOM_event (no, z)))
{
/* 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,
+ int peek = ZOOM_connection_peek_event(z[i-1]);
+ printf ("no = %d peek = %d event = %d\n", i-1,
+ peek,
ZOOM_connection_last_event(z[i-1]));
}
ZOOM_connection_last_event(z[i-1]));
}
@@
-84,7
+85,7
@@
int main(int argc, char **argv)
{
/* OK, no major errors. Look at the result count */
int pos;
{
/* OK, no major errors. Look at the result count */
int pos;
- printf ("%s: %d hits\n", tname, ZOOM_resultset_size(r[i]));
+ printf ("%s: %ld hits\n", tname, (long) ZOOM_resultset_size(r[i]));
/* go through all records at target */
for (pos = 0; pos < 10; pos++)
{
/* go through all records at target */
for (pos = 0; pos < 10; pos++)
{
@@
-94,12
+95,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);
}
}
}
}
}
}
@@
-115,6
+111,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