1 /* Localization <locale.h>
3 This file is part of the Public Domain C Library (PDCLib).
4 Permission is granted to use, modify, and / or redistribute at will.
7 #ifndef _PDCLIB_LOCALE_H
8 #define _PDCLIB_LOCALE_H _PDCLIB_LOCALE_H
10 #include "_PDCLIB_int.h"
12 #ifndef _PDCLIB_NULL_DEFINED
13 #define _PDCLIB_NULL_DEFINED _PDCLIB_NULL_DEFINED
14 #define NULL _PDCLIB_NULL
17 /* The structure returned by localeconv().
19 The values for *_sep_by_space:
21 1 - if symbol and sign are adjacent, a space seperates them from the value;
22 otherwise a space seperates the symbol from the value
23 2 - if symbol and sign are adjacent, a space seperates them; otherwise a
24 space seperates the sign from the value
26 The values for *_sign_posn:
27 0 - Parentheses surround value and symbol
28 1 - sign precedes value and symbol
29 2 - sign succeeds value and symbol
30 3 - sign immediately precedes symbol
31 4 - sign immediately succeeds symbol
35 struct _PDCLIB_ctype_t * ctype; /* internal <ctype.h> information */
36 char * _PDCLIB_errno_texts[_PDCLIB_ERRNO_MAX]; /* strerror() / perror() */
37 char * month_name_abbr[12]; /* month names, abbreviated */
38 char * month_name_full[12]; /* month names, full */
39 char * day_name_abbr[7]; /* weekday names, abbreviated */
40 char * day_name_full[7]; /* weekday names, full */
41 char * date_time_format; /* date / time format for strftime( "%c" ) */
42 char * time_format_12h; /* 12-hour time format for strftime( "%r" ) */
43 char * date_format; /* date format for strftime( "%x" ) */
44 char * time_format; /* time format for strftime( "%X" ) */
45 char * am_pm[2]; /* AM / PM designation */
46 char * decimal_point; /* decimal point character */
47 char * thousands_sep; /* character for seperating groups of digits */
48 char * grouping; /* string indicating the size of digit groups */
49 char * mon_decimal_point; /* decimal point for monetary quantities */
50 char * mon_thousands_sep; /* thousands_sep for monetary quantities */
51 char * mon_grouping; /* grouping for monetary quantities */
52 char * positive_sign; /* string indicating nonnegative mty. qty. */
53 char * negative_sign; /* string indicating negative mty. qty. */
54 char * currency_symbol; /* local currency symbol (e.g. '$') */
55 char * int_curr_symbol; /* international currency symbol (e.g. "USD" */
56 char frac_digits; /* fractional digits in local monetary qty. */
57 char p_cs_precedes; /* if currency_symbol precedes positive qty. */
58 char n_cs_precedes; /* if currency_symbol precedes negative qty. */
59 char p_sep_by_space; /* if it is seperated by space from pos. qty. */
60 char n_sep_by_space; /* if it is seperated by space from neg. qty. */
61 char p_sign_posn; /* positioning of positive_sign for mon. qty. */
62 char n_sign_posn; /* positioning of negative_sign for mon. qty. */
63 char int_frac_digits; /* Same as above, for international format */
64 char int_p_cs_precedes; /* Same as above, for international format */
65 char int_n_cs_precedes; /* Same as above, for international format */
66 char int_p_sep_by_space; /* Same as above, for international format */
67 char int_n_sep_by_space; /* Same as above, for international format */
68 char int_p_sign_posn; /* Same as above, for international format */
69 char int_n_sign_posn; /* Same as above, for international format */
72 /* This is strictly internal, and visible here for technical reasons only. */
73 extern struct lconv _PDCLIB_lconv;
75 /* First arguments to setlocale().
76 TODO: Beware, values might change before v0.6 is released.
80 /* Collation (strcoll(), strxfrm()) */
82 /* Character types (<ctype.h>) */
84 /* Monetary formatting (as returned by localeconv) */
86 /* Decimal-point character (for printf() / scanf() functions), string
87 conversions, nonmonetary formatting as returned by localeconv */
89 /* Time formats (strftime(), wcsftime()) */
92 /* The category parameter can be any of the LC_* macros to specify if the call
93 to setlocale() shall affect the entire locale or only a portion thereof.
94 The category locale specifies which locale should be switched to, with "C"
95 being the minimal default locale, and "" being the locale-specific native
96 environment. A NULL pointer makes setlocale() return the *current* setting.
97 Otherwise, returns a pointer to a string associated with the specified
98 category for the new locale.
100 char * setlocale( int category, const char * locale );
102 /* Returns a struct lconv initialized to the values appropriate for the current
105 struct lconv * localeconv( void );