FreeBSD/usr.bin/locale/locale.c
/*
 * keyword value lookup helper (via localeconv())
 */
keyword value lookup helper (via localeconv())
keyword value lookup helper ( via localeconv () )
char *
kwval_lconv(int id)
{
	struct lconv *lc;
	char *rval;
	rval = NULL;
	lc = localeconv();
	switch (id) {
		case KW_GROUPING:
			rval = lc->grouping;
			break;
		case KW_INT_CURR_SYMBOL:
			rval = lc->int_curr_symbol;
			break;
		case KW_CURRENCY_SYMBOL:
			rval = lc->currency_symbol;
			break;
		case KW_MON_DECIMAL_POINT:
			rval = lc->mon_decimal_point;
			break;
		case KW_MON_THOUSANDS_SEP:
			rval = lc->mon_thousands_sep;
			break;
		case KW_MON_GROUPING:
			rval = lc->mon_grouping;
			break;
		case KW_POSITIVE_SIGN:
			rval = lc->positive_sign;
			break;
		case KW_NEGATIVE_SIGN:
			rval = lc->negative_sign;
			break;
		case KW_INT_FRAC_DIGITS:
			rval = &(lc->int_frac_digits);
			break;
		case KW_FRAC_DIGITS:
			rval = &(lc->frac_digits);
			break;
		case KW_P_CS_PRECEDES:
			rval = &(lc->p_cs_precedes);
			break;
		case KW_P_SEP_BY_SPACE:
			rval = &(lc->p_sep_by_space);
			break;
		case KW_N_CS_PRECEDES:
			rval = &(lc->n_cs_precedes);
			break;
		case KW_N_SEP_BY_SPACE:
			rval = &(lc->n_sep_by_space);
			break;
		case KW_P_SIGN_POSN:
			rval = &(lc->p_sign_posn);
			break;
		case KW_N_SIGN_POSN:
			rval = &(lc->n_sign_posn);
			break;
		case KW_INT_P_CS_PRECEDES:
			rval = &(lc->int_p_cs_precedes);
			break;
		case KW_INT_P_SEP_BY_SPACE:
			rval = &(lc->int_p_sep_by_space);
			break;
		case KW_INT_N_CS_PRECEDES:
			rval = &(lc->int_n_cs_precedes);
			break;
		case KW_INT_N_SEP_BY_SPACE:
			rval = &(lc->int_n_sep_by_space);
			break;
		case KW_INT_P_SIGN_POSN:
			rval = &(lc->int_p_sign_posn);
			break;
		case KW_INT_N_SIGN_POSN:
			rval = &(lc->int_n_sign_posn);
			break;
		default:
			break;
	}
	return (rval);
}
char * kwval_lconv ( int id ) { struct lconv * lc ; char * rval ; rval = NULL ; lc = localeconv ( ) ; switch ( id ) { case KW_GROUPING : rval = lc -> grouping ; break ; case KW_INT_CURR_SYMBOL : rval = lc -> int_curr_symbol ; break ; case KW_CURRENCY_SYMBOL : rval = lc -> currency_symbol ; break ; case KW_MON_DECIMAL_POINT : rval = lc -> mon_decimal_point ; break ; case KW_MON_THOUSANDS_SEP : rval = lc -> mon_thousands_sep ; break ; case KW_MON_GROUPING : rval = lc -> mon_grouping ; break ; case KW_POSITIVE_SIGN : rval = lc -> positive_sign ; break ; case KW_NEGATIVE_SIGN : rval = lc -> negative_sign ; break ; case KW_INT_FRAC_DIGITS : rval = & ( lc -> int_frac_digits ) ; break ; case KW_FRAC_DIGITS : rval = & ( lc -> frac_digits ) ; break ; case KW_P_CS_PRECEDES : rval = & ( lc -> p_cs_precedes ) ; break ; case KW_P_SEP_BY_SPACE : rval = & ( lc -> p_sep_by_space ) ; break ; case KW_N_CS_PRECEDES : rval = & ( lc -> n_cs_precedes ) ; break ; case KW_N_SEP_BY_SPACE : rval = & ( lc -> n_sep_by_space ) ; break ; case KW_P_SIGN_POSN : rval = & ( lc -> p_sign_posn ) ; break ; case KW_N_SIGN_POSN : rval = & ( lc -> n_sign_posn ) ; break ; case KW_INT_P_CS_PRECEDES : rval = & ( lc -> int_p_cs_precedes ) ; break ; case KW_INT_P_SEP_BY_SPACE : rval = & ( lc -> int_p_sep_by_space ) ; break ; case KW_INT_N_CS_PRECEDES : rval = & ( lc -> int_n_cs_precedes ) ; break ; case KW_INT_N_SEP_BY_SPACE : rval = & ( lc -> int_n_sep_by_space ) ; break ; case KW_INT_P_SIGN_POSN : rval = & ( lc -> int_p_sign_posn ) ; break ; case KW_INT_N_SIGN_POSN : rval = & ( lc -> int_n_sign_posn ) ; break ; default : break ; } return ( rval ) ; }
keyword value lookup helper (via localeconv())
keyword value lookup helper ( via localeconv () )