1 /* gintset.h - Headers for a Glib-link set of integers |
|
2 * Copyright (C) 2006 Collabora Ltd. |
|
3 * |
|
4 * This library is free software; you can redistribute it and/or |
|
5 * modify it under the terms of the GNU Lesser General Public License |
|
6 * as published by the Free Software Foundation; either version 2.1 of |
|
7 * the License, or (at your option) any later version. |
|
8 * |
|
9 * This library is distributed in the hope that it will be useful, but |
|
10 * WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
12 * Lesser General Public License for more details. |
|
13 * |
|
14 * You should have received a copy of the GNU Lesser General Public |
|
15 * License along with this library; if not, write to the Free Software |
|
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA |
|
17 * 02110-1301 USA |
|
18 * |
|
19 */ |
|
20 |
|
21 #ifndef __G_INTSET_H__ |
|
22 #define __G_INTSET_H__ |
|
23 |
|
24 #include <glib-object.h> |
|
25 |
|
26 typedef struct _GIntSet GIntSet; |
|
27 typedef void (*GIntFunc) (guint i, gpointer userdata); |
|
28 |
|
29 GIntSet *g_intset_new (); |
|
30 void g_intset_destroy (GIntSet *); |
|
31 void g_intset_clear (GIntSet *); |
|
32 |
|
33 void g_intset_add (GIntSet *set, guint element); |
|
34 gboolean g_intset_remove (GIntSet *set, guint element); |
|
35 gboolean g_intset_is_member (const GIntSet *set, guint element); |
|
36 |
|
37 void g_intset_foreach (const GIntSet *set, GIntFunc func, gpointer userdata); |
|
38 GArray *g_intset_to_array (GIntSet *set); |
|
39 GIntSet *g_intset_from_array (GArray *array); |
|
40 |
|
41 guint g_intset_size (const GIntSet *set); |
|
42 |
|
43 gboolean g_intset_is_equal (const GIntSet *left, const GIntSet *right); |
|
44 |
|
45 GIntSet *g_intset_copy (const GIntSet *orig); |
|
46 GIntSet *g_intset_intersection (const GIntSet *left, const GIntSet *right); |
|
47 GIntSet *g_intset_union (const GIntSet *left, const GIntSet *right); |
|
48 GIntSet *g_intset_difference (const GIntSet *left, const GIntSet *right); |
|
49 GIntSet *g_intset_symmetric_difference (const GIntSet *left, const GIntSet *right); |
|
50 |
|
51 gchar *g_intset_dump (const GIntSet *set); |
|
52 |
|
53 #endif /*__G_INTSET_H__*/ |
|