Fwd: Re: comments on g_list_slice / g_list_splice

I just realized that all of the APIs need to return the original list because it
 can be modified. The way I'm playing with it now, the slice calls would simply 
unlink 'link' and it is up to the caller to reuse the same 'link' pointer as the
 newly separated list.. 

----- Original Message -----
From: Paul Leonerd Evans  <leonerd leonerd org uk>
At: 11/30  5:49

On Wed, 30 Nov 2005 00:57:42 -0500
"ANDREW PAPROCKI, BLOOMBERG/ 731 LEXIN" <apaprocki bloomberg net> wrote:

> GList * g_list_slice(GList *list, GList *link, gint n_links);
> GList * g_list_remove_slice(GList *list, GList *link, gint n_links);
> GList * g_list_splice(GList *list, GList *splice_list, gint position);
> GList * g_list_splice_before(GList *list, GList *splice_list, GList
> *sibling);

I added myself

 GPtrArray* g_ptr_array_slice(const GPtrArray* orig, guint first, gint

I have found it more useful to pass offset indexes. For arrays this is
the only sensible choice, but for lists it's somewhat harder to say what
is the correct way of "indexing" them. Offset count, or link node pointer?

Either way, the presence of functions which do that job, sound very

Paul "LeoNerd" Evans

leonerd leonerd org uk
ICQ# 4135350       |  Registered Linux# 179460

gtk-devel-list mailing list
gtk-devel-list gnome org

Attachment: signatur.asc
Description: Binary data

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