Exemplo n.º 1
0
/*
 * Return the current locale conversion.
 */
struct lconv *
localeconv_l(locale_t loc)
{
	FIX_LOCALE(loc);
    struct lconv *ret = &loc->lconv;

    if (loc->monetary_locale_changed) {
	/* LC_MONETARY part */
        struct lc_monetary_T * mptr; 

#define M_ASSIGN_STR(NAME) (ret->NAME = (char*)mptr->NAME)
#define M_ASSIGN_CHAR(NAME) (ret->NAME = mptr->NAME[0])

	mptr = __get_current_monetary_locale(loc);
	M_ASSIGN_STR(int_curr_symbol);
	M_ASSIGN_STR(currency_symbol);
	M_ASSIGN_STR(mon_decimal_point);
	M_ASSIGN_STR(mon_thousands_sep);
	M_ASSIGN_STR(mon_grouping);
	M_ASSIGN_STR(positive_sign);
	M_ASSIGN_STR(negative_sign);
	M_ASSIGN_CHAR(int_frac_digits);
	M_ASSIGN_CHAR(frac_digits);
	M_ASSIGN_CHAR(p_cs_precedes);
	M_ASSIGN_CHAR(p_sep_by_space);
	M_ASSIGN_CHAR(n_cs_precedes);
	M_ASSIGN_CHAR(n_sep_by_space);
	M_ASSIGN_CHAR(p_sign_posn);
	M_ASSIGN_CHAR(n_sign_posn);
	M_ASSIGN_CHAR(int_p_cs_precedes);
	M_ASSIGN_CHAR(int_n_cs_precedes);
	M_ASSIGN_CHAR(int_p_sep_by_space);
	M_ASSIGN_CHAR(int_n_sep_by_space);
	M_ASSIGN_CHAR(int_p_sign_posn);
	M_ASSIGN_CHAR(int_n_sign_posn);
	loc->monetary_locale_changed = 0;
    }

    if (loc->numeric_locale_changed) {
	/* LC_NUMERIC part */
        struct lc_numeric_T * nptr; 

#define N_ASSIGN_STR(NAME) (ret->NAME = (char*)nptr->NAME)

	nptr = __get_current_numeric_locale(loc);
	N_ASSIGN_STR(decimal_point);
	N_ASSIGN_STR(thousands_sep);
	N_ASSIGN_STR(grouping);
	loc->numeric_locale_changed = 0;
    }

    return ret;
}
Exemplo n.º 2
0
/*
 * Return the current locale conversion.
 */
struct lconv *
localeconv()
{
    static struct lconv ret;

    if (__mlocale_changed) {
	/* LC_MONETARY part */
        struct lc_monetary_T * mptr; 

#define M_ASSIGN_STR(NAME) (ret.NAME = (char*)mptr->NAME)
#define M_ASSIGN_CHAR(NAME) (ret.NAME = mptr->NAME[0])

	mptr = __get_current_monetary_locale();
	M_ASSIGN_STR(int_curr_symbol);
	M_ASSIGN_STR(currency_symbol);
	M_ASSIGN_STR(mon_decimal_point);
	M_ASSIGN_STR(mon_thousands_sep);
	M_ASSIGN_STR(mon_grouping);
	M_ASSIGN_STR(positive_sign);
	M_ASSIGN_STR(negative_sign);
	M_ASSIGN_CHAR(int_frac_digits);
	M_ASSIGN_CHAR(frac_digits);
	M_ASSIGN_CHAR(p_cs_precedes);
	M_ASSIGN_CHAR(p_sep_by_space);
	M_ASSIGN_CHAR(n_cs_precedes);
	M_ASSIGN_CHAR(n_sep_by_space);
	M_ASSIGN_CHAR(p_sign_posn);
	M_ASSIGN_CHAR(n_sign_posn);
	M_ASSIGN_CHAR(int_p_cs_precedes);
	M_ASSIGN_CHAR(int_n_cs_precedes);
	M_ASSIGN_CHAR(int_p_sep_by_space);
	M_ASSIGN_CHAR(int_n_sep_by_space);
	M_ASSIGN_CHAR(int_p_sign_posn);
	M_ASSIGN_CHAR(int_n_sign_posn);
	__mlocale_changed = 0;
    }

    if (__nlocale_changed) {
	/* LC_NUMERIC part */
        struct lc_numeric_T * nptr; 

#define N_ASSIGN_STR(NAME) (ret.NAME = (char*)nptr->NAME)

	nptr = __get_current_numeric_locale();
	N_ASSIGN_STR(decimal_point);
	N_ASSIGN_STR(thousands_sep);
	N_ASSIGN_STR(grouping);
	__nlocale_changed = 0;
    }

    return (&ret);
}
Exemplo n.º 3
0
/*
 * Return the current locale conversion.
 */
