1
0

locale.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #ifndef _LOCALE_H
  2. #define _LOCALE_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #include <features.h>
  7. #undef NULL
  8. #ifdef __cplusplus
  9. #define NULL 0
  10. #else
  11. #define NULL ((void*)0)
  12. #endif
  13. #define LC_CTYPE 0
  14. #define LC_NUMERIC 1
  15. #define LC_TIME 2
  16. #define LC_COLLATE 3
  17. #define LC_MONETARY 4
  18. #define LC_MESSAGES 5
  19. #define LC_ALL 6
  20. struct lconv {
  21. char *decimal_point;
  22. char *thousands_sep;
  23. char *grouping;
  24. char *int_curr_symbol;
  25. char *currency_symbol;
  26. char *mon_decimal_point;
  27. char *mon_thousands_sep;
  28. char *mon_grouping;
  29. char *positive_sign;
  30. char *negative_sign;
  31. char int_frac_digits;
  32. char frac_digits;
  33. char p_cs_precedes;
  34. char p_sep_by_space;
  35. char n_cs_precedes;
  36. char n_sep_by_space;
  37. char p_sign_posn;
  38. char n_sign_posn;
  39. char int_p_cs_precedes;
  40. char int_p_sep_by_space;
  41. char int_n_cs_precedes;
  42. char int_n_sep_by_space;
  43. char int_p_sign_posn;
  44. char int_n_sign_posn;
  45. };
  46. char *setlocale (int, const char *);
  47. struct lconv *localeconv(void);
  48. #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
  49. || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
  50. #define __NEED_locale_t
  51. #include <bits/alltypes.h>
  52. #define LC_GLOBAL_LOCALE ((locale_t)-1)
  53. #define LC_CTYPE_MASK (1<<LC_CTYPE)
  54. #define LC_NUMERIC_MASK (1<<LC_NUMERIC)
  55. #define LC_TIME_MASK (1<<LC_TIME)
  56. #define LC_COLLATE_MASK (1<<LC_COLLATE)
  57. #define LC_MONETARY_MASK (1<<LC_MONETARY)
  58. #define LC_MESSAGES_MASK (1<<LC_MESSAGES)
  59. #define LC_ALL_MASK 0x7fffffff
  60. locale_t duplocale(locale_t);
  61. void freelocale(locale_t);
  62. locale_t newlocale(int, const char *, locale_t);
  63. locale_t uselocale(locale_t);
  64. #endif
  65. #ifdef __cplusplus
  66. }
  67. #endif
  68. #endif