X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fmodest-pair.h;h=e1ebbfd2e1376ed1113e84d167ef093af18afcbc;hb=b2304dfbb0509edbf1077c0058abfe5a3530511f;hp=d59cd0c650a08ffaa5207cb2013cdf4cd7061112;hpb=259b2c3a417dba1c9170c5353d1740e5c29bf246;p=modest diff --git a/src/modest-pair.h b/src/modest-pair.h index d59cd0c..e1ebbfd 100644 --- a/src/modest-pair.h +++ b/src/modest-pair.h @@ -34,28 +34,50 @@ G_BEGIN_DECLS -struct _ModestPair { +typedef struct _ModestPair { gpointer *first; gpointer *second; gboolean own; -}; -typedef struct _ModestPair ModestPair; +} ModestPair; + +typedef GSList ModestPairList; /** - * modest_pait_new + * modest_pair_new: + * @first: the first element of the pair + * @second: the second element of the pair + * @own: does the pair own the item (ie. should the items be freed when the pair is destroyed) * * create a new ModestPair instance * * Returns: a newly allocated ModestPair instance */ -ModestPair* modest_pair_new (gpointer first, gpointer second, gboolean own); -void modest_pair_destroy (ModestPair *pair); +ModestPair* modest_pair_new (gpointer first, gpointer second, gboolean own); + + +/** + * modest_pair_free: + * @self: a valid ModestPair instance or NULL + * + * free a ModestPair instance. If it was created with own==TRUE, the elements + * will be g_free'd as well. If pair==NULL, nothing will be done. + */ +void modest_pair_free (ModestPair *self); -GSList *modest_pair_gslist_destroy (GSList *pairs); +/** + * modest_pair_list_free: + * @pairs: a valid ModestPairList + * + * convenience function to destroy all pairs in a list + * + * Returns: NULL + */ +ModestPairList *modest_pair_list_free (ModestPairList *pairs); + G_END_DECLS #endif /* __MODEST_PAIR_H__ */