include/string.h: Also declare strcasecmp() and strncasecmp().

POSIX declares strcasecmp() and strncasecmp() in <strings.h>.  glibc,
musl and newlib also declare them in <string.h>, and some programs
rely on that: they include only <string.h> and get an implicit
declaration on NuttX.

Declare the two functions in <string.h> too.  Only the prototypes are
added: the BSD macros of <strings.h> (bcopy(), bzero() and others) stay
out of <string.h>.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
This commit is contained in:
Marco Casaroli 2026-10-08 22:02:16 +02:00 • committed by Alan C. Assis
parent e794a88e1e
commit fe34a3ee78

View file

@ -74,6 +74,14 @@ size_t strlcat(FAR char *, FAR const char *, size_t);
FAR char *strncat(FAR char *, FAR const char *, size_t);
int strcmp(FAR const char *, FAR const char *);
int strncmp(FAR const char *, FAR const char *, size_t);
/* Also declared in <strings.h>. Other C libraries declare them in
* <string.h> as well, and some programs rely on that.
*/
int strcasecmp(FAR const char *, FAR const char *);
int strncasecmp(FAR const char *, FAR const char *, size_t);
int strcoll(FAR const char *, FAR const char *s2);
FAR char *strcpy(FAR char *dest, FAR const char *src);
FAR char *stpcpy(FAR char *dest, FAR const char *src);