Root/
| 1 | /* |
| 2 | * bitset.h - Arbitrary-length bit sets |
| 3 | * |
| 4 | * Written 2010 by Werner Almesberger |
| 5 | * Copyright 2010 by Werner Almesberger |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; either version 2 of the License, or |
| 10 | * (at your option) any later version. |
| 11 | */ |
| 12 | |
| 13 | #ifndef BITSET_H |
| 14 | #define BITSET_H |
| 15 | |
| 16 | struct bitset; |
| 17 | |
| 18 | struct bitset *bitset_new(int n); |
| 19 | struct bitset *bitset_clone(const struct bitset *old); |
| 20 | void bitset_free(struct bitset *set); |
| 21 | |
| 22 | void bitset_set(struct bitset *set, int n); |
| 23 | void bitset_clear(struct bitset *set, int n); |
| 24 | int bitset_pick(const struct bitset *set, int n); |
| 25 | |
| 26 | int bitset_is_empty(const struct bitset *set); |
| 27 | void bitset_zero(struct bitset *a); |
| 28 | |
| 29 | void bitset_and(struct bitset *a, const struct bitset *b); |
| 30 | void bitset_or(struct bitset *a, const struct bitset *b); |
| 31 | |
| 32 | int bitset_ge(const struct bitset *a, const struct bitset *b); |
| 33 | |
| 34 | #endif /* !BITSET_H */ |
| 35 |
Branches:
master
