Root/bitset.h

Source at commit 809e8142b53ba7227241d39d2c4057f7201087a9 created 4 years 7 months ago.
By Werner Almesberger, gui.c (change_world): don't change color of the active frame
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
16struct bitset;
17
18struct bitset *bitset_new(int n);
19struct bitset *bitset_clone(const struct bitset *old);
20void bitset_free(struct bitset *set);
21
22void bitset_set(struct bitset *set, int n);
23void bitset_clear(struct bitset *set, int n);
24int bitset_pick(const struct bitset *set, int n);
25
26int bitset_is_empty(const struct bitset *set);
27void bitset_zero(struct bitset *a);
28
29void bitset_and(struct bitset *a, const struct bitset *b);
30void bitset_or(struct bitset *a, const struct bitset *b);
31
32int bitset_ge(const struct bitset *a, const struct bitset *b);
33
34#endif /* !BITSET_H */
35

Archive Download this file

Branches:
master



interactive