projects
/
idzebra-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update m4
[idzebra-moved-to-github.git]
/
isamb
/
tstisamb.c
diff --git
a/isamb/tstisamb.c
b/isamb/tstisamb.c
index
986899e
..
72de84a
100644
(file)
--- a/
isamb/tstisamb.c
+++ b/
isamb/tstisamb.c
@@
-1,8
+1,5
@@
-/* $Id: tstisamb.c,v 1.24 2006-08-14 10:40:17 adam Exp $
- Copyright (C) 1995-2006
- Index Data ApS
-
-This file is part of the Zebra server.
+/* This file is part of the Zebra server.
+ Copyright (C) 1994-2011 Index Data
Zebra is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Zebra is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
@@
-20,6
+17,16
@@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+#if HAVE_SYS_TIMES_H
+#include <sys/times.h>
+#endif
+#if HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
#include <stdlib.h>
#include <string.h>
#include <yaz/log.h>
#include <stdlib.h>
#include <string.h>
#include <yaz/log.h>
@@
-27,16
+34,18
@@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include <idzebra/isamb.h>
#include <assert.h>
#include <idzebra/isamb.h>
#include <assert.h>
+static int log_level = 0;
+
static void log_item(int level, const void *b, const char *txt)
{
int x;
memcpy(&x, b, sizeof(int));
static void log_item(int level, const void *b, const char *txt)
{
int x;
memcpy(&x, b, sizeof(int));
- yaz_log(YLOG_DEBUG, "%s %d", txt, x);
+ yaz_log(log_level, "%s %d", txt, x);
}
static void log_pr(const char *txt)
{
}
static void log_pr(const char *txt)
{
- yaz_log(YLOG_DEBUG, "%s", txt);
+ yaz_log(log_level, "%s", txt);
}
int compare_item(const void *a, const void *b)
}
int compare_item(const void *a, const void *b)
@@
-52,7
+61,7
@@
int compare_item(const void *a, const void *b)
return 0;
}
return 0;
}
-void *code_start()
+void *code_start(void)
{
return 0;
}
{
return 0;
}
@@
-96,8
+105,8
@@
int code_read(void *vp, char **dst, int *insertMode)
ri->val = ri->val + ri->step;
*insertMode = ri->insertMode;
ri->val = ri->val + ri->step;
*insertMode = ri->insertMode;
-#if 1
- yaz_log(YLOG_DEBUG, "%d %5d", ri->insertMode, x);
+#if 0
+ yaz_log(log_level, "%d %5d", ri->insertMode, x);
#endif
return 1;
}
#endif
return 1;
}
@@
-140,7
+149,7
@@
void tst_insert(ISAMB isb, int n)
nerrs++;
}
else if (nerrs)
nerrs++;
}
else if (nerrs)
- yaz_log(YLOG_LOG, "isamb_pp_read. n=%d Got %d",
+ yaz_log(log_level, "isamb_pp_read. n=%d Got %d",
n, x);
ri.val++;
n, x);
ri.val++;
@@
-556,7
+565,6
@@
int main(int argc, char **argv)
yaz_log(YLOG_WARN, "isamb_open failed");
exit(2);
}
yaz_log(YLOG_WARN, "isamb_open failed");
exit(2);
}
-#if 1
tst_insert(isb, 1);
tst_insert(isb, 2);
tst_insert(isb, 20);
tst_insert(isb, 1);
tst_insert(isb, 2);
tst_insert(isb, 20);
@@
-569,7
+577,6
@@
int main(int argc, char **argv)
tst_x(isb);
tst_append(isb, 1000);
tst_x(isb);
tst_append(isb, 1000);
-#endif
if (0)
identical_keys_tests(isb);
if (0)
identical_keys_tests(isb);
@@
-584,6
+591,7
@@
int main(int argc, char **argv)
/*
* Local variables:
* c-basic-offset: 4
/*
* Local variables:
* c-basic-offset: 4
+ * c-file-style: "Stroustrup"
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab