1 /* $Id: zoomtst1.c,v 1.5 2006-04-21 10:28:08 adam Exp $ */
4 \brief Synchronous single-target client doing search (but no retrieval)
9 #include <yaz/xmalloc.h>
12 int main(int argc, char **argv)
17 const char *errmsg, *addinfo;
21 fprintf (stderr, "usage:\n%s target query\n", *argv);
22 fprintf (stderr, " eg. bagel.indexdata.dk/gils computer\n");
25 z = ZOOM_connection_new (argv[1], 0);
27 if ((error = ZOOM_connection_error(z, &errmsg, &addinfo)))
29 fprintf (stderr, "Error: %s (%d) %s\n", errmsg, error, addinfo);
33 r = ZOOM_connection_search_pqf (z, argv[2]);
34 if ((error = ZOOM_connection_error(z, &errmsg, &addinfo)))
35 fprintf (stderr, "Error: %s (%d) %s\n", errmsg, error, addinfo);
37 printf ("Result count: %ld\n", (long) ZOOM_resultset_size(r));
38 ZOOM_resultset_destroy (r);
39 ZOOM_connection_destroy (z);
45 * indent-tabs-mode: nil
47 * vim: shiftwidth=4 tabstop=8 expandtab