1 /* This file is part of the Zebra server.
2 Copyright (C) 1994-2010 Index Data
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
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
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
23 #include <yaz/yconfig.h>
27 typedef unsigned short BSetWord;
28 typedef BSetWord *BSet;
30 typedef struct BSetHandle_ {
31 unsigned size; /* size of set in members */
32 unsigned wsize; /* size of individual set (in BSetWord)*/
33 unsigned offset; /* offset in current set block */
34 unsigned chunk; /* chunk, i.e. size of each block */
35 struct BSetHandle_ *setchain;
39 BSetHandle *mk_BSetHandle (int size, int chunk);
40 void rm_BSetHandle (BSetHandle **shp);
41 int inf_BSetHandle (BSetHandle *sh, long *used, long *alloc);
42 BSet cp_BSet (BSetHandle *sh, BSet dst, BSet src);
43 void add_BSet (BSetHandle *sh, BSet dst, unsigned member);
44 void union_BSet (BSetHandle *sh, BSet dst, BSet src);
45 BSet mk_BSet (BSetHandle **shp);
46 void rm_BSet (BSetHandle **shp);
47 void res_BSet (BSetHandle *sh, BSet dst);
48 void com_BSet (BSetHandle *sh, BSet dst);
49 void pr_BSet (BSetHandle *sh, BSet src);
50 unsigned test_BSet (BSetHandle *sh, BSet src, unsigned member);
51 int trav_BSet (BSetHandle *sh, BSet src, unsigned member);
52 int travi_BSet (BSetHandle *sh, BSet src, unsigned member);
53 unsigned hash_BSet (BSetHandle *sh, BSet src);
54 int eq_BSet (BSetHandle *sh, BSet dst, BSet src);
55 void pr_charBSet (BSetHandle *sh, BSet src, void (*f)(int));
63 * c-file-style: "Stroustrup"
64 * indent-tabs-mode: nil
66 * vim: shiftwidth=4 tabstop=8 expandtab