localeconv(), localeconv_l

get locale-specific symbols 

Function


SYNOPSIS

#include <locale.h>

struct lconv *localeconv(void);

struct lconv *localeconv_l(locale_t locale);


DESCRIPTION

The localeconv() function returns a pointer to an lconv struct that has values for locale-specific symbols. Members of the structure lconv are either char or pointers to char. The pointers to char are null-terminated, possibly zero-length strings. Members that are type char have either the value of the symbol, or have the value CHAR_MAX to indicate that the symbol has no definition in the current locale.

localeconv_l() behaves in the same way as localeconv() without the _l suffix, but uses the specified locale rather than the global or per-thread locale. A locale_t is returned by newlocale().

The members of struct lconv are:

char *decimal_point 

The radix character used to format nonmonetary quantities. This string is never empty.

char *thousands_sep 

The character used to separate groups of digits before the radix character in formatted nonmonetary quantities.

char *grouping 

A string whose elements indicate the size of each group of digits in formatted nonmonetary quantities.

char *int_curr_symbol 

The international currency symbol applicable to the current locale.

char *currency_symbol 

The local currency symbol applicable to the current locale.

char *mon_decimal_point 

The radix character used to format monetary quantities.

char *mon_thousands_sep 

The separator for groups of digits before the radix character in formatted monetary quantities.

char *mon_grouping 

A string whose elements indicate the size of each group of digits in formatted monetary quantities.

char *positive_sign 

The character used to indicate that a formatted monetary quantity is nonnegative.

char *negative_sign 

The character used to indicate that a formatted monetary quantity is negative.

char int_frac_digits 

The number of digits to be displayed following the radix character in an internationally formatted monetary quantity.

char frac_digits 

The number of digits to be displayed following the radix character in a locally formatted monetary quantity.

char p_cs_precedes 

Boolean value to indicate whether the currency_symbol precedes the value for a nonnegative formatted monetary quantity.

char p_sep_by_space 

Boolean value to indicate whether the currency_symbol is separated by a space from the value for a nonnegative formatted monetary quantity.

char n_cs_precedes 

Boolean value to indicate whether the currency_symbol precedes the value for a negative formatted monetary quantity.

char n_sep_by_space 

Boolean value to indicate whether the currency_symbol is separated by a space from the value for a negative formatted monetary quantity.

char p_sign_posn 

Set to a value indicating the position of the positive_sign for a nonnegative formatted monetary quantity.

char n_sign_posn 

Set to a value indicating the position of the negative_sign for a negative formatted monetary quantity.

The values of p_sign_posn and n_sign_posn are defined as follows:

0 

Parentheses surround the quantity and currency_symbol.

1 

The sign precedes the quantity and currency_symbol.

2 

The sign follows the quantity and currency_symbol.

3 

The sign immediately precedes the currency_symbol.

4 

The sign immediately follows the currency_symbol.


PARAMETERS

None.


RETURN VALUES

A pointer to static storage that holds a filled-in lconv structure. Subsequent calls to localeconv() or localeconv_l() overwrite this area.


CONFORMANCE

localeconv() conforms to ANSI/ISO 9899:1990 'ISO C90'

localeconv_l() conforms to ANSI/ISO 9899:1999 'ISO C99'


PARAMETERS

locale 

Is a locale_t perhaps returned by newlocale() or LC_GLOBAL_LOCALE or 0 for the current thread locale set with uselocale().


MULTITHREAD SAFETY LEVEL

MT-Safe, with exceptions.

The function localeconv() is MT-Safe as long as no thread calls setlocale() while this function is executing.

The function localeconv_l() is MT-Safe as long as no thread calls freelocale() on locale while this function is executing.


PORTING ISSUES

None.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
newlocale(), setlocale()


PTC MKS Toolkit 10.4 Documentation Build 39.