locale.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /* locale.h
  2. * Support international type specific characters.
  3. */
  4. #ifndef _LOCALE_H
  5. #define _LOCALE_H 1
  6. #include <features.h>
  7. #ifndef NULL
  8. #ifdef __cplusplus
  9. #define NULL 0
  10. #else
  11. #define NULL ((void *) 0)
  12. #endif
  13. #endif
  14. /* These are the possibilities for the first argument to setlocale.
  15. The code assumes that LC_ALL is the highest value, and zero the lowest. */
  16. #define LC_CTYPE 0
  17. #define LC_NUMERIC 1
  18. #define LC_TIME 2
  19. #define LC_COLLATE 3
  20. #define LC_MONETARY 4
  21. #define LC_MESSAGES 5
  22. #define LC_ALL 6
  23. /* Structure giving information about numeric and monetary notation. */
  24. struct lconv
  25. {
  26. /* Numeric (non-monetary) information. */
  27. char *decimal_point; /* Decimal point character. */
  28. char *thousands_sep; /* Thousands separator. */
  29. /* Each element is the number of digits in each group;
  30. elements with higher indices are farther left.
  31. An element with value CHAR_MAX means that no further grouping is done.
  32. An element with value 0 means that the previous element is used
  33. for all groups farther left. */
  34. char *grouping;
  35. /* Monetary information. */
  36. /* First three chars are a currency symbol from ISO 4217.
  37. Fourth char is the separator. Fifth char is '\0'. */
  38. char *int_curr_symbol;
  39. char *currency_symbol; /* Local currency symbol. */
  40. char *mon_decimal_point; /* Decimal point character. */
  41. char *mon_thousands_sep; /* Thousands separator. */
  42. char *mon_grouping; /* Like `grouping' element (above). */
  43. char *positive_sign; /* Sign for positive values. */
  44. char *negative_sign; /* Sign for negative values. */
  45. char int_frac_digits; /* Int'l fractional digits. */
  46. char frac_digits; /* Local fractional digits. */
  47. /* 1 if currency_symbol precedes a positive value, 0 if succeeds. */
  48. char p_cs_precedes;
  49. /* 1 iff a space separates currency_symbol from a positive value. */
  50. char p_sep_by_space;
  51. /* 1 if currency_symbol precedes a negative value, 0 if succeeds. */
  52. char n_cs_precedes;
  53. /* 1 iff a space separates currency_symbol from a negative value. */
  54. char n_sep_by_space;
  55. /* Positive and negative sign positions:
  56. 0 Parentheses surround the quantity and currency_symbol.
  57. 1 The sign string precedes the quantity and currency_symbol.
  58. 2 The sign string follows the quantity and currency_symbol.
  59. 3 The sign string immediately precedes the currency_symbol.
  60. 4 The sign string immediately follows the currency_symbol. */
  61. char p_sign_posn;
  62. char n_sign_posn;
  63. };
  64. __BEGIN_DECLS
  65. extern char *setlocale(int __category, __const char *__locale);
  66. /* Return the numeric/monetary information for the current locale. */
  67. extern struct lconv *localeconv __P ((void));
  68. __END_DECLS
  69. #endif /* locale.h */