]> Savannah Git Hosting - gnulib.git/commit
unistr/u{16,32}-strstr: Use two-way algorithm (no memory allocation).
authorBruno Haible <bruno@clisp.org>
Sun, 2 Apr 2023 14:07:36 +0000 (16:07 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 2 Apr 2023 14:07:36 +0000 (16:07 +0200)
commit4a3872f5902158b6a0d5f9bac02620da63639d90
treee660a5bf4c03659e6bc95015554f46145a12b024
parent768593d575328a4b7c0fae0958f3d3af0a2ac3f9
unistr/u{16,32}-strstr: Use two-way algorithm (no memory allocation).

* lib/wcs-two-way.h: Use UNIT instead of wchar_t. Don't undefine
RETURN_TYPE.
* lib/wcsstr-impl.h: Move the non-linear implementation away. Use UNIT
instead of wchar_t, RETURN_TYPE instead of 'wchar_t *', FUNC instead of
wcsstr.
(AVAILABLE): Use MEMCHR0 instead of wmemchr.
(FUNC): Use STRCHR instead of wcschr.
* lib/wcsstr.c: Moved the non-linear implementation to here.
(FUNC, UNIT, RETURN_TYPE, MEMCHR0, STRCHR): New macros.
* lib/unistr/u16-strstr.c: Don't include malloca.h, str-kmp.h,
u-strstr.h. Instead, include wcsstr-impl.h.
* lib/unistr/u32-strstr.c: Likewise.
* modules/unistr/u16-strstr (Files): Remove u-strstr.h, str-kmp.h. Add
wcsstr-impl.h, wcs-two-way.h.
(Depends-on): Remove u16-strmbtouc, u16-strlen, u16-strnlen, malloca.
Add u16-chr, u16-cmp.
* modules/unistr/u32-strstr (Files): Remove u-strstr.h, str-kmp.h. Add
wcsstr-impl.h, wcs-two-way.h.
(Depends-on): Remove u32-strlen, u32-strnlen, malloca. Add u32-chr,
u32-cmp.
ChangeLog
lib/unistr/u16-strstr.c
lib/unistr/u32-strstr.c
lib/wcs-two-way.h
lib/wcsstr-impl.h
lib/wcsstr.c
modules/unistr/u16-strstr
modules/unistr/u32-strstr