From: Manish Singh Date: Sun, 1 Aug 1999 00:54:14 +0000 (+0000) Subject: glib.h the #define for g_strescape interfered with the compilation of the X-Git-Tag: GLIB_1_3_1~159 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4877766d0efcf6ab78300a4beab8fab5e9749fa5;p=platform%2Fupstream%2Fglib.git glib.h the #define for g_strescape interfered with the compilation of the * glib.h * gstrfuncs.c: the #define for g_strescape interfered with the compilation of the function, so just remove the function and note that it's deprecated in the header -Yosh --- diff --git a/ChangeLog b/ChangeLog index 9f3113e..60df74c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Sat Jul 31 17:52:03 PDT 1999 Manish Singh + + * glib.h + * gstrfuncs.c: the #define for g_strescape interfered with the + compilation of the function, so just remove the function and + note that it's deprecated in the header + 1999-08-01 Tor Lillqvist * gstrfuncs.c (g_strccpy, g_strecpy): New functions. diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 9f3113e..60df74c 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,10 @@ +Sat Jul 31 17:52:03 PDT 1999 Manish Singh + + * glib.h + * gstrfuncs.c: the #define for g_strescape interfered with the + compilation of the function, so just remove the function and + note that it's deprecated in the header + 1999-08-01 Tor Lillqvist * gstrfuncs.c (g_strccpy, g_strecpy): New functions. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 9f3113e..60df74c 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,10 @@ +Sat Jul 31 17:52:03 PDT 1999 Manish Singh + + * glib.h + * gstrfuncs.c: the #define for g_strescape interfered with the + compilation of the function, so just remove the function and + note that it's deprecated in the header + 1999-08-01 Tor Lillqvist * gstrfuncs.c (g_strccpy, g_strecpy): New functions. diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 9f3113e..60df74c 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,10 @@ +Sat Jul 31 17:52:03 PDT 1999 Manish Singh + + * glib.h + * gstrfuncs.c: the #define for g_strescape interfered with the + compilation of the function, so just remove the function and + note that it's deprecated in the header + 1999-08-01 Tor Lillqvist * gstrfuncs.c (g_strccpy, g_strecpy): New functions. diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 9f3113e..60df74c 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,10 @@ +Sat Jul 31 17:52:03 PDT 1999 Manish Singh + + * glib.h + * gstrfuncs.c: the #define for g_strescape interfered with the + compilation of the function, so just remove the function and + note that it's deprecated in the header + 1999-08-01 Tor Lillqvist * gstrfuncs.c (g_strccpy, g_strecpy): New functions. diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 9f3113e..60df74c 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,10 @@ +Sat Jul 31 17:52:03 PDT 1999 Manish Singh + + * glib.h + * gstrfuncs.c: the #define for g_strescape interfered with the + compilation of the function, so just remove the function and + note that it's deprecated in the header + 1999-08-01 Tor Lillqvist * gstrfuncs.c (g_strccpy, g_strecpy): New functions. diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 9f3113e..60df74c 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,10 @@ +Sat Jul 31 17:52:03 PDT 1999 Manish Singh + + * glib.h + * gstrfuncs.c: the #define for g_strescape interfered with the + compilation of the function, so just remove the function and + note that it's deprecated in the header + 1999-08-01 Tor Lillqvist * gstrfuncs.c (g_strccpy, g_strecpy): New functions. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 9f3113e..60df74c 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,10 @@ +Sat Jul 31 17:52:03 PDT 1999 Manish Singh + + * glib.h + * gstrfuncs.c: the #define for g_strescape interfered with the + compilation of the function, so just remove the function and + note that it's deprecated in the header + 1999-08-01 Tor Lillqvist * gstrfuncs.c (g_strccpy, g_strecpy): New functions. diff --git a/glib.h b/glib.h index fb69482..dac8f51 100644 --- a/glib.h +++ b/glib.h @@ -1528,11 +1528,8 @@ gchar* g_strecpy (gchar *dest, const gchar *source, const gchar *exceptions); -/* deprecated function */ -gchar* g_strescape (gchar *string); - -/* Define a macro for it */ -#define g_strescape(src) g_strecpy (g_malloc (strlen (src)*4+1), src, NULL) +/* deprecated function (used to be a real function) */ +#define g_strescape(src) g_strecpy (g_new (char, strlen (src)*4+1), (src), NULL) gpointer g_memdup (gconstpointer mem, guint byte_size); diff --git a/glib/glib.h b/glib/glib.h index fb69482..dac8f51 100644 --- a/glib/glib.h +++ b/glib/glib.h @@ -1528,11 +1528,8 @@ gchar* g_strecpy (gchar *dest, const gchar *source, const gchar *exceptions); -/* deprecated function */ -gchar* g_strescape (gchar *string); - -/* Define a macro for it */ -#define g_strescape(src) g_strecpy (g_malloc (strlen (src)*4+1), src, NULL) +/* deprecated function (used to be a real function) */ +#define g_strescape(src) g_strecpy (g_new (char, strlen (src)*4+1), (src), NULL) gpointer g_memdup (gconstpointer mem, guint byte_size); diff --git a/glib/gstrfuncs.c b/glib/gstrfuncs.c index 1ed8a2d..b71fd3f 100644 --- a/glib/gstrfuncs.c +++ b/glib/gstrfuncs.c @@ -1188,9 +1188,9 @@ g_strecpy (gchar *dest, if ((*p < ' ') || (*p >= 0177)) { *q++ = '\\'; - *q++ = '0' + (((*p) >> 6)&07); - *q++ = '0' + (((*p) >> 3)&07); - *q++ = '0' + ((*p)&07); + *q++ = '0' + (((*p) >> 6) & 07); + *q++ = '0' + (((*p) >> 3) & 07); + *q++ = '0' + ((*p) & 07); } else *q++ = *p; @@ -1203,43 +1203,6 @@ g_strecpy (gchar *dest, return dest; } -gchar* -g_strescape (gchar *string) -{ - gchar *q; - gchar *escaped; - guint escapes_needed = 0; - gchar *p = string; - - g_message ("g_strescape() is deprecated"); - - g_return_val_if_fail (string != NULL, NULL); - - while (*p != '\000') - { - escapes_needed += (*p == '\\' || *p == '"'); - p++; - } - - if (!escapes_needed) - return g_strdup (string); - - escaped = g_new (gchar, strlen (string) + escapes_needed + 1); - - p = string; - q = escaped; - - while (*p != '\000') - { - if (*p == '\\' || *p == '"') - *q++ = '\\'; - *q++ = *p++; - } - *q = '\000'; - - return escaped; -} - /* blame Elliot for these next five routines */ gchar* g_strchug (gchar *string) diff --git a/gstrfuncs.c b/gstrfuncs.c index 1ed8a2d..b71fd3f 100644 --- a/gstrfuncs.c +++ b/gstrfuncs.c @@ -1188,9 +1188,9 @@ g_strecpy (gchar *dest, if ((*p < ' ') || (*p >= 0177)) { *q++ = '\\'; - *q++ = '0' + (((*p) >> 6)&07); - *q++ = '0' + (((*p) >> 3)&07); - *q++ = '0' + ((*p)&07); + *q++ = '0' + (((*p) >> 6) & 07); + *q++ = '0' + (((*p) >> 3) & 07); + *q++ = '0' + ((*p) & 07); } else *q++ = *p; @@ -1203,43 +1203,6 @@ g_strecpy (gchar *dest, return dest; } -gchar* -g_strescape (gchar *string) -{ - gchar *q; - gchar *escaped; - guint escapes_needed = 0; - gchar *p = string; - - g_message ("g_strescape() is deprecated"); - - g_return_val_if_fail (string != NULL, NULL); - - while (*p != '\000') - { - escapes_needed += (*p == '\\' || *p == '"'); - p++; - } - - if (!escapes_needed) - return g_strdup (string); - - escaped = g_new (gchar, strlen (string) + escapes_needed + 1); - - p = string; - q = escaped; - - while (*p != '\000') - { - if (*p == '\\' || *p == '"') - *q++ = '\\'; - *q++ = *p++; - } - *q = '\000'; - - return escaped; -} - /* blame Elliot for these next five routines */ gchar* g_strchug (gchar *string)