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 #if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
22 #error "Only <glib.h> can be included directly."
25 #ifndef __G_SEQUENCE_H__
26 #define __G_SEQUENCE_H__
28 #include <glib/gtypes.h>
32 typedef struct _GSequence GSequence;
33 typedef struct _GSequenceNode GSequenceIter;
35 typedef gint (* GSequenceIterCompareFunc) (GSequenceIter *a,
41 GSequence * g_sequence_new (GDestroyNotify data_destroy);
42 void g_sequence_free (GSequence *seq);
43 gint g_sequence_get_length (GSequence *seq);
44 void g_sequence_foreach (GSequence *seq,
47 void g_sequence_foreach_range (GSequenceIter *begin,
51 void g_sequence_sort (GSequence *seq,
52 GCompareDataFunc cmp_func,
54 void g_sequence_sort_iter (GSequence *seq,
55 GSequenceIterCompareFunc cmp_func,
60 GSequenceIter *g_sequence_get_begin_iter (GSequence *seq);
61 GSequenceIter *g_sequence_get_end_iter (GSequence *seq);
62 GSequenceIter *g_sequence_get_iter_at_pos (GSequence *seq,
64 GSequenceIter *g_sequence_append (GSequence *seq,
66 GSequenceIter *g_sequence_prepend (GSequence *seq,
68 GSequenceIter *g_sequence_insert_before (GSequenceIter *iter,
70 void g_sequence_move (GSequenceIter *src,
72 void g_sequence_swap (GSequenceIter *a,
74 GSequenceIter *g_sequence_insert_sorted (GSequence *seq,
76 GCompareDataFunc cmp_func,
78 GSequenceIter *g_sequence_insert_sorted_iter (GSequence *seq,
80 GSequenceIterCompareFunc iter_cmp,
82 void g_sequence_sort_changed (GSequenceIter *iter,
83 GCompareDataFunc cmp_func,
85 void g_sequence_sort_changed_iter (GSequenceIter *iter,
86 GSequenceIterCompareFunc iter_cmp,
88 void g_sequence_remove (GSequenceIter *iter);
89 void g_sequence_remove_range (GSequenceIter *begin,
91 void g_sequence_move_range (GSequenceIter *dest,
94 GSequenceIter *g_sequence_search (GSequence *seq,
96 GCompareDataFunc cmp_func,
98 GSequenceIter *g_sequence_search_iter (GSequence *seq,
100 GSequenceIterCompareFunc iter_cmp,
105 gpointer g_sequence_get (GSequenceIter *iter);
106 void g_sequence_set (GSequenceIter *iter,
109 /* Operations on GSequenceIter * */
110 gboolean g_sequence_iter_is_begin (GSequenceIter *iter);
111 gboolean g_sequence_iter_is_end (GSequenceIter *iter);
112 GSequenceIter *g_sequence_iter_next (GSequenceIter *iter);
113 GSequenceIter *g_sequence_iter_prev (GSequenceIter *iter);
114 gint g_sequence_iter_get_position (GSequenceIter *iter);
115 GSequenceIter *g_sequence_iter_move (GSequenceIter *iter,
117 GSequence * g_sequence_iter_get_sequence (GSequenceIter *iter);
121 gint g_sequence_iter_compare (GSequenceIter *a,
123 GSequenceIter *g_sequence_range_get_midpoint (GSequenceIter *begin,
128 #endif /* __G_SEQUENCE_H__ */