WCSLEN(3C) Standard C Library Functions WCSLEN(3C)

NAME


wcslen, wcsnlen - get length of wide-character string

SYNOPSIS


#include <wchar.h>

size_t
wcslen(const wchar_t *string);

size_t
wcsnlen(const wchar_t *string, size_t maxlen);

DESCRIPTION


The wcslen() and wcsnlen() functions count the number of wide-characters
that are present in string. They stop counting when they encounter a null
wide-character. The terminating null wide-character is not included in the
count.

Additionally, wcsnlen() stops counting after it has counted maxlen wide-
characters.

The wcslen() and wcsnlen() functions are the wide-character equivalents of
strlen(3C) and strnlen(3C), respectively.

RETURN VALUES


The wcslen() function returns the length of string. The wcsnlen() function
returns the smaller of the length of string and maxlen.

ERRORS


None.

INTERFACE STABILITY


Standard.

MT-LEVEL
MT-Safe.

SEE ALSO


free(3C), strlen(3C), strnlen(3C), wchar.h(3HEAD), locale(7), standards(7)

STANDARDS


The wcslen() function was introduced in X/Open Portability Guide Issue 4
("XPG4") and standardized in ISO/IEC 9899:1999 ("ISO C99"). The wcsnlen()
function was introduced in IEEE Std 1003.1-2008 ("POSIX.1").

OmniOS November 4, 2014 OmniOS