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