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
Bug #529. On Unix, combine pthreed locks with file locking because file
[idzebra-moved-to-github.git]
/
index
/
reckeys.c
diff --git
a/index/reckeys.c
b/index/reckeys.c
index
346fd28
..
649ec1c
100644
(file)
--- a/
index/reckeys.c
+++ b/
index/reckeys.c
@@
-1,5
+1,5
@@
-/* $Id: reckeys.c,v 1.3 2005-11-09 11:51:29 adam Exp $
- Copyright (C) 1995-2005
+/* $Id: reckeys.c,v 1.6 2006-06-07 10:14:41 adam Exp $
+ Copyright (C) 1995-2006
Index Data ApS
This file is part of the Zebra server.
Index Data ApS
This file is part of the Zebra server.
@@
-53,12
+53,16
@@
struct zebra_rec_keys_t_ {
struct zebra_rec_key_entry **zebra_rec_keys_mk_hash(zebra_rec_keys_t p,
const char *buf,
struct zebra_rec_key_entry **zebra_rec_keys_mk_hash(zebra_rec_keys_t p,
const char *buf,
- size_t len)
+ size_t len,
+ const struct it_key *key)
{
unsigned h = 0;
size_t i;
{
unsigned h = 0;
size_t i;
+ int j;
for (i = 0; i<len; i++)
h = h * 65509 + buf[i];
for (i = 0; i<len; i++)
h = h * 65509 + buf[i];
+ for (j = 0; j<key->len; j++)
+ h = h * 65509 + CAST_ZINT_TO_INT(key->mem[j]);
return &p->entries[h % (unsigned) p->hash_size];
}
return &p->entries[h % (unsigned) p->hash_size];
}
@@
-87,7
+91,7
@@
zebra_rec_keys_t zebra_rec_keys_open()
p->decode_handle = iscz1_start();
p->nmem = nmem_create();
p->decode_handle = iscz1_start();
p->nmem = nmem_create();
- p->hash_size = 127;
+ p->hash_size = 1023;
p->entries = 0;
init_hash(p);
p->entries = 0;
init_hash(p);
@@
-148,7
+152,8
@@
int zebra_rec_keys_add_hash(zebra_rec_keys_t keys,
const char *str, size_t slen,
const struct it_key *key)
{
const char *str, size_t slen,
const struct it_key *key)
{
- struct zebra_rec_key_entry **kep = zebra_rec_keys_mk_hash(keys, str, slen);
+ struct zebra_rec_key_entry **kep = zebra_rec_keys_mk_hash(keys,
+ str, slen, key);
while (*kep)
{
struct zebra_rec_key_entry *e = *kep;
while (*kep)
{
struct zebra_rec_key_entry *e = *kep;
@@
-251,3
+256,11
@@
int zebra_rec_keys_read(zebra_rec_keys_t keys,
}
return 1;
}
}
return 1;
}
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
+