diff src/gtkimhtml.c @ 4793:677d3cb193a1

[gaim-migrate @ 5113] this removes all the remaining deprecated glib, gdk, gdk-pixbuf, and gtk function calls. Hopefully I didn't break anything. Most of this is due to the deprecation of g_strcasecmp and g_strncasecmp. Two functions I never thought would be deprecated, but apparently they're no good at comparing utf8 text. g_ascii_str{,n}casecmp is OK when you're sure that it's ASCII. Otherwise, we're supposed to use g_utf8_collate(), except that it is case sensitive. Since glib doesn't currently have a case-insensitive one, I wrote one. If you need to compare utf8 text, you can use gaim_utf8_strcasecmp(). I have to go do dishes now. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sun, 16 Mar 2003 00:01:49 +0000
parents b0367d56b608
children dc6de8ad81ae
line wrap: on
line diff
--- a/src/gtkimhtml.c	Sat Mar 15 22:22:39 2003 +0000
+++ b/src/gtkimhtml.c	Sun Mar 16 00:01:49 2003 +0000
@@ -532,14 +532,14 @@
 
 	return t->image->icon;
 }
-#define VALID_TAG(x)	if (!g_strncasecmp (string, x ">", strlen (x ">"))) {	\
+#define VALID_TAG(x)	if (!g_ascii_strncasecmp (string, x ">", strlen (x ">"))) {	\
 				*tag = g_strndup (string, strlen (x));		\
 				*len = strlen (x) + 1;				\
 				return TRUE;					\
 			}							\
 			(*type)++
 
-#define VALID_OPT_TAG(x)	if (!g_strncasecmp (string, x " ", strlen (x " "))) {	\
+#define VALID_OPT_TAG(x)	if (!g_ascii_strncasecmp (string, x " ", strlen (x " "))) {	\
 					const gchar *c = string + strlen (x " ");	\
 					gchar e = '"';					\
 					gboolean quote = FALSE;				\
@@ -573,25 +573,25 @@
 	g_return_val_if_fail (replace != NULL, FALSE);
 	g_return_val_if_fail (length != NULL, FALSE);
 
-	if (!g_strncasecmp (string, "&amp;", 5)) {
+	if (!g_ascii_strncasecmp (string, "&amp;", 5)) {
 		*replace = '&';
 		*length = 5;
-	} else if (!g_strncasecmp (string, "&lt;", 4)) {
+	} else if (!g_ascii_strncasecmp (string, "&lt;", 4)) {
 		*replace = '<';
 		*length = 4;
-	} else if (!g_strncasecmp (string, "&gt;", 4)) {
+	} else if (!g_ascii_strncasecmp (string, "&gt;", 4)) {
 		*replace = '>';
 		*length = 4;
-	} else if (!g_strncasecmp (string, "&nbsp;", 6)) {
+	} else if (!g_ascii_strncasecmp (string, "&nbsp;", 6)) {
 		*replace = ' ';
 		*length = 6;
-	} else if (!g_strncasecmp (string, "&copy;", 6)) {
+	} else if (!g_ascii_strncasecmp (string, "&copy;", 6)) {
 		*replace = '©'; /* was: '©' */
 		*length = 6;
-	} else if (!g_strncasecmp (string, "&quot;", 6)) {
+	} else if (!g_ascii_strncasecmp (string, "&quot;", 6)) {
 		*replace = '\"';
 		*length = 6;
-	} else if (!g_strncasecmp (string, "&reg;", 5)) {
+	} else if (!g_ascii_strncasecmp (string, "&reg;", 5)) {
 		*replace = '®'; /* was: '®' */
 		*length = 5;
 	} else if (*(string + 1) == '#') {
@@ -674,7 +674,7 @@
 	VALID_OPT_TAG ("P");
 	VALID_OPT_TAG ("H3");
 
-	if (!g_strncasecmp(string, "!--", strlen ("!--"))) {
+	if (!g_ascii_strncasecmp(string, "!--", strlen ("!--"))) {
 		gchar *e = strstr (string + strlen("!--"), "-->");
 		if (e) {
 			*len = e - string + strlen ("-->");
@@ -693,7 +693,7 @@
 	gchar *t = tag;
 	gchar *e, *a;
 
-	while (g_strncasecmp (t, opt, strlen (opt))) {
+	while (g_ascii_strncasecmp (t, opt, strlen (opt))) {
 		gboolean quote = FALSE;
 		if (*t == '\0') break;
 		while (*t && !((*t == ' ') && !quote)) {
@@ -704,7 +704,7 @@
 		while (*t && (*t == ' ')) t++;
 	}
 
-	if (!g_strncasecmp (t, opt, strlen (opt))) {
+	if (!g_ascii_strncasecmp (t, opt, strlen (opt))) {
 		t += strlen (opt);
 	} else {
 		return NULL;