1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339
|
/* A substitute for ISO C99 <ctype.h>, for platforms on which it is incomplete.
Copyright (C) 2009-2025 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of the
License, or (at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Bruno Haible. */
/*
* ISO C 99 <ctype.h> for platforms on which it is incomplete.
* <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/ctype.h.html>
*/
#ifndef _@GUARD_PREFIX@_CTYPE_H
#if __GNUC__ >= 3
@PRAGMA_SYSTEM_HEADER@
#endif
@PRAGMA_COLUMNS@
/* On Solaris 11 OmniOS, we cannot include <locale.h> until after <wchar.h> has
been entirely included. That is because
- <locale.h> includes <xlocale.h>, which makes use of the mbstate_t type.
- <wchar.h> includes <iso/wchar_iso.h>, which includes <ctype.h> *before*
defining mbstate_t, WEOF, etc. */
#if defined __sun && defined _ISO_WCHAR_ISO_H && !defined WEOF
/* We're in the middle of including <iso/wchar_iso.h>.
Include just the original <ctype.h>. */
#@INCLUDE_NEXT@ @NEXT_CTYPE_H@
#else
/* Include the original <ctype.h>. */
/* The include_next requires a split double-inclusion guard. */
#@INCLUDE_NEXT@ @NEXT_CTYPE_H@
#ifndef _@GUARD_PREFIX@_CTYPE_H
#define _@GUARD_PREFIX@_CTYPE_H
/* This file uses _GL_ARG_NONNULL, GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
#if !_GL_CONFIG_H_INCLUDED
#error "Please include config.h first."
#endif
#if (@GNULIB_ISALNUM_L@ || @GNULIB_ISALPHA_L@ || @GNULIB_ISBLANK_L@ \
|| @GNULIB_ISCNTRL_L@ || @GNULIB_ISDIGIT_L@ || @GNULIB_ISGRAPH_L@ \
|| @GNULIB_ISLOWER_L@ || @GNULIB_ISPRINT_L@ || @GNULIB_ISPUNCT_L@ \
|| @GNULIB_ISSPACE_L@ || @GNULIB_ISUPPER_L@ || @GNULIB_ISXDIGIT_L@ \
|| @GNULIB_TOLOWER_L@ || @GNULIB_TOUPPER_L@)
/* Get locale_t. */
# include <locale.h>
#endif
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
/* The definition of _GL_ARG_NONNULL is copied here. */
/* The definition of _GL_WARN_ON_USE is copied here. */
/* Return non-zero if c is alphanumeric. */
#if @GNULIB_ISALNUM_L@
# if !@HAVE_ISALNUM_L@
_GL_FUNCDECL_SYS (isalnum_l, int, (int c, locale_t locale),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (isalnum_l, int, (int c, locale_t locale));
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (isalnum_l);
# endif
#elif defined GNULIB_POSIXCHECK
# undef isalnum_l
# if HAVE_RAW_DECL_ISALNUM_L
_GL_WARN_ON_USE (isalnum_l, "isalnum_l is unportable - "
"use gnulib module isalnum_l for portability");
# endif
#endif
/* Return non-zero if c is alphabetic. */
#if @GNULIB_ISALPHA_L@
# if !@HAVE_ISALPHA_L@
_GL_FUNCDECL_SYS (isalpha_l, int, (int c, locale_t locale),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (isalpha_l, int, (int c, locale_t locale));
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (isalpha_l);
# endif
#elif defined GNULIB_POSIXCHECK
# undef isalpha_l
# if HAVE_RAW_DECL_ISALPHA_L
_GL_WARN_ON_USE (isalpha_l, "isalpha_l is unportable - "
"use gnulib module isalpha_l for portability");
# endif
#endif
/* Return non-zero if c is a blank, i.e. a space or tab character. */
#if @GNULIB_ISBLANK@
# if !@HAVE_ISBLANK@
_GL_EXTERN_C int isblank (int c);
# endif
#elif defined GNULIB_POSIXCHECK
# undef isblank
# if HAVE_RAW_DECL_ISBLANK
_GL_WARN_ON_USE (isblank, "isblank is unportable - "
"use gnulib module isblank for portability");
# endif
#endif
/* Return non-zero if c is a blank, i.e. a space or tab character. */
#if @GNULIB_ISBLANK_L@
# if !@HAVE_ISBLANK_L@
_GL_FUNCDECL_SYS (isblank_l, int, (int c, locale_t locale),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (isblank_l, int, (int c, locale_t locale));
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (isblank_l);
# endif
#elif defined GNULIB_POSIXCHECK
# undef isblank_l
# if HAVE_RAW_DECL_ISBLANK_L
_GL_WARN_ON_USE (isblank_l, "isblank_l is unportable - "
"use gnulib module isblank_l for portability");
# endif
#endif
/* Return non-zero if c is a control character. */
#if @GNULIB_ISCNTRL_L@
# if !@HAVE_ISCNTRL_L@
_GL_FUNCDECL_SYS (iscntrl_l, int, (int c, locale_t locale),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (iscntrl_l, int, (int c, locale_t locale));
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (iscntrl_l);
# endif
#elif defined GNULIB_POSIXCHECK
# undef iscntrl_l
# if HAVE_RAW_DECL_ISCNTRL_L
_GL_WARN_ON_USE (iscntrl_l, "iscntrl_l is unportable - "
"use gnulib module iscntrl_l for portability");
# endif
#endif
/* Return non-zero if c is a digit. */
#if @GNULIB_ISDIGIT_L@
# if !@HAVE_ISDIGIT_L@
_GL_FUNCDECL_SYS (isdigit_l, int, (int c, locale_t locale),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (isdigit_l, int, (int c, locale_t locale));
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (isdigit_l);
# endif
#elif defined GNULIB_POSIXCHECK
# undef isdigit_l
# if HAVE_RAW_DECL_ISDIGIT_L
_GL_WARN_ON_USE (isdigit_l, "isdigit_l is unportable - "
"use gnulib module isdigit_l for portability");
# endif
#endif
/* Return non-zero if c is graphic. */
#if @GNULIB_ISGRAPH_L@
# if !@HAVE_ISGRAPH_L@
_GL_FUNCDECL_SYS (isgraph_l, int, (int c, locale_t locale),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (isgraph_l, int, (int c, locale_t locale));
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (isgraph_l);
# endif
#elif defined GNULIB_POSIXCHECK
# undef isgraph_l
# if HAVE_RAW_DECL_ISGRAPH_L
_GL_WARN_ON_USE (isgraph_l, "isgraph_l is unportable - "
"use gnulib module isgraph_l for portability");
# endif
#endif
/* Return non-zero if c is lowercase. */
#if @GNULIB_ISLOWER_L@
# if !@HAVE_ISLOWER_L@
_GL_FUNCDECL_SYS (islower_l, int, (int c, locale_t locale),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (islower_l, int, (int c, locale_t locale));
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (islower_l);
# endif
#elif defined GNULIB_POSIXCHECK
# undef islower_l
# if HAVE_RAW_DECL_ISLOWER_L
_GL_WARN_ON_USE (islower_l, "islower_l is unportable - "
"use gnulib module islower_l for portability");
# endif
#endif
/* Return non-zero if c is printable. */
#if @GNULIB_ISPRINT_L@
# if !@HAVE_ISPRINT_L@
_GL_FUNCDECL_SYS (isprint_l, int, (int c, locale_t locale),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (isprint_l, int, (int c, locale_t locale));
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (isprint_l);
# endif
#elif defined GNULIB_POSIXCHECK
# undef isprint_l
# if HAVE_RAW_DECL_ISPRINT_L
_GL_WARN_ON_USE (isprint_l, "isprint_l is unportable - "
"use gnulib module isprint_l for portability");
# endif
#endif
/* Return non-zero if c is a punctuation or symbol character. */
#if @GNULIB_ISPUNCT_L@
# if !@HAVE_ISPUNCT_L@
_GL_FUNCDECL_SYS (ispunct_l, int, (int c, locale_t locale),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (ispunct_l, int, (int c, locale_t locale));
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (ispunct_l);
# endif
#elif defined GNULIB_POSIXCHECK
# undef ispunct_l
# if HAVE_RAW_DECL_ISPUNCT_L
_GL_WARN_ON_USE (ispunct_l, "ispunct_l is unportable - "
"use gnulib module ispunct_l for portability");
# endif
#endif
/* Return non-zero if c is white-space. */
#if @GNULIB_ISSPACE_L@
# if !@HAVE_ISSPACE_L@
_GL_FUNCDECL_SYS (isspace_l, int, (int c, locale_t locale),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (isspace_l, int, (int c, locale_t locale));
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (isspace_l);
# endif
#elif defined GNULIB_POSIXCHECK
# undef isspace_l
# if HAVE_RAW_DECL_ISSPACE_L
_GL_WARN_ON_USE (isspace_l, "isspace_l is unportable - "
"use gnulib module isspace_l for portability");
# endif
#endif
/* Return non-zero if c is uppercase. */
#if @GNULIB_ISUPPER_L@
# if !@HAVE_ISUPPER_L@
_GL_FUNCDECL_SYS (isupper_l, int, (int c, locale_t locale),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (isupper_l, int, (int c, locale_t locale));
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (isupper_l);
# endif
#elif defined GNULIB_POSIXCHECK
# undef isupper_l
# if HAVE_RAW_DECL_ISUPPER_L
_GL_WARN_ON_USE (isupper_l, "isupper_l is unportable - "
"use gnulib module isupper_l for portability");
# endif
#endif
/* Return non-zero if c is a hexadecimal digit. */
#if @GNULIB_ISXDIGIT_L@
# if !@HAVE_ISXDIGIT_L@
_GL_FUNCDECL_SYS (isxdigit_l, int, (int c, locale_t locale),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (isxdigit_l, int, (int c, locale_t locale));
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (isxdigit_l);
# endif
#elif defined GNULIB_POSIXCHECK
# undef isxdigit_l
# if HAVE_RAW_DECL_ISXDIGIT_L
_GL_WARN_ON_USE (isxdigit_l, "isxdigit_l is unportable - "
"use gnulib module isxdigit_l for portability");
# endif
#endif
/* Map c to lowercase. */
#if @GNULIB_TOLOWER_L@
# if !@HAVE_TOLOWER_L@
_GL_FUNCDECL_SYS (tolower_l, int, (int c, locale_t locale),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (tolower_l, int, (int c, locale_t locale));
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (tolower_l);
# endif
#elif defined GNULIB_POSIXCHECK
# undef tolower_l
# if HAVE_RAW_DECL_TOLOWER_L
_GL_WARN_ON_USE (tolower_l, "tolower_l is unportable - "
"use gnulib module tolower_l for portability");
# endif
#endif
/* Map c to uppercase. */
#if @GNULIB_TOUPPER_L@
# if !@HAVE_TOUPPER_L@
_GL_FUNCDECL_SYS (toupper_l, int, (int c, locale_t locale),
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (toupper_l, int, (int c, locale_t locale));
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (toupper_l);
# endif
#elif defined GNULIB_POSIXCHECK
# undef toupper_l
# if HAVE_RAW_DECL_TOUPPER_L
_GL_WARN_ON_USE (toupper_l, "toupper_l is unportable - "
"use gnulib module toupper_l for portability");
# endif
#endif
#endif /* _@GUARD_PREFIX@_CTYPE_H */
#endif
#endif /* _@GUARD_PREFIX@_CTYPE_H */
|