IDZEBRA 2.2.8
bset.h
Go to the documentation of this file.
1/* This file is part of the Zebra server.
2 Copyright (C) Index Data
3
4Zebra is free software; you can redistribute it and/or modify it under
5the terms of the GNU General Public License as published by the Free
6Software Foundation; either version 2, or (at your option) any later
7version.
8
9Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
10WARRANTY; without even the implied warranty of MERCHANTABILITY or
11FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program; if not, write to the Free Software
16Foundation, 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
25YAZ_BEGIN_CDECL
26
27typedef unsigned short BSetWord;
28typedef BSetWord *BSet;
29
30typedef 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
40void rm_BSetHandle (BSetHandle **shp);
41int inf_BSetHandle (BSetHandle *sh, long *used, long *alloc);
42BSet cp_BSet (BSetHandle *sh, BSet dst, BSet src);
43void add_BSet (BSetHandle *sh, BSet dst, unsigned member);
44void union_BSet (BSetHandle *sh, BSet dst, BSet src);
45BSet mk_BSet (BSetHandle **shp);
46void rm_BSet (BSetHandle **shp);
47void res_BSet (BSetHandle *sh, BSet dst);
48void com_BSet (BSetHandle *sh, BSet dst);
49void pr_BSet (BSetHandle *sh, BSet src);
50unsigned test_BSet (BSetHandle *sh, BSet src, unsigned member);
51int trav_BSet (BSetHandle *sh, BSet src, unsigned member);
52int travi_BSet (BSetHandle *sh, BSet src, unsigned member);
53unsigned hash_BSet (BSetHandle *sh, BSet src);
54int eq_BSet (BSetHandle *sh, BSet dst, BSet src);
55void pr_charBSet (BSetHandle *sh, BSet src, void (*f)(int));
56
57YAZ_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
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
BSetHandle * mk_BSetHandle(int size, int chunk)
Definition bset.c:37
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