1 /* 2 * Distributed under the Boost Software License, Version 1.0. 3 * (See accompanying file LICENSE_1_0.txt or copy at 4 * http://www.boost.org/LICENSE_1_0.txt) 5 */ 6 module glib.gslist; 7 8 import glib.gtypes; 9 import glib.gmem; 10 import glib.gnode; 11 12 13 14 struct GSList 15 { 16 gpointer data; 17 GSList *next; 18 } 19 20 21 extern (C) { 22 23 GSList* g_slist_alloc (); 24 25 void g_slist_free (GSList *list); 26 27 void g_slist_free_1 (GSList *list); 28 alias g_slist_free1 = g_slist_free_1; 29 30 void g_slist_free_full (GSList *list, 31 GDestroyNotify free_func); 32 33 GSList* g_slist_append (GSList *list, 34 gpointer data); 35 36 GSList* g_slist_prepend (GSList *list, 37 gpointer data); 38 39 GSList* g_slist_insert (GSList *list, 40 gpointer data, 41 gint position); 42 43 GSList* g_slist_insert_sorted (GSList *list, 44 gpointer data, 45 GCompareFunc func); 46 47 GSList* g_slist_insert_sorted_with_data (GSList *list, 48 gpointer data, 49 GCompareDataFunc func, 50 gpointer user_data); 51 52 GSList* g_slist_insert_before (GSList *slist, 53 GSList *sibling, 54 gpointer data); 55 56 GSList* g_slist_concat (GSList *list1, 57 GSList *list2); 58 59 GSList* g_slist_remove (GSList *list, 60 gconstpointer data); 61 62 GSList* g_slist_remove_all (GSList *list, 63 gconstpointer data); 64 65 GSList* g_slist_remove_link (GSList *list, 66 GSList *link_); 67 68 GSList* g_slist_delete_link (GSList *list, 69 GSList *link_); 70 71 GSList* g_slist_reverse (GSList *list); 72 73 GSList* g_slist_copy (GSList *list); 74 75 76 GSList* g_slist_copy_deep (GSList *list, 77 GCopyFunc func, 78 gpointer user_data); 79 80 GSList* g_slist_nth (GSList *list, 81 guint n); 82 83 GSList* g_slist_find (GSList *list, 84 gconstpointer data); 85 86 GSList* g_slist_find_custom (GSList *list, 87 gconstpointer data, 88 GCompareFunc func); 89 90 gint g_slist_position (GSList *list, 91 GSList *llink); 92 93 gint g_slist_index (GSList *list, 94 gconstpointer data); 95 96 GSList* g_slist_last (GSList *list); 97 98 guint g_slist_length (GSList *list); 99 100 void g_slist_foreach (GSList *list, 101 GFunc func, 102 gpointer user_data); 103 104 GSList* g_slist_sort (GSList *list, 105 GCompareFunc compare_func); 106 107 GSList* g_slist_sort_with_data (GSList *list, 108 GCompareDataFunc compare_func, 109 gpointer user_data); 110 111 gpointer g_slist_nth_data (GSList *list, 112 guint n); 113 114 115 } 116 117 auto g_slist_next(S)(S slist) { 118 return slist ? slist.next : null; 119 } 120