From: Bruno Haible Date: Mon, 28 Aug 2006 13:07:37 +0000 (+0000) Subject: Move to gnulib. X-Git-Tag: 0.16.x-branchpoint~176 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7085d6ddf27b3c9920ff9b1d9165a0b6e5cbf16c;p=thirdparty%2Fgettext.git Move to gnulib. --- diff --git a/gnulib-local/ChangeLog b/gnulib-local/ChangeLog index 5346598f1..7402afe14 100644 --- a/gnulib-local/ChangeLog +++ b/gnulib-local/ChangeLog @@ -1,3 +1,9 @@ +2006-08-28 Bruno Haible + + * modules/c-strstr: Remove file, now in gnulib. + * lib/c-strstr.h: Remove file, now in gnulib. + * lib/c-strstr.c: Remove file, now in gnulib. + 2006-08-22 Bruno Haible * modules/pathmax.diff: Remove file. diff --git a/gnulib-local/lib/c-strstr.c b/gnulib-local/lib/c-strstr.c deleted file mode 100644 index 0cf97d6ff..000000000 --- a/gnulib-local/lib/c-strstr.c +++ /dev/null @@ -1,117 +0,0 @@ -/* Copyright (C) 1994, 1999, 2002-2003, 2005-2006 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 2, 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, write to the Free Software Foundation, -Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -/* - * My personal strstr() implementation that beats most other algorithms. - * Until someone tells me otherwise, I assume that this is the - * fastest implementation of strstr() in C. - * I deliberately chose not to comment it. You should have at least - * as much fun trying to understand it, as I had to write it :-). - * - * Stephen R. van den Berg, berg@pool.informatik.rwth-aachen.de */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#include - -typedef unsigned chartype; - -char * -c_strstr (const char *phaystack, const char *pneedle) -{ - register const unsigned char *haystack, *needle; - register chartype b, c; - - haystack = (const unsigned char *) phaystack; - needle = (const unsigned char *) pneedle; - - b = *needle; - if (b != '\0') - { - haystack--; /* possible ANSI violation */ - do - { - c = *++haystack; - if (c == '\0') - goto ret0; - } - while (c != b); - - c = *++needle; - if (c == '\0') - goto foundneedle; - ++needle; - goto jin; - - for (;;) - { - register chartype a; - register const unsigned char *rhaystack, *rneedle; - - do - { - a = *++haystack; - if (a == '\0') - goto ret0; - if (a == b) - break; - a = *++haystack; - if (a == '\0') - goto ret0; -shloop:; } - while (a != b); - -jin: a = *++haystack; - if (a == '\0') - goto ret0; - - if (a != c) - goto shloop; - - rhaystack = haystack-- + 1; - rneedle = needle; - a = *rneedle; - - if (*rhaystack == a) - do - { - if (a == '\0') - goto foundneedle; - ++rhaystack; - a = *++needle; - if (*rhaystack != a) - break; - if (a == '\0') - goto foundneedle; - ++rhaystack; - a = *++needle; - } - while (*rhaystack == a); - - needle = rneedle; /* took the register-poor approach */ - - if (a == '\0') - break; - } - } -foundneedle: - return (char *) haystack; -ret0: - return 0; -} diff --git a/gnulib-local/lib/c-strstr.h b/gnulib-local/lib/c-strstr.h deleted file mode 100644 index 4ce2db252..000000000 --- a/gnulib-local/lib/c-strstr.h +++ /dev/null @@ -1,45 +0,0 @@ -/* Searching in a string. - Copyright (C) 2001-2003, 2006 Free Software Foundation, Inc. - - 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 2, 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, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - - -/* The functions defined in this file assume a nearly ASCII compatible - character set. */ - - -#ifdef __cplusplus -extern "C" { -#endif - -/* Find the first occurrence of NEEDLE in HAYSTACK. - This function is safe to be called, even in a multibyte locale, if NEEDLE - 1. consists solely of printable ASCII characters excluding '\\' and '~' - [this restriction is needed because of Shift_JIS and JOHAB] - or of the control ASCII characters '\a' '\b' '\f' '\n' '\r' '\t' '\v' - [this restriction is needed because of VISCII], and - 2. has at least length 2 - [this restriction is needed because of BIG5, BIG5-HKSCS, GBK, GB18030, - Shift_JIS, JOHAB], and - 3. does not consist entirely of decimal digits, or has at least length 4 - [this restricion is needed because of GB18030]. - This function is also safe to be called, even in a multibyte locale, if - HAYSTACK and NEEDLE are known to both consist solely of printable ASCII - characters excluding '\\' and '~'. */ -extern char *c_strstr (const char *haystack, const char *needle); - -#ifdef __cplusplus -} -#endif diff --git a/gnulib-local/modules/c-strstr b/gnulib-local/modules/c-strstr deleted file mode 100644 index bcc7b77a1..000000000 --- a/gnulib-local/modules/c-strstr +++ /dev/null @@ -1,23 +0,0 @@ -Description: -Search for a substring in a string in C locale. - -Files: -lib/c-strstr.h -lib/c-strstr.c - -Depends-on: - -configure.ac: - -Makefile.am: -lib_SOURCES += c-strstr.h c-strstr.c - -Include: -"c-strstr.h" - -License: -LGPL - -Maintainer: -Bruno Haible -