00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef __G_LIST_H__
00029 #define __G_LIST_H__
00030
00031 #include <_ansi.h>
00032 #include <glib/gmem.h>
00033
00034 G_BEGIN_DECLS
00035
00036 typedef struct _GList GList;
00037
00038 struct _GList
00039 {
00040 gpointer data;
00041 GList *next;
00042 GList *prev;
00043 };
00044
00045
00046
00047 IMPORT_C GList* g_list_alloc (void);
00048 IMPORT_C void g_list_free (GList *list);
00049 IMPORT_C void g_list_free_1 (GList *list);
00050 #define g_list_free1 g_list_free_1
00051 IMPORT_C GList* g_list_append (GList *list,
00052 gpointer data) G_GNUC_WARN_UNUSED_RESULT;
00053 IMPORT_C GList* g_list_prepend (GList *list,
00054 gpointer data) G_GNUC_WARN_UNUSED_RESULT;
00055 IMPORT_C GList* g_list_insert (GList *list,
00056 gpointer data,
00057 gint position) G_GNUC_WARN_UNUSED_RESULT;
00058 IMPORT_C GList* g_list_insert_sorted (GList *list,
00059 gpointer data,
00060 GCompareFunc func) G_GNUC_WARN_UNUSED_RESULT;
00061 IMPORT_C GList* g_list_insert_sorted_with_data (GList *list,
00062 gpointer data,
00063 GCompareDataFunc func,
00064 gpointer user_data) G_GNUC_WARN_UNUSED_RESULT;
00065 IMPORT_C GList* g_list_insert_before (GList *list,
00066 GList *sibling,
00067 gpointer data) G_GNUC_WARN_UNUSED_RESULT;
00068 IMPORT_C GList* g_list_concat (GList *list1,
00069 GList *list2) G_GNUC_WARN_UNUSED_RESULT;
00070 IMPORT_C GList* g_list_remove (GList *list,
00071 gconstpointer data) G_GNUC_WARN_UNUSED_RESULT;
00072 IMPORT_C GList* g_list_remove_all (GList *list,
00073 gconstpointer data) G_GNUC_WARN_UNUSED_RESULT;
00074 IMPORT_C GList* g_list_remove_link (GList *list,
00075 GList *llink) G_GNUC_WARN_UNUSED_RESULT;
00076 IMPORT_C GList* g_list_delete_link (GList *list,
00077 GList *link_) G_GNUC_WARN_UNUSED_RESULT;
00078 IMPORT_C GList* g_list_reverse (GList *list);
00079 IMPORT_C GList* g_list_copy (GList *list);
00080 IMPORT_C GList* g_list_nth (GList *list,
00081 guint n);
00082 IMPORT_C GList* g_list_nth_prev (GList *list,
00083 guint n);
00084 IMPORT_C GList* g_list_find (GList *list,
00085 gconstpointer data);
00086 IMPORT_C GList* g_list_find_custom (GList *list,
00087 gconstpointer data,
00088 GCompareFunc func);
00089 IMPORT_C gint g_list_position (GList *list,
00090 GList *llink);
00091 IMPORT_C gint g_list_index (GList *list,
00092 gconstpointer data);
00093 IMPORT_C GList* g_list_last (GList *list);
00094 IMPORT_C GList* g_list_first (GList *list);
00095 IMPORT_C guint g_list_length (GList *list);
00096 IMPORT_C void g_list_foreach (GList *list,
00097 GFunc func,
00098 gpointer user_data);
00099 IMPORT_C GList* g_list_sort (GList *list,
00100 GCompareFunc compare_func) G_GNUC_WARN_UNUSED_RESULT;
00101 IMPORT_C GList* g_list_sort_with_data (GList *list,
00102 GCompareDataFunc compare_func,
00103 gpointer user_data) G_GNUC_WARN_UNUSED_RESULT;
00104 IMPORT_C gpointer g_list_nth_data (GList *list,
00105 guint n);
00106
00107
00108 #define g_list_previous(list) ((list) ? (((GList *)(list))->prev) : NULL)
00109 #define g_list_next(list) ((list) ? (((GList *)(list))->next) : NULL)
00110
00111 #ifndef G_DISABLE_DEPRECATED
00112 IMPORT_C void g_list_push_allocator (gpointer allocator);
00113 IMPORT_C void g_list_pop_allocator (void);
00114 #endif
00115 G_END_DECLS
00116
00117 #endif
00118