The following issue has been SUBMITTED. ====================================================================== https://www.austingroupbugs.net/view.php?id=1633 ====================================================================== Reported By: nrk Assigned To: ====================================================================== Project: Issue 8 drafts Issue ID: 1633 Category: Base Definitions and Headers Type: Enhancement Request Severity: Comment Priority: normal Status: New Name: Nickolas Raymond Kaczynski Organization: User Reference: Section: <string.h> Page Number: n/a Line Number: n/a Final Accepted Text: ====================================================================== Date Submitted: 2023-02-16 10:07 UTC Last Modified: 2023-02-16 10:07 UTC ====================================================================== Summary: Add memrchr Description: memrchr is a simple and useful function that is similar to memchr, except it finds the last occurrence of a byte. It is provided by the following implementations already:
* glibc (https://www.man7.org/linux/man-pages/man3/memrchr.3.html) * musl * openbsd (https://man.openbsd.org/memrchr.3) * freebsd (https://man.freebsd.org/cgi/man.cgi?query=memrchr&manpath=FreeBSD+13.1-RELEASE+and+Ports) (And probably many others). Desired Action: Under section <string.h> add: void *memrchr(const void *s, int c, size_t n); Under memchr, add memrchr to SEE ALSO. Add a new memrchr page: NAME memrchr - find last occurrence of a byte in memory SYNOPSIS #include <string.h> void *memrchr(const void *s, int c, size_t n); DESCRIPTION The memrchr() function shall locate the last occurrence of c (converted to an unsigned char) in the initial n bytes (each interpreted as unsigned char) pointed to by s. RETURN VALUE The memrchr() function shall return a pointer to the located byte, or a null pointer if the byte is not found. ERRORS No errors are defined. ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 2023-02-16 10:07 nrk New Issue 2023-02-16 10:07 nrk Name => Nickolas Raymond Kaczynski 2023-02-16 10:07 nrk Section => <string.h> 2023-02-16 10:07 nrk Page Number => n/a 2023-02-16 10:07 nrk Line Number => n/a ======================================================================