diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2000-05-16 01:16:55 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2000-05-16 01:16:55 +0800 |
commit | 6dfcfd767d0e0c515609cd36a80d8cc65370e264 (patch) | |
tree | 3b8b5964f6a47c7f0e01094e296eb7da6198ff8f /e-util | |
parent | e927ce214f28163a2159129e2d4771da274d5611 (diff) | |
download | gsoc2013-evolution-6dfcfd767d0e0c515609cd36a80d8cc65370e264.tar.gz gsoc2013-evolution-6dfcfd767d0e0c515609cd36a80d8cc65370e264.tar.zst gsoc2013-evolution-6dfcfd767d0e0c515609cd36a80d8cc65370e264.zip |
Utility function to free a GList of strings.
svn path=/trunk/; revision=3048
Diffstat (limited to 'e-util')
-rw-r--r-- | e-util/ChangeLog | 4 | ||||
-rw-r--r-- | e-util/e-util.c | 11 | ||||
-rw-r--r-- | e-util/e-util.c-8611 | 11 | ||||
-rw-r--r-- | e-util/e-util.h | 12 | ||||
-rw-r--r-- | e-util/e-util.h-29002 | 12 |
5 files changed, 40 insertions, 10 deletions
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 <ettore@helixcode.com> + + * e-util.c (e_free_string_list): New function. + 2000-05-14 Christopher James Lahey <clahey@helixcode.com> * 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_ */ |