gCAD3D 2.35
ut_BitTab.h
Go to the documentation of this file.
1 /* BitTab.h Functions for bit-arrays 2010-04-29 RF
2 */
3 #ifdef globTag
4 void BitTab(){}
5 #endif
6 /*----------------------------------------
44 
45 
46 */
47 
49 #define BitTab(bt,siz)\
50  unsigned char bt[(siz >> 3) + 1]
51 
53 #define BitTab_ini0(bt)\
54  memset(bt,'\0',sizeof(bt))
55 
57 #define BitTab_ini1(bt)\
58  memset(bt,255,sizeof(bt))
59 
61 #define BitTab_set(bt,ii)\
62  (bt[ii >> 3] |= 1 << ii % 8)
63 
65 #define BitTab_get(bt,ii)\
66  (bt[ii >> 3] & 1 << ii % 8)
67 
69 #define BitTab_clr(bt,ii)\
70  bt[ii >> 3] &= ~(1 << ii % 8)
71 
73 #define BitTab_cpy(bt2,bt1)\
74  memcpy (bt2, bt1, sizeof(bt1))
75 
77 #define BitTab_bNr(bt1)\
78  (sizeof(bt1) << 3)
79 
80 
81 // Proto:
82 int BitTab_dump (unsigned char *bt, int bNr);
83 
84 
85 // EOF
#define BitTab(bt, siz)
define bitArray; bt = arrayName; siz = number of bits.
Definition: ut_BitTab.h:49
int BitTab_dump(unsigned char *bt, int bNr)
Definition: ut_BitTab.c:71