00001
00002
00003
00004
00005
00006 #ifndef BITS_H
00007 #define BITS_H
00008
00009 typedef unsigned char Bits;
00010
00011 Bits *bitAlloc(int bitCount);
00012
00013
00014 Bits *bitRealloc(Bits *b, int bitCount, int newBitCount);
00015
00016
00017 Bits *bitClone(Bits* orig, int bitCount);
00018
00019
00020 void bitFree(Bits **pB);
00021
00022
00023 void bitSetOne(Bits *b, int bitIx);
00024
00025
00026 void bitClearOne(Bits *b, int bitIx);
00027
00028
00029 void bitSetRange(Bits *b, int startIx, int bitCount);
00030
00031
00032 boolean bitReadOne(Bits *b, int bitIx);
00033
00034
00035 int bitCountRange(Bits *b, int startIx, int bitCount);
00036
00037
00038 int bitFindSet(Bits *b, int startIx, int bitCount);
00039
00040
00041 int bitFindClear(Bits *b, int startIx, int bitCount);
00042
00043
00044 void bitClear(Bits *b, int bitCount);
00045
00046
00047 void bitClearRange(Bits *b, int startIx, int bitCount);
00048
00049
00050 void bitAnd(Bits *a, Bits *b, int bitCount);
00051
00052
00053 void bitOr(Bits *a, Bits *b, int bitCount);
00054
00055
00056 void bitXor(Bits *a, Bits *b, int bitCount);
00057
00058
00059 void bitNot(Bits *a, int bitCount);
00060
00061
00062 void bitPrint(Bits *a, int startIx, int bitCount, FILE* out);
00063
00064
00065
00066 extern int bitsInByte[256];
00067
00068
00069 void bitsInByteInit();
00070
00071
00072 #endif
00073