locale.h 2.8 KB

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