]> mj.ucw.cz Git - eval.git/blob - sherlock/attrset.h
Adapted to reflect changes in libucw.
[eval.git] / sherlock / attrset.h
1 /*
2  *      Sherlock Library -- Sets of object attributes
3  *
4  *      (c) 2006 Martin Mares <mj@ucw.cz>
5  *
6  *      This software may be freely distributed and used according to the terms
7  *      of the GNU Lesser General Public License.
8  */
9
10 #ifndef _SHERLOCK_ATTRSET_H
11 #define _SHERLOCK_ATTRSET_H
12
13 #include "ucw/bitarray.h"
14 #include "sherlock/object.h"
15
16 COMPILE_ASSERT(son_value, OBJ_ATTR_SON == 256);
17 #define ATTR_SET_SIZE 512
18
19 struct attr_set {
20   BIT_ARRAY(a, ATTR_SET_SIZE);
21 };
22
23 static inline uns
24 attr_set_match(struct attr_set *set, struct oattr *attr)
25 {
26   return bit_array_isset(set->a, attr->attr);
27 }
28
29 /* Configuration helpers */
30
31 extern struct cf_section attr_set_cf, attr_set_cf_sub;
32
33 struct clist;
34 void attr_set_commit(struct attr_set *set, struct clist *list);
35
36 #endif