All versions of GLib 2.x come with g_ascii_strcasecmp(), and we require

GLib 2.x; we don't have to check for its presence and supply a
replacement if it's missing.

Get rid of an unremoved reference in epan/dtd_parse.l.

svn path=/trunk/; revision=25197
This commit is contained in:
Guy Harris 2008-04-29 16:24:22 +00:00
parent 1c67ad6e2e
commit a6815b1070
5 changed files with 2 additions and 169 deletions

View File

@ -1381,28 +1381,6 @@ fi
AC_SUBST(MKSTEMP_C)
AC_SUBST(MKSTEMP_O)
ac_save_LIBS="$LIBS"
LIBS="$GLIB_LIBS $LIBS"
G_ASCII_STRCASECMP_C=""
G_ASCII_STRCASECMP_O=""
G_ASCII_STRCASECMP_LO=""
AC_CHECK_FUNC(g_ascii_strcasecmp,
[G_ASCII_STRCASECMP_O=""
G_ASCII_STRCASECMP_LO=""],
[G_ASCII_STRCASECMP_O="g_ascii_strcasecmp.o"
G_ASCII_STRCASECMP_LO="g_ascii_strcasecmp.lo"
AC_DEFINE(NEED_G_ASCII_STRCASECMP_H, 1, [Define if g_ascii_strcasecmp.h needs to be included])
])
LIBS="$ac_save_LIBS"
if test "$ac_cv_func_g_ascii_strcasecmp" = no ; then
G_ASCII_STRCASECMP_C="g_ascii_strcasecmp.c"
G_ASCII_STRCASECMP_O="g_ascii_strcasecmp.o"
G_ASCII_STRCASECMP_LO="g_ascii_strcasecmp.lo"
fi
AC_SUBST(G_ASCII_STRCASECMP_C)
AC_SUBST(G_ASCII_STRCASECMP_O)
AC_SUBST(G_ASCII_STRCASECMP_LO)
ac_save_LIBS="$LIBS"
LIBS="$GLIB_LIBS $LIBS"
G_ASCII_STRTOULL_C=""

View File

@ -76,8 +76,6 @@ libwireshark_asmopt_la_SOURCES = \
asm_utils_win32_x86.asm
EXTRA_libwireshark_la_SOURCES = \
g_ascii_strcasecmp.c \
g_ascii_strcasecmp.h \
g_ascii_strtoull.c \
g_ascii_strtoull.h \
inet_aton.c \
@ -124,7 +122,7 @@ MAINTAINERCLEANFILES = \
#
# Add the object files for missing routines, if any.
#
libwireshark_la_LIBADD = @G_ASCII_STRCASECMP_LO@ @G_ASCII_STRTOULL_LO@ \
libwireshark_la_LIBADD = @G_ASCII_STRTOULL_LO@ \
@INET_ATON_LO@ @INET_PTON_LO@ @INET_NTOP_LO@ libwireshark_generated.la \
libwireshark_asmopt.la crypt/libairpdcap.la ftypes/libftypes.la \
dfilter/libdfilter.la dissectors/libcleandissectors.la \
@ -132,7 +130,7 @@ libwireshark_la_LIBADD = @G_ASCII_STRCASECMP_LO@ @G_ASCII_STRTOULL_LO@ \
dissectors/libpidldissectors.la $(wslua_lib) @SOCKET_LIBS@ @NSL_LIBS@ \
@ADNS_LIBS@ @LIBGCRYPT_LIBS@ @LIBGNUTLS_LIBS@ @LIBICONV@ @KRB5_LIBS@ \
@SSL_LIBS@ @LIBSMI_LDFLAGS@ -lm
libwireshark_la_DEPENDENCIES = @G_ASCII_STRCASECMP_LO@ @G_ASCII_STRTOULL_LO@ \
libwireshark_la_DEPENDENCIES = @G_ASCII_STRTOULL_LO@ \
@INET_ATON_LO@ @INET_PTON_LO@ @INET_NTOP_LO@ libwireshark_generated.la \
libwireshark_asmopt.la crypt/libairpdcap.la ftypes/libftypes.la \
dfilter/libdfilter.la dissectors/libcleandissectors.la \

View File

@ -53,10 +53,6 @@
#include "dtd_parse.h"
#include "dtd_parse_lex.h"
#ifdef NEED_G_ASCII_STRCASECMP_H
#include "g_ascii_strcasecmp.h"
#endif
struct _proto_xmlpi_attr {
gchar* name;
void (*act)(gchar*);

View File

@ -1,121 +0,0 @@
/* GLIB - Library of useful routines for C programming
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/*
* Modified by the GLib Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GLib Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GLib at ftp://ftp.gtk.org/pub/gtk/.
*/
/*
* $Id$
*
* "g_ascii_strcasecmp()" and "g_ascii_strncasecmp()" extracted from
* GLib 2.4.8, for use with GLibs that don't have it (e.g., GLib 1.2[.x]).
*/
#include <glib.h>
#include "g_ascii_strcasecmp.h"
#define ISUPPER(c) ((c) >= 'A' && (c) <= 'Z')
#define ISLOWER(c) ((c) >= 'a' && (c) <= 'z')
#define TOUPPER(c) (ISLOWER (c) ? (c) - 'a' + 'A' : (c))
#define TOLOWER(c) (ISUPPER (c) ? (c) - 'A' + 'a' : (c))
/**
* g_ascii_strcasecmp:
* @s1: string to compare with @s2.
* @s2: string to compare with @s1.
*
* Compare two strings, ignoring the case of ASCII characters.
*
* Unlike the BSD strcasecmp() function, this only recognizes standard
* ASCII letters and ignores the locale, treating all non-ASCII
* characters as if they are not letters.
*
* Return value: an integer less than, equal to, or greater than
* zero if @s1 is found, respectively, to be less than,
* to match, or to be greater than @s2.
**/
gint
g_ascii_strcasecmp (const gchar *s1,
const gchar *s2)
{
gint c1, c2;
g_return_val_if_fail (s1 != NULL, 0);
g_return_val_if_fail (s2 != NULL, 0);
while (*s1 && *s2)
{
c1 = (gint)(guchar) TOLOWER (*s1);
c2 = (gint)(guchar) TOLOWER (*s2);
if (c1 != c2)
return (c1 - c2);
s1++; s2++;
}
return (((gint)(guchar) *s1) - ((gint)(guchar) *s2));
}
/**
* g_ascii_strncasecmp:
* @s1: string to compare with @s2.
* @s2: string to compare with @s1.
* @n: number of characters to compare.
*
* Compare @s1 and @s2, ignoring the case of ASCII characters and any
* characters after the first @n in each string.
*
* Unlike the BSD strcasecmp() function, this only recognizes standard
* ASCII letters and ignores the locale, treating all non-ASCII
* characters as if they are not letters.
*
* Return value: an integer less than, equal to, or greater than zero
* if the first @n bytes of @s1 is found, respectively,
* to be less than, to match, or to be greater than the
* first @n bytes of @s2.
**/
gint
g_ascii_strncasecmp (const gchar *s1,
const gchar *s2,
gsize n)
{
gint c1, c2;
g_return_val_if_fail (s1 != NULL, 0);
g_return_val_if_fail (s2 != NULL, 0);
while (n && *s1 && *s2)
{
n -= 1;
c1 = (gint)(guchar) TOLOWER (*s1);
c2 = (gint)(guchar) TOLOWER (*s2);
if (c1 != c2)
return (c1 - c2);
s1++; s2++;
}
if (n)
return (((gint) (guchar) *s1) - ((gint) (guchar) *s2));
else
return 0;
}

View File

@ -1,18 +0,0 @@
/*
* $Id$
*
* "g_ascii_strcasecmp()" and "g_ascii_strncasecmp()" extracted from
* GLib 2.4.8, for use with GLibs that don't have it (e.g., GLib 1.2[.x]).
*/
#ifndef __WIRESHARK_G_ASCII_STRCASECMP_H__
#define __WIRESHARK_G_ASCII_STRCASECMP_H__
extern gint g_ascii_strcasecmp (const gchar *s1,
const gchar *s2);
extern gint g_ascii_strncasecmp (const gchar *s1,
const gchar *s2,
gsize n);
#endif