Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions | Variables
prbit.h File Reference
#include "prtypes.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define PR_TEST_BIT(_map, _bit)   ((_map)[(_bit)>>PR_BITS_PER_LONG_LOG2] & (1L << ((_bit) & (PR_BITS_PER_LONG-1))))
#define PR_SET_BIT(_map, _bit)   ((_map)[(_bit)>>PR_BITS_PER_LONG_LOG2] |= (1L << ((_bit) & (PR_BITS_PER_LONG-1))))
#define PR_CLEAR_BIT(_map, _bit)   ((_map)[(_bit)>>PR_BITS_PER_LONG_LOG2] &= ~(1L << ((_bit) & (PR_BITS_PER_LONG-1))))
#define PR_CEILING_LOG2(_log2, _n)
#define PR_FLOOR_LOG2(_log2, _n)

Functions

 NSPR_API (PRIntn) PR_CeilingLog2(PRUint32 i)

Variables

PR_BEGIN_EXTERN_C typedef
unsigned long 
prbitmap_t

Define Documentation

#define PR_CEILING_LOG2 (   _log2,
  _n 
)
Value:
PR_BEGIN_MACRO                    \
    PRUint32 j_ = (PRUint32)(_n);  \
    (_log2) = 0;                    \
    if ((j_) & ((j_)-1))            \
       (_log2) += 1;               \
    if ((j_) >> 16)                 \
       (_log2) += 16, (j_) >>= 16; \
    if ((j_) >> 8)                  \
       (_log2) += 8, (j_) >>= 8;   \
    if ((j_) >> 4)                  \
       (_log2) += 4, (j_) >>= 4;   \
    if ((j_) >> 2)                  \
       (_log2) += 2, (j_) >>= 2;   \
    if ((j_) >> 1)                  \
       (_log2) += 1;               \
  PR_END_MACRO

Definition at line 70 of file prbit.h.

#define PR_CLEAR_BIT (   _map,
  _bit 
)    ((_map)[(_bit)>>PR_BITS_PER_LONG_LOG2] &= ~(1L << ((_bit) & (PR_BITS_PER_LONG-1))))

Definition at line 53 of file prbit.h.

#define PR_FLOOR_LOG2 (   _log2,
  _n 
)
Value:
PR_BEGIN_MACRO                    \
    PRUint32 j_ = (PRUint32)(_n);  \
    (_log2) = 0;                    \
    if ((j_) >> 16)                 \
       (_log2) += 16, (j_) >>= 16; \
    if ((j_) >> 8)                  \
       (_log2) += 8, (j_) >>= 8;   \
    if ((j_) >> 4)                  \
       (_log2) += 4, (j_) >>= 4;   \
    if ((j_) >> 2)                  \
       (_log2) += 2, (j_) >>= 2;   \
    if ((j_) >> 1)                  \
       (_log2) += 1;               \
  PR_END_MACRO

Definition at line 94 of file prbit.h.

#define PR_SET_BIT (   _map,
  _bit 
)    ((_map)[(_bit)>>PR_BITS_PER_LONG_LOG2] |= (1L << ((_bit) & (PR_BITS_PER_LONG-1))))

Definition at line 51 of file prbit.h.

#define PR_TEST_BIT (   _map,
  _bit 
)    ((_map)[(_bit)>>PR_BITS_PER_LONG_LOG2] & (1L << ((_bit) & (PR_BITS_PER_LONG-1))))

Definition at line 49 of file prbit.h.


Function Documentation

NSPR_API ( PRIntn  )

Variable Documentation

PR_BEGIN_EXTERN_C typedef unsigned long prbitmap_t

Definition at line 47 of file prbit.h.