Commit 01200282 authored by Manish Singh's avatar Manish Singh
Browse files

Added and autoconfigured in a new utility function g_strcasecmp

GtkCombo uses g_strcasecmp now
Quelled a warning about atexit undeclared in gtkobject

-Yosh
parent 4ef94fd7
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
......
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
......
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
......
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
......
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
......
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
......
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
......
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
......
......@@ -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)
......
......@@ -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
......
......@@ -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
......
......@@ -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
}
......@@ -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;
......
......@@ -18,6 +18,7 @@
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include "gtkobject.h"
#include "gtksignal.h"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment