BitOps

Name

BitOps -- Bitmap operations.

Synopsis


void        set_bit                         (gint nr,
                                             guint32 *addr);
gboolean    test_bit                        (gint nr,
                                             guint32 *addr);
void        clear_bit                       (gint nr,
                                             guint32 *addr);

Description

Confortable functions to set, test and clear bits in a bitmap.

Details

set_bit ()

void        set_bit                         (gint nr,
                                             guint32 *addr);

Set bit number nr in the bitmap pointed by addr.

nr : index of the bit to be set to 1.
addr : address of the bitmap.


test_bit ()

gboolean    test_bit                        (gint nr,
                                             guint32 *addr);

Test if bit number nr of the bitmap pointed by addr is 1 or 0.

nr : index of the bit to be tested.
addr : address of the bitmap.
Returns : TRUE if the bit is 1 and FALSE otherwise.


clear_bit ()

void        clear_bit                       (gint nr,
                                             guint32 *addr);

Clear bit number nr in the bitmap pointed by addr.

nr : index of the bit to be cleard to 0.
addr : address of the bitmap.