1 /* GLIB - Library of useful routines for C programming
2 * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007
3 * Soeren Sandmann (sandmann@daimi.au.dk)
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
21 #include <glib/gtypes.h>
23 #ifndef __G_SEQUENCE_H__
24 #define __G_SEQUENCE_H__
26 typedef struct _GSequence GSequence;
27 typedef struct _GSequenceNode GSequenceIter;
29 typedef gint (* GSequenceIterCompareFunc) (GSequenceIter *a,
35 GSequence * g_sequence_new (GDestroyNotify data_destroy);
36 void g_sequence_free (GSequence *seq);
37 gint g_sequence_get_length (GSequence *seq);
38 void g_sequence_foreach (GSequence *seq,
41 void g_sequence_foreach_range (GSequenceIter *begin,
45 void g_sequence_sort (GSequence *seq,
46 GCompareDataFunc cmp_func,
48 void g_sequence_sort_iter (GSequence *seq,
49 GSequenceIterCompareFunc cmp_func,
54 GSequenceIter *g_sequence_get_begin_iter (GSequence *seq);
55 GSequenceIter *g_sequence_get_end_iter (GSequence *seq);
56 GSequenceIter *g_sequence_get_iter_at_pos (GSequence *seq,
58 GSequenceIter *g_sequence_append (GSequence *seq,
60 GSequenceIter *g_sequence_prepend (GSequence *seq,
62 GSequenceIter *g_sequence_insert_before (GSequenceIter *iter,
64 void g_sequence_move (GSequenceIter *src,
66 void g_sequence_swap (GSequenceIter *a,
68 GSequenceIter *g_sequence_insert_sorted (GSequence *seq,
70 GCompareDataFunc cmp_func,
72 GSequenceIter *g_sequence_insert_sorted_iter (GSequence *seq,
74 GSequenceIterCompareFunc iter_cmp,
76 void g_sequence_sort_changed (GSequenceIter *iter,
77 GCompareDataFunc cmp_func,
79 void g_sequence_sort_changed_iter (GSequenceIter *iter,
80 GSequenceIterCompareFunc iter_cmp,
82 void g_sequence_remove (GSequenceIter *iter);
83 void g_sequence_remove_range (GSequenceIter *begin,
85 void g_sequence_move_range (GSequenceIter *dest,
88 GSequenceIter *g_sequence_search (GSequence *seq,
90 GCompareDataFunc cmp_func,
92 GSequenceIter *g_sequence_search_iter (GSequence *seq,
94 GSequenceIterCompareFunc iter_cmp,
99 gpointer g_sequence_get (GSequenceIter *iter);
100 void g_sequence_set (GSequenceIter *iter,
103 /* Operations on GSequenceIter * */
104 gboolean g_sequence_iter_is_begin (GSequenceIter *iter);
105 gboolean g_sequence_iter_is_end (GSequenceIter *iter);
106 GSequenceIter *g_sequence_iter_next (GSequenceIter *iter);
107 GSequenceIter *g_sequence_iter_prev (GSequenceIter *iter);
108 gint g_sequence_iter_get_position (GSequenceIter *iter);
109 GSequenceIter *g_sequence_iter_move (GSequenceIter *iter,
111 GSequence * g_sequence_iter_get_sequence (GSequenceIter *iter);
115 gint g_sequence_iter_compare (GSequenceIter *a,
117 GSequenceIter *g_sequence_range_get_midpoint (GSequenceIter *begin,
121 #endif /* __G_SEQUENCE_H__ */