summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManish Singh <yosh@src.gnome.org>1998-01-31 08:15:57 +0000
committerManish Singh <yosh@src.gnome.org>1998-01-31 08:15:57 +0000
commit01200282da3d4a06885eff34de1678a9da47d2f2 (patch)
treeda64af5d7a31b05a904cd236bc9f75164b7d1935
parent4ef94fd74e479465b05bfaeddf4a5361ed2ab140 (diff)
downloadgtk+-01200282da3d4a06885eff34de1678a9da47d2f2.tar.gz
Added and autoconfigured in a new utility function g_strcasecmp
GtkCombo uses g_strcasecmp now Quelled a warning about atexit undeclared in gtkobject -Yosh
-rw-r--r--ChangeLog5
-rw-r--r--ChangeLog.pre-2-05
-rw-r--r--ChangeLog.pre-2-105
-rw-r--r--ChangeLog.pre-2-25
-rw-r--r--ChangeLog.pre-2-45
-rw-r--r--ChangeLog.pre-2-65
-rw-r--r--ChangeLog.pre-2-85
-rw-r--r--glib/ChangeLog5
-rw-r--r--glib/configure.in4
-rw-r--r--glib/glib.h13
-rw-r--r--glib/glibconfig.h.in3
-rw-r--r--glib/gutils.c19
-rw-r--r--gtk/gtkcombo.c2
-rw-r--r--gtk/gtkobject.c1
14 files changed, 73 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index ec9ff0bbe0..08cd96220d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Jan 31 00:05:34 PST 1998 Manish Singh <yosh@gimp.org>
+
+ * gtk/gtkcombo.c: changed to use g_strcasecmp
+ * gtk/gtkobject.c: #include <stdlib.h> for atexit
+
Sat Jan 31 00:13:33 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkstyle.c: Backed out change to close polygons
diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0
index ec9ff0bbe0..08cd96220d 100644
--- a/ChangeLog.pre-2-0
+++ b/ChangeLog.pre-2-0
@@ -1,3 +1,8 @@
+Sat Jan 31 00:05:34 PST 1998 Manish Singh <yosh@gimp.org>
+
+ * gtk/gtkcombo.c: changed to use g_strcasecmp
+ * gtk/gtkobject.c: #include <stdlib.h> for atexit
+
Sat Jan 31 00:13:33 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkstyle.c: Backed out change to close polygons
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index ec9ff0bbe0..08cd96220d 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,8 @@
+Sat Jan 31 00:05:34 PST 1998 Manish Singh <yosh@gimp.org>
+
+ * gtk/gtkcombo.c: changed to use g_strcasecmp
+ * gtk/gtkobject.c: #include <stdlib.h> for atexit
+
Sat Jan 31 00:13:33 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkstyle.c: Backed out change to close polygons
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index ec9ff0bbe0..08cd96220d 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -1,3 +1,8 @@
+Sat Jan 31 00:05:34 PST 1998 Manish Singh <yosh@gimp.org>
+
+ * gtk/gtkcombo.c: changed to use g_strcasecmp
+ * gtk/gtkobject.c: #include <stdlib.h> for atexit
+
Sat Jan 31 00:13:33 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkstyle.c: Backed out change to close polygons
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index ec9ff0bbe0..08cd96220d 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,8 @@
+Sat Jan 31 00:05:34 PST 1998 Manish Singh <yosh@gimp.org>
+
+ * gtk/gtkcombo.c: changed to use g_strcasecmp
+ * gtk/gtkobject.c: #include <stdlib.h> for atexit
+
Sat Jan 31 00:13:33 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkstyle.c: Backed out change to close polygons
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index ec9ff0bbe0..08cd96220d 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,8 @@
+Sat Jan 31 00:05:34 PST 1998 Manish Singh <yosh@gimp.org>
+
+ * gtk/gtkcombo.c: changed to use g_strcasecmp
+ * gtk/gtkobject.c: #include <stdlib.h> for atexit
+
Sat Jan 31 00:13:33 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkstyle.c: Backed out change to close polygons
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index ec9ff0bbe0..08cd96220d 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,8 @@
+Sat Jan 31 00:05:34 PST 1998 Manish Singh <yosh@gimp.org>
+
+ * gtk/gtkcombo.c: changed to use g_strcasecmp
+ * gtk/gtkobject.c: #include <stdlib.h> for atexit
+
Sat Jan 31 00:13:33 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkstyle.c: Backed out change to close polygons
diff --git a/glib/ChangeLog b/glib/ChangeLog
index 5fb90e439a..df0ae96dac 100644
--- a/glib/ChangeLog
+++ b/glib/ChangeLog
@@ -1,3 +1,8 @@
+Fri Jan 30 23:57:17 PST 1998 Manish Singh <yosh@gimp.org>
+
+ * added and autoconfigured in a new utility function
+ g_strcasecmp
+
Wed Jan 28 23:53:27 PST 1998 Manish Singh <yosh@gimp.org>
* glist.c
diff --git a/glib/configure.in b/glib/configure.in
index 66da2f0fa4..9df1d3922b 100644
--- a/glib/configure.in
+++ b/glib/configure.in
@@ -69,8 +69,8 @@ AC_CHECK_HEADERS(float.h, AC_DEFINE(HAVE_FLOAT_H))
AC_CHECK_HEADERS(limits.h, AC_DEFINE(HAVE_LIMITS_H))
AC_CHECK_HEADERS(values.h, AC_DEFINE(HAVE_VALUES_H))
-# Check for strerror, strsignal, and memmove functions
-AC_CHECK_FUNCS(strerror strsignal memmove vsnprintf)
+# Check for strerror, strsignal, memmove, vsnprintf, and strcasecmp functions
+AC_CHECK_FUNCS(strerror strsignal memmove vsnprintf strcasecmp)
# Check for sys_errlist
AC_MSG_CHECKING(sys_errlist)
diff --git a/glib/glib.h b/glib/glib.h
index 257d5925ce..32850def1e 100644
--- a/glib/glib.h
+++ b/glib/glib.h
@@ -625,12 +625,13 @@ void g_print (gchar *format, ...);
/* Utility functions
*/
-gchar* g_strdup (const gchar *str);
-gchar* g_strconcat (const gchar *string1, ...); /* NULL terminated */
-gdouble g_strtod (const gchar *nptr, gchar **endptr);
-gchar* g_strerror (gint errnum);
-gchar* g_strsignal (gint signum);
-gint g_snprintf (gchar *str, gulong n, gchar const *fmt, ...);
+gchar* g_strdup (const gchar *str);
+gchar* g_strconcat (const gchar *string1, ...); /* NULL terminated */
+gdouble g_strtod (const gchar *nptr, gchar **endptr);
+gchar* g_strerror (gint errnum);
+gchar* g_strsignal (gint signum);
+gint g_strcasecmp (const guchar *s1, const guchar *s2);
+gint g_snprintf (gchar *str, gulong n, gchar const *fmt, ...);
/* We make the assumption that if memmove isn't available, then
diff --git a/glib/glibconfig.h.in b/glib/glibconfig.h.in
index ad4a6b08ee..f1b9eacfa4 100644
--- a/glib/glibconfig.h.in
+++ b/glib/glibconfig.h.in
@@ -65,6 +65,9 @@
/* Define if you have the vsnprintf function. */
#undef HAVE_VSNPRINTF
+/* Define if you have the strcasecmp function. */
+#undef HAVE_STRCASECMP
+
/* Define if you have the <float.h> header file. */
#undef HAVE_FLOAT_H
diff --git a/glib/gutils.c b/glib/gutils.c
index 87c3964b53..6dd230d4e4 100644
--- a/glib/gutils.c
+++ b/glib/gutils.c
@@ -842,3 +842,22 @@ g_snprintf (gchar *str,
#endif
}
+
+gint
+g_strcasecmp (const guchar *s1, const guchar *s2)
+{
+#ifdef HAVE_STRCASECMP
+ return strcasecmp(s1, s2);
+#else
+ gint c1, c2;
+
+ while (*s1 && *s2)
+ {
+ c1 = tolower(*s1++); c2 = tolower(*s2++);
+ if (c1 != c2)
+ return (c1 - c2);
+ }
+
+ return ((gint) *s1 - (gint) *s2);
+#endif
+}
diff --git a/gtk/gtkcombo.c b/gtk/gtkcombo.c
index 539985da0e..b2fe20952e 100644
--- a/gtk/gtkcombo.c
+++ b/gtk/gtkcombo.c
@@ -148,7 +148,7 @@ gtk_combo_find (GtkCombo * combo)
if (combo->case_sensitive)
string_compare = strcmp;
else
- string_compare = strcasecmp;
+ string_compare = g_strcasecmp;
text = gtk_entry_get_text (GTK_ENTRY (combo->entry));
clist = GTK_LIST (combo->list)->children;
diff --git a/gtk/gtkobject.c b/gtk/gtkobject.c
index 07d921f34c..dbfedb276b 100644
--- a/gtk/gtkobject.c
+++ b/gtk/gtkobject.c
@@ -18,6 +18,7 @@
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
+#include <stdlib.h>
#include "gtkobject.h"
#include "gtksignal.h"