Added g_memdup implementation

-Yosh
This commit is contained in:
Manish Singh 1998-09-18 18:32:59 +00:00
parent 4193614b1c
commit 0dbf1d8cc4
12 changed files with 64 additions and 0 deletions

View File

@ -1,3 +1,8 @@
Fri Sep 18 11:31:50 PDT 1998 Manish Singh <yosh@gimp.org>
* glib.h
* gstrfuncs.c: added g_memdup implementation
Fri Sep 18 18:46:14 1998 Tim Janik <timj@gtk.org> Fri Sep 18 18:46:14 1998 Tim Janik <timj@gtk.org>
* glib.h: * glib.h:

View File

@ -1,3 +1,8 @@
Fri Sep 18 11:31:50 PDT 1998 Manish Singh <yosh@gimp.org>
* glib.h
* gstrfuncs.c: added g_memdup implementation
Fri Sep 18 18:46:14 1998 Tim Janik <timj@gtk.org> Fri Sep 18 18:46:14 1998 Tim Janik <timj@gtk.org>
* glib.h: * glib.h:

View File

@ -1,3 +1,8 @@
Fri Sep 18 11:31:50 PDT 1998 Manish Singh <yosh@gimp.org>
* glib.h
* gstrfuncs.c: added g_memdup implementation
Fri Sep 18 18:46:14 1998 Tim Janik <timj@gtk.org> Fri Sep 18 18:46:14 1998 Tim Janik <timj@gtk.org>
* glib.h: * glib.h:

View File

@ -1,3 +1,8 @@
Fri Sep 18 11:31:50 PDT 1998 Manish Singh <yosh@gimp.org>
* glib.h
* gstrfuncs.c: added g_memdup implementation
Fri Sep 18 18:46:14 1998 Tim Janik <timj@gtk.org> Fri Sep 18 18:46:14 1998 Tim Janik <timj@gtk.org>
* glib.h: * glib.h:

View File

@ -1,3 +1,8 @@
Fri Sep 18 11:31:50 PDT 1998 Manish Singh <yosh@gimp.org>
* glib.h
* gstrfuncs.c: added g_memdup implementation
Fri Sep 18 18:46:14 1998 Tim Janik <timj@gtk.org> Fri Sep 18 18:46:14 1998 Tim Janik <timj@gtk.org>
* glib.h: * glib.h:

View File

@ -1,3 +1,8 @@
Fri Sep 18 11:31:50 PDT 1998 Manish Singh <yosh@gimp.org>
* glib.h
* gstrfuncs.c: added g_memdup implementation
Fri Sep 18 18:46:14 1998 Tim Janik <timj@gtk.org> Fri Sep 18 18:46:14 1998 Tim Janik <timj@gtk.org>
* glib.h: * glib.h:

View File

@ -1,3 +1,8 @@
Fri Sep 18 11:31:50 PDT 1998 Manish Singh <yosh@gimp.org>
* glib.h
* gstrfuncs.c: added g_memdup implementation
Fri Sep 18 18:46:14 1998 Tim Janik <timj@gtk.org> Fri Sep 18 18:46:14 1998 Tim Janik <timj@gtk.org>
* glib.h: * glib.h:

View File

@ -1,3 +1,8 @@
Fri Sep 18 11:31:50 PDT 1998 Manish Singh <yosh@gimp.org>
* glib.h
* gstrfuncs.c: added g_memdup implementation
Fri Sep 18 18:46:14 1998 Tim Janik <timj@gtk.org> Fri Sep 18 18:46:14 1998 Tim Janik <timj@gtk.org>
* glib.h: * glib.h:

3
glib.h
View File

@ -1205,6 +1205,9 @@ void g_strreverse (gchar *string);
guint g_printf_string_upper_bound (const gchar* format, guint g_printf_string_upper_bound (const gchar* format,
va_list args); va_list args);
guint8* g_memdup (const guint8 *mem,
guint len);
/* Retrive static string info /* Retrive static string info
*/ */

View File

@ -1205,6 +1205,9 @@ void g_strreverse (gchar *string);
guint g_printf_string_upper_bound (const gchar* format, guint g_printf_string_upper_bound (const gchar* format,
va_list args); va_list args);
guint8* g_memdup (const guint8 *mem,
guint len);
/* Retrive static string info /* Retrive static string info
*/ */

View File

@ -43,6 +43,15 @@ g_strdup (const gchar *str)
return new_str; return new_str;
} }
guint8*
g_memdup (const guint8 *mem,
guint len)
{
guint8* mem2 = g_malloc (len);
memcpy (mem2, mem, len);
return mem2;
}
gchar* gchar*
g_strndup (const gchar *str, g_strndup (const gchar *str,
guint n) guint n)

View File

@ -43,6 +43,15 @@ g_strdup (const gchar *str)
return new_str; return new_str;
} }
guint8*
g_memdup (const guint8 *mem,
guint len)
{
guint8* mem2 = g_malloc (len);
memcpy (mem2, mem, len);
return mem2;
}
gchar* gchar*
g_strndup (const gchar *str, g_strndup (const gchar *str,
guint n) guint n)