1 /* GLIB - Library of useful routines for C programming
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but 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.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
19 * Modified by the GLib Team and others 1997-2000. See the AUTHORS
20 * file for a list of people on the GLib Team. See the ChangeLog
21 * files for a list of changes. These files are distributed with
22 * GLib at ftp://ftp.gtk.org/pub/gtk/.
28 #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
29 #error "Only <glib.h> can be included directly."
32 #include <glib/gmem.h>
33 #include <glib/gnode.h>
37 typedef struct _GSList GSList;
45 /* Singly linked lists
48 GSList* g_slist_alloc (void) G_GNUC_WARN_UNUSED_RESULT;
50 void g_slist_free (GSList *list);
52 void g_slist_free_1 (GSList *list);
53 #define g_slist_free1 g_slist_free_1
55 void g_slist_free_full (GSList *list,
56 GDestroyNotify free_func);
58 GSList* g_slist_append (GSList *list,
59 gpointer data) G_GNUC_WARN_UNUSED_RESULT;
61 GSList* g_slist_prepend (GSList *list,
62 gpointer data) G_GNUC_WARN_UNUSED_RESULT;
64 GSList* g_slist_insert (GSList *list,
66 gint position) G_GNUC_WARN_UNUSED_RESULT;
68 GSList* g_slist_insert_sorted (GSList *list,
70 GCompareFunc func) G_GNUC_WARN_UNUSED_RESULT;
72 GSList* g_slist_insert_sorted_with_data (GSList *list,
74 GCompareDataFunc func,
75 gpointer user_data) G_GNUC_WARN_UNUSED_RESULT;
77 GSList* g_slist_insert_before (GSList *slist,
79 gpointer data) G_GNUC_WARN_UNUSED_RESULT;
81 GSList* g_slist_concat (GSList *list1,
82 GSList *list2) G_GNUC_WARN_UNUSED_RESULT;
84 GSList* g_slist_remove (GSList *list,
85 gconstpointer data) G_GNUC_WARN_UNUSED_RESULT;
87 GSList* g_slist_remove_all (GSList *list,
88 gconstpointer data) G_GNUC_WARN_UNUSED_RESULT;
90 GSList* g_slist_remove_link (GSList *list,
91 GSList *link_) G_GNUC_WARN_UNUSED_RESULT;
93 GSList* g_slist_delete_link (GSList *list,
94 GSList *link_) G_GNUC_WARN_UNUSED_RESULT;
96 GSList* g_slist_reverse (GSList *list) G_GNUC_WARN_UNUSED_RESULT;
98 GSList* g_slist_copy (GSList *list) G_GNUC_WARN_UNUSED_RESULT;
100 GLIB_AVAILABLE_IN_2_34
101 GSList* g_slist_copy_deep (GSList *list,
103 gpointer user_data) G_GNUC_WARN_UNUSED_RESULT;
104 GLIB_AVAILABLE_IN_ALL
105 GSList* g_slist_nth (GSList *list,
107 GLIB_AVAILABLE_IN_ALL
108 GSList* g_slist_find (GSList *list,
110 GLIB_AVAILABLE_IN_ALL
111 GSList* g_slist_find_custom (GSList *list,
114 GLIB_AVAILABLE_IN_ALL
115 gint g_slist_position (GSList *list,
117 GLIB_AVAILABLE_IN_ALL
118 gint g_slist_index (GSList *list,
120 GLIB_AVAILABLE_IN_ALL
121 GSList* g_slist_last (GSList *list);
122 GLIB_AVAILABLE_IN_ALL
123 guint g_slist_length (GSList *list);
124 GLIB_AVAILABLE_IN_ALL
125 void g_slist_foreach (GSList *list,
128 GLIB_AVAILABLE_IN_ALL
129 GSList* g_slist_sort (GSList *list,
130 GCompareFunc compare_func) G_GNUC_WARN_UNUSED_RESULT;
131 GLIB_AVAILABLE_IN_ALL
132 GSList* g_slist_sort_with_data (GSList *list,
133 GCompareDataFunc compare_func,
134 gpointer user_data) G_GNUC_WARN_UNUSED_RESULT;
135 GLIB_AVAILABLE_IN_ALL
136 gpointer g_slist_nth_data (GSList *list,
139 #define g_slist_next(slist) ((slist) ? (((GSList *)(slist))->next) : NULL)
143 #endif /* __G_SLIST_H__ */