/*
- * Copyright (c) 2002-2004, Index Data.
+ * Copyright (C) 1995-2005, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: zoomsh.c,v 1.30 2004-11-18 15:18:14 heikki Exp $
+ * $Id: zoomsh.c,v 1.36 2005-06-25 15:42:19 adam Exp $
*/
/* ZOOM-C Shell */
#include <yaz/xmalloc.h>
-#include <yaz/ylog.h>
+#include <yaz/log.h>
#include <yaz/nmem.h>
#include <yaz/zoom.h>
#include <yaz/oid.h>
dset, error, addinfo);
else if (p[i])
{
+ const char *v;
printf ("ok\n");
+ v = ZOOM_package_option_get (p[i], "targetReference");
+ if (v)
+ printf("targetReference: %s\n", v);
+ v = ZOOM_package_option_get (p[i], "xmlUpdateDoc");
+ if (v)
+ printf("xmlUpdateDoc: %s\n", v);
}
ZOOM_package_destroy (p[i]);
}
printf ("scan <term>\n");
printf ("quit\n");
printf ("close <zurl>\n");
+ printf ("ext <type>\n");
printf ("set <option> [<value>]\n");
printf ("get <option>\n");
printf ("\n");
}
}
-int main (int argc, char **argv)
+static void zoomsh(int argc, char **argv)
{
ZOOM_options options = ZOOM_options_create();
int i, res;
ZOOM_connection z39_con[MAX_CON];
ZOOM_resultset z39_res[MAX_CON];
- nmem_init();
for (i = 0; i<MAX_CON; i++)
{
z39_con[i] = 0;
ZOOM_connection_destroy(z39_con[i]);
ZOOM_resultset_destroy(z39_res[i]);
}
+}
+
+int main(int argc, char **argv)
+{
+ const char *maskstr = 0;
+ if (argc > 2 && !strcmp(argv[1], "-v"))
+ {
+ maskstr = argv[2];
+ argv += 2;
+ argc -= 2;
+ }
+ else if (argc > 1 && !strncmp(argv[1], "-v", 2))
+ {
+ maskstr = argv[1]+2;
+ argv++;
+ argc--;
+ }
+ if (maskstr)
+ {
+ int mask = yaz_log_mask_str(maskstr);
+ yaz_log_init_level(mask);
+ }
+ nmem_init();
+ zoomsh(argc, argv);
nmem_exit();
exit (0);
}