list filtering



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I have implemented list filtering functions for my own purpose since there 
were none in glib.

typedef gboolean (*GPredicateFunc)(gpointer data, gpointer cond);
GList* g_list_filter & g_slist_filter(GList* list, GList** filtered_elements, 
GPredicateFunc f, gpointer filter_cond)

It scans through the list. For every element which fulfills the filter 
condition, the element is removed from list and put on filtered_elements. The 
result is two lists: The remaining elements are returned, while the elements 
which were removed are in *filtered_elements (in no particular order).

Would this functionality be interesting for glib? If so tell me where I can 
send a patch.

- -- 
Jörgen Sigvardsson, B. Sc.
Lecturer, Computer Science Dept. Karlstad University
Tel: +46-(0)54-700 1786
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.3 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE6N2i7JtcD8rikkmwRAlUsAKCNYXLqAr9XQvq5z62f97e6jw5atQCgitOn
+RjpfV4RWvZDrpRUOvU31zM=
=uLrF
-----END PGP SIGNATURE-----




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