1 /* ----------------------------------------------------------------------------
3 * ----------------------------------------------------------------------------
4 * Public Domain C Library - http://pdclib.sourceforge.net
5 * This code is Public Domain. Use, modify, and redistribute at will.
6 * ----------------------------------------------------------------------------
8 * --------------------------------------------------------------------------*/
11 #define _LOCALE_H _LOCALE_H
17 /* ----------------------------------------------------------------------------
19 * --------------------------------------------------------------------------*/
23 /* Locale categories */
24 #define LC_COLLATE 1 /* affects strcoll() and strxfrm() */
25 #define LC_CTYPE 2 /* affects ctype.h */
26 #define LC_MONETARY 4 /* affects monetary aspect of localeconv() */
27 #define LC_NUMERIC 8 /* affects numeric aspect of localeconv() */
28 #define LC_TIME 16 /* affects strftime() */
29 #define LC_ALL 31 /* affects all of the above */
31 /* ----------------------------------------------------------------------------
33 * --------------------------------------------------------------------------*/
35 /* TODO: Detailed documentation of grouping formats and field values */
40 char * decimal_point; /* decimal point */
41 char * grouping; /* grouping */
42 char * thousands_sep; /* grouping string */
45 char * mon_decimal_point; /* decimal point */
46 char * mon_grouping; /* grouping */
47 char * mon_thousands_sep; /* grouping string */
48 char * negative_sign; /* negative sign */
49 char * positive_sign; /* positive sign */
50 char * currency_symbol; /* currency symbol */
51 char frac_digits; /* after-point digits */
53 char n_cs_precedes; /* currency symbol preceding value? */
54 char n_sep_by_space; /* currency symbol seperated by space? */
55 char n_sign_posn; /* sign position */
57 char p_cs_precedes; /* currency symbol preceding value? */
58 char p_sep_by_space; /* currency symbol seperated by space? */
59 char p_sign_posn; /* sign position? */
61 /* for international monetary values */
62 char * int_curr_symbol; /* international currency symbol (ISO 4217) */
63 char int_frac_digits; /* after-point digits */
65 char int_n_cs_precedes; /* currency symbol preceding value? */
66 char int_n_sep_by_space; /* currency symbol seperated by space? */
67 char int_n_sign_posn; /* sign position? */
69 char int_p_cs_precedes; /* currency symbol preceding value? */
70 char int_p_sep_by_space; /* currency symbol seperated by space? */
71 char int_p_sign_posn; /* sign position? */
74 /* ----------------------------------------------------------------------------
76 * --------------------------------------------------------------------------*/
78 /** Returns a (pointer to a) lconv structure holding the values for the current
79 * locale. The structure must not be changed; values might become outdated with
80 * later calls to setlocale() changing LC_NUMERIC, LC_MONETARY or LC_ALL.
82 struct lconv * localeconv( void );
84 /** Categories are selected by OR'ing the LC_* defines from this header. The
85 * function sets the current locale to that defined by locale_name, and returns
86 * the name of the new locale (if it was set successfully) or a null pointer
87 * (if unsuccessful). At startup, the current locale is "C" by default. A null
88 * pointer as locale_name leaves the locale unchanged, an empty string sets it
89 * to the "native" locale.
91 char * setlocale( int categories, const char * locale_name );
93 #endif /* _LOCALE_H */