Split it_key stuff into it_key.c. For indexing, sort key chunks in a separate
[idzebra-moved-to-github.git] / include / it_key.h
1 /* $Id: it_key.h,v 1.1 2006-11-21 14:32:38 adam Exp $
2    Copyright (C) 1995-2006
3    Index Data ApS
4
5 This file is part of the Zebra server.
6
7 Zebra is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
10 version.
11
12 Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15 for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20
21 */
22
23 #ifndef ZEBRA_IT_KEY_H
24 #define ZEBRA_IT_KEY_H
25
26 #include <idzebra/version.h>
27 #include <idzebra/util.h>
28
29 YAZ_BEGIN_CDECL
30
31 #define IT_MAX_WORD 256
32
33 #define IT_KEY_LEVEL_MAX 5
34 struct it_key {
35     int  len;
36     zint mem[IT_KEY_LEVEL_MAX];
37 };
38
39 void *iscz1_start(void);
40 void iscz1_reset(void *vp);
41 void iscz1_stop(void *p);
42 void iscz1_decode(void *vp, char **dst, const char **src);
43 void iscz1_encode(void *vp, char **dst, const char **src);
44
45 int key_compare(const void *p1, const void *p2);
46 void key_init(struct it_key *k);
47 zint key_get_seq(const void *p);
48 zint key_get_segment(const void *p);
49 int key_compare_it(const void *p1, const void *p2);
50 int key_qsort_compare(const void *p1, const void *p2);
51 char *key_print_it(const void *p, char *buf);
52 void key_logdump(int mask, const void *p);
53 void key_logdump_txt(int logmask, const void *p, const char *txt);
54
55 int key_SU_decode(int *ch, const unsigned char *out);
56 int key_SU_encode(int ch, char *out);
57
58 YAZ_END_CDECL
59
60 #endif
61 /*
62  * Local variables:
63  * c-basic-offset: 4
64  * indent-tabs-mode: nil
65  * End:
66  * vim: shiftwidth=4 tabstop=8 expandtab
67  */
68