Root/bitset.h

Source at commit 5fdea0e99a2e8543a59d508cf28e1f2ff3607f18 created 4 years 9 months ago.
By Werner Almesberger, gui_canvas.c (key_press_event): make / rotate through packages as well
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