Confirms that its argument is a valid wide character in the current program's locale. Format #include <unistd.h> int decc$validate_wchar (wchar_t wc);
1 – Argument
wc Wide character to be validated.
2 – Description
The decc$validate_wchar function provides a convenient way to verify whether a specified argument of wchar_t type is a valid wide character in the current program's locale. One reason to call decc$validate_wchar is that the isw* wide- character classification functions and macros do not validate their argument before dereferencing the classmask array describing character properties. Passing an isw* function a value that exceeds the maximum wide-character value for the current program's locale can result in an attempt to access memory beyond the allocated classmask array. A standard way to validate a wide character is to call the wctomb function, but this way is less convenient because it requires declaring a multibyte character array of sufficient size and passing it to wctomb.
3 – Return Values
1 Indicates that the specified wide character is a valid wide character in the current program's locale. 0 Indicates that the specified wide character is not a valid wide character in the current program's locale. errno is not set.