locale.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * Copyright (c) mlibc & plct lab
  3. *
  4. * SPDX-License-Identifier: MIT
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2024/8/8 0Bitbiscuits the first version
  9. */
  10. #ifndef MLIBC_LOCAL_H__
  11. #define MLBIC_LOCAL_H__
  12. #include <features.h>
  13. #if __cplusplus >= 201103L
  14. #define NULL nullptr
  15. #elif defined(__cplusplus)
  16. #define NULL 0L
  17. #else
  18. #define NULL ((void*)0)
  19. #endif
  20. #define LC_CTYPE 0
  21. #define LC_NUMERIC 1
  22. #define LC_TIME 2
  23. #define LC_COLLATE 3
  24. #define LC_MONETARY 4
  25. #define LC_MESSAGES 5
  26. #define LC_ALL 6
  27. struct lconv {
  28. char *decimal_point;
  29. char *thousands_sep;
  30. char *grouping;
  31. char *int_curr_symbol;
  32. char *currency_symbol;
  33. char *mon_decimal_point;
  34. char *mon_thousands_sep;
  35. char *mon_grouping;
  36. char *positive_sign;
  37. char *negative_sign;
  38. char int_frac_digits;
  39. char frac_digits;
  40. char p_cs_precedes;
  41. char p_sep_by_space;
  42. char n_cs_precedes;
  43. char n_sep_by_space;
  44. char p_sign_posn;
  45. char n_sign_posn;
  46. char int_p_cs_precedes;
  47. char int_p_sep_by_space;
  48. char int_n_cs_precedes;
  49. char int_n_sep_by_space;
  50. char int_p_sign_posn;
  51. char int_n_sign_posn;
  52. };
  53. char *setlocale (int, const char *);
  54. struct lconv *localeconv(void);
  55. #endif /* MLBIC_LOCAL_H__ */