1 /*-----------------------------------------------------------------------
2 
3 File  : clb_properties.h
4 
5 Author: Stephan Schulz
6 
7 Contents
8 
9   Macros for dealing with 1 bit properties of objects (well,
10   structs). It requires the object to be dealt with to have a field
11   named "properties" that is of some integer or enumeration type. This
12   is pretty ugly, but I did not want to spend to much time on it.
13 
14   Copyright 1998, 1999 by the author.
15   This code is released under the GNU General Public Licence and
16   the GNU Lesser General Public License.
17   See the file COPYING in the main E directory for details..
18   Run "eprover -h" for contact information.
19 
20 Changes
21 
22 <1> Fri Sep 18 14:27:52 MET DST 1998
23     New
24 
25 -----------------------------------------------------------------------*/
26 
27 #ifndef CLB_PROPERTIES
28 
29 #define CLB_PROPERTIES
30 
31 
32 
33 /*---------------------------------------------------------------------*/
34 /*                    Data type declarations                           */
35 /*---------------------------------------------------------------------*/
36 
37 
38 
39 
40 /*---------------------------------------------------------------------*/
41 /*                Exported Functions and Variables                     */
42 /*---------------------------------------------------------------------*/
43 
44 
45 #define SetProp(obj, prop) ((obj)->properties = (obj)->properties | (prop))
46 #define DelProp(obj, prop) ((obj)->properties = (obj)->properties & ~(prop))
47 #define FlipProp(obj, prop) ((obj)->properties = (obj)->properties ^ (prop))
48 #define AssignProp(obj, sel, prop) DelProp((obj),(sel));SetProp((obj),(sel)&(prop))
49 
50 /* Are _all_ properties in prop set in obj? */
51 #define QueryProp(obj, prop) (((obj)->properties & (prop)) == (prop))
52 
53 /* Are any properties in prop set in obj? */
54 #define IsAnyPropSet(obj, prop) ((obj)->properties & (prop))
55 
56 /* Return the properties of object...yes, this is the same code as
57    above, but implements a different concept */
58 #define GiveProps(obj,prop) ((obj)->properties & (prop))
59 
60 /* Are two property sets equivalent? */
61 
62 #define PropsAreEquiv(obj1, obj2, props)\
63         (((obj1->properties)&(props))==((obj2->properties)&(props)))
64 
65 #endif
66 
67 /*---------------------------------------------------------------------*/
68 /*                        End of File                                  */
69 /*---------------------------------------------------------------------*/
70 
71 
72 
73 
74 
75