1 /* This file is part of the YAZ toolkit.
2 * Copyright (C) 1995-2011 Index Data
3 * See the file LICENSE for details.
10 #include <yaz/wrbuf.h>
13 #include <yaz/xmalloc.h>
16 int main(int argc, char **argv)
19 ZOOM_options o = ZOOM_options_create ();
20 const char *errmsg, *addinfo;
24 fprintf (stderr, "usage:\nzoom-ka sleepinterval target query\n");
28 ZOOM_options_set (o, "async", "1");
30 z = ZOOM_connection_create(o);
36 ZOOM_connection_connect (z, argv[2], 0);
37 rset = ZOOM_connection_search_pqf(z, argv[3]);
39 while ((i = ZOOM_event(1, &z)))
41 printf ("no = %d event = %d\n", i-1,
42 ZOOM_connection_last_event(z));
44 if ((error = ZOOM_connection_error(z, &errmsg, &addinfo)))
46 fprintf(stderr, "%s error: %s (%d) %s\n",
47 ZOOM_connection_option_get(z, "host"),
48 errmsg, error, addinfo);
50 ZOOM_resultset_destroy(rset);
53 ZOOM_connection_destroy (z);
54 ZOOM_options_destroy(o);
59 * c-file-style: "Stroustrup"
60 * indent-tabs-mode: nil
62 * vim: shiftwidth=4 tabstop=8 expandtab