Orbits  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages
Macros | Typedefs | Functions
bitset.h File Reference

Go to the source code of this file.

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 BYTEbitset
 

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

Typedef Documentation

typedef BYTE* bitset

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 
)

Copyright 2014 Google Inc. All rights reserved.