langinfo.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. /*++
  2. Copyright (c) 2015 Minoca Corp.
  3. This file is licensed under the terms of the GNU Lesser General Public
  4. License version 3. Alternative licensing terms are available. Contact
  5. info@minocacorp.com for details.
  6. Module Name:
  7. langinfo.h
  8. Abstract:
  9. This header contains definitions for retrieving specific language
  10. information strings.
  11. Author:
  12. Evan Green 21-Jan-2015
  13. --*/
  14. #ifndef _LANGINFO_H
  15. #define _LANGINFO_H
  16. //
  17. // ------------------------------------------------------------------- Includes
  18. //
  19. #include <sys/types.h>
  20. //
  21. // ---------------------------------------------------------------- Definitions
  22. //
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. //
  27. // Current codeset name
  28. //
  29. #define CODESET 0
  30. //
  31. // Date and time formatting string
  32. //
  33. #define D_T_FMT 1
  34. //
  35. // Date formatting string
  36. //
  37. #define D_FMT 2
  38. //
  39. // Time formatting string
  40. //
  41. #define T_FMT 3
  42. //
  43. // AM/PM time formatting string
  44. //
  45. #define T_FMT_AMPM 4
  46. //
  47. // Ante Meridian affix
  48. //
  49. #define AM_STR 5
  50. //
  51. // Post Meridian affix
  52. //
  53. #define PM_STR 6
  54. //
  55. // Weekday names
  56. //
  57. #define DAY_1 7
  58. #define DAY_2 8
  59. #define DAY_3 9
  60. #define DAY_4 10
  61. #define DAY_5 11
  62. #define DAY_6 12
  63. #define DAY_7 13
  64. //
  65. // Abbreviated weekday names
  66. //
  67. #define ABDAY_1 14
  68. #define ABDAY_2 15
  69. #define ABDAY_3 16
  70. #define ABDAY_4 17
  71. #define ABDAY_5 18
  72. #define ABDAY_6 19
  73. #define ABDAY_7 20
  74. //
  75. // Month names
  76. //
  77. #define MON_1 21
  78. #define MON_2 22
  79. #define MON_3 23
  80. #define MON_4 24
  81. #define MON_5 25
  82. #define MON_6 26
  83. #define MON_7 27
  84. #define MON_8 28
  85. #define MON_9 29
  86. #define MON_10 30
  87. #define MON_11 31
  88. #define MON_12 32
  89. //
  90. // Abbreviated month names
  91. //
  92. #define ABMON_1 33
  93. #define ABMON_2 34
  94. #define ABMON_3 35
  95. #define ABMON_4 36
  96. #define ABMON_5 37
  97. #define ABMON_6 38
  98. #define ABMON_7 39
  99. #define ABMON_8 40
  100. #define ABMON_9 41
  101. #define ABMON_10 42
  102. #define ABMON_11 43
  103. #define ABMON_12 44
  104. //
  105. // Era description segments
  106. //
  107. #define ERA 45
  108. //
  109. // Era date format string
  110. //
  111. #define ERA_D_FMT 46
  112. //
  113. // Era date and time format string
  114. //
  115. #define ERA_D_T_FMT 47
  116. //
  117. // Era time format string
  118. //
  119. #define ERA_T_FMT 48
  120. //
  121. // Alternative digit symbols
  122. //
  123. #define ALT_DIGITS 49
  124. //
  125. // Radix character
  126. //
  127. #define RADIXCHAR 50
  128. //
  129. // Thousands separator
  130. //
  131. #define THOUSEP 51
  132. //
  133. // Affirmative response expression
  134. //
  135. #define YESEXPR 52
  136. //
  137. // Negative response expression
  138. //
  139. #define NOEXPR 53
  140. //
  141. // Affirmative response for yes/no queries
  142. //
  143. #define YESSTR 54
  144. //
  145. // Negative response for yes/no queries
  146. //
  147. #define NOSTR 55
  148. //
  149. // Currency symbol
  150. //
  151. #define CRNCYSTR 56
  152. //
  153. // Month/day order
  154. //
  155. #define D_MD_ORDER 57
  156. //
  157. // ------------------------------------------------------ Data Type Definitions
  158. //
  159. typedef int nl_item;
  160. //
  161. // -------------------------------------------------------------------- Globals
  162. //
  163. //
  164. // -------------------------------------------------------- Function Prototypes
  165. //
  166. LIBC_API
  167. char *
  168. nl_langinfo (
  169. nl_item Item
  170. );
  171. /*++
  172. Routine Description:
  173. This routine returns a pointer to a string containing the relevant message
  174. for the given item.
  175. Arguments:
  176. Item - Supplies the item to get a string for. See definitions in
  177. langinfo.h.
  178. Return Value:
  179. Returns a pointer to a string for the given item. If item is invalid,
  180. returns a pointer to an empty string. If language information is not
  181. defined, returns the string from the POSIX locale. The memory returned here
  182. may be overwritten by subsequent calls.
  183. --*/
  184. #ifdef __cplusplus
  185. }
  186. #endif
  187. #endif