Convert strcasestr module to use Two-Way algorithm.
authorEric Blake <ebb9@byu.net>
Fri, 11 Jan 2008 05:22:51 +0000 (22:22 -0700)
committerEric Blake <ebb9@byu.net>
Tue, 15 Jan 2008 03:34:33 +0000 (20:34 -0700)
commit9c063a2afdc2f2f6a1da2bb2ec54eadbae42a0ab
tree263de037f110058b34c96c2ae6053ef355b1c88c
parentf94627382dd83f0b4a5572a08257976e21d2f8d0
Convert strcasestr module to use Two-Way algorithm.

* modules/strcasestr-simple: New module, based on the old
strcasestr, but with Two-Way rather than KMP.
* modules/strcasestr (Depends-on): Change to strcasestr-simple.
* lib/string.in.h (rpl_strcasestr): Declare.
* m4/strcasestr.m4 (gl_FUNC_STRCASESTR): Check for linear
performance.
* lib/strcasestr.c (strcasestr): Simplify, and avoid malloc.
* modules/string (Makefile.am): Support strcasestr.
* m4/string_h.m4 (gl_HEADER_STRING_H_DEFAULTS): Likewise.
* modules/strcasestr-tests (Depends-on): Check for alarm.
* tests/test-strcasestr.c: Augment test.
* lib/str-two-way.h: Clean up stray macro.
* NEWS: Document new module.
* MODULES.html.sh (string handling): Likewise.
* doc/functions/strcasestr.texi: New file.
* doc/gnulib.texi (Function Substitutes): New node.  Move memmem
here, since it is not a POSIX function.

Signed-off-by: Eric Blake <ebb9@byu.net>
15 files changed:
ChangeLog
MODULES.html.sh
NEWS
doc/functions/strcasestr.texi [new file with mode: 0644]
doc/gnulib.texi
lib/str-two-way.h
lib/strcasestr.c
lib/string.in.h
m4/strcasestr.m4
m4/string_h.m4
modules/strcasestr
modules/strcasestr-simple [new file with mode: 0644]
modules/strcasestr-tests
modules/string
tests/test-strcasestr.c