Put local variables footer in all c, h files.
[idzebra-moved-to-github.git] / include / bset.h
1 /* $Id: bset.h,v 1.7 2006-05-10 08:13:18 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 BSET_H
24 #define BSET_H
25
26 #include <yaz/yconfig.h>
27
28 YAZ_BEGIN_CDECL
29
30 typedef unsigned short BSetWord;
31 typedef BSetWord *BSet;
32
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;
39     BSetWord setarray[1];
40 } BSetHandle;
41
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));
59
60 YAZ_END_CDECL
61
62 #endif
63 /*
64  * Local variables:
65  * c-basic-offset: 4
66  * indent-tabs-mode: nil
67  * End:
68  * vim: shiftwidth=4 tabstop=8 expandtab
69  */
70