The ifx_gl_wcscoll() function

The ifx_gl_wcscoll() function uses locale-specific order to compare two wide-character strings.

Syntax

#include <ifxgls.h>
...
int ifx_gl_wcscoll(wcs1, wcs1_char_length, wcs2, wcs2_char_length)
       gl_wchar_t *wcs1;
       int wcs1_char_length;
       gl_wchar_t *wcs2;
       int wcs2_char_length;
wcs1
A pointer to the wide-character string to compare with wcs2.
wcs1_char_length
The integer number of characters in the wcs1 string. If wcs1_char_length is the value IFX_GL_NULL, the function assumes that wcs1 is a null-terminated string.
wcs2
A pointer to the wide-character string to compare with wcs1.
wcs2_char_length
The integer number of characters in the wcs2 string. If wcs2_char_length is the value IFX_GL_NULL, the function assumes that wcs2 is a null-terminated string.
Valid in client application Valid in DataBlade® UDR
Yes Yes

Usage

The ifx_gl_wcscoll() function uses locale-specific order to compare the wide-character strings wcs1 and wcs2.

Locale information

The LC_COLLATE category of the current locale affects the behavior of this function because it defines the locale-specific order.

Return values

<0
The wcs1 string is less than the wcs2 string (wcs1 < wcs2); or the function was not successful, and the error number is set to indicate the cause. See the Errors section.
=0
The wcs1 string is equal to the wcs string (wcs1 = wcs).
>0
The wcs1 string is greater than the wcs string (wcs1 > wcs).

Errors

This function does not return a unique value to indicate an error. If an error occurred, this function returns -1 and sets the ifx_gl_lc_errno() error number to one of the following values.
IFX_GL_PARAMERR
Either wcs1_char_length is not equal to IFX_GL_NULL and is not greater than or equal to 0, or wcs2_char_length is not equal to IFX_GL_NULL and is not greater than or equal to 0.
IFX_GL_TERMMISMAT
Either wcs1_char_length is equal to IFX_GL_NULL, and wcs2_char_length is greater than or equal to 0; or wcs1_char_length is greater than or equal to 0, and wcs2_char_length is equal to IFX_GL_NULL.
IFX_GL_EILSEQ
Either wcs1 or wcs2 contains an invalid wide character.
IFX_GL_ENOMEM
Not enough memory is available to complete the operation.