From d55e49c51f3a45aa4fb3efe22e144bed70549f1b Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Fri, 29 Jun 2001 23:42:14 +0000 Subject: Add e_free_string_slist() and e_free_object_slist(). svn path=/trunk/; revision=10613 --- e-util/e-util.c | 21 +++++++++++++++++++++ e-util/e-util.h | 4 ++++ 2 files changed, 25 insertions(+) diff --git a/e-util/e-util.c b/e-util/e-util.c index 35412510d9..82799d280f 100644 --- a/e-util/e-util.c +++ b/e-util/e-util.c @@ -89,6 +89,17 @@ e_free_object_list (GList *list) g_list_free (list); } +void +e_free_object_slist (GSList *list) +{ + GSList *p; + + for (p = list; p != NULL; p = p->next) + gtk_object_unref (GTK_OBJECT (p->data)); + + g_slist_free (list); +} + void e_free_string_list (GList *list) { @@ -100,6 +111,16 @@ e_free_string_list (GList *list) g_list_free (list); } +void +e_free_string_slist (GSList *list) +{ + GSList *p; + + for (p = list; p != NULL; p = p->next) + g_free (p->data); + g_slist_free (list); +} + #define BUFF_SIZE 1024 char * diff --git a/e-util/e-util.h b/e-util/e-util.h index 3c78825628..8f99e0f8d5 100644 --- a/e-util/e-util.h +++ b/e-util/e-util.h @@ -63,8 +63,12 @@ int g_str_compare (cons int g_int_compare (const void *x, const void *y); char *e_strdup_strip (const char *string); + void e_free_object_list (GList *list); +void e_free_object_slist (GSList *list); void e_free_string_list (GList *list); +void e_free_string_slist (GSList *list); + char *e_read_file (const char *filename); int e_write_file (const char *filename, const char *data, -- cgit v1.2.3