ICU term lists are handled for search.
[idzebra-moved-to-github.git] / include / zebramap.h
1 /* $Id: zebramap.h,v 1.28 2007-12-07 14:09:09 adam Exp $
2    Copyright (C) 1995-2007
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 ZEBRAMAP_H
24 #define ZEBRAMAP_H
25
26 #include <yaz/proto.h>
27 #include <idzebra/res.h>
28
29 YAZ_BEGIN_CDECL
30
31 typedef struct zebra_maps_s *zebra_maps_t;
32 typedef struct zebra_map *zebra_map_t;
33
34 YAZ_EXPORT
35 zebra_maps_t zebra_maps_open(Res res, const char *base_path,
36                           const char *profile_path);
37 YAZ_EXPORT
38 ZEBRA_RES zebra_maps_read_file(zebra_maps_t zms, const char *fname);
39
40 YAZ_EXPORT
41 void zebra_maps_close(zebra_maps_t zm);
42
43 YAZ_EXPORT
44 const char **zebra_maps_input(zebra_map_t zm,
45                               const char **from, int len, int first);
46
47 YAZ_EXPORT
48 const char **zebra_maps_search(zebra_map_t zm,
49                                const char **from, int len, int *q_map_match);
50
51 YAZ_EXPORT
52 const char *zebra_maps_output(zebra_map_t zm, const char **from);
53
54 YAZ_EXPORT
55 int zebra_maps_attr(zebra_maps_t zms, Z_AttributesPlusTerm *zapt,
56                     const char **reg_id, char **search_type, char *rank_type,
57                     int *complete_flag, int *sort_flag);
58
59 YAZ_EXPORT
60 int zebra_maps_sort(zebra_maps_t zms, Z_SortAttributes *sortAttributes,
61                     int *numerical);
62
63 YAZ_EXPORT
64 int zebra_maps_is_complete(zebra_map_t zm);
65
66 YAZ_EXPORT
67 int zebra_maps_is_sort(zebra_map_t zm);
68
69 YAZ_EXPORT
70 int zebra_maps_is_index(zebra_map_t zm);
71
72 YAZ_EXPORT
73 int zebra_maps_is_staticrank(zebra_map_t zm);
74
75 YAZ_EXPORT
76 int zebra_maps_is_alwaysmatches(zebra_map_t zm);
77
78 YAZ_EXPORT
79 int zebra_maps_is_positioned(zebra_map_t zm);
80
81 YAZ_EXPORT
82 int zebra_maps_is_icu(zebra_map_t zm);
83
84 YAZ_EXPORT
85 int zebra_maps_is_first_in_field(zebra_map_t zm);
86
87 YAZ_EXPORT
88 WRBUF zebra_replace(zebra_map_t zm, const char *ex_list,
89                     const char *input_str, int input_len);
90
91 YAZ_EXPORT
92 zebra_map_t zebra_map_get(zebra_maps_t zms, const char *id);
93
94 YAZ_EXPORT
95 zebra_map_t zebra_map_get_or_add(zebra_maps_t zms, const char *id);
96
97 YAZ_EXPORT
98 int zebra_map_tokenize_start(zebra_map_t zm,
99                              const char *buf, size_t len);
100
101 YAZ_EXPORT
102 int zebra_map_tokenize_next(zebra_map_t zm,
103                             const char **result_buf, size_t *result_len);
104
105 YAZ_END_CDECL
106
107 #endif
108 /*
109  * Local variables:
110  * c-basic-offset: 4
111  * indent-tabs-mode: nil
112  * End:
113  * vim: shiftwidth=4 tabstop=8 expandtab
114  */
115