Added and autoconfigured in a new utility function g_strcasecmp

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

-Yosh
This commit is contained in:
Manish Singh 1998-01-31 08:15:57 +00:00
parent 4ef94fd74e
commit 01200282da
14 changed files with 73 additions and 9 deletions

View File

@ -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> Sat Jan 31 00:13:33 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkstyle.c: Backed out change to close polygons * gtk/gtkstyle.c: Backed out change to close polygons

View File

@ -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> Sat Jan 31 00:13:33 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkstyle.c: Backed out change to close polygons * gtk/gtkstyle.c: Backed out change to close polygons

View File

@ -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> Sat Jan 31 00:13:33 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkstyle.c: Backed out change to close polygons * gtk/gtkstyle.c: Backed out change to close polygons

View File

@ -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> Sat Jan 31 00:13:33 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkstyle.c: Backed out change to close polygons * gtk/gtkstyle.c: Backed out change to close polygons

View File

@ -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> Sat Jan 31 00:13:33 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkstyle.c: Backed out change to close polygons * gtk/gtkstyle.c: Backed out change to close polygons

View File

@ -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> Sat Jan 31 00:13:33 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkstyle.c: Backed out change to close polygons * gtk/gtkstyle.c: Backed out change to close polygons

View File

@ -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> Sat Jan 31 00:13:33 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkstyle.c: Backed out change to close polygons * gtk/gtkstyle.c: Backed out change to close polygons

View File

@ -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> Wed Jan 28 23:53:27 PST 1998 Manish Singh <yosh@gimp.org>
* glist.c * glist.c

View File

@ -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(limits.h, AC_DEFINE(HAVE_LIMITS_H))
AC_CHECK_HEADERS(values.h, AC_DEFINE(HAVE_VALUES_H)) AC_CHECK_HEADERS(values.h, AC_DEFINE(HAVE_VALUES_H))
# Check for strerror, strsignal, and memmove functions # Check for strerror, strsignal, memmove, vsnprintf, and strcasecmp functions
AC_CHECK_FUNCS(strerror strsignal memmove vsnprintf) AC_CHECK_FUNCS(strerror strsignal memmove vsnprintf strcasecmp)
# Check for sys_errlist # Check for sys_errlist
AC_MSG_CHECKING(sys_errlist) AC_MSG_CHECKING(sys_errlist)

View File

@ -625,12 +625,13 @@ void g_print (gchar *format, ...);
/* Utility functions /* Utility functions
*/ */
gchar* g_strdup (const gchar *str); gchar* g_strdup (const gchar *str);
gchar* g_strconcat (const gchar *string1, ...); /* NULL terminated */ gchar* g_strconcat (const gchar *string1, ...); /* NULL terminated */
gdouble g_strtod (const gchar *nptr, gchar **endptr); gdouble g_strtod (const gchar *nptr, gchar **endptr);
gchar* g_strerror (gint errnum); gchar* g_strerror (gint errnum);
gchar* g_strsignal (gint signum); gchar* g_strsignal (gint signum);
gint g_snprintf (gchar *str, gulong n, gchar const *fmt, ...); 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 /* We make the assumption that if memmove isn't available, then

View File

@ -65,6 +65,9 @@
/* Define if you have the vsnprintf function. */ /* Define if you have the vsnprintf function. */
#undef HAVE_VSNPRINTF #undef HAVE_VSNPRINTF
/* Define if you have the strcasecmp function. */
#undef HAVE_STRCASECMP
/* Define if you have the <float.h> header file. */ /* Define if you have the <float.h> header file. */
#undef HAVE_FLOAT_H #undef HAVE_FLOAT_H

View File

@ -842,3 +842,22 @@ g_snprintf (gchar *str,
#endif #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
}

View File

@ -148,7 +148,7 @@ gtk_combo_find (GtkCombo * combo)
if (combo->case_sensitive) if (combo->case_sensitive)
string_compare = strcmp; string_compare = strcmp;
else else
string_compare = strcasecmp; string_compare = g_strcasecmp;
text = gtk_entry_get_text (GTK_ENTRY (combo->entry)); text = gtk_entry_get_text (GTK_ENTRY (combo->entry));
clist = GTK_LIST (combo->list)->children; clist = GTK_LIST (combo->list)->children;

View File

@ -18,6 +18,7 @@
#include <stdarg.h> #include <stdarg.h>
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include "gtkobject.h" #include "gtkobject.h"
#include "gtksignal.h" #include "gtksignal.h"