-/* $Id: scantest.c,v 1.1 2004-12-07 14:57:08 adam Exp $
- Copyright (C) 2003,2004
- Index Data Aps
+/* $Id: scantest.c,v 1.5 2006-05-10 08:13:18 adam Exp $
+ Copyright (C) 1995-2005
+ Index Data ApS
This file is part of the Zebra server.
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <yaz/log.h>
#include <yaz/options.h>
-#include <dict.h>
+#include <idzebra/dict.h>
struct handle_info {
int b;
idx = hi->a - pos + hi->b;
else
idx = -pos - 1;
- hi->ar[idx] = malloc(strlen(name)+1);
- strcpy(hi->ar[idx], name);
+
#if 0
printf ("pos=%d idx=%d name=%s\n", pos, idx, name);
#endif
+ if (idx < 0)
+ return 0;
+
+ hi->ar[idx] = malloc(strlen(name)+1);
+ strcpy(hi->ar[idx], name);
return 0;
}
char *arg;
strcpy(scan_term, "1004");
- while ((ret = options("b:a:t:n:", argv, argc, &arg)) != -2)
+ while ((ret = options("b:a:t:n:v:", argv, argc, &arg)) != -2)
{
switch(ret)
{
case 'n':
number = atoi(arg);
break;
+ case 'v':
+ yaz_log_init_level(yaz_log_mask_str(arg));
}
}
"4497",
"4498",
"4499",
- "45"};
+ "45"};
strcpy(scan_term, "4499");
errors += tst(dict, 2, 2, scan_term, cs, 0);
}
exit(1);
exit(0);
}
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
+