NSPR Reference Previous Contents Next |
Bitmap Type
Bitmap Functions and Macros
Logarithmic Functions and Macros
prbitmap_t
type represents a bitmap structure.
#include <prbit.h>
typedef unsigned long prbitmap_t;
prbitmap_t
as an array to define a bitmap.
PR_TEST_BIT
PR_SET_BIT
PR_CLEAR_BIT
Logarithmic functions and macros are also defined in the bitmap API, but are not limited to use with bitmaps. See Logarithmic Functions and Macros.
#include <prbit.h>
PRIntn PR_TEST_BIT (
prbitmap_t *_map,
PRInt32 _bit);
_map
|
Address of the bitmap containing the bit to be tested.
|
_bit
|
The relative position within the bitmap of the bit to be tested.
|
TRUE
(non-zero) if the bit is set. If the bit is clear, the
macro evaluates to zero.
#include <prbit.h>
void PR_SET_BIT (
prbitmap_t *_map,
PRInt32 _bit);
_map
|
Address of the bitmap containing the bit to be set.
|
_bit
|
The relative position within the bitmap of the bit to be set.
|
#include <prbit.h>
void PR_CLEAR_BIT (
prbitmap_t *_map,
PRInt32 _bit);
_map
|
Address of the bitmap containing the bit to be cleared.
|
_bit
|
The relative position within the bitmap of the bit to be cleared.
|
PR_CeilingLog2
PR_FloorLog2
PR_CEILING_LOG2
PR_FLOOR_LOG2
#include <prbit.h>
PRIntn PR_CeilingLog2 (PRUint32 i);
i
|
An unsigned 32-bit number.
|
i
.
Ceil(Log2(i));
PRIntn j = PR_CeilingLog2( 32 ); /* After execution, j == 5 */
#include <prbit.h>
PRIntn PR_FloorLog2 (PRUint32 i);
i
|
An unsigned 32-bit number.
|
i
.
Floor(Log2(i));
#include <prbit.h>
void PR_CEILING_LOG2 (
PRUint32 _log,
PRUint32 i);
_log
|
A variable that will contain the result of the operation.
|
i
|
An unsigned 32-bit number.
|
_log
.
The parameters must be variables of the proper type predefined by the caller.
#include <prbit.h>
void PR_FLOOR_LOG2 (
PRUint32 _log,
PRUint32 i);
_log
|
A variable that will contain the result of the operation.
|
i
|
An unsigned 32-bit number.
|
_log
. The
parameters must be variables of the proper type predefined by the caller.
Last Updated May 18, 2001