-/* $Id: tstisamb.c,v 1.15 2005-01-03 09:23:25 adam Exp $
+/* $Id: tstisamb.c,v 1.19 2005-03-21 17:20:54 adam Exp $
Copyright (C) 1995-2005
- Index Data Aps
+ Index Data ApS
This file is part of the Zebra server.
02111-1307, USA.
*/
+#include <stdlib.h>
#include <string.h>
#include <yaz/log.h>
#include <yaz/xmalloc.h>
isamb_unlink(isb, isamc_p);
}
+void tst_x(ISAMB isb)
+{
+ ISAMC_I isamc_i;
+ ISAMB_P isamb_p = 0;
+ struct read_info ri;
+
+ isamc_i.clientData = &ri;
+ isamc_i.read_item = code_read;
+ ri.no = 1000;
+ ri.step = 1;
+ ri.max = 1500;
+
+ isamb_p = isamb_merge (isb, isamb_p , &isamc_i);
+
+ ri.no = 1;
+ ri.step = 1;
+ ri.max = 500;
+
+ isamb_p = isamb_merge (isb, isamb_p , &isamc_i);
+}
+
+void tst_append(ISAMB isb, int n)
+{
+ ISAMC_I isamc_i;
+ ISAMB_P isamb_p = 0;
+ struct read_info ri;
+ int i;
+ int chunk = 10;
+
+ for (i = 0; i < n; i += chunk)
+ {
+ /* insert a number of entries */
+ ri.no = 0;
+ ri.step = 1;
+ ri.max = i + chunk;
+ ri.insertMode = 1;
+
+ isamc_i.clientData = &ri;
+ isamc_i.read_item = code_read;
+
+ isamb_p = isamb_merge (isb, isamb_p , &isamc_i);
+ }
+}
+
int main(int argc, char **argv)
{
BFiles bfs;
tst_insert(isb, 100);
tst_insert(isb, 500);
tst_insert(isb, 10000);
+
tst_forward(isb, 10000);
+
+ tst_x(isb);
+
+ tst_append(isb, 1000);
/* close isam handle */
isamb_close(isb);