Hash :
c36a0f21
Author :
Date :
2024-10-27T17:01:29
doc: Add a module index. * doc/Makefile (undocumented-modules.texi): New rule. (%.info, %.html, %.dvi, %.pdf): Depend on undocumented-modules.texi. (mostlyclean): Remove also *.m and *.tmp. (force): New rule. * doc/*.texi: Add module index entries. * doc/*/*.texi: Likewise.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
@node memmem
@subsection @code{memmem}
@findex memmem
POSIX specification:@* @url{https://pubs.opengroup.org/onlinepubs/9799919799/functions/memmem.html}
Documentation:
@itemize
@item
@ifinfo
@ref{Search Functions,,Search Functions,libc},
@end ifinfo
@ifnotinfo
@url{https://www.gnu.org/software/libc/manual/html_node/Search-Functions.html},
@end ifnotinfo
@item
@uref{https://www.kernel.org/doc/man-pages/online/pages/man3/memmem.3.html,,man memmem}.
@end itemize
Gnulib module: memmem or memmem-simple
@mindex memmem
@mindex memmem-simple
Both modules implement the same replacement for the @code{memmem} function
with the @code{memmem} module providing a replacement on more platforms where
the existing @code{memmem} function has a quadratic worst-case complexity.
Portability problems fixed by either Gnulib module @code{memmem-simple}
or @code{memmem}:
@itemize
@item
This function is missing on some platforms:
Mac OS X 10.5, FreeBSD 5.2.1, OpenBSD 4.0, Minix 3.1.8, HP-UX 11, Solaris 10, mingw, MSVC 14.
@item
This function has reversed arguments on some older platforms:
Linux libc 5.0.9
@item
This function can trigger false positives for long periodic needles on
some platforms:
glibc 2.12, Cygwin 1.7.7.
@item
This function returns incorrect values in some cases, such as when
given an empty needle:
glibc <= 2.0, macOS 14, AIX 7.2, Solaris 11.3, Cygwin 1.5.x.
@end itemize
Performance problems fixed by Gnulib module @code{memmem}:
@itemize
@item
This function has quadratic instead of linear worst-case complexity on some
platforms:
glibc 2.8, macOS 14, FreeBSD 11.4, NetBSD 8.2, OpenBSD 6.6, AIX 7.2, Solaris 11.4, Cygwin 1.5.x.
Note for small needles the replacement may be slower.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@end itemize