1 /* $Id: dict.h,v 1.7 2006-08-29 09:27:56 adam Exp $
2 Copyright (C) 1995-2006
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 this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 \brief Zebra dictionary
26 The dictionary is a hash that maps a string to a value.
27 The value is opaque and is defined as a sequence of bytes
28 with a length in the range 0 to 255.
34 #include <yaz/yconfig.h>
35 #include <idzebra/bfile.h>
40 * \brief Dictionary type
42 * Most dictionary functions operatate on a Dict type (object).
44 typedef struct Dict_struct *Dict;
46 typedef unsigned Dict_ptr;
49 Dict dict_open (BFiles bfs, const char *name, int cache, int rw,
50 int compact_flag, int page_size);
53 int dict_close (Dict dict);
56 int dict_insert (Dict dict, const char *p, int userlen, void *userinfo);
59 int dict_delete (Dict dict, const char *p);
62 int dict_delete_subtree (Dict dict, const char *p, void *client,
63 int (*f)(const char *info, void *client));
65 char *dict_lookup (Dict dict, const char *p);
68 int dict_lookup_ec (Dict dict, char *p, int range, int (*f)(char *name));
71 int dict_lookup_grep (Dict dict, const char *p, int range, void *client,
72 int *max_pos, int init_pos,
73 int (*f)(char *name, const char *info, void *client));
76 int dict_scan (Dict dict, char *str,
77 int *before, int *after, void *client,
78 int (*f)(char *name, const char *info, int pos, void *client));
81 void dict_grep_cmap (Dict dict, void *vp,
82 const char **(*cmap)(void *vp,
83 const char **from, int len));
86 int dict_copy_compact (BFiles bfs, const char *from, const char *to);
94 * indent-tabs-mode: nil
96 * vim: shiftwidth=4 tabstop=8 expandtab