Navit SVN

/work/compile/navit/src/navit/support/glib/gslist.h

00001 /* GLIB - Library of useful routines for C programming
00002  * Copyright (C) 1995-1997  Peter Mattis, Spencer Kimball and Josh MacDonald
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the
00016  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00017  * Boston, MA 02111-1307, USA.
00018  */
00019 
00020 /*
00021  * Modified by the GLib Team and others 1997-2000.  See the AUTHORS
00022  * file for a list of people on the GLib Team.  See the ChangeLog
00023  * files for a list of changes.  These files are distributed with
00024  * GLib at ftp://ftp.gtk.org/pub/gtk/.
00025  */
00026 
00027 #if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
00028 #error "Only <glib.h> can be included directly."
00029 #endif
00030 
00031 #ifndef __G_SLIST_H__
00032 #define __G_SLIST_H__
00033 
00034 /* #include <glib/gmem.h> */
00035 
00036 G_BEGIN_DECLS
00037 
00038 typedef struct _GSList GSList;
00039 
00040 struct _GSList
00041 {
00042   gpointer data;
00043   GSList *next;
00044 };
00045 
00046 /* Singly linked lists
00047  */
00048 GSList*  g_slist_alloc                   (void) G_GNUC_WARN_UNUSED_RESULT;
00049 void     g_slist_free                    (GSList           *list);
00050 void     g_slist_free_1                  (GSList           *list);
00051 #define  g_slist_free1                   g_slist_free_1
00052 void     g_slist_free_full               (GSList           *list,
00053                                           GDestroyNotify    free_func);
00054 GSList*  g_slist_append                  (GSList           *list,
00055                                           gpointer          data) G_GNUC_WARN_UNUSED_RESULT;
00056 GSList*  g_slist_prepend                 (GSList           *list,
00057                                           gpointer          data) G_GNUC_WARN_UNUSED_RESULT;
00058 GSList*  g_slist_insert                  (GSList           *list,
00059                                           gpointer          data,
00060                                           gint              position) G_GNUC_WARN_UNUSED_RESULT;
00061 GSList*  g_slist_insert_sorted           (GSList           *list,
00062                                           gpointer          data,
00063                                           GCompareFunc      func) G_GNUC_WARN_UNUSED_RESULT;
00064 GSList*  g_slist_insert_sorted_with_data (GSList           *list,
00065                                           gpointer          data,
00066                                           GCompareDataFunc  func,
00067                                           gpointer          user_data) G_GNUC_WARN_UNUSED_RESULT;
00068 GSList*  g_slist_insert_before           (GSList           *slist,
00069                                           GSList           *sibling,
00070                                           gpointer          data) G_GNUC_WARN_UNUSED_RESULT;
00071 GSList*  g_slist_concat                  (GSList           *list1,
00072                                           GSList           *list2) G_GNUC_WARN_UNUSED_RESULT;
00073 GSList*  g_slist_remove                  (GSList           *list,
00074                                           gconstpointer     data) G_GNUC_WARN_UNUSED_RESULT;
00075 GSList*  g_slist_remove_all              (GSList           *list,
00076                                           gconstpointer     data) G_GNUC_WARN_UNUSED_RESULT;
00077 GSList*  g_slist_remove_link             (GSList           *list,
00078                                           GSList           *link_) G_GNUC_WARN_UNUSED_RESULT;
00079 GSList*  g_slist_delete_link             (GSList           *list,
00080                                           GSList           *link_) G_GNUC_WARN_UNUSED_RESULT;
00081 GSList*  g_slist_reverse                 (GSList           *list) G_GNUC_WARN_UNUSED_RESULT;
00082 GSList*  g_slist_copy                    (GSList           *list) G_GNUC_WARN_UNUSED_RESULT;
00083 GSList*  g_slist_nth                     (GSList           *list,
00084                                           guint             n);
00085 GSList*  g_slist_find                    (GSList           *list,
00086                                           gconstpointer     data);
00087 GSList*  g_slist_find_custom             (GSList           *list,
00088                                           gconstpointer     data,
00089                                           GCompareFunc      func);
00090 gint     g_slist_position                (GSList           *list,
00091                                           GSList           *llink);
00092 gint     g_slist_index                   (GSList           *list,
00093                                           gconstpointer     data);
00094 GSList*  g_slist_last                    (GSList           *list);
00095 guint    g_slist_length                  (GSList           *list);
00096 void     g_slist_foreach                 (GSList           *list,
00097                                           GFunc             func,
00098                                           gpointer          user_data);
00099 GSList*  g_slist_sort                    (GSList           *list,
00100                                           GCompareFunc      compare_func) G_GNUC_WARN_UNUSED_RESULT;
00101 GSList*  g_slist_sort_with_data          (GSList           *list,
00102                                           GCompareDataFunc  compare_func,
00103                                           gpointer          user_data) G_GNUC_WARN_UNUSED_RESULT;
00104 gpointer g_slist_nth_data                (GSList           *list,
00105                                           guint             n);
00106 
00107 #define  g_slist_next(slist)             ((slist) ? (((GSList *)(slist))->next) : NULL)
00108 
00109 #ifndef G_DISABLE_DEPRECATED
00110 void     g_slist_push_allocator          (gpointer         dummy);
00111 void     g_slist_pop_allocator           (void);
00112 #endif
00113 
00114 G_END_DECLS
00115 
00116 #endif /* __G_SLIST_H__ */