Wed Sep 11 12:53:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
[mono.git] / mono / utils / monobitset.h
1 #ifndef __MONO_BITSET_H__
2 #define __MONO_BITSET_H__
3
4 #include <glib.h>
5
6 typedef struct MonoBitSet MonoBitSet;
7 typedef void (*MonoBitSetFunc) (guint idx, gpointer data);
8
9 enum {
10         MONO_BITSET_DONT_FREE = 1
11 };
12
13 /*
14  * Interface documentation can be found in the c-file.
15  * Interface documentation by Dennis Haney.
16  */
17
18 guint32     mono_bitset_alloc_size   (guint32 max_size, guint32 flags);
19
20 MonoBitSet* mono_bitset_new          (guint32 max_size, guint32 flags);
21
22 MonoBitSet* mono_bitset_mem_new      (gpointer mem, guint32 max_size, guint32 flags);
23
24 void        mono_bitset_free         (MonoBitSet *set); 
25
26 void        mono_bitset_set          (MonoBitSet *set, guint32 pos);
27
28 int         mono_bitset_test         (const MonoBitSet *set, guint32 pos);
29
30 void        mono_bitset_clear        (MonoBitSet *set, guint32 pos);
31
32 void        mono_bitset_clear_all    (MonoBitSet *set);
33
34 void        mono_bitset_invert       (MonoBitSet *set);
35
36 guint32     mono_bitset_size         (const MonoBitSet *set);
37
38 guint32     mono_bitset_count        (const MonoBitSet *set);
39
40 int         mono_bitset_find_start   (const MonoBitSet *set);
41
42 int         mono_bitset_find_first   (const MonoBitSet *set, gint pos);
43
44 int         mono_bitset_find_last    (const MonoBitSet *set, gint pos);
45
46 MonoBitSet* mono_bitset_clone        (const MonoBitSet *set, guint32 new_size);
47
48 void        mono_bitset_copyto       (const MonoBitSet *src, MonoBitSet *dest);
49
50 void        mono_bitset_union        (MonoBitSet *dest, const MonoBitSet *src);
51
52 void        mono_bitset_intersection (MonoBitSet *dest, const MonoBitSet *src);
53
54 void        mono_bitset_sub          (MonoBitSet *dest, const MonoBitSet *src);
55
56 gboolean    mono_bitset_equal        (const MonoBitSet *src, const MonoBitSet *src1);
57
58 void        mono_bitset_foreach      (MonoBitSet *set, MonoBitSetFunc func, gpointer data);
59
60 #endif /* __MONO_BITSET_H__ */