Re: g_list_find
- From: Tim Müller <zen18864 zen co uk>
- To: gtk-app-devel-list gnome org, "Johnny" <johnny troppoilmigliore inwind it>
- Subject: Re: g_list_find
- Date: Mon, 26 Apr 2004 15:52:15 +0100
On Monday 26 April 2004 15:25, Johnny wrote:
I have to find in a GList a string,can g_list_find do it?
g_list_find() will only work if you know the exact pointer value of the string
you inserted into the list, it will not check whether the contents, ie. the
strings itself, are the same (so it's most likely not what you want).
GList *node;
node = g_list_find_custom (list,
"Find this",
(GCompareFunc) strcmp);
or
node = g_list_find_custom (list,
"Find this",
(GCompareFunc) g_ascii_strcasecmp);
should do the trick.
Cheers
-Tim
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]