NWLstrxfrm(3nw)


NWLstrxfrm -- transforms a string by replacing each character with its corresponding collation value

Synopsis

   #include <time.h> or #define NWL_EXCLUDE_TIME 
   #include <stdio.h> or #define NWL_EXCLUDE_FILE 
   #include <nwlocale.h> 
   

size_t NWAPI NWLstrxfrm (char NWFAR *string1, char NWFAR *string2, size_t numChars);

Description

The parameters are as follows:

string1
(OUT) Points to the string after it is transformed to its collation value.

string2
(IN) Points to the string to be transformed.

numChars
(IN) Specifies the size in bytes of the buffer for ``string1,' plus 1 for the NULL terminator.

Return values

0x0000
String not transformed

Non-zero
Length of the transformed string, not including the NULL terminator.

Notices

NWLstrxfrm transforms string2, and places the results in string1.

If you apply strcmp to two transformed strings, it returns a value greater than, equal to, or less than zero, corresponding to the result of NWLstrcoll applied to the same two original strings.

NWLstrxfrm returns a 0 for any of the following reasons:

   string2 was NULL 
   numCharswas '0' 
   Collation table not initialized 
   Any combination of the above 

NWLstrxfrm places no more than numChars into string1. If numChars is zero, string2 is allowed to be NULL.

NWLstrxfrm is used in place of NWLstrcoll when multiple comparisons of the same string are necessary. This should provide a performance advantage.


NOTE: NWLstrxfrm does not distinguish between characters with accents and characters without accents unless the character is specifically in the alphabet for the country.

Services

Internationalization

NCP calls

None

References

NWLsetlocale(3nw), NWLstrcoll(3nw)
30 January 1998
© 1998 The Santa Cruz Operation, Inc. All rights reserved.