IDZEBRA 2.2.8
dict.h
Go to the documentation of this file.
1/* This file is part of the Zebra server.
2 Copyright (C) Index Data
3
4Zebra is free software; you can redistribute it and/or modify it under
5the terms of the GNU General Public License as published by the Free
6Software Foundation; either version 2, or (at your option) any later
7version.
8
9Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
10WARRANTY; without even the implied warranty of MERCHANTABILITY or
11FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program; if not, write to the Free Software
16Foundation, 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
34YAZ_BEGIN_CDECL
35
41typedef struct Dict_struct *Dict;
42
52YAZ_EXPORT
53Dict dict_open(BFiles bfs, const char *name, int cache, int rw,
54 int compact_flag, int page_size);
55
61YAZ_EXPORT
63
74YAZ_EXPORT
75int dict_insert(Dict dict, const char *p, int userlen, void *userinfo);
76
84YAZ_EXPORT
85int dict_delete(Dict dict, const char *p);
86
93YAZ_EXPORT
94char *dict_lookup(Dict dict, const char *p);
95
107YAZ_EXPORT
108int dict_delete_subtree(Dict dict, const char *p, void *client,
109 int (*f)(const char *info, void *client));
110
111
122YAZ_EXPORT
123int dict_lookup_ec(Dict dict, char *p, int range, int (*f)(char *name));
124
141YAZ_EXPORT
142int 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
160YAZ_EXPORT
161int 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
174YAZ_EXPORT
175void dict_grep_cmap(Dict dict, void *vp,
176 const char **(*cmap)(void *vp,
177 const char **from, int len));
178
184YAZ_EXPORT
185int dict_copy_compact(BFiles bfs, const char *from, const char *to);
186
190YAZ_EXPORT
191void dict_clean(Dict dict);
192
197YAZ_EXPORT
199
204YAZ_EXPORT
206
211YAZ_EXPORT
213
214YAZ_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
Zebra Block File Layer.
static void init_pos(struct DFA_parse *parse_info)
Definition dfa.c:627
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_delete(Dict dict, const char *p)
deletes item from dictionary
Definition delete.c:260
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
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
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
zint dict_get_no_insert(Dict dict)
get number of insert operations, since dict_open
Definition open.c:128
zint dict_get_no_lookup(Dict dict)
get number of lookup operations, since dict_open
Definition open.c:123
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_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_insert(Dict dict, const char *p, int userlen, void *userinfo)
insert item into dictionary
Definition insert.c:439
int dict_copy_compact(BFiles bfs, const char *from, const char *to)
copies one dictionary to another
Definition dcompact.c:90
char * dict_lookup(Dict dict, const char *p)
lookup item in dictionary
Definition lookup.c:100
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
int dict_close(Dict dict)
closes dictionary
Definition close.c:32
static Dict dict
Definition dicttest.c:35
long zint
Zebra integer.
Definition util.h:66