EXPORT_C struct lconv *
localeconv()
{
#ifdef __SYMBIAN32__
    static struct lconv lret;
#else //__SYMBIAN32__
    static struct lconv ret;
#endif //__SYMBIAN32__

#ifdef SYMBIAN_OE_ENHANCED_LOCALE_SUPPORT
    if (__mlocale_changed || !(__applocale_changed)) {
#else
    if (__mlocale_changed) {
#endif
	/* LC_MONETARY part */
        struct lc_monetary_T * mptr; 
	
#ifndef __SYMBIAN32__

#define M_ASSIGN_STR(NAME) (ret.NAME = (char*)mptr->NAME)
#define M_ASSIGN_CHAR(NAME) (ret.NAME = mptr->NAME[0])
#else //__SYMBIAN32__

#define M_ASSIGN_STR(NAME) (lret.NAME = (char*)mptr->NAME)
#define M_ASSIGN_CHAR(NAME) (lret.NAME = mptr->NAME[0])
#endif //__SYMBIAN32__

	mptr = __get_current_monetary_locale();
	M_ASSIGN_STR(int_curr_symbol);
	M_ASSIGN_STR(currency_symbol);
	M_ASSIGN_STR(mon_decimal_point);
	M_ASSIGN_STR(mon_thousands_sep);
	M_ASSIGN_STR(mon_grouping);
	M_ASSIGN_STR(positive_sign);
	M_ASSIGN_STR(negative_sign);
	M_ASSIGN_CHAR(int_frac_digits);
	M_ASSIGN_CHAR(frac_digits);
	M_ASSIGN_CHAR(p_cs_precedes);
	M_ASSIGN_CHAR(p_sep_by_space);
	M_ASSIGN_CHAR(n_cs_precedes);
	M_ASSIGN_CHAR(n_sep_by_space);
	M_ASSIGN_CHAR(p_sign_posn);
	M_ASSIGN_CHAR(n_sign_posn);
	M_ASSIGN_CHAR(int_p_cs_precedes);
	M_ASSIGN_CHAR(int_n_cs_precedes);
	M_ASSIGN_CHAR(int_p_sep_by_space);
	M_ASSIGN_CHAR(int_n_sep_by_space);
	M_ASSIGN_CHAR(int_p_sign_posn);
	M_ASSIGN_CHAR(int_n_sign_posn);
	__mlocale_changed = 0;
    }

    if (__nlocale_changed) {
	/* LC_NUMERIC part */
        struct lc_numeric_T * nptr; 

#ifndef __SYMBIAN32__

#define N_ASSIGN_STR(NAME) (ret.NAME = (char*)nptr->NAME)
#else //__SYMBIAN32__

#define N_ASSIGN_STR(NAME) (lret.NAME = (char*)nptr->NAME)
#endif //__SYMBIAN32__

	nptr = __get_current_numeric_locale();
	N_ASSIGN_STR(decimal_point);
	N_ASSIGN_STR(thousands_sep);
	N_ASSIGN_STR(grouping);
	__nlocale_changed = 0;
    }
#ifndef __SYMBIAN32__

    return (&ret);
#else //__SYMBIAN32__

    return (&lret);
#endif //__SYMBIAN32__
}