The ifx_gl_wcslen() function
The ifx_gl_wcslen() function determines the number of characters in a wide-character string.
Syntax
#include <ifxgls.h>
...
int ifx_gl_wcslen(wcs)
gl_wchar_t *wcs;
- wcs
- A pointer to the wide-character string whose length the function determines.
Valid in client application | Valid in DataBlade® UDR |
---|---|
Yes | Yes |
Usage
The ifx_gl_wcslen() function computes the number of wide characters in the wide-character string to which wcs points, not including the null-terminating wide-character code. The length that ifx_gl_wcslen() returns includes any trailing white space. The trailing-space characters are all characters that the blank character class of the current locale defines.
For example, the following call to ifx_gl_wcslen() return
a value of 7 (where A1A2, B1B2,
and C1C2 are wide characters of 2 bytes each,
and s1s2 is the wide-character blank space):
ifx_gl_wcslen("A1A2B1B2s1s2C1C2s1s2s1s2s1s2")
Use the ifx_gl_wcntslen() function if you want the length without trailing white space.
Return values
- >=0
- The number of characters in the wcs string, not including any null terminator but including any trailing white space.
- -1
- The function was not successful, and the error number is set to indicate the cause. See the Errors section.
Errors
If an error occurred, this function
returns -1 and sets the ifx_gl_lc_errno() error
number to the following value.
- IFX_GL_EILSEQ
- The *wcs value contains an invalid wide character.