python-2.7.6/include/bitset.h File Reference

bitset.h File Reference

Macros

#define BYTE   char
 
#define testbit(ss, ibit)   (((ss)[BIT2BYTE(ibit)] & BIT2MASK(ibit)) != 0)
 
#define BITSPERBYTE   (8*sizeof(BYTE))
 
#define NBYTES(nbits)   (((nbits) + BITSPERBYTE - 1) / BITSPERBYTE)
 
#define BIT2BYTE(ibit)   ((ibit) / BITSPERBYTE)
 
#define BIT2SHIFT(ibit)   ((ibit) % BITSPERBYTE)
 
#define BIT2MASK(ibit)   (1 << BIT2SHIFT(ibit))
 
#define BYTE2BIT(ibyte)   ((ibyte) * BITSPERBYTE)
 

Typedefs

typedef char * bitset
 

Functions

bitset newbitset (int nbits)
 
void delbitset (bitset bs)
 
int addbit (bitset bs, int ibit)
 
int samebitset (bitset bs1, bitset bs2, int nbits)
 
void mergebitset (bitset bs1, bitset bs2, int nbits)
 

Macro Definition Documentation

#define BIT2BYTE (   ibit)    ((ibit) / BITSPERBYTE)

Definition at line 24 of file bitset.h.

#define BIT2MASK (   ibit)    (1 << BIT2SHIFT(ibit))

Definition at line 26 of file bitset.h.

#define BIT2SHIFT (   ibit)    ((ibit) % BITSPERBYTE)

Definition at line 25 of file bitset.h.

#define BITSPERBYTE   (8*sizeof(BYTE))

Definition at line 21 of file bitset.h.

#define BYTE   char
#define BYTE2BIT (   ibyte)    ((ibyte) * BITSPERBYTE)

Definition at line 27 of file bitset.h.

#define NBYTES (   nbits)    (((nbits) + BITSPERBYTE - 1) / BITSPERBYTE)

Definition at line 22 of file bitset.h.

#define testbit (   ss,
  ibit 
)    (((ss)[BIT2BYTE(ibit)] & BIT2MASK(ibit)) != 0)

Definition at line 16 of file bitset.h.

Typedef Documentation

typedef char* bitset

Definition at line 12 of file bitset.h.

Function Documentation

int addbit ( bitset  bs,
int  ibit 
)
void delbitset ( bitset  bs)
void mergebitset ( bitset  bs1,
bitset  bs2,
int  nbits 
)
bitset newbitset ( int  nbits)
int samebitset ( bitset  bs1,
bitset  bs2,
int  nbits 
)

Go to the source code of this file.