1 /* $Id: dict.h,v 1.3 2005-01-15 19:38:24 adam Exp $
2 Copyright (C) 1995-2005
5 This file is part of the Zebra server.
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
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
17 You should have received a copy of the GNU General Public License
18 along with Zebra; see the file LICENSE.zebra. If not, write to the
19 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
26 #include <yaz/yconfig.h>
27 #include <idzebra/bfile.h>
31 typedef struct Dict_struct *Dict;
33 typedef unsigned Dict_ptr;
34 typedef unsigned char Dict_char;
37 Dict dict_open (BFiles bfs, const char *name, int cache, int rw,
38 int compact_flag, int page_size);
41 int dict_close (Dict dict);
44 int dict_insert (Dict dict, const char *p, int userlen, void *userinfo);
47 int dict_delete (Dict dict, const char *p);
50 int dict_delete_subtree (Dict dict, const char *p, void *client,
51 int (*f)(const char *info, void *client));
53 char *dict_lookup (Dict dict, const char *p);
56 int dict_lookup_ec (Dict dict, char *p, int range, int (*f)(char *name));
59 int dict_lookup_grep (Dict dict, const char *p, int range, void *client,
60 int *max_pos, int init_pos,
61 int (*f)(char *name, const char *info, void *client));
64 int dict_strcmp (const Dict_char *s1, const Dict_char *s2);
67 int dict_strncmp (const Dict_char *s1, const Dict_char *s2, size_t n);
70 int dict_strlen (const Dict_char *s);
73 int dict_scan (Dict dict, char *str,
74 int *before, int *after, void *client,
75 int (*f)(char *name, const char *info, int pos, void *client));
78 void dict_grep_cmap (Dict dict, void *vp,
79 const char **(*cmap)(void *vp,
80 const char **from, int len));
83 int dict_copy_compact (BFiles bfs, const char *from, const char *to);