IDZEBRA  2.2.7
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 */
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 
BSetHandle * mk_BSetHandle(int size, int chunk)
Definition: bset.c:37
void pr_BSet(BSetHandle *sh, BSet src)
Definition: bset.c:238
int trav_BSet(BSetHandle *sh, BSet src, unsigned member)
Definition: bset.c:183
void add_BSet(BSetHandle *sh, BSet dst, unsigned member)
Definition: bset.c:110
unsigned short BSetWord
Definition: bset.h:27
void union_BSet(BSetHandle *sh, BSet dst, BSet src)
Definition: bset.c:141
unsigned hash_BSet(BSetHandle *sh, BSet src)
Definition: bset.c:151
BSet cp_BSet(BSetHandle *sh, BSet dst, BSet src)
Definition: bset.c:126
void rm_BSet(BSetHandle **shp)
struct BSetHandle_ BSetHandle
void pr_charBSet(BSetHandle *sh, BSet src, void(*f)(int))
Definition: bset.c:248
unsigned test_BSet(BSetHandle *sh, BSet src, unsigned member)
Definition: bset.c:118
void res_BSet(BSetHandle *sh, BSet dst)
Definition: bset.c:135
BSet mk_BSet(BSetHandle **shp)
Definition: bset.c:86
void rm_BSetHandle(BSetHandle **shp)
Definition: bset.c:55
int inf_BSetHandle(BSetHandle *sh, long *used, long *alloc)
Definition: bset.c:70
BSetWord * BSet
Definition: bset.h:28
int eq_BSet(BSetHandle *sh, BSet dst, BSet src)
Definition: bset.c:171
int travi_BSet(BSetHandle *sh, BSet src, unsigned member)
Definition: bset.c:210
void com_BSet(BSetHandle *sh, BSet dst)
Definition: bset.c:162
unsigned chunk
Definition: bset.h:34
unsigned offset
Definition: bset.h:33
unsigned wsize
Definition: bset.h:32
unsigned size
Definition: bset.h:31
struct BSetHandle_ * setchain
Definition: bset.h:35
BSetWord setarray[1]
Definition: bset.h:36