diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2007-08-23 08:01:06 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2007-08-23 08:01:06 +0000 |
commit | 75b016927c9deb7c1a1b05628aa2fe56d9c8f255 (patch) | |
tree | ba01dd57ebfad3a846d37dbf84b34cc482f95666 /eglib/gmain.c | |
parent | 73b35c403df78c10e03ded497fcb16fcb23b822e (diff) |
Fix missing eglib functions
Diffstat (limited to 'eglib/gmain.c')
-rw-r--r-- | eglib/gmain.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/eglib/gmain.c b/eglib/gmain.c index f658b02a..9a4f0097 100644 --- a/eglib/gmain.c +++ b/eglib/gmain.c @@ -1289,16 +1289,30 @@ gchar *g_strdup(const gchar *str) return s; } -gchar* g_strdup_printf(const gchar *format, ...) +gchar *g_strdup_printf(const gchar *format, ...) { - /* FIXME: Implement this */ - return g_strdup(format); + va_list args; + gchar buffer[1024]; + gint length; + + va_start(args, format); + length = vsnprintf(buffer, sizeof(buffer) - 1, format, args); + va_end(args); + + return strdup(buffer); } -gchar* g_strdelimit(gchar *string, const gchar *delimiters, - gchar new_delimiter) +gchar *g_strdelimit(gchar *string, const gchar *delimiters, gchar new_delim) { - /* FIXME: Implement this */ + register gchar *c; + + if (!string) + return NULL; + + for (c = string; *c; c++) + if (strchr(delimiters, *c)) + *c = new_delim; + return string; } |