Coda Distributed File System
bitvect.h
Go to the documentation of this file.
1/* BLURB gpl
2
3 Coda File System
4 Release 6
5
6 Copyright (c) 1987-2003 Carnegie Mellon University
7 Additional copyrights listed below
8
9This code is distributed "AS IS" without warranty of any kind under
10the terms of the GNU General Public Licence Version 2, as shown in the
11file LICENSE. The technical and financial contributors to Coda are
12listed in the file CREDITS.
13
14 Additional copyrights
15 none currently
16
17#*/
18
19/* this code owes several ideas to Hanson's C Interfaces and Implementations,
20 * Addison-Wesley, 1997
21 */
22
23#ifndef BITVECT_INCLUDED
24#define BITVECT_INCLUDED
25
26typedef struct Bitv_s *Bitv;
27
29void Bitv_free(Bitv *b);
30int Bitv_length(Bitv b);
31int Bitv_count(Bitv b); /* how many bits are set to 1 */
32int Bitv_put(Bitv b, int n, int bit); /* set n to bit, return previous value */
33void Bitv_clear(Bitv b, int loc);
34void Bitv_set(Bitv b, int loc);
35int Bitv_getfree(Bitv b); /* get first 0 index and set it to 1 */
36void Bitv_print(Bitv b, FILE *fd);
37
38#endif
int Bitv_put(Bitv b, int n, int bit)
Definition: bitvect.c:99
void Bitv_free(Bitv *b)
Definition: bitvect.c:62
int Bitv_count(Bitv b)
Definition: bitvect.c:155
void Bitv_print(Bitv b, FILE *fd)
Definition: bitvect.c:169
Bitv Bitv_new(int length)
Definition: bitvect.c:42
int Bitv_length(Bitv b)
Definition: bitvect.c:75
int Bitv_getfree(Bitv b)
Definition: bitvect.c:129
struct Bitv_s * Bitv
Definition: bitvect.h:26
void Bitv_set(Bitv b, int loc)
Definition: bitvect.c:119
void Bitv_clear(Bitv b, int loc)
Definition: bitvect.c:124
Definition: bitvect.c:30
int length
Definition: bitvect.c:31