api: add float limits locale math
[libc-test] / src / api / locale.c
1 #include <locale.h>
2 #define T(t) (t*)0;
3 #define F(t,n) {t *y = &x.n;}
4 #define C(n) switch(n){case n:;}
5 static void f()
6 {
7 T(locale_t)
8 {
9 struct lconv x;
10 F(char*,currency_symbol)
11 F(char*,decimal_point)
12 F(char,frac_digits)
13 F(char*,grouping)
14 F(char*,int_curr_symbol)
15 F(char,int_frac_digits)
16 F(char,int_n_cs_precedes)
17 F(char,int_n_sep_by_space)
18 F(char,int_n_sign_posn)
19 F(char,int_p_cs_precedes)
20 F(char,int_p_sep_by_space)
21 F(char,int_p_sign_posn)
22 F(char*,mon_decimal_point)
23 F(char*,mon_grouping)
24 F(char*,mon_thousands_sep)
25 F(char*,negative_sign)
26 F(char,n_cs_precedes)
27 F(char,n_sep_by_space)
28 F(char,n_sign_posn)
29 F(char*,positive_sign)
30 F(char,p_cs_precedes)
31 F(char,p_sep_by_space)
32 F(char,p_sign_posn)
33 F(char*,thousands_sep)
34 }
35 #ifndef NULL
36 #error no NULL
37 #endif
38 C(LC_ALL)
39 C(LC_COLLATE)
40 C(LC_CTYPE)
41 #ifdef _POSIX_C_SOURCE
42 C(LC_MESSAGES)
43 #endif
44 C(LC_MONETARY)
45 C(LC_NUMERIC)
46 C(LC_TIME)
47 #ifdef _POSIX_C_SOURCE
48 C(LC_ALL_MASK)
49 C(LC_COLLATE_MASK)
50 C(LC_CTYPE_MASK)
51 C(LC_MESSAGES_MASK)
52 C(LC_MONETARY_MASK)
53 C(LC_NUMERIC_MASK)
54 C(LC_TIME_MASK)
55 {locale_t x = LC_GLOBAL_LOCALE;}
56 locale_t(*p_duplocale)(locale_t) = duplocale;
57 void(*p_freelocale)(locale_t) = freelocale;
58 locale_t(*p_newlocale)(int,const char*,locale_t) = newlocale;
59 locale_t(*p_uselocale)(locale_t) = uselocale;
60 #endif
61 struct lconv*(*p_localeconv)(void) = localeconv;
62 char*(*p_setlocale)(int,const char*) = setlocale;
63 }