From 6dfcfd767d0e0c515609cd36a80d8cc65370e264 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Mon, 15 May 2000 17:16:55 +0000 Subject: Utility function to free a GList of strings. svn path=/trunk/; revision=3048 --- e-util/ChangeLog | 4 ++++ e-util/e-util.c | 11 +++++++++++ e-util/e-util.c-8611 | 11 +++++++++++ e-util/e-util.h | 12 +++++++----- e-util/e-util.h-29002 | 12 +++++++----- 5 files changed, 40 insertions(+), 10 deletions(-) (limited to 'e-util') diff --git a/e-util/ChangeLog b/e-util/ChangeLog index 015d840969..a672adfa2d 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,7 @@ +2000-05-15 Ettore Perazzoli + + * e-util.c (e_free_string_list): New function. + 2000-05-14 Christopher James Lahey * e-util.c, e-util.h: Added e_strdup_strip which returns a copy of diff --git a/e-util/e-util.c b/e-util/e-util.c index 33c10aba5c..fd167599df 100644 --- a/e-util/e-util.c +++ b/e-util/e-util.c @@ -74,6 +74,17 @@ e_free_object_list (GList *list) g_list_free (list); } +void +e_free_string_list (GList *list) +{ + GList *p; + + for (p = list; p != NULL; p = p->next) + g_free (p->data); + + g_list_free (list); +} + #define BUFF_SIZE 1024 char * diff --git a/e-util/e-util.c-8611 b/e-util/e-util.c-8611 index 33c10aba5c..fd167599df 100644 --- a/e-util/e-util.c-8611 +++ b/e-util/e-util.c-8611 @@ -74,6 +74,17 @@ e_free_object_list (GList *list) g_list_free (list); } +void +e_free_string_list (GList *list) +{ + GList *p; + + for (p = list; p != NULL; p = p->next) + g_free (p->data); + + g_list_free (list); +} + #define BUFF_SIZE 1024 char * diff --git a/e-util/e-util.h b/e-util/e-util.h index 2043235cf7..fef56c0531 100644 --- a/e-util/e-util.h +++ b/e-util/e-util.h @@ -31,12 +31,14 @@ typedef enum { E_FOCUS_END } EFocus; -int g_str_compare(const void *x, const void *y); -int g_int_compare(const void *x, const void *y); +int g_str_compare (const void *x, const void *y); +int g_int_compare (const void *x, const void *y); -char *e_strdup_strip(char *string); +char *e_strdup_strip (char *string); -void e_free_object_list (GList *list); -char *e_read_file(const char *filename); +void e_free_object_list (GList *list); +void e_free_string_list (GList *list); + +char *e_read_file (const char *filename); #endif /* _E_UTIL_H_ */ diff --git a/e-util/e-util.h-29002 b/e-util/e-util.h-29002 index 2043235cf7..fef56c0531 100644 --- a/e-util/e-util.h-29002 +++ b/e-util/e-util.h-29002 @@ -31,12 +31,14 @@ typedef enum { E_FOCUS_END } EFocus; -int g_str_compare(const void *x, const void *y); -int g_int_compare(const void *x, const void *y); +int g_str_compare (const void *x, const void *y); +int g_int_compare (const void *x, const void *y); -char *e_strdup_strip(char *string); +char *e_strdup_strip (char *string); -void e_free_object_list (GList *list); -char *e_read_file(const char *filename); +void e_free_object_list (GList *list); +void e_free_string_list (GList *list); + +char *e_read_file (const char *filename); #endif /* _E_UTIL_H_ */ -- cgit v1.2.3