Re: comments on g_list_slice / g_list_splice



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
  last);

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
useful.

-- 
Paul "LeoNerd" Evans

leonerd leonerd org uk
ICQ# 4135350       |  Registered Linux# 179460
http://www.leonerd.org.uk/

Attachment: signature.asc
Description: PGP signature



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