Dillo v3.1.1-99-gf3103cc4
Loading...
Searching...
No Matches
bitvec.h File Reference
#include "d_size.h"
Include dependency graph for bitvec.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  bitvec_t
 

Macros

#define BVEC_TYPE   uchar_t
 
#define BVEC_SIZE   sizeof(BVEC_TYPE)
 
#define a_Bitvec_clear_bit(bvec, pos)    ((bvec)->vec[(pos)/BVEC_SIZE] &= ~(1 << (pos) % BVEC_SIZE))
 

Functions

bitvec_ta_Bitvec_new (int bits)
 Create a new bitvec with 'num_bits' size.
 
void a_Bitvec_free (bitvec_t *bvec)
 Free a bitvec.
 
int a_Bitvec_get_bit (bitvec_t *bvec, int pos)
 Get a bit.
 
void a_Bitvec_set_bit (bitvec_t *bvec, int pos)
 Set a bit.
 
void a_Bitvec_clear (bitvec_t *bvec)
 Clear a bitvec.
 

Macro Definition Documentation

◆ a_Bitvec_clear_bit

#define a_Bitvec_clear_bit (   bvec,
  pos 
)     ((bvec)->vec[(pos)/BVEC_SIZE] &= ~(1 << (pos) % BVEC_SIZE))

Definition at line 31 of file bitvec.h.

◆ BVEC_SIZE

#define BVEC_SIZE   sizeof(BVEC_TYPE)

Definition at line 7 of file bitvec.h.

◆ BVEC_TYPE

#define BVEC_TYPE   uchar_t

Definition at line 6 of file bitvec.h.

Function Documentation

◆ a_Bitvec_clear()

void a_Bitvec_clear ( bitvec_t bvec)

Clear a bitvec.

Definition at line 35 of file bitvec.c.

References BVEC_SIZE, bitvec_t::len, and bitvec_t::vec.

Referenced by a_Dicache_new_scan().

◆ a_Bitvec_free()

void a_Bitvec_free ( bitvec_t bvec)

Free a bitvec.

Definition at line 43 of file bitvec.c.

References dFree(), and bitvec_t::vec.

Referenced by a_Dicache_freeall(), Dicache_remove(), and Image_free().

◆ a_Bitvec_get_bit()

int a_Bitvec_get_bit ( bitvec_t bvec,
int  pos 
)

Get a bit.

Definition at line 54 of file bitvec.c.

References BVEC_SIZE, dReturn_val_if_fail, and bitvec_t::vec.

Referenced by a_Dicache_callback().

◆ a_Bitvec_new()

bitvec_t * a_Bitvec_new ( int  bits)

Create a new bitvec with 'num_bits' size.

Definition at line 23 of file bitvec.c.

References BVEC_SIZE, dNew, dNew0, bitvec_t::len, and bitvec_t::vec.

Referenced by a_Dicache_set_parms(), and a_Image_set_parms().

◆ a_Bitvec_set_bit()

void a_Bitvec_set_bit ( bitvec_t bvec,
int  pos 
)

Set a bit.

Definition at line 63 of file bitvec.c.

References BVEC_SIZE, dReturn_if_fail, and bitvec_t::vec.

Referenced by a_Dicache_write(), and a_Image_write().