IDZEBRA  2.1.2
dict.h
Go to the documentation of this file.
1 /* This file is part of the Zebra server.
2  Copyright (C) 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 
28 #ifndef DICT_H
29 #define DICT_H
30 
31 #include <yaz/yconfig.h>
32 #include <idzebra/bfile.h>
33 
34 YAZ_BEGIN_CDECL
35 
41 typedef struct Dict_struct *Dict;
42 
52 YAZ_EXPORT
53 Dict dict_open(BFiles bfs, const char *name, int cache, int rw,
54  int compact_flag, int page_size);
55 
61 YAZ_EXPORT
62 int dict_close(Dict dict);
63 
74 YAZ_EXPORT
75 int dict_insert(Dict dict, const char *p, int userlen, void *userinfo);
76 
84 YAZ_EXPORT
85 int dict_delete(Dict dict, const char *p);
86 
93 YAZ_EXPORT
94 char *dict_lookup(Dict dict, const char *p);
95 
107 YAZ_EXPORT
108 int dict_delete_subtree(Dict dict, const char *p, void *client,
109  int (*f)(const char *info, void *client));
110 
111 
122 YAZ_EXPORT
123 int dict_lookup_ec(Dict dict, char *p, int range, int (*f)(char *name));
124 
141 YAZ_EXPORT
142 int dict_lookup_grep(Dict dict, const char *p, int range, void *client,
143  int *max_pos, int init_pos,
144  int (*f)(char *name, const char *info, void *client));
145 
160 YAZ_EXPORT
161 int dict_scan(Dict dict, char *str,
162  int *before, int *after, void *client,
163  int (*f)(char *name, const char *info, int pos, void *client));
164 
165 
174 YAZ_EXPORT
175 void dict_grep_cmap(Dict dict, void *vp,
176  const char **(*cmap)(void *vp,
177  const char **from, int len));
178 
184 YAZ_EXPORT
185 int dict_copy_compact(BFiles bfs, const char *from, const char *to);
186 
190 YAZ_EXPORT
191 void dict_clean(Dict dict);
192 
197 YAZ_EXPORT
198 zint dict_get_no_lookup(Dict dict);
199 
204 YAZ_EXPORT
205 zint dict_get_no_insert(Dict dict);
206 
211 YAZ_EXPORT
212 zint dict_get_no_split(Dict dict);
213 
214 YAZ_END_CDECL
215 
216 #endif
217 /*
218  * Local variables:
219  * c-basic-offset: 4
220  * c-file-style: "Stroustrup"
221  * indent-tabs-mode: nil
222  * End:
223  * vim: shiftwidth=4 tabstop=8 expandtab
224  */
225 
void dict_grep_cmap(Dict dict, void *vp, const char **(*cmap)(void *vp, const char **from, int len))
install character mapping handler for dict_lookup_grep
Definition: lookgrep.c:445
int dict_lookup_ec(Dict dict, char *p, int range, int(*f)(char *name))
lookup item(s) in dictionary with error correction
Definition: lookupec.c:149
Zebra Block File Layer.
struct Dict_struct * Dict
Dictionary handle.
Definition: dict.h:41
zint dict_get_no_split(Dict dict)
get number of page split operations, since dict_open
Definition: open.c:133
int dict_close(Dict dict)
closes dictionary
Definition: close.c:32
int dict_insert(Dict dict, const char *p, int userlen, void *userinfo)
insert item into dictionary
Definition: insert.c:438
zint dict_get_no_lookup(Dict dict)
get number of lookup operations, since dict_open
Definition: open.c:123
static Dict dict
Definition: dicttest.c:34
int dict_delete_subtree(Dict dict, const char *p, void *client, int(*f)(const char *info, void *client))
delete items with a given prefix from dictionary
Definition: delete.c:266
int dict_scan(Dict dict, char *str, int *before, int *after, void *client, int(*f)(char *name, const char *info, int pos, void *client))
dictionary scan
Definition: scan.c:242
char * dict_lookup(Dict dict, const char *p)
lookup item in dictionary
Definition: lookup.c:100
zint dict_get_no_insert(Dict dict)
get number of insert operations, since dict_open
Definition: open.c:128
int rw
Definition: dict-p.h:73
static void init_pos(struct DFA_parse *parse_info)
Definition: dfa.c:625
long zint
Zebra integer.
Definition: util.h:66
Dict dict_open(BFiles bfs, const char *name, int cache, int rw, int compact_flag, int page_size)
open dictionary
Definition: open.c:50
void dict_clean(Dict dict)
reset Dictionary (makes it empty)
Definition: open.c:31
int dict_lookup_grep(Dict dict, const char *p, int range, void *client, int *max_pos, int init_pos, int(*f)(char *name, const char *info, void *client))
regular expression search with error correction
Definition: lookgrep.c:374
int dict_copy_compact(BFiles bfs, const char *from, const char *to)
copies one dictionary to another
Definition: dcompact.c:90
int dict_delete(Dict dict, const char *p)
deletes item from dictionary
Definition: delete.c:260