[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[6932] remove memmem gnulib module
From: |
Gavin D. Smith |
Subject: |
[6932] remove memmem gnulib module |
Date: |
Sat, 09 Jan 2016 15:33:36 +0000 |
Revision: 6932
http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=6932
Author: gavin
Date: 2016-01-09 15:33:35 +0000 (Sat, 09 Jan 2016)
Log Message:
-----------
remove memmem gnulib module
Modified Paths:
--------------
trunk/ChangeLog
trunk/gnulib/lib/Makefile.am
trunk/gnulib/m4/gnulib-cache.m4
trunk/gnulib/m4/gnulib-comp.m4
Removed Paths:
-------------
trunk/gnulib/lib/memmem.c
trunk/gnulib/m4/memmem.m4
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2016-01-09 13:49:43 UTC (rev 6931)
+++ trunk/ChangeLog 2016-01-09 15:33:35 UTC (rev 6932)
@@ -4,6 +4,8 @@
module which isn't used any where (possibly used in texindex.c,
which isn't distributed any more).
+ * gnulib: Run gnulib-tool --add-import, omitting "memmem".
+
2016-01-07 Masamichi Hosoda <address@hidden> (tiny change)
* doc/texinfo.tex: For XeTeX, fix input by bytes instead of
Modified: trunk/gnulib/lib/Makefile.am
===================================================================
--- trunk/gnulib/lib/Makefile.am 2016-01-09 13:49:43 UTC (rev 6931)
+++ trunk/gnulib/lib/Makefile.am 2016-01-09 15:33:35 UTC (rev 6932)
@@ -21,7 +21,7 @@
# the same distribution terms as the rest of that program.
#
# Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --lib=libgnu --source-base=gnulib/lib
--m4-base=gnulib/m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux
--conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files argz
getopt-gnu gettext iconv mbchar mbiter mbscasecmp mbschr mbslen mbsncasecmp
mbsstr mbswidth memmem memrchr regex stdarg strcasestr strdup-posix strerror
vasprintf xalloc
+# Reproduce by: gnulib-tool --import --lib=libgnu --source-base=gnulib/lib
--m4-base=gnulib/m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux
--conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files argz
getopt-gnu gettext iconv mbchar mbiter mbscasecmp mbschr mbslen mbsncasecmp
mbsstr mbswidth memrchr regex stdarg strcasestr strdup-posix strerror vasprintf
xalloc
AUTOMAKE_OPTIONS = 1.9.6 gnits subdir-objects
@@ -602,15 +602,6 @@
## end gnulib module memchr
-## begin gnulib module memmem-simple
-
-
-EXTRA_DIST += memmem.c str-two-way.h
-
-EXTRA_libgnu_a_SOURCES += memmem.c
-
-## end gnulib module memmem-simple
-
## begin gnulib module mempcpy
if gl_GNULIB_ENABLED_mempcpy
Deleted: trunk/gnulib/lib/memmem.c
===================================================================
--- trunk/gnulib/lib/memmem.c 2016-01-09 13:49:43 UTC (rev 6931)
+++ trunk/gnulib/lib/memmem.c 2016-01-09 15:33:35 UTC (rev 6932)
@@ -1,75 +0,0 @@
-/* Copyright (C) 1991-1994, 1996-1998, 2000, 2004, 2007-2015 Free Software
- Foundation, Inc.
- This file is part of the GNU C Library.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3, or (at your option)
- any later version.
-
- This program 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 General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, see <http://www.gnu.org/licenses/>. */
-
-/* This particular implementation was written by Eric Blake, 2008. */
-
-#ifndef _LIBC
-# include <config.h>
-#endif
-
-/* Specification of memmem. */
-#include <string.h>
-
-#ifndef _LIBC
-# define __builtin_expect(expr, val) (expr)
-#endif
-
-#define RETURN_TYPE void *
-#define AVAILABLE(h, h_l, j, n_l) ((j) <= (h_l) - (n_l))
-#include "str-two-way.h"
-
-/* Return the first occurrence of NEEDLE in HAYSTACK. Return HAYSTACK
- if NEEDLE_LEN is 0, otherwise NULL if NEEDLE is not found in
- HAYSTACK. */
-void *
-memmem (const void *haystack_start, size_t haystack_len,
- const void *needle_start, size_t needle_len)
-{
- /* Abstract memory is considered to be an array of 'unsigned char' values,
- not an array of 'char' values. See ISO C 99 section 6.2.6.1. */
- const unsigned char *haystack = (const unsigned char *) haystack_start;
- const unsigned char *needle = (const unsigned char *) needle_start;
-
- if (needle_len == 0)
- /* The first occurrence of the empty string is deemed to occur at
- the beginning of the string. */
- return (void *) haystack;
-
- /* Sanity check, otherwise the loop might search through the whole
- memory. */
- if (__builtin_expect (haystack_len < needle_len, 0))
- return NULL;
-
- /* Use optimizations in memchr when possible, to reduce the search
- size of haystack using a linear algorithm with a smaller
- coefficient. However, avoid memchr for long needles, since we
- can often achieve sublinear performance. */
- if (needle_len < LONG_NEEDLE_THRESHOLD)
- {
- haystack = memchr (haystack, *needle, haystack_len);
- if (!haystack || __builtin_expect (needle_len == 1, 0))
- return (void *) haystack;
- haystack_len -= haystack - (const unsigned char *) haystack_start;
- if (haystack_len < needle_len)
- return NULL;
- return two_way_short_needle (haystack, haystack_len, needle, needle_len);
- }
- else
- return two_way_long_needle (haystack, haystack_len, needle, needle_len);
-}
-
-#undef LONG_NEEDLE_THRESHOLD
Modified: trunk/gnulib/m4/gnulib-cache.m4
===================================================================
--- trunk/gnulib/m4/gnulib-cache.m4 2016-01-09 13:49:43 UTC (rev 6931)
+++ trunk/gnulib/m4/gnulib-cache.m4 2016-01-09 15:33:35 UTC (rev 6932)
@@ -27,7 +27,7 @@
# Specification in the form of a command-line invocation:
-# gnulib-tool --import --lib=libgnu --source-base=gnulib/lib
--m4-base=gnulib/m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux
--conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files argz
getopt-gnu gettext iconv mbchar mbiter mbscasecmp mbschr mbslen mbsncasecmp
mbsstr mbswidth memmem memrchr regex stdarg strcasestr strdup-posix strerror
vasprintf xalloc
+# gnulib-tool --import --lib=libgnu --source-base=gnulib/lib
--m4-base=gnulib/m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux
--conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files argz
getopt-gnu gettext iconv mbchar mbiter mbscasecmp mbschr mbslen mbsncasecmp
mbsstr mbswidth memrchr regex stdarg strcasestr strdup-posix strerror vasprintf
xalloc
# Specification in the form of a few gnulib-tool.m4 macro invocations:
gl_LOCAL_DIR([])
@@ -44,7 +44,6 @@
mbsncasecmp
mbsstr
mbswidth
- memmem
memrchr
regex
stdarg
Modified: trunk/gnulib/m4/gnulib-comp.m4
===================================================================
--- trunk/gnulib/m4/gnulib-comp.m4 2016-01-09 13:49:43 UTC (rev 6931)
+++ trunk/gnulib/m4/gnulib-comp.m4 2016-01-09 15:33:35 UTC (rev 6932)
@@ -83,8 +83,6 @@
# Code from module mbtowc:
# Code from module mbuiter:
# Code from module memchr:
- # Code from module memmem:
- # Code from module memmem-simple:
# Code from module mempcpy:
# Code from module memrchr:
# Code from module msvc-inval:
@@ -247,15 +245,6 @@
gl_PREREQ_MEMCHR
fi
gl_STRING_MODULE_INDICATOR([memchr])
- gl_FUNC_MEMMEM
- if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
- AC_LIBOBJ([memmem])
- fi
- gl_FUNC_MEMMEM_SIMPLE
- if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
- AC_LIBOBJ([memmem])
- fi
- gl_STRING_MODULE_INDICATOR([memmem])
gl_FUNC_MEMRCHR
if test $ac_cv_func_memrchr = no; then
AC_LIBOBJ([memrchr])
@@ -872,7 +861,6 @@
lib/mbuiter.h
lib/memchr.c
lib/memchr.valgrind
- lib/memmem.c
lib/mempcpy.c
lib/memrchr.c
lib/msvc-inval.c
@@ -996,7 +984,6 @@
m4/mbswidth.m4
m4/mbtowc.m4
m4/memchr.m4
- m4/memmem.m4
m4/mempcpy.m4
m4/memrchr.m4
m4/mmap-anon.m4
Deleted: trunk/gnulib/m4/memmem.m4
===================================================================
--- trunk/gnulib/m4/memmem.m4 2016-01-09 13:49:43 UTC (rev 6931)
+++ trunk/gnulib/m4/memmem.m4 2016-01-09 15:33:35 UTC (rev 6932)
@@ -1,151 +0,0 @@
-# memmem.m4 serial 24
-dnl Copyright (C) 2002-2004, 2007-2015 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl Check that memmem is present and functional.
-AC_DEFUN([gl_FUNC_MEMMEM_SIMPLE],
-[
- dnl Persuade glibc <string.h> to declare memmem().
- AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
-
- AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
- AC_CHECK_FUNCS([memmem])
- if test $ac_cv_func_memmem = yes; then
- HAVE_MEMMEM=1
- else
- HAVE_MEMMEM=0
- fi
- AC_CHECK_DECLS_ONCE([memmem])
- if test $ac_cv_have_decl_memmem = no; then
- HAVE_DECL_MEMMEM=0
- else
- dnl Detect http://sourceware.org/bugzilla/show_bug.cgi?id=12092.
- dnl Also check that we handle empty needles correctly.
- AC_CACHE_CHECK([whether memmem works],
- [gl_cv_func_memmem_works_always],
- [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
-#include <string.h> /* for memmem */
-#define P "_EF_BF_BD"
-#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
-#define NEEDLE P P P P P
-]], [[
- int result = 0;
- if (memmem (HAYSTACK, strlen (HAYSTACK), NEEDLE, strlen (NEEDLE)))
- result |= 1;
- /* Check for empty needle behavior. */
- {
- const char *haystack = "AAA";
- if (memmem (haystack, 3, NULL, 0) != haystack)
- result |= 2;
- }
- return result;
- ]])],
- [gl_cv_func_memmem_works_always=yes],
- [gl_cv_func_memmem_works_always=no],
- [dnl glibc 2.9..2.12 and cygwin 1.7.7 have issue #12092 above.
- dnl Also empty needles work on glibc >= 2.1 and cygwin >= 1.7.0.
- dnl uClibc is not affected, since it uses different source code.
- dnl Assume that it works on all other platforms (even if not linear).
- AC_EGREP_CPP([Lucky user],
- [
-#ifdef __GNU_LIBRARY__
- #include <features.h>
- #if ((__GLIBC__ == 2 && ((__GLIBC_MINOR > 0 && __GLIBC_MINOR__ < 9) \
- || __GLIBC_MINOR__ > 12)) \
- || (__GLIBC__ > 2)) \
- || defined __UCLIBC__
- Lucky user
- #endif
-#elif defined __CYGWIN__
- #include <cygwin/version.h>
- #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
- Lucky user
- #endif
-#else
- Lucky user
-#endif
- ],
- [gl_cv_func_memmem_works_always="guessing yes"],
- [gl_cv_func_memmem_works_always="guessing no"])
- ])
- ])
- case "$gl_cv_func_memmem_works_always" in
- *yes) ;;
- *)
- REPLACE_MEMMEM=1
- ;;
- esac
- fi
- gl_PREREQ_MEMMEM
-]) # gl_FUNC_MEMMEM_SIMPLE
-
-dnl Additionally, check that memmem has linear performance characteristics
-AC_DEFUN([gl_FUNC_MEMMEM],
-[
- AC_REQUIRE([gl_FUNC_MEMMEM_SIMPLE])
- if test $HAVE_DECL_MEMMEM = 1 && test $REPLACE_MEMMEM = 0; then
- AC_CACHE_CHECK([whether memmem works in linear time],
- [gl_cv_func_memmem_works_fast],
- [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
-#include <signal.h> /* for signal */
-#include <string.h> /* for memmem */
-#include <stdlib.h> /* for malloc */
-#include <unistd.h> /* for alarm */
-static void quit (int sig) { exit (sig + 128); }
-]], [[
- int result = 0;
- size_t m = 1000000;
- char *haystack = (char *) malloc (2 * m + 1);
- char *needle = (char *) malloc (m + 1);
- /* Failure to compile this test due to missing alarm is okay,
- since all such platforms (mingw) also lack memmem. */
- signal (SIGALRM, quit);
- alarm (5);
- /* Check for quadratic performance. */
- if (haystack && needle)
- {
- memset (haystack, 'A', 2 * m);
- haystack[2 * m] = 'B';
- memset (needle, 'A', m);
- needle[m] = 'B';
- if (!memmem (haystack, 2 * m + 1, needle, m + 1))
- result |= 1;
- }
- return result;
- ]])],
- [gl_cv_func_memmem_works_fast=yes], [gl_cv_func_memmem_works_fast=no],
- [dnl Only glibc >= 2.9 and cygwin > 1.7.0 are known to have a
- dnl memmem that works in linear time.
- AC_EGREP_CPP([Lucky user],
- [
-#include <features.h>
-#ifdef __GNU_LIBRARY__
- #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 9) || (__GLIBC__ > 2)) \
- && !defined __UCLIBC__
- Lucky user
- #endif
-#endif
-#ifdef __CYGWIN__
- #include <cygwin/version.h>
- #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 0)
- Lucky user
- #endif
-#endif
- ],
- [gl_cv_func_memmem_works_fast="guessing yes"],
- [gl_cv_func_memmem_works_fast="guessing no"])
- ])
- ])
- case "$gl_cv_func_memmem_works_fast" in
- *yes) ;;
- *)
- REPLACE_MEMMEM=1
- ;;
- esac
- fi
-]) # gl_FUNC_MEMMEM
-
-# Prerequisites of lib/memmem.c.
-AC_DEFUN([gl_PREREQ_MEMMEM], [:])
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [6932] remove memmem gnulib module,
Gavin D. Smith <=