wctype.in.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733
  1. /* A substitute for ISO C99 <wctype.h>, for platforms that lack it.
  2. Copyright (C) 2006-2021 Free Software Foundation, Inc.
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU Lesser General Public License as published by
  5. the Free Software Foundation; either version 2, or (at your option)
  6. any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public License
  12. along with this program; if not, see <https://www.gnu.org/licenses/>. */
  13. /* Written by Bruno Haible and Paul Eggert. */
  14. /*
  15. * ISO C 99 <wctype.h> for platforms that lack it.
  16. * <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/wctype.h.html>
  17. *
  18. * iswctype, towctrans, towlower, towupper, wctrans, wctype,
  19. * wctrans_t, and wctype_t are not yet implemented.
  20. */
  21. #if __GNUC__ >= 3
  22. @PRAGMA_SYSTEM_HEADER@
  23. #endif
  24. @PRAGMA_COLUMNS@
  25. #if (defined __MINGW32__ && defined __CTYPE_H_SOURCED__)
  26. /* Special invocation convention:
  27. - With MinGW 3.22, when <ctype.h> includes <wctype.h>, only some part of
  28. <wctype.h> is being processed, which doesn't include the idempotency
  29. guard. */
  30. #@INCLUDE_NEXT@ @NEXT_WCTYPE_H@
  31. #else
  32. /* Normal invocation convention. */
  33. #ifndef _@GUARD_PREFIX@_WCTYPE_H
  34. #if @HAVE_WINT_T@
  35. /* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. */
  36. # include <wchar.h>
  37. #endif
  38. /* Native Windows (mingw, MSVC) have declarations of towupper, towlower, and
  39. isw* functions in <ctype.h>, <wchar.h> as well as in <wctype.h>. Include
  40. <ctype.h>, <wchar.h> in advance to avoid rpl_ prefix being added to the
  41. declarations. */
  42. #if defined _WIN32 && ! defined __CYGWIN__
  43. # include <ctype.h>
  44. # include <wchar.h>
  45. #endif
  46. /* Include the original <wctype.h> if it exists.
  47. BeOS 5 has the functions but no <wctype.h>. */
  48. /* The include_next requires a split double-inclusion guard. */
  49. #if @HAVE_WCTYPE_H@
  50. # @INCLUDE_NEXT@ @NEXT_WCTYPE_H@
  51. #endif
  52. #ifndef _@GUARD_PREFIX@_WCTYPE_H
  53. #define _@GUARD_PREFIX@_WCTYPE_H
  54. #ifndef _GL_INLINE_HEADER_BEGIN
  55. #error "Please include config.h first."
  56. #endif
  57. _GL_INLINE_HEADER_BEGIN
  58. #ifndef _GL_WCTYPE_INLINE
  59. # define _GL_WCTYPE_INLINE _GL_INLINE
  60. #endif
  61. /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
  62. /* The definition of _GL_WARN_ON_USE is copied here. */
  63. /* Solaris 2.6 <wctype.h> includes <widec.h> which includes <euc.h> which
  64. #defines a number of identifiers in the application namespace. Revert
  65. these #defines. */
  66. #ifdef __sun
  67. # undef multibyte
  68. # undef eucw1
  69. # undef eucw2
  70. # undef eucw3
  71. # undef scrw1
  72. # undef scrw2
  73. # undef scrw3
  74. #endif
  75. /* Define wint_t and WEOF. (Also done in wchar.in.h.) */
  76. #if !@HAVE_WINT_T@ && !defined wint_t
  77. # define wint_t int
  78. # ifndef WEOF
  79. # define WEOF -1
  80. # endif
  81. #else
  82. /* mingw and MSVC define wint_t as 'unsigned short' in <crtdefs.h> or
  83. <stddef.h>. This is too small: ISO C 99 section 7.24.1.(2) says that
  84. wint_t must be "unchanged by default argument promotions". Override it. */
  85. # if @GNULIB_OVERRIDES_WINT_T@
  86. # if !GNULIB_defined_wint_t
  87. # if @HAVE_CRTDEFS_H@
  88. # include <crtdefs.h>
  89. # else
  90. # include <stddef.h>
  91. # endif
  92. typedef unsigned int rpl_wint_t;
  93. # undef wint_t
  94. # define wint_t rpl_wint_t
  95. # define GNULIB_defined_wint_t 1
  96. # endif
  97. # endif
  98. # ifndef WEOF
  99. # define WEOF ((wint_t) -1)
  100. # endif
  101. #endif
  102. #if !GNULIB_defined_wctype_functions
  103. /* FreeBSD 4.4 to 4.11 has <wctype.h> but lacks the functions.
  104. Linux libc5 has <wctype.h> and the functions but they are broken.
  105. mingw and MSVC have <wctype.h> and the functions but they take a wchar_t
  106. as argument, not an rpl_wint_t.
  107. Assume all 11 functions (all isw* except iswblank) are implemented the
  108. same way, or not at all. */
  109. # if ! @HAVE_ISWCNTRL@ || @REPLACE_ISWCNTRL@
  110. # if @GNULIB_OVERRIDES_WINT_T@ /* implies @REPLACE_ISWCNTRL@ */
  111. _GL_WCTYPE_INLINE int
  112. rpl_iswalnum (wint_t wc)
  113. {
  114. return ((wchar_t) wc == wc ? iswalnum ((wchar_t) wc) : 0);
  115. }
  116. _GL_WCTYPE_INLINE int
  117. rpl_iswalpha (wint_t wc)
  118. {
  119. return ((wchar_t) wc == wc ? iswalpha ((wchar_t) wc) : 0);
  120. }
  121. _GL_WCTYPE_INLINE int
  122. rpl_iswblank (wint_t wc)
  123. {
  124. return ((wchar_t) wc == wc ? iswblank ((wchar_t) wc) : 0);
  125. }
  126. _GL_WCTYPE_INLINE int
  127. rpl_iswcntrl (wint_t wc)
  128. {
  129. return ((wchar_t) wc == wc ? iswcntrl ((wchar_t) wc) : 0);
  130. }
  131. _GL_WCTYPE_INLINE int
  132. rpl_iswdigit (wint_t wc)
  133. {
  134. return ((wchar_t) wc == wc ? wc >= '0' && wc <= '9' : 0);
  135. }
  136. _GL_WCTYPE_INLINE int
  137. rpl_iswgraph (wint_t wc)
  138. {
  139. return ((wchar_t) wc == wc ? iswgraph ((wchar_t) wc) : 0);
  140. }
  141. _GL_WCTYPE_INLINE int
  142. rpl_iswlower (wint_t wc)
  143. {
  144. return ((wchar_t) wc == wc ? iswlower ((wchar_t) wc) : 0);
  145. }
  146. _GL_WCTYPE_INLINE int
  147. rpl_iswprint (wint_t wc)
  148. {
  149. return ((wchar_t) wc == wc ? iswprint ((wchar_t) wc) : 0);
  150. }
  151. _GL_WCTYPE_INLINE int
  152. rpl_iswpunct (wint_t wc)
  153. {
  154. return ((wchar_t) wc == wc ? iswpunct ((wchar_t) wc) : 0);
  155. }
  156. _GL_WCTYPE_INLINE int
  157. rpl_iswspace (wint_t wc)
  158. {
  159. return ((wchar_t) wc == wc ? iswspace ((wchar_t) wc) : 0);
  160. }
  161. _GL_WCTYPE_INLINE int
  162. rpl_iswupper (wint_t wc)
  163. {
  164. return ((wchar_t) wc == wc ? iswupper ((wchar_t) wc) : 0);
  165. }
  166. _GL_WCTYPE_INLINE int
  167. rpl_iswxdigit (wint_t wc)
  168. {
  169. return ((wchar_t) wc == wc
  170. ? (wc >= '0' && wc <= '9')
  171. || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'F')
  172. : 0);
  173. }
  174. _GL_WCTYPE_INLINE wint_t
  175. rpl_towlower (wint_t wc)
  176. {
  177. return ((wchar_t) wc == wc ? (wchar_t) towlower ((wchar_t) wc) : wc);
  178. }
  179. _GL_WCTYPE_INLINE wint_t
  180. rpl_towupper (wint_t wc)
  181. {
  182. return ((wchar_t) wc == wc ? (wchar_t) towupper ((wchar_t) wc) : wc);
  183. }
  184. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  185. # undef iswalnum
  186. # undef iswalpha
  187. # undef iswblank
  188. # undef iswcntrl
  189. # undef iswdigit
  190. # undef iswgraph
  191. # undef iswlower
  192. # undef iswprint
  193. # undef iswpunct
  194. # undef iswspace
  195. # undef iswupper
  196. # undef iswxdigit
  197. # undef towlower
  198. # undef towupper
  199. # define iswalnum rpl_iswalnum
  200. # define iswalpha rpl_iswalpha
  201. # define iswblank rpl_iswblank
  202. # define iswcntrl rpl_iswcntrl
  203. # define iswdigit rpl_iswdigit
  204. # define iswgraph rpl_iswgraph
  205. # define iswlower rpl_iswlower
  206. # define iswprint rpl_iswprint
  207. # define iswpunct rpl_iswpunct
  208. # define iswspace rpl_iswspace
  209. # define iswupper rpl_iswupper
  210. # define iswxdigit rpl_iswxdigit
  211. # define towlower rpl_towlower
  212. # define towupper rpl_towupper
  213. # endif
  214. # else
  215. /* IRIX 5.3 has macros but no functions, its isw* macros refer to an
  216. undefined variable _ctmp_ and to <ctype.h> macros like _P, and they
  217. refer to system functions like _iswctype that are not in the
  218. standard C library. Rather than try to get ancient buggy
  219. implementations like this to work, just disable them. */
  220. # undef iswalnum
  221. # undef iswalpha
  222. # undef iswblank
  223. # undef iswcntrl
  224. # undef iswdigit
  225. # undef iswgraph
  226. # undef iswlower
  227. # undef iswprint
  228. # undef iswpunct
  229. # undef iswspace
  230. # undef iswupper
  231. # undef iswxdigit
  232. # undef towlower
  233. # undef towupper
  234. /* Linux libc5 has <wctype.h> and the functions but they are broken. */
  235. # if @REPLACE_ISWCNTRL@
  236. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  237. # define iswalnum rpl_iswalnum
  238. # define iswalpha rpl_iswalpha
  239. # define iswblank rpl_iswblank
  240. # define iswcntrl rpl_iswcntrl
  241. # define iswdigit rpl_iswdigit
  242. # define iswgraph rpl_iswgraph
  243. # define iswlower rpl_iswlower
  244. # define iswprint rpl_iswprint
  245. # define iswpunct rpl_iswpunct
  246. # define iswspace rpl_iswspace
  247. # define iswupper rpl_iswupper
  248. # define iswxdigit rpl_iswxdigit
  249. # endif
  250. # endif
  251. # if @REPLACE_TOWLOWER@
  252. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  253. # define towlower rpl_towlower
  254. # define towupper rpl_towupper
  255. # endif
  256. # endif
  257. _GL_WCTYPE_INLINE int
  258. # if @REPLACE_ISWCNTRL@
  259. rpl_iswalnum
  260. # else
  261. iswalnum
  262. # endif
  263. (wint_t wc)
  264. {
  265. return ((wc >= '0' && wc <= '9')
  266. || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z'));
  267. }
  268. _GL_WCTYPE_INLINE int
  269. # if @REPLACE_ISWCNTRL@
  270. rpl_iswalpha
  271. # else
  272. iswalpha
  273. # endif
  274. (wint_t wc)
  275. {
  276. return (wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z';
  277. }
  278. _GL_WCTYPE_INLINE int
  279. # if @REPLACE_ISWCNTRL@
  280. rpl_iswblank
  281. # else
  282. iswblank
  283. # endif
  284. (wint_t wc)
  285. {
  286. return wc == ' ' || wc == '\t';
  287. }
  288. _GL_WCTYPE_INLINE int
  289. # if @REPLACE_ISWCNTRL@
  290. rpl_iswcntrl
  291. # else
  292. iswcntrl
  293. # endif
  294. (wint_t wc)
  295. {
  296. return (wc & ~0x1f) == 0 || wc == 0x7f;
  297. }
  298. _GL_WCTYPE_INLINE int
  299. # if @REPLACE_ISWDIGIT@
  300. rpl_iswdigit
  301. # else
  302. iswdigit
  303. # endif
  304. (wint_t wc)
  305. {
  306. return wc >= '0' && wc <= '9';
  307. }
  308. _GL_WCTYPE_INLINE int
  309. # if @REPLACE_ISWCNTRL@
  310. rpl_iswgraph
  311. # else
  312. iswgraph
  313. # endif
  314. (wint_t wc)
  315. {
  316. return wc >= '!' && wc <= '~';
  317. }
  318. _GL_WCTYPE_INLINE int
  319. # if @REPLACE_ISWCNTRL@
  320. rpl_iswlower
  321. # else
  322. iswlower
  323. # endif
  324. (wint_t wc)
  325. {
  326. return wc >= 'a' && wc <= 'z';
  327. }
  328. _GL_WCTYPE_INLINE int
  329. # if @REPLACE_ISWCNTRL@
  330. rpl_iswprint
  331. # else
  332. iswprint
  333. # endif
  334. (wint_t wc)
  335. {
  336. return wc >= ' ' && wc <= '~';
  337. }
  338. _GL_WCTYPE_INLINE int
  339. # if @REPLACE_ISWCNTRL@
  340. rpl_iswpunct
  341. # else
  342. iswpunct
  343. # endif
  344. (wint_t wc)
  345. {
  346. return (wc >= '!' && wc <= '~'
  347. && !((wc >= '0' && wc <= '9')
  348. || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z')));
  349. }
  350. _GL_WCTYPE_INLINE int
  351. # if @REPLACE_ISWCNTRL@
  352. rpl_iswspace
  353. # else
  354. iswspace
  355. # endif
  356. (wint_t wc)
  357. {
  358. return (wc == ' ' || wc == '\t'
  359. || wc == '\n' || wc == '\v' || wc == '\f' || wc == '\r');
  360. }
  361. _GL_WCTYPE_INLINE int
  362. # if @REPLACE_ISWCNTRL@
  363. rpl_iswupper
  364. # else
  365. iswupper
  366. # endif
  367. (wint_t wc)
  368. {
  369. return wc >= 'A' && wc <= 'Z';
  370. }
  371. _GL_WCTYPE_INLINE int
  372. # if @REPLACE_ISWXDIGIT@
  373. rpl_iswxdigit
  374. # else
  375. iswxdigit
  376. # endif
  377. (wint_t wc)
  378. {
  379. return ((wc >= '0' && wc <= '9')
  380. || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'F'));
  381. }
  382. _GL_WCTYPE_INLINE wint_t
  383. # if @REPLACE_TOWLOWER@
  384. rpl_towlower
  385. # else
  386. towlower
  387. # endif
  388. (wint_t wc)
  389. {
  390. return (wc >= 'A' && wc <= 'Z' ? wc - 'A' + 'a' : wc);
  391. }
  392. _GL_WCTYPE_INLINE wint_t
  393. # if @REPLACE_TOWLOWER@
  394. rpl_towupper
  395. # else
  396. towupper
  397. # endif
  398. (wint_t wc)
  399. {
  400. return (wc >= 'a' && wc <= 'z' ? wc - 'a' + 'A' : wc);
  401. }
  402. # endif
  403. # else
  404. /* Only some of the functions are missing or broken. */
  405. # if @GNULIB_ISWBLANK@ && (! @HAVE_ISWBLANK@ || @REPLACE_ISWBLANK@)
  406. /* Only the iswblank function is missing. */
  407. # if @REPLACE_ISWBLANK@
  408. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  409. # define iswblank rpl_iswblank
  410. # endif
  411. _GL_FUNCDECL_RPL (iswblank, int, (wint_t wc));
  412. # else
  413. _GL_FUNCDECL_SYS (iswblank, int, (wint_t wc));
  414. # endif
  415. # endif
  416. # if @GNULIB_ISWDIGIT@
  417. # if @REPLACE_ISWDIGIT@
  418. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  419. # undef iswdigit
  420. # define iswdigit rpl_iswdigit
  421. # endif
  422. _GL_FUNCDECL_RPL (iswdigit, int, (wint_t wc));
  423. # endif
  424. # endif
  425. # if @GNULIB_ISWXDIGIT@
  426. # if @REPLACE_ISWXDIGIT@
  427. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  428. # undef iswxdigit
  429. # define iswxdigit rpl_iswxdigit
  430. # endif
  431. _GL_FUNCDECL_RPL (iswxdigit, int, (wint_t wc));
  432. # endif
  433. # endif
  434. # endif
  435. # if defined __MINGW32__ && !@GNULIB_OVERRIDES_WINT_T@
  436. /* On native Windows, wchar_t is uint16_t, and wint_t is uint32_t.
  437. The functions towlower and towupper are implemented in the MSVCRT library
  438. to take a wchar_t argument and return a wchar_t result. mingw declares
  439. these functions to take a wint_t argument and return a wint_t result.
  440. This means that:
  441. 1. When the user passes an argument outside the range 0x0000..0xFFFF, the
  442. function will look only at the lower 16 bits. This is allowed according
  443. to POSIX.
  444. 2. The return value is returned in the lower 16 bits of the result register.
  445. The upper 16 bits are random: whatever happened to be in that part of the
  446. result register. We need to fix this by adding a zero-extend from
  447. wchar_t to wint_t after the call. */
  448. _GL_WCTYPE_INLINE wint_t
  449. rpl_towlower (wint_t wc)
  450. {
  451. return (wint_t) (wchar_t) towlower (wc);
  452. }
  453. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  454. # define towlower rpl_towlower
  455. # endif
  456. _GL_WCTYPE_INLINE wint_t
  457. rpl_towupper (wint_t wc)
  458. {
  459. return (wint_t) (wchar_t) towupper (wc);
  460. }
  461. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  462. # define towupper rpl_towupper
  463. # endif
  464. # endif /* __MINGW32__ && !@GNULIB_OVERRIDES_WINT_T@ */
  465. # define GNULIB_defined_wctype_functions 1
  466. #endif
  467. #if @REPLACE_ISWCNTRL@
  468. _GL_CXXALIAS_RPL (iswalnum, int, (wint_t wc));
  469. #else
  470. _GL_CXXALIAS_SYS (iswalnum, int, (wint_t wc));
  471. #endif
  472. #if @REPLACE_ISWCNTRL@
  473. _GL_CXXALIAS_RPL (iswalpha, int, (wint_t wc));
  474. #else
  475. _GL_CXXALIAS_SYS (iswalpha, int, (wint_t wc));
  476. #endif
  477. #if @REPLACE_ISWCNTRL@
  478. _GL_CXXALIAS_RPL (iswcntrl, int, (wint_t wc));
  479. #else
  480. _GL_CXXALIAS_SYS (iswcntrl, int, (wint_t wc));
  481. #endif
  482. #if @GNULIB_ISWDIGIT@
  483. # if @REPLACE_ISWDIGIT@
  484. _GL_CXXALIAS_RPL (iswdigit, int, (wint_t wc));
  485. # else
  486. _GL_CXXALIAS_SYS (iswdigit, int, (wint_t wc));
  487. # endif
  488. #endif
  489. #if @REPLACE_ISWCNTRL@
  490. _GL_CXXALIAS_RPL (iswgraph, int, (wint_t wc));
  491. #else
  492. _GL_CXXALIAS_SYS (iswgraph, int, (wint_t wc));
  493. #endif
  494. #if @REPLACE_ISWCNTRL@
  495. _GL_CXXALIAS_RPL (iswlower, int, (wint_t wc));
  496. #else
  497. _GL_CXXALIAS_SYS (iswlower, int, (wint_t wc));
  498. #endif
  499. #if @REPLACE_ISWCNTRL@
  500. _GL_CXXALIAS_RPL (iswprint, int, (wint_t wc));
  501. #else
  502. _GL_CXXALIAS_SYS (iswprint, int, (wint_t wc));
  503. #endif
  504. #if @REPLACE_ISWCNTRL@
  505. _GL_CXXALIAS_RPL (iswpunct, int, (wint_t wc));
  506. #else
  507. _GL_CXXALIAS_SYS (iswpunct, int, (wint_t wc));
  508. #endif
  509. #if @REPLACE_ISWCNTRL@
  510. _GL_CXXALIAS_RPL (iswspace, int, (wint_t wc));
  511. #else
  512. _GL_CXXALIAS_SYS (iswspace, int, (wint_t wc));
  513. #endif
  514. #if @REPLACE_ISWCNTRL@
  515. _GL_CXXALIAS_RPL (iswupper, int, (wint_t wc));
  516. #else
  517. _GL_CXXALIAS_SYS (iswupper, int, (wint_t wc));
  518. #endif
  519. #if @GNULIB_ISWXDIGIT@
  520. # if @REPLACE_ISWXDIGIT@
  521. _GL_CXXALIAS_RPL (iswxdigit, int, (wint_t wc));
  522. # else
  523. _GL_CXXALIAS_SYS (iswxdigit, int, (wint_t wc));
  524. # endif
  525. #endif
  526. #if __GLIBC__ >= 2
  527. _GL_CXXALIASWARN (iswalnum);
  528. _GL_CXXALIASWARN (iswalpha);
  529. _GL_CXXALIASWARN (iswcntrl);
  530. _GL_CXXALIASWARN (iswdigit);
  531. _GL_CXXALIASWARN (iswgraph);
  532. _GL_CXXALIASWARN (iswlower);
  533. _GL_CXXALIASWARN (iswprint);
  534. _GL_CXXALIASWARN (iswpunct);
  535. _GL_CXXALIASWARN (iswspace);
  536. _GL_CXXALIASWARN (iswupper);
  537. _GL_CXXALIASWARN (iswxdigit);
  538. #endif
  539. #if @GNULIB_ISWBLANK@
  540. # if @REPLACE_ISWCNTRL@ || @REPLACE_ISWBLANK@
  541. _GL_CXXALIAS_RPL (iswblank, int, (wint_t wc));
  542. # else
  543. _GL_CXXALIAS_SYS (iswblank, int, (wint_t wc));
  544. # endif
  545. # if __GLIBC__ >= 2
  546. _GL_CXXALIASWARN (iswblank);
  547. # endif
  548. #endif
  549. #if !@HAVE_WCTYPE_T@
  550. # if !GNULIB_defined_wctype_t
  551. typedef void * wctype_t;
  552. # define GNULIB_defined_wctype_t 1
  553. # endif
  554. #endif
  555. /* Get a descriptor for a wide character property. */
  556. #if @GNULIB_WCTYPE@
  557. # if !@HAVE_WCTYPE_T@
  558. _GL_FUNCDECL_SYS (wctype, wctype_t, (const char *name));
  559. # endif
  560. _GL_CXXALIAS_SYS (wctype, wctype_t, (const char *name));
  561. # if __GLIBC__ >= 2
  562. _GL_CXXALIASWARN (wctype);
  563. # endif
  564. #elif defined GNULIB_POSIXCHECK
  565. # undef wctype
  566. # if HAVE_RAW_DECL_WCTYPE
  567. _GL_WARN_ON_USE (wctype, "wctype is unportable - "
  568. "use gnulib module wctype for portability");
  569. # endif
  570. #endif
  571. /* Test whether a wide character has a given property.
  572. The argument WC must be either a wchar_t value or WEOF.
  573. The argument DESC must have been returned by the wctype() function. */
  574. #if @GNULIB_ISWCTYPE@
  575. # if @GNULIB_OVERRIDES_WINT_T@
  576. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  577. # undef iswctype
  578. # define iswctype rpl_iswctype
  579. # endif
  580. _GL_FUNCDECL_RPL (iswctype, int, (wint_t wc, wctype_t desc));
  581. _GL_CXXALIAS_RPL (iswctype, int, (wint_t wc, wctype_t desc));
  582. # else
  583. # if !@HAVE_WCTYPE_T@
  584. _GL_FUNCDECL_SYS (iswctype, int, (wint_t wc, wctype_t desc));
  585. # endif
  586. _GL_CXXALIAS_SYS (iswctype, int, (wint_t wc, wctype_t desc));
  587. # endif
  588. # if __GLIBC__ >= 2
  589. _GL_CXXALIASWARN (iswctype);
  590. # endif
  591. #elif defined GNULIB_POSIXCHECK
  592. # undef iswctype
  593. # if HAVE_RAW_DECL_ISWCTYPE
  594. _GL_WARN_ON_USE (iswctype, "iswctype is unportable - "
  595. "use gnulib module iswctype for portability");
  596. # endif
  597. #endif
  598. #if @REPLACE_TOWLOWER@ || defined __MINGW32__
  599. _GL_CXXALIAS_RPL (towlower, wint_t, (wint_t wc));
  600. _GL_CXXALIAS_RPL (towupper, wint_t, (wint_t wc));
  601. #else
  602. _GL_CXXALIAS_SYS (towlower, wint_t, (wint_t wc));
  603. _GL_CXXALIAS_SYS (towupper, wint_t, (wint_t wc));
  604. #endif
  605. #if __GLIBC__ >= 2
  606. _GL_CXXALIASWARN (towlower);
  607. _GL_CXXALIASWARN (towupper);
  608. #endif
  609. #if !@HAVE_WCTRANS_T@
  610. # if !GNULIB_defined_wctrans_t
  611. typedef void * wctrans_t;
  612. # define GNULIB_defined_wctrans_t 1
  613. # endif
  614. #endif
  615. /* Get a descriptor for a wide character case conversion. */
  616. #if @GNULIB_WCTRANS@
  617. # if !@HAVE_WCTRANS_T@
  618. _GL_FUNCDECL_SYS (wctrans, wctrans_t, (const char *name));
  619. # endif
  620. _GL_CXXALIAS_SYS (wctrans, wctrans_t, (const char *name));
  621. # if __GLIBC__ >= 2
  622. _GL_CXXALIASWARN (wctrans);
  623. # endif
  624. #elif defined GNULIB_POSIXCHECK
  625. # undef wctrans
  626. # if HAVE_RAW_DECL_WCTRANS
  627. _GL_WARN_ON_USE (wctrans, "wctrans is unportable - "
  628. "use gnulib module wctrans for portability");
  629. # endif
  630. #endif
  631. /* Perform a given case conversion on a wide character.
  632. The argument WC must be either a wchar_t value or WEOF.
  633. The argument DESC must have been returned by the wctrans() function. */
  634. #if @GNULIB_TOWCTRANS@
  635. # if !@HAVE_WCTRANS_T@
  636. _GL_FUNCDECL_SYS (towctrans, wint_t, (wint_t wc, wctrans_t desc));
  637. # endif
  638. _GL_CXXALIAS_SYS (towctrans, wint_t, (wint_t wc, wctrans_t desc));
  639. # if __GLIBC__ >= 2
  640. _GL_CXXALIASWARN (towctrans);
  641. # endif
  642. #elif defined GNULIB_POSIXCHECK
  643. # undef towctrans
  644. # if HAVE_RAW_DECL_TOWCTRANS
  645. _GL_WARN_ON_USE (towctrans, "towctrans is unportable - "
  646. "use gnulib module towctrans for portability");
  647. # endif
  648. #endif
  649. _GL_INLINE_HEADER_END
  650. #endif /* _@GUARD_PREFIX@_WCTYPE_H */
  651. #endif /* _@GUARD_PREFIX@_WCTYPE_H */
  652. #endif