Utility function to free a GList of strings.

svn path=/trunk/; revision=3048
This commit is contained in:
Ettore Perazzoli
2000-05-15 17:16:55 +00:00
parent e927ce214f
commit 6dfcfd767d
5 changed files with 40 additions and 10 deletions

View File

@ -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

View File

@ -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 *

View File

@ -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 *

View File

@ -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_ */

View File

@ -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_ */