-/*
- * $Id: zoom-benchmark.c,v 1.15 2006-10-04 16:59:35 mike Exp $
- *
- * Asynchronous multi-target client doing search and piggyback retrieval
+/* This file is part of the YAZ toolkit.
+ * Copyright (C) 1995-2011 Index Data
+ * See the file LICENSE for details.
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
#include <sys/time.h>
#include <yaz/xmalloc.h>
#include <yaz/options.h>
#include <yaz/zoom.h>
-
/* naming events */
-static char* zoom_events[10];
+static char* zoom_events[ZOOM_EVENT_MAX+1];
/* re-sorting event numbers to progress numbers */
-static int zoom_progress[10];
+static int zoom_progress[ZOOM_EVENT_MAX+1];
/* commando line parameters */
static struct parameters_t {
read_params(argc, argv, ¶meters);
- z = xmalloc(sizeof(*z) * parameters.concurrent);
- r = xmalloc(sizeof(*r) * parameters.concurrent);
- elc = xmalloc(sizeof(*elc) * parameters.concurrent * parameters.repeat);
- els = xmalloc(sizeof(*els)
- * parameters.concurrent * parameters.repeat * 10);
+ z = (ZOOM_connection *) xmalloc(sizeof(*z) * parameters.concurrent);
+ r = (ZOOM_resultset *) xmalloc(sizeof(*r) * parameters.concurrent);
+ elc = (int *) xmalloc(sizeof(*elc) * parameters.concurrent * parameters.repeat);
+ els = (struct event_line_t *) xmalloc(
+ sizeof(*els) * parameters.concurrent * parameters.repeat * 10);
o = ZOOM_options_create();
/* async mode */
const char *errmsg;
const char *addinfo;
int error = 0;
- int progress = zoom_progress[event];
+ //int progress = zoom_progress[event];
if (event == ZOOM_EVENT_SEND_DATA || event == ZOOM_EVENT_RECV_DATA)
continue;
/* updating events and event list */
error = ZOOM_connection_error(z[i-1] , &errmsg, &addinfo);
if (error)
- parameters.progress[i] = -progress;
+ parameters.progress[i] = zoom_progress[ZOOM_EVENT_UNKNOWN];
+ //parameters.progress[i] = zoom_progress[ZOOM_EVENT_NONE];
+ else if (event == ZOOM_EVENT_CONNECT)
+ parameters.progress[i] = zoom_progress[event];
else
+ //parameters.progress[i] = zoom_progress[event];
parameters.progress[i] += 1;
update_events(elc, els,
/*
* Local variables:
* c-basic-offset: 4
+ * c-file-style: "Stroustrup"
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab