IDZEBRA  2.1.2
bset.h
Go to the documentation of this file.
1 /* This file is part of the Zebra server.
2  Copyright (C) Index Data
3 
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
7 version.
8 
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
12 for more details.
13 
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
17 
18 */
19 
20 #ifndef BSET_H
21 #define BSET_H
22 
23 #include <yaz/yconfig.h>
24 
25 YAZ_BEGIN_CDECL
26 
27 typedef unsigned short BSetWord;
28 typedef BSetWord *BSet;
29 
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 */
37 } BSetHandle;
38 
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));
56 
57 YAZ_END_CDECL
58 
59 #endif
60 /*
61  * Local variables:
62  * c-basic-offset: 4
63  * c-file-style: "Stroustrup"
64  * indent-tabs-mode: nil
65  * End:
66  * vim: shiftwidth=4 tabstop=8 expandtab
67  */
68 
unsigned hash_BSet(BSetHandle *sh, BSet src)
Definition: bset.c:151
void pr_BSet(BSetHandle *sh, BSet src)
Definition: bset.c:238
BSetWord setarray[1]
Definition: bset.h:36
struct BSetHandle_ BSetHandle
unsigned short BSetWord
Definition: bset.h:27
struct BSetHandle_ * setchain
Definition: bset.h:35
void res_BSet(BSetHandle *sh, BSet dst)
Definition: bset.c:135
void rm_BSet(BSetHandle **shp)
unsigned wsize
Definition: bset.h:32
void union_BSet(BSetHandle *sh, BSet dst, BSet src)
Definition: bset.c:141
void pr_charBSet(BSetHandle *sh, BSet src, void(*f)(int))
Definition: bset.c:248
int travi_BSet(BSetHandle *sh, BSet src, unsigned member)
Definition: bset.c:210
int trav_BSet(BSetHandle *sh, BSet src, unsigned member)
Definition: bset.c:183
unsigned offset
Definition: bset.h:33
unsigned chunk
Definition: bset.h:34
unsigned test_BSet(BSetHandle *sh, BSet src, unsigned member)
Definition: bset.c:118
BSetWord * BSet
Definition: bset.h:28
BSet mk_BSet(BSetHandle **shp)
Definition: bset.c:86
BSet cp_BSet(BSetHandle *sh, BSet dst, BSet src)
Definition: bset.c:126
void com_BSet(BSetHandle *sh, BSet dst)
Definition: bset.c:162
void rm_BSetHandle(BSetHandle **shp)
Definition: bset.c:55
int inf_BSetHandle(BSetHandle *sh, long *used, long *alloc)
Definition: bset.c:70
void add_BSet(BSetHandle *sh, BSet dst, unsigned member)
Definition: bset.c:110
BSetHandle * mk_BSetHandle(int size, int chunk)
Definition: bset.c:37
int eq_BSet(BSetHandle *sh, BSet dst, BSet src)
Definition: bset.c:171
unsigned size
Definition: bset.h:31