00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00042 #ifndef ASC_BIT_H
00043 #define ASC_BIT_H
00044
00045 #include <utilities/ascConfig.h>
00046
00052 struct BitList {
00053 unsigned long length;
00054 };
00055
00056 extern struct BitList *CreateBList(unsigned long len);
00061 extern struct BitList *CreateFBList(unsigned long len);
00066 extern struct BitList *ExpandBList(struct BitList *bl, unsigned long len);
00074 extern struct BitList *ExpandFBList(struct BitList *bl, unsigned long len);
00082 extern void DestroyBList(struct BitList *bl);
00087 extern struct BitList *CopyBList(CONST struct BitList *bl);
00094 extern void OverwriteBList(CONST struct BitList *src, struct BitList *target);
00102 extern unsigned long BitListBytes(CONST struct BitList *bl);
00107 extern void SetBit(struct BitList *bl, unsigned long pos);
00112 extern void ClearBit(struct BitList *bl, unsigned long pos);
00117 extern void CondSetBit(struct BitList *bl, unsigned long pos, int cond);
00122 ASC_DLLSPEC int ReadBit(CONST struct BitList *bl, unsigned long pos);
00127 extern void IntersectBLists(struct BitList *bl1, CONST struct BitList *bl2);
00133 extern void UnionBLists(struct BitList *bl1, CONST struct BitList *bl2);
00139 #ifdef NDEBUG
00140
00141 #define BLength(bl) ((bl)->length)
00142 #else
00143
00144 #define BLength(bl) BLengthF(bl)
00145 #endif
00146 extern unsigned long BLengthF(CONST struct BitList *bl);
00151 ASC_DLLSPEC int BitListEmpty(CONST struct BitList *bl);
00156 extern int CompBList(struct BitList *b1, struct BitList *b2);
00161 extern unsigned long FirstNonZeroBit(CONST struct BitList *bl);
00167
00168
00169 #endif
00170