File: utilPropMask.h

package info (click to toggle)
ted 2.11-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 11,064 kB
  • ctags: 13,935
  • sloc: ansic: 120,446; makefile: 7,469; sh: 253
file content (49 lines) | stat: -rw-r--r-- 1,309 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/************************************************************************/
/*									*/
/*  Property mask operations.						*/
/*									*/
/************************************************************************/

#   ifndef	UTIL_PROP_MASK_H
#   define	UTIL_PROP_MASK_H

#   define	PROPmaskSIZE	8

typedef struct PropertyMask
    {
    unsigned char	pmBits[PROPmaskSIZE];
    } PropertyMask;

#   define	PROPmaskCLEAR( pm ) \
			memset( (pm)->pmBits, 0, PROPmaskSIZE )

#   define	PROPmaskADD( pm, v ) \
			(pm)->pmBits[(v)/8] |= (1<<((v)%8))

#   define	PROPmaskUNSET( pm, v ) \
			(pm)->pmBits[(v)/8] &= ~(1<<((v)%8))

#   define	PROPmaskISSET( pm, v ) \
			( (pm)->pmBits[(v)/8] & (1<<((v)%8)) ) != 0

#   define	PROPmaskFILL( pm, c )	utilPropMaskFill( pm, c )

#   define	PROPmaskISEMPTY( pm )		utilPropMaskIsEmpty( pm )

extern void utilPropMaskFill(		PropertyMask *		pm,
					int			c );

extern int utilPropMaskIsEmpty(		const PropertyMask *	pm );

extern void utilPropMaskAnd(		PropertyMask *		pm0,
					const PropertyMask *	pm1,
					const PropertyMask *	pm2 );

extern void utilPropMaskOr(		PropertyMask *		pm0,
					const PropertyMask *	pm1,
					const PropertyMask *	pm2 );

extern void utilPropMaskNot(		PropertyMask *		pm0,
					const PropertyMask *	pm1 );

#   endif	/*  UTIL_PROP_MASK_H  */