diff options
author | Miguel de Icaza <miguel@gnome.org> | 2009-02-06 00:24:41 +0300 |
---|---|---|
committer | Miguel de Icaza <miguel@gnome.org> | 2009-02-06 00:24:41 +0300 |
commit | 1df1b72f37f28b854c4702024b72c21f8a508c4c (patch) | |
tree | 665e8d7db08115e23710a11ad1b6873143f9817a /eglib | |
parent | 76bcb8a5e225dee30d6b1532c280d500ea395b1e (diff) |
2009-02-05 Miguel de Icaza <miguel@novell.com>
* src/gstr.c: Add g_strnfill
* src/glib.h: Add g_list_previous
svn path=/trunk/mono/; revision=125934
Diffstat (limited to 'eglib')
-rw-r--r-- | eglib/ChangeLog | 6 | ||||
-rw-r--r-- | eglib/src/glib.h | 2 | ||||
-rw-r--r-- | eglib/src/gstr.c | 13 |
3 files changed, 19 insertions, 2 deletions
diff --git a/eglib/ChangeLog b/eglib/ChangeLog index c421a095449..d898416d6ed 100644 --- a/eglib/ChangeLog +++ b/eglib/ChangeLog @@ -1,3 +1,9 @@ +2009-02-05 Miguel de Icaza <miguel@novell.com> + + * src/gstr.c: Add g_strnfill + + * src/glib.h: Add g_list_previous + 2009-01-19 Bill Holmes <billholmes54@gmail.com> * gmisc-win32.c (g_path_is_absolute): Adding support for UNC diff --git a/eglib/src/glib.h b/eglib/src/glib.h index 9afdda33385..c60a0c6ab48 100644 --- a/eglib/src/glib.h +++ b/eglib/src/glib.h @@ -234,6 +234,7 @@ gchar *g_strjoinv (const gchar *separator, gchar **str_array); gchar *g_strchug (gchar *str); gchar *g_strchomp (gchar *str); void g_strdown (gchar *string); +gchar *g_strnfill (gsize length, gchar fill_char); gchar *g_strdelimit (gchar *string, const gchar *delimiters, gchar new_delimiter); gchar *g_strescape (const gchar *source, const gchar *exceptions); @@ -366,6 +367,7 @@ struct _GList { }; #define g_list_next(list) ((list) ? (((GList *) (list))->next) : NULL) +#define g_list_previous(list) ((list) ? (((GList *) (list))->prev) : NULL) GList *g_list_alloc (void); GList *g_list_append (GList *list, diff --git a/eglib/src/gstr.c b/eglib/src/gstr.c index 6a2b963fbd5..ccf12d8f11c 100644 --- a/eglib/src/gstr.c +++ b/eglib/src/gstr.c @@ -826,6 +826,15 @@ g_ascii_xdigit_value (gchar c) (c - 'A' + 10)))); } +gchar * +g_strnfill (gsize length, gchar fill_char) +{ + gchar *ret = g_new (gchar, length + 1); + int i; - - + for (i = 0; i < length; i++) + ret [i] = fill_char; + + ret [length] = 0; + return ret; +} |