From 0dbf1d8cc4d24c1c1f552a627cf7fcb865ba775b Mon Sep 17 00:00:00 2001 From: Manish Singh Date: Fri, 18 Sep 1998 18:32:59 +0000 Subject: [PATCH] Added g_memdup implementation -Yosh --- ChangeLog | 5 +++++ ChangeLog.pre-2-0 | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ ChangeLog.pre-2-12 | 5 +++++ ChangeLog.pre-2-2 | 5 +++++ ChangeLog.pre-2-4 | 5 +++++ ChangeLog.pre-2-6 | 5 +++++ ChangeLog.pre-2-8 | 5 +++++ glib.h | 3 +++ glib/glib.h | 3 +++ glib/gstrfuncs.c | 9 +++++++++ gstrfuncs.c | 9 +++++++++ 12 files changed, 64 insertions(+) diff --git a/ChangeLog b/ChangeLog index 84690abb0..1b52cf1e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Sep 18 11:31:50 PDT 1998 Manish Singh + + * glib.h + * gstrfuncs.c: added g_memdup implementation + Fri Sep 18 18:46:14 1998 Tim Janik * glib.h: diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 84690abb0..1b52cf1e2 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,8 @@ +Fri Sep 18 11:31:50 PDT 1998 Manish Singh + + * glib.h + * gstrfuncs.c: added g_memdup implementation + Fri Sep 18 18:46:14 1998 Tim Janik * glib.h: diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 84690abb0..1b52cf1e2 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +Fri Sep 18 11:31:50 PDT 1998 Manish Singh + + * glib.h + * gstrfuncs.c: added g_memdup implementation + Fri Sep 18 18:46:14 1998 Tim Janik * glib.h: diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 84690abb0..1b52cf1e2 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,8 @@ +Fri Sep 18 11:31:50 PDT 1998 Manish Singh + + * glib.h + * gstrfuncs.c: added g_memdup implementation + Fri Sep 18 18:46:14 1998 Tim Janik * glib.h: diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 84690abb0..1b52cf1e2 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,8 @@ +Fri Sep 18 11:31:50 PDT 1998 Manish Singh + + * glib.h + * gstrfuncs.c: added g_memdup implementation + Fri Sep 18 18:46:14 1998 Tim Janik * glib.h: diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 84690abb0..1b52cf1e2 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,8 @@ +Fri Sep 18 11:31:50 PDT 1998 Manish Singh + + * glib.h + * gstrfuncs.c: added g_memdup implementation + Fri Sep 18 18:46:14 1998 Tim Janik * glib.h: diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 84690abb0..1b52cf1e2 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,8 @@ +Fri Sep 18 11:31:50 PDT 1998 Manish Singh + + * glib.h + * gstrfuncs.c: added g_memdup implementation + Fri Sep 18 18:46:14 1998 Tim Janik * glib.h: diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 84690abb0..1b52cf1e2 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +Fri Sep 18 11:31:50 PDT 1998 Manish Singh + + * glib.h + * gstrfuncs.c: added g_memdup implementation + Fri Sep 18 18:46:14 1998 Tim Janik * glib.h: diff --git a/glib.h b/glib.h index f9725b6cf..0817691de 100644 --- a/glib.h +++ b/glib.h @@ -1205,6 +1205,9 @@ void g_strreverse (gchar *string); guint g_printf_string_upper_bound (const gchar* format, va_list args); +guint8* g_memdup (const guint8 *mem, + guint len); + /* Retrive static string info */ diff --git a/glib/glib.h b/glib/glib.h index f9725b6cf..0817691de 100644 --- a/glib/glib.h +++ b/glib/glib.h @@ -1205,6 +1205,9 @@ void g_strreverse (gchar *string); guint g_printf_string_upper_bound (const gchar* format, va_list args); +guint8* g_memdup (const guint8 *mem, + guint len); + /* Retrive static string info */ diff --git a/glib/gstrfuncs.c b/glib/gstrfuncs.c index 176985434..d4777368c 100644 --- a/glib/gstrfuncs.c +++ b/glib/gstrfuncs.c @@ -43,6 +43,15 @@ g_strdup (const gchar *str) return new_str; } +guint8* +g_memdup (const guint8 *mem, + guint len) +{ + guint8* mem2 = g_malloc (len); + memcpy (mem2, mem, len); + return mem2; +} + gchar* g_strndup (const gchar *str, guint n) diff --git a/gstrfuncs.c b/gstrfuncs.c index 176985434..d4777368c 100644 --- a/gstrfuncs.c +++ b/gstrfuncs.c @@ -43,6 +43,15 @@ g_strdup (const gchar *str) return new_str; } +guint8* +g_memdup (const guint8 *mem, + guint len) +{ + guint8* mem2 = g_malloc (len); + memcpy (mem2, mem, len); + return mem2; +} + gchar* g_strndup (const gchar *str, guint n)