g_list_first()



Hello,

I am writing an application that uses Singly-Linked Lists for adding and removing elements on that list.

I need to go through the list, identify each element and remove them on the go...

As the subject suggests, there's a function for getting the first element of the list (g_list_first()), which is what I need, but is

only available for the doubly-linked lists implementations...

However, there's one, namely g_slist_nth(),  which should do the trick but on the iteration it fails to get the elements, so I can

do what I want with them.

Am I on the right track, or is there another function in glib.h that would work like a charm for the GSList?

Thanks in advance for the pointers,

Elmano Carvalho
elmano carvalho gmail com




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]