Bump year. Change Aps->ApS
[idzebra-moved-to-github.git] / include / idzebra / dict.h
1 /* $Id: dict.h,v 1.3 2005-01-15 19:38:24 adam Exp $
2    Copyright (C) 1995-2005
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 Zebra; see the file LICENSE.zebra.  If not, write to the
19 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
20 02111-1307, USA.
21 */
22
23 #ifndef DICT_H
24 #define DICT_H
25
26 #include <yaz/yconfig.h>
27 #include <idzebra/bfile.h>
28
29 YAZ_BEGIN_CDECL
30
31 typedef struct Dict_struct *Dict;
32
33 typedef unsigned Dict_ptr;
34 typedef unsigned char Dict_char;
35
36 YAZ_EXPORT 
37 Dict dict_open (BFiles bfs, const char *name, int cache, int rw,
38                       int compact_flag, int page_size);
39
40 YAZ_EXPORT
41 int dict_close (Dict dict);
42
43 YAZ_EXPORT
44 int dict_insert (Dict dict, const char *p, int userlen, void *userinfo);
45
46 YAZ_EXPORT
47 int dict_delete (Dict dict, const char *p);
48
49 YAZ_EXPORT
50 int dict_delete_subtree (Dict dict, const char *p, void *client,
51                                 int (*f)(const char *info, void *client));
52 YAZ_EXPORT
53 char *dict_lookup (Dict dict, const char *p);
54
55 YAZ_EXPORT
56 int dict_lookup_ec (Dict dict, char *p, int range, int (*f)(char *name));
57
58 YAZ_EXPORT
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));
62
63 YAZ_EXPORT
64 int dict_strcmp (const Dict_char *s1, const Dict_char *s2);
65
66 YAZ_EXPORT
67 int dict_strncmp (const Dict_char *s1, const Dict_char *s2, size_t n);
68
69 YAZ_EXPORT
70 int dict_strlen (const Dict_char *s);
71
72 YAZ_EXPORT
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));
76
77 YAZ_EXPORT 
78 void dict_grep_cmap (Dict dict, void *vp,
79                      const char **(*cmap)(void *vp,
80                                           const char **from, int len));
81
82 YAZ_EXPORT
83 int dict_copy_compact (BFiles bfs, const char *from, const char *to);
84
85 YAZ_END_CDECL
86    
87 #endif