以上的許多函式用於單向鏈結串列是一樣的。下面是串列操作函式的部分列表:
GSList *g_slist_append( GSList *list, gpointer data ); GSList *g_slist_prepend( GSList *list, gpointer data ); GSList *g_slist_insert( GSList *list, gpointer data, gint position ); GSList *g_slist_remove( GSList *list, gpointer data ); GSList *g_slist_remove_link( GSList *list, GSList *link ); GSList *g_slist_reverse( GSList *list ); GSList *g_slist_nth( GSList *list, gint n ); GSList *g_slist_find( GSList *list, gpointer data ); GSList *g_slist_last( GSList *list ); gint g_slist_length( GSList *list ); void g_slist_foreach( GSList *list, GFunc func, gpointer user_data ); |
1 則留言