posix.cfg: Added support for wcsnrtombs().

This commit is contained in:
orbitcowboy 2022-04-25 12:26:02 +02:00
parent 6b9ac6f7a8
commit d42bab47ae
2 changed files with 41 additions and 0 deletions

View File

@ -14,6 +14,36 @@
<not-bool/> <not-bool/>
</arg> </arg>
</function> </function>
<!-- https://man7.org/linux/man-pages/man3/wcsnrtombs.3.html -->
<!-- size_t wcsnrtombs(char *restrict dest, const wchar_t **restrict src, size_t nwc, size_t len, mbstate_t *restrict ps); -->
<function name="wcsnrtombs">
<use-retval/>
<returnValue type="size_t"/>
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1" direction="out">
<not-bool/>
</arg>
<arg nr="2" direction="in">
<not-null/>
<not-uninit/>
<not-bool/>
</arg>
<arg nr="3" direction="in">
<not-uninit/>
<not-bool/>
<valid>0:</valid>
</arg>
<arg nr="4" direction="in">
<not-uninit/>
<not-bool/>
<valid>0:</valid>
</arg>
<arg nr="5" direction="in">
<not-uninit/>
<not-null/>
</arg>
</function>
<!-- https://man7.org/linux/man-pages/man3/aio_read.3.html --> <!-- https://man7.org/linux/man-pages/man3/aio_read.3.html -->
<!-- int aio_read(struct aiocb *aiocbp); --> <!-- int aio_read(struct aiocb *aiocbp); -->
<!-- https://man7.org/linux/man-pages/man3/aio_write.3.html --> <!-- https://man7.org/linux/man-pages/man3/aio_write.3.html -->

View File

@ -31,6 +31,17 @@
#include <wchar.h> #include <wchar.h>
#include <string.h> #include <string.h>
size_t nullPointer_wcsnrtombs(char *restrict dest, const wchar_t **restrict src, size_t nwc, size_t len, mbstate_t *restrict ps)
{
// It is allowed to set the first arg to NULL
(void)wcsnrtombs(NULL,src,nwc,len,ps);
// cppcheck-suppress nullPointer
(void)wcsnrtombs(dest,NULL,nwc,len,ps);
// cppcheck-suppress nullPointer
(void)wcsnrtombs(dest,src,nwc,len,NULL);
return wcsnrtombs(dest,src,nwc,len,ps);
}
int nullPointer_wcsncasecmp(const wchar_t *s1, const wchar_t *s2, size_t n) int nullPointer_wcsncasecmp(const wchar_t *s1, const wchar_t *s2, size_t n)
{ {
// cppcheck-suppress nullPointer // cppcheck-suppress nullPointer