some things...



Hi, I'm making a new gtk-mail program with pop3 functionality. Now I must
to implement the GList foreach single mail. Ok for this, but which are the
differences between GList and GSList? Ok, i have read the GList are the
Linked List and GSList are the Signle (?) List, but I see (in the gtk
manual) that the 2 gtk-items have the same function. Which are ,so, the
difference? Now i'm reading the glib.h file and see that the difference
(logic!!!) are :

struct _GList
{
  gpointer data;
  GList *next;
  GList *prev;     <---- this is the difference
};

struct _GSList
{
  gpointer data;
  GSList *next;
};


In the Linked list can someone add an pointer to the aim current item? 
And the linked function g_list_next and g_list_prev ?
Are these function not usefull? 

And now String items... 
I have write sone new function, and these are the single code : 
char *
g_string_return(GString *string)
{ return string->str;
}

int 
g_string_length(GString *string)
{ return string->len;
}

int
g_strncmp(gchar *s1, gchar *s2, int n)
{
  return (strncmp(s1,s2,n));
}

int g_string_ncmp(GString *s1, GString *s2, int n)
{ return g_strncmp(s1->str, s2->str,n);
}

I think that an interface between the implementation and what the coder
want to see (and learn) is better that none.

ciaoz
--
Morelli 'ZioBudda' Davide Michel - Member of Pluto Linux User Group
ziobudda@chiara.dei.unipd.it - http://www.dau.ing.univaq.it/~ziobudda/
Linux Problem? Ask to linux@media.dsi.unimi.it
"/dev/ziobudda: access to /var/tmp/beer denied, use /var/adm/pineapple"



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