[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: String equivalence in glib functions (such as g_slist_remove)
- From: David Nečas (Yeti) <yeti physics muni cz>
- To: gtk-list gnome org
- Subject: Re: String equivalence in glib functions (such as g_slist_remove)
- Date: Sat, 28 Jul 2007 21:02:22 +0200
On Sat, Jul 28, 2007 at 07:51:42PM +0100, j t wrote:
> ...
> I assume that this is because the dynamically allocated strings aren't
> "the same" (i.e. they're at different places in memory). What do
> people generally do when their idea of equivalence isn't the same as
> "=="? Is there some way of getting glib's functions to use an
> "equivalence function" rather than the "hardcoded" "=="?
Use g_slist_find_custom() to find the item using an
arbitrary comparison function (in the described example you
can directly pass a string comparison function) and then
remove it. Most GLib data structures offer this kind of
functionality.
Yeti
--
http://gwyddion.net/
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]