diff options
author | Eric Blake <eblake@redhat.com> | 2008-01-12 04:25:55 +0000 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2008-01-12 04:25:55 +0000 |
commit | 40617efc8b9309006af1f0c72425fc4a404f40d4 (patch) | |
tree | 5f97df24fcf156b492ae2123f201de1528abf0cf /newlib/libc/string/strings.tex | |
parent | 978e84cf602994e44570fbac0c7adcd2ef5690e1 (diff) | |
download | cygnal-40617efc8b9309006af1f0c72425fc4a404f40d4.tar.gz cygnal-40617efc8b9309006af1f0c72425fc4a404f40d4.tar.bz2 cygnal-40617efc8b9309006af1f0c72425fc4a404f40d4.zip |
Make strstr and strcasestr O(n), not O(n^2); add memmem.
* libc/string/str-two-way.h: New file.
* libc/string/memmem.c (memmem): New file.
* libc/include/string.h (memmem): Declare for all platforms.
* libc/string/strstr.c (strstr): Provide O(n) implementation when
not optimizing for space.
* libc/string/strcasestr.c (strcasestr): Likewise.
* libc/string/Makefile.am (ELIX_SOURCES): Rename to...
(ELIX_2_SOURCES): ...this.
(ELIX_4_SOURCES): New category, for memmem.
(lib_a_SOURCES, libstring_la_SOURCES): Build new file.
(CHEWOUT_FILES): Build documentation for memmem.
* libc/string/strings.tex: Include new docs.
Diffstat (limited to 'newlib/libc/string/strings.tex')
-rw-r--r-- | newlib/libc/string/strings.tex | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/newlib/libc/string/strings.tex b/newlib/libc/string/strings.tex index 5ba6e0fe5..6750f3eb0 100644 --- a/newlib/libc/string/strings.tex +++ b/newlib/libc/string/strings.tex @@ -14,6 +14,7 @@ managing areas of memory. The corresponding declarations are in * memchr:: Find character in memory * memcmp:: Compare two memory areas * memcpy:: Copy memory regions +* memmem:: Find memory segment * memmove:: Move possibly overlapping memory * mempcpy:: Copy memory regions and locate end * memset:: Set an area of memory @@ -72,6 +73,9 @@ managing areas of memory. The corresponding declarations are in @include string/memcpy.def @page +@include string/memmem.def + +@page @include string/memmove.def @page |