g_slist_foreach
- From: Sascha Ziemann <szi aibon ping de>
- To: GTK Mailinglist <gtk-list redhat com>
- Subject: g_slist_foreach
- Date: 02 Sep 1998 14:24:57 +0200
This definition of g_slist_foreach is not able to report errors during
execution of the user function.
void
g_slist_foreach (GSList *list,
GFunc func,
gpointer user_data)
{
while (list)
{
(*func) (list->data, user_data);
list = list->next;
}
}
I think it should be changed in this way to be able to catch errors:
gint
g_slist_foreach (GSList *list,
GFunc func,
gpointer user_data)
{
gint result;
while (list)
{
result = (*func) (list->data, user_data);
if (result) return result;
list = list->next;
}
return 0;
}
--
/* In the beginning was the Word: */
typedef long SCM;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]