Coda Distributed File System
Classes | Macros | Functions
bitvect.c File Reference
#include "coda_assert.h"
#include <stdlib.h>
#include "coda_string.h"
#include <lwp/lock.h>
#include <util.h>
#include "bitvect.h"
Include dependency graph for bitvect.c:

Classes

struct  Bitv_s
 

Macros

#define BPW   (8 * sizeof(unsigned long))
 
#define nwords(len)   ((((len) + BPW - 1) & (~(BPW - 1))) / BPW)
 
#define ALLOCMASK   (~((unsigned long)0))
 
#define HIGHBIT   1 << (BPW - 1)
 
#define HIGHCBIT   128
 

Functions

Bitv Bitv_new (int len)
 
void Bitv_free (Bitv *b)
 
int Bitv_length (Bitv b)
 
int Bitv_get (Bitv b, int n)
 
int Bitv_put (Bitv b, int n, int bit)
 
void Bitv_set (Bitv b, int n)
 
void Bitv_clear (Bitv b, int n)
 
int Bitv_getfree (Bitv b)
 
int Bitv_count (Bitv b)
 
void Bitv_print (Bitv b, FILE *fd)
 

Macro Definition Documentation

◆ ALLOCMASK

#define ALLOCMASK   (~((unsigned long)0))

◆ BPW

#define BPW   (8 * sizeof(unsigned long))

◆ HIGHBIT

#define HIGHBIT   1 << (BPW - 1)

◆ HIGHCBIT

#define HIGHCBIT   128

◆ nwords

#define nwords (   len)    ((((len) + BPW - 1) & (~(BPW - 1))) / BPW)

Function Documentation

◆ Bitv_clear()

void Bitv_clear ( Bitv  b,
int  n 
)

◆ Bitv_count()

int Bitv_count ( Bitv  b)

◆ Bitv_free()

void Bitv_free ( Bitv b)

◆ Bitv_get()

int Bitv_get ( Bitv  b,
int  n 
)

◆ Bitv_getfree()

int Bitv_getfree ( Bitv  b)

◆ Bitv_length()

int Bitv_length ( Bitv  b)

◆ Bitv_new()

Bitv Bitv_new ( int  len)

◆ Bitv_print()

void Bitv_print ( Bitv  b,
FILE *  fd 
)

◆ Bitv_put()

int Bitv_put ( Bitv  b,
int  n,
int  bit 
)

◆ Bitv_set()

void Bitv_set ( Bitv  b,
int  n 
)