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]
/
index
/
reckeys.c
diff --git
a/index/reckeys.c
b/index/reckeys.c
index
652b729
..
39a3f4a
100644
(file)
--- a/
index/reckeys.c
+++ b/
index/reckeys.c
@@
-1,8
+1,5
@@
-/* $Id: reckeys.c,v 1.10 2006-11-21 22:17:49 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,9
@@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@
-45,10
+45,11
@@
struct zebra_rec_keys_t_ {
void *encode_handle;
void *decode_handle;
char owner_of_buffer;
void *encode_handle;
void *decode_handle;
char owner_of_buffer;
+ zint custom_record_id;
NMEM nmem;
size_t hash_size;
NMEM nmem;
size_t hash_size;
- struct zebra_rec_key_entry **entries;
+ struct zebra_rec_key_entry **entries;
};
};
@@
-95,6
+96,7
@@
zebra_rec_keys_t zebra_rec_keys_open(void)
p->encode_handle = iscz1_start();
p->decode_handle = iscz1_start();
p->encode_handle = iscz1_start();
p->decode_handle = iscz1_start();
+ p->custom_record_id = 0;
p->nmem = nmem_create();
p->hash_size = 32767;
p->entries = 0;
p->nmem = nmem_create();
p->hash_size = 32767;
p->entries = 0;
@@
-192,6
+194,10
@@
void zebra_rec_keys_write(zebra_rec_keys_t keys,
assert(keys->owner_of_buffer);
assert(keys->owner_of_buffer);
+ if (key->mem[1]) /* record_id custom */
+ {
+ keys->custom_record_id = key->mem[1];
+ }
#if 1
if (!zebra_rec_keys_add_hash(keys, str, slen, key))
{
#if 1
if (!zebra_rec_keys_add_hash(keys, str, slen, key))
{
@@
-229,13
+235,14
@@
void zebra_rec_keys_reset(zebra_rec_keys_t keys)
iscz1_reset(keys->encode_handle);
init_hash(keys);
iscz1_reset(keys->encode_handle);
init_hash(keys);
-
}
int zebra_rec_keys_rewind(zebra_rec_keys_t keys)
{
assert(keys);
iscz1_reset(keys->decode_handle);
}
int zebra_rec_keys_rewind(zebra_rec_keys_t keys)
{
assert(keys);
iscz1_reset(keys->decode_handle);
+
+
keys->fetch_offset = 0;
if (keys->buf_used == 0)
return 0;
keys->fetch_offset = 0;
if (keys->buf_used == 0)
return 0;
@@
-275,9
+282,16
@@
int zebra_rec_keys_read(zebra_rec_keys_t keys,
}
return 1;
}
}
return 1;
}
+
+zint zebra_rec_keys_get_custom_record_id(zebra_rec_keys_t keys)
+{
+ return keys->custom_record_id;
+}
+
/*
* 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