1 /* $Id: bset.h,v 1.4 2002-08-02 19:26:55 adam Exp $
2 Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
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
31 typedef unsigned short BSetWord;
32 typedef BSetWord *BSet;
34 typedef struct BSetHandle_ {
35 unsigned size; /* size of set in members */
36 unsigned wsize; /* size of individual set (in BSetWord)*/
37 unsigned offset; /* offset in current set block */
38 unsigned chunk; /* chunk, i.e. size of each block */
39 struct BSetHandle_ *setchain;
43 BSetHandle *mk_BSetHandle (int size, int chunk);
44 void rm_BSetHandle (BSetHandle **shp);
45 int inf_BSetHandle (BSetHandle *sh, long *used, long *alloc);
46 BSet cp_BSet (BSetHandle *sh, BSet dst, BSet src);
47 void add_BSet (BSetHandle *sh, BSet dst, unsigned member);
48 void union_BSet (BSetHandle *sh, BSet dst, BSet src);
49 BSet mk_BSet (BSetHandle **shp);
50 void rm_BSet (BSetHandle **shp);
51 void res_BSet (BSetHandle *sh, BSet dst);
52 void com_BSet (BSetHandle *sh, BSet dst);
53 void pr_BSet (BSetHandle *sh, BSet src);
54 unsigned test_BSet (BSetHandle *sh, BSet src, unsigned member);
55 int trav_BSet (BSetHandle *sh, BSet src, unsigned member);
56 int travi_BSet (BSetHandle *sh, BSet src, unsigned member);
57 unsigned hash_BSet (BSetHandle *sh, BSet src);
58 int eq_BSet (BSetHandle *sh, BSet dst, BSet src);
59 void pr_charBSet (BSetHandle *sh, BSet src, void (*f)(int));