]> git.sur5r.net Git - cc65/blob - libsrc/common/locale.c
Adjusted C declarations to the changed static driver names.
[cc65] / libsrc / common / locale.c
1 /*
2  * locale.c
3  *
4  * Ullrich von Bassewitz, 11.12.1998
5  */
6
7
8
9 #include <locale.h>
10 #include <limits.h>
11
12
13
14 /*****************************************************************************/
15 /*                                   Data                                    */
16 /*****************************************************************************/
17
18
19
20 /* For memory efficiency use a separate empty string */
21 static char EmptyString [] = "";
22
23 static struct lconv lc = {
24     EmptyString,        /* currency_symbol */
25     ".",                /* decimal_point */
26     EmptyString,        /* grouping */
27     EmptyString,        /* int_curr_symbol */
28     EmptyString,        /* mon_decimal_point */
29     EmptyString,        /* mon_grouping */
30     EmptyString,        /* mon_thousands_sep */
31     EmptyString,        /* negative_sign */
32     EmptyString,        /* positive_sign */
33     EmptyString,        /* thousands_sep */
34     CHAR_MAX,           /* frac_digits */
35     CHAR_MAX,           /* int_frac_digits */
36     CHAR_MAX,           /* n_cs_precedes */
37     CHAR_MAX,           /* n_sep_by_space */
38     CHAR_MAX,           /* n_sign_posn */
39     CHAR_MAX,           /* p_cs_precedes */
40     CHAR_MAX,           /* p_sep_by_space */
41     CHAR_MAX,           /* p_sign_posn */
42 };
43
44
45
46 /*****************************************************************************/
47 /*                                   Code                                    */
48 /*****************************************************************************/
49
50
51
52 struct lconv* localeconv (void)
53 {
54     return &lc;
55 }
56
57
58
59 char* __fastcall__ setlocale (int, const char* locale)
60 {
61     if (locale == 0 || (locale [0] == 'C' && locale [1] == '\0') || locale [0] == '\0') {
62         /* No change, or value already set, our locale is the "C" locale */
63         return "C";
64     } else {
65         /* Cannot set this one */
66         return 0;
67     }
68 }
69
70
71
72