diff options
author | Guy Harris <guy@alum.mit.edu> | 2008-04-29 16:24:22 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2008-04-29 16:24:22 +0000 |
commit | a6815b10709401ba7a3dcf35a534a5f9a6eb3123 (patch) | |
tree | 4916126c5cd6a4a1f260c18e227c2bde3abe4eb7 /epan | |
parent | 1c67ad6e2ee0103ba1d75f1267827a1256b266f9 (diff) |
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
Diffstat (limited to 'epan')
-rw-r--r-- | epan/Makefile.am | 6 | ||||
-rw-r--r-- | epan/dtd_parse.l | 4 | ||||
-rw-r--r-- | epan/g_ascii_strcasecmp.c | 121 | ||||
-rw-r--r-- | epan/g_ascii_strcasecmp.h | 18 |
4 files changed, 2 insertions, 147 deletions
diff --git a/epan/Makefile.am b/epan/Makefile.am index d7fb214f0a..ef5c70637b 100644 --- a/epan/Makefile.am +++ b/epan/Makefile.am @@ -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 \ diff --git a/epan/dtd_parse.l b/epan/dtd_parse.l index f097148809..4556a05858 100644 --- a/epan/dtd_parse.l +++ b/epan/dtd_parse.l @@ -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*); diff --git a/epan/g_ascii_strcasecmp.c b/epan/g_ascii_strcasecmp.c deleted file mode 100644 index dc03f7cce3..0000000000 --- a/epan/g_ascii_strcasecmp.c +++ /dev/null @@ -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; -} - diff --git a/epan/g_ascii_strcasecmp.h b/epan/g_ascii_strcasecmp.h deleted file mode 100644 index 05621735a7..0000000000 --- a/epan/g_ascii_strcasecmp.h +++ /dev/null @@ -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 |