/* This file is part of the Zebra server.
- Copyright (C) 1995-2008 Index Data
+ 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
*/
-#include <assert.h>
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include <assert.h>
#include <string.h>
#include <yaz/log.h>
return 0;
(s->no)--;
-
+
*insertMode = s->insert_flag;
memcpy(*dst, &s->st, sizeof(s->st));
*dst += sizeof(s->st);
case ZEBRA_SORT_TYPE_ISAMB:
method.codec.encode = sort_term_encode1;
method.codec.decode = sort_term_decode1;
-
+
sprintf(fname, "sortb%d", id);
sf->u.isamb = isamb_open2(si->bfs, fname, si->write_flag, &method,
/* cache */ 0,
isam_block_size = 32768;
method.codec.encode = sort_term_encode2;
method.codec.decode = sort_term_decode2;
-
+
sprintf(fname, "sortm%d", id);
sf->u.isamb = isamb_open2(si->bfs, fname, si->write_flag, &method,
/* cache */ 0,
s.st.section_id = section_id;
s.st.length = 0;
s.st.term[0] = '\0';
-
+
s.no = 1;
s.insert_flag = 0;
isamc_i.clientData = &s;
isamc_i.read_item = sort_term_code_read;
-
+
isamb_merge(sf->u.isamb, &sf->isam_p, &isamc_i);
sf->no_deleted++;
}
len = strlen(wrbuf_buf(wrbuf));
if (len > SORT_IDX_ENTRYSIZE)
len = SORT_IDX_ENTRYSIZE;
-
+
memcpy(si->entry_buf, wrbuf_buf(wrbuf), len);
if (len < SORT_IDX_ENTRYSIZE-len)
memset(si->entry_buf+len, 0, SORT_IDX_ENTRYSIZE-len);
s.insert_flag = 1;
isamc_i.clientData = &s;
isamc_i.read_item = sort_term_code_read;
-
+
isamb_merge(sf->u.isamb, &sf->isam_p, &isamc_i);
sf->no_inserted++;
}
s.insert_flag = 1;
isamc_i.clientData = &s;
isamc_i.read_item = sort_term_code_read;
-
+
isamb_merge(sf->u.isamb, &sf->isam_p, &isamc_i);
sf->no_inserted++;
}
/*
* Local variables:
* c-basic-offset: 4
+ * c-file-style: "Stroustrup"
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab