glist.h

Go to the documentation of this file.
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 #ifndef __G_LIST_H__
00028 #define __G_LIST_H__
00029 
00030 #include <gmem.h>
00031 
00032 G_BEGIN_DECLS
00033 
00034 typedef struct _GList           GList;
00035 
00036 struct _GList
00037 {
00038   gpointer data;
00039   GList *next;
00040   GList *prev;
00041 };
00042 
00043 /* Doubly linked lists
00044  */
00045 void     g_list_push_allocator (GAllocator       *allocato);
00046 void     g_list_pop_allocator  (void);
00047 GList*   g_list_alloc          (void);
00048 void     g_list_free           (GList            *list);
00049 void     g_list_free_1         (GList            *list);
00050 GList*   g_list_append         (GList            *list,
00051                                 gpointer          data);
00052 GList*   g_list_prepend        (GList            *list,
00053                                 gpointer          data);
00054 GList*   g_list_insert         (GList            *list,
00055                                 gpointer          data,
00056                                 gint              position);
00057 GList*   g_list_insert_sorted  (GList            *list,
00058                                 gpointer          data,
00059                                 GCompareFunc      func);
00060 GList*   g_list_concat         (GList            *list1,
00061                                 GList            *list2);
00062 GList*   g_list_remove         (GList            *list,
00063                                 gconstpointer     data);
00064 GList*   g_list_remove_link    (GList            *list,
00065                                 GList            *llink);
00066 GList*   g_list_delete_link    (GList            *list,
00067                                 GList            *link);
00068 GList*   g_list_reverse        (GList            *list);
00069 GList*   g_list_copy           (GList            *list);
00070 GList*   g_list_nth            (GList            *list,
00071                                 guint             n);
00072 GList*   g_list_find           (GList            *list,
00073                                 gconstpointer     data);
00074 GList*   g_list_find_custom    (GList            *list,
00075                                 gconstpointer     data,
00076                                 GCompareFunc      func);
00077 gint     g_list_position       (GList            *list,
00078                                 GList            *llink);
00079 gint     g_list_index          (GList            *list,
00080                                 gconstpointer     data);
00081 GList*   g_list_last           (GList            *list);
00082 GList*   g_list_first          (GList            *list);
00083 guint    g_list_length         (GList            *list);
00084 void     g_list_foreach        (GList            *list,
00085                                 GFunc             func,
00086                                 gpointer          user_data);
00087 GList*   g_list_sort           (GList            *list,
00088                                 GCompareFunc      compare_func);
00089 GList*   g_list_sort_with_data (GList            *list,
00090                                 GCompareFuncData  compare_func,
00091                                 gpointer          user_data);
00092 gpointer g_list_nth_data       (GList            *list,
00093                                 guint             n);
00094 
00095 #define g_list_previous(list)   ((list) ? (((GList *)(list))->prev) : NULL)
00096 #define g_list_next(list)       ((list) ? (((GList *)(list))->next) : NULL)
00097 
00098 G_END_DECLS
00099 
00100 #endif /* __G_LIST_H__ */
00101 

Generated on Tue Jul 5 14:14:41 2011 for ROOT_528-00b_version by  doxygen 1.5.1