1 /* $Id: bset.h,v 1.7 2006-05-10 08:13:18 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>
30 typedef unsigned short BSetWord;
31 typedef BSetWord *BSet;
33 typedef struct BSetHandle_ {
34 unsigned size; /* size of set in members */
35 unsigned wsize; /* size of individual set (in BSetWord)*/
36 unsigned offset; /* offset in current set block */
37 unsigned chunk; /* chunk, i.e. size of each block */
38 struct BSetHandle_ *setchain;
42 BSetHandle *mk_BSetHandle (int size, int chunk);
43 void rm_BSetHandle (BSetHandle **shp);
44 int inf_BSetHandle (BSetHandle *sh, long *used, long *alloc);
45 BSet cp_BSet (BSetHandle *sh, BSet dst, BSet src);
46 void add_BSet (BSetHandle *sh, BSet dst, unsigned member);
47 void union_BSet (BSetHandle *sh, BSet dst, BSet src);
48 BSet mk_BSet (BSetHandle **shp);
49 void rm_BSet (BSetHandle **shp);
50 void res_BSet (BSetHandle *sh, BSet dst);
51 void com_BSet (BSetHandle *sh, BSet dst);
52 void pr_BSet (BSetHandle *sh, BSet src);
53 unsigned test_BSet (BSetHandle *sh, BSet src, unsigned member);
54 int trav_BSet (BSetHandle *sh, BSet src, unsigned member);
55 int travi_BSet (BSetHandle *sh, BSet src, unsigned member);
56 unsigned hash_BSet (BSetHandle *sh, BSet src);
57 int eq_BSet (BSetHandle *sh, BSet dst, BSet src);
58 void pr_charBSet (BSetHandle *sh, BSet src, void (*f)(int));
66 * indent-tabs-mode: nil
68 * vim: shiftwidth=4 tabstop=8 expandtab