Mercurial > repos > yating-l > jbrowsearchivecreator
comparison test/include/python2.7/bitset.h @ 3:7d1a9a91b989 draft
planemo upload for repository https://github.com/Yating-L/jbrowse-archive-creator.git commit d583ac16a6c6942730ea536eb59cc37941816030-dirty
| author | yating-l |
|---|---|
| date | Thu, 18 May 2017 18:37:28 -0400 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 2:3e2160197902 | 3:7d1a9a91b989 |
|---|---|
| 1 | |
| 2 #ifndef Py_BITSET_H | |
| 3 #define Py_BITSET_H | |
| 4 #ifdef __cplusplus | |
| 5 extern "C" { | |
| 6 #endif | |
| 7 | |
| 8 /* Bitset interface */ | |
| 9 | |
| 10 #define BYTE char | |
| 11 | |
| 12 typedef BYTE *bitset; | |
| 13 | |
| 14 bitset newbitset(int nbits); | |
| 15 void delbitset(bitset bs); | |
| 16 #define testbit(ss, ibit) (((ss)[BIT2BYTE(ibit)] & BIT2MASK(ibit)) != 0) | |
| 17 int addbit(bitset bs, int ibit); /* Returns 0 if already set */ | |
| 18 int samebitset(bitset bs1, bitset bs2, int nbits); | |
| 19 void mergebitset(bitset bs1, bitset bs2, int nbits); | |
| 20 | |
| 21 #define BITSPERBYTE (8*sizeof(BYTE)) | |
| 22 #define NBYTES(nbits) (((nbits) + BITSPERBYTE - 1) / BITSPERBYTE) | |
| 23 | |
| 24 #define BIT2BYTE(ibit) ((ibit) / BITSPERBYTE) | |
| 25 #define BIT2SHIFT(ibit) ((ibit) % BITSPERBYTE) | |
| 26 #define BIT2MASK(ibit) (1 << BIT2SHIFT(ibit)) | |
| 27 #define BYTE2BIT(ibyte) ((ibyte) * BITSPERBYTE) | |
| 28 | |
| 29 #ifdef __cplusplus | |
| 30 } | |
| 31 #endif | |
| 32 #endif /* !Py_BITSET_H */ |
