Initial revision
This commit is contained in:
parent
8c9800d8fe
commit
cd367c7940
2 changed files with 61 additions and 0 deletions
35
lang/cem/libcc.ansi/locale/localeconv.c
Normal file
35
lang/cem/libcc.ansi/locale/localeconv.c
Normal file
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* localeconv - set components of a struct according to current locale
|
||||
*/
|
||||
/* $Header$ */
|
||||
|
||||
#include <limits.h>
|
||||
#include <locale.h>
|
||||
|
||||
extern struct lconv _lc;
|
||||
|
||||
struct lconv *
|
||||
localeconv(void)
|
||||
{
|
||||
register struct lconv *lcp = &_lc;
|
||||
|
||||
lcp->decimal_point = ".";
|
||||
lcp->thousands_sep = "";
|
||||
lcp->grouping = "";
|
||||
lcp->int_curr_symbol = "";
|
||||
lcp->currency_symbol = "";
|
||||
lcp->mon_decimal_point = "";
|
||||
lcp->mon_thousands_sep = "";
|
||||
lcp->mon_grouping = "";
|
||||
lcp->positive_sign = "";
|
||||
lcp->negative_sign = "";
|
||||
lcp->frac_digits = CHAR_MAX;
|
||||
lcp->p_cs_precedes = CHAR_MAX;
|
||||
lcp->p_sep_by_space = CHAR_MAX;
|
||||
lcp->n_cs_precedes = CHAR_MAX;
|
||||
lcp->n_sep_by_space = CHAR_MAX;
|
||||
lcp->p_sign_posn = CHAR_MAX;
|
||||
lcp->n_sign_posn = CHAR_MAX;
|
||||
|
||||
return lcp;
|
||||
}
|
26
lang/cem/libcc.ansi/locale/setlocale.c
Normal file
26
lang/cem/libcc.ansi/locale/setlocale.c
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* setlocale - set the programs locale
|
||||
*/
|
||||
/* $Header$ */
|
||||
|
||||
#include <locale.h>
|
||||
|
||||
struct lconv _lc;
|
||||
|
||||
char *
|
||||
setlocale(int category, const char *locale)
|
||||
{
|
||||
if (strcmp(locale, "C")) return (char *)NULL;
|
||||
|
||||
switch(category) {
|
||||
case LC_ALL:
|
||||
case LC_COLLATE:
|
||||
case LC_CTYPE:
|
||||
case LC_MONETARY:
|
||||
case LC_NUMERIC:
|
||||
case LC_TIME:
|
||||
return locale;
|
||||
default:
|
||||
return (char *)NULL;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue