@ -2124,14 +2124,7 @@ pg_strxfrm_libc(char *dest, const char *src, size_t destsize,
pg_locale_t locale )
pg_locale_t locale )
{
{
Assert ( locale - > provider = = COLLPROVIDER_LIBC ) ;
Assert ( locale - > provider = = COLLPROVIDER_LIBC ) ;
# ifdef TRUST_STRXFRM
return strxfrm_l ( dest , src , destsize , locale - > info . lt ) ;
return strxfrm_l ( dest , src , destsize , locale - > info . lt ) ;
# else
/* shouldn't happen */
PGLOCALE_SUPPORT_ERROR ( locale - > provider ) ;
return 0 ; /* keep compiler quiet */
# endif
}
}
static size_t
static size_t
@ -2340,6 +2333,10 @@ pg_strxfrm_enabled(pg_locale_t locale)
* The provided ' src ' must be nul - terminated . If ' destsize ' is zero , ' dest '
* The provided ' src ' must be nul - terminated . If ' destsize ' is zero , ' dest '
* may be NULL .
* may be NULL .
*
*
* Not all providers support pg_strxfrm ( ) safely . The caller should check
* pg_strxfrm_enabled ( ) first , otherwise this function may return wrong
* results or an error .
*
* Returns the number of bytes needed ( or more ) to store the transformed
* Returns the number of bytes needed ( or more ) to store the transformed
* string , excluding the terminating nul byte . If the value returned is
* string , excluding the terminating nul byte . If the value returned is
* ' destsize ' or greater , the resulting contents of ' dest ' are undefined .
* ' destsize ' or greater , the resulting contents of ' dest ' are undefined .
@ -2372,6 +2369,10 @@ pg_strxfrm(char *dest, const char *src, size_t destsize, pg_locale_t locale)
* ' src ' does not need to be nul - terminated . If ' destsize ' is zero , ' dest ' may
* ' src ' does not need to be nul - terminated . If ' destsize ' is zero , ' dest ' may
* be NULL .
* be NULL .
*
*
* Not all providers support pg_strnxfrm ( ) safely . The caller should check
* pg_strxfrm_enabled ( ) first , otherwise this function may return wrong
* results or an error .
*
* Returns the number of bytes needed ( or more ) to store the transformed
* Returns the number of bytes needed ( or more ) to store the transformed
* string , excluding the terminating nul byte . If the value returned is
* string , excluding the terminating nul byte . If the value returned is
* ' destsize ' or greater , the resulting contents of ' dest ' are undefined .
* ' destsize ' or greater , the resulting contents of ' dest ' are undefined .
@ -2426,6 +2427,10 @@ pg_strxfrm_prefix_enabled(pg_locale_t locale)
*
*
* The provided ' src ' must be nul - terminated .
* The provided ' src ' must be nul - terminated .
*
*
* Not all providers support pg_strxfrm_prefix ( ) safely . The caller should
* check pg_strxfrm_prefix_enabled ( ) first , otherwise this function may return
* wrong results or an error .
*
* If destsize is not large enough to hold the resulting byte sequence , stores
* If destsize is not large enough to hold the resulting byte sequence , stores
* only the first destsize bytes in ' dest ' . Returns the number of bytes
* only the first destsize bytes in ' dest ' . Returns the number of bytes
* actually copied to ' dest ' .
* actually copied to ' dest ' .
@ -2455,6 +2460,10 @@ pg_strxfrm_prefix(char *dest, const char *src, size_t destsize,
*
*
* The provided ' src ' must be nul - terminated .
* The provided ' src ' must be nul - terminated .
*
*
* Not all providers support pg_strnxfrm_prefix ( ) safely . The caller should
* check pg_strxfrm_prefix_enabled ( ) first , otherwise this function may return
* wrong results or an error .
*
* If destsize is not large enough to hold the resulting byte sequence , stores
* If destsize is not large enough to hold the resulting byte sequence , stores
* only the first destsize bytes in ' dest ' . Returns the number of bytes
* only the first destsize bytes in ' dest ' . Returns the number of bytes
* actually copied to ' dest ' .
* actually copied to ' dest ' .