1 /* $OpenBSD: ctype.h,v 1.4 2017/09/05 03:16:13 schwarze Exp $ */ 2 /* 3 * Copyright (c) 2015 Philip Guenther <guenther@openbsd.org> 4 * 5 * Permission to use, copy, modify, and distribute this software for any 6 * purpose with or without fee is hereby granted, provided that the above 7 * copyright notice and this permission notice appear in all copies. 8 * 9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 */ 17 18 #ifndef _LIBC_CTYPE_H_ 19 #define _LIBC_CTYPE_H_ 20 21 /* sigh: predeclare and rename the functions which we'll declare inline */ 22 __only_inline int isalnum(int _c); 23 __only_inline int isalpha(int _c); 24 __only_inline int iscntrl(int _c); 25 __only_inline int isdigit(int _c); 26 __only_inline int isgraph(int _c); 27 __only_inline int islower(int _c); 28 __only_inline int isprint(int _c); 29 __only_inline int ispunct(int _c); 30 __only_inline int isspace(int _c); 31 __only_inline int isupper(int _c); 32 __only_inline int isxdigit(int _c); 33 __only_inline int tolower(int _c); 34 __only_inline int toupper(int _c); 35 __only_inline int isblank(int _c); 36 __only_inline int isascii(int _c); 37 __only_inline int toascii(int _c); 38 __only_inline int _tolower(int _c); 39 __only_inline int _toupper(int _c); 40 41 #ifndef _LOCALE_T_DEFINED_ 42 #define _LOCALE_T_DEFINED_ 43 typedef void *locale_t; 44 #endif 45 46 __only_inline int isalnum_l(int _c, locale_t _l); 47 __only_inline int isalpha_l(int _c, locale_t _l); 48 __only_inline int iscntrl_l(int _c, locale_t _l); 49 __only_inline int isdigit_l(int _c, locale_t _l); 50 __only_inline int isgraph_l(int _c, locale_t _l); 51 __only_inline int islower_l(int _c, locale_t _l); 52 __only_inline int isprint_l(int _c, locale_t _l); 53 __only_inline int ispunct_l(int _c, locale_t _l); 54 __only_inline int isspace_l(int _c, locale_t _l); 55 __only_inline int isupper_l(int _c, locale_t _l); 56 __only_inline int isxdigit_l(int _c, locale_t _l); 57 __only_inline int tolower_l(int _c, locale_t _l); 58 __only_inline int toupper_l(int _c, locale_t _l); 59 __only_inline int isblank_l(int _c, locale_t _l); 60 61 PROTO_NORMAL(isalnum); 62 PROTO_DEPRECATED(isalnum_l); 63 PROTO_NORMAL(isalpha); 64 PROTO_DEPRECATED(isalpha_l); 65 PROTO_NORMAL(isascii); 66 PROTO_NORMAL(isblank); 67 PROTO_DEPRECATED(isblank_l); 68 PROTO_NORMAL(iscntrl); 69 PROTO_DEPRECATED(iscntrl_l); 70 PROTO_NORMAL(isdigit); 71 PROTO_DEPRECATED(isdigit_l); 72 PROTO_NORMAL(isgraph); 73 PROTO_DEPRECATED(isgraph_l); 74 PROTO_NORMAL(islower); 75 PROTO_DEPRECATED(islower_l); 76 PROTO_NORMAL(isprint); 77 PROTO_DEPRECATED(isprint_l); 78 PROTO_NORMAL(ispunct); 79 PROTO_DEPRECATED(ispunct_l); 80 PROTO_NORMAL(isspace); 81 PROTO_DEPRECATED(isspace_l); 82 PROTO_NORMAL(isupper); 83 PROTO_DEPRECATED(isupper_l); 84 PROTO_NORMAL(isxdigit); 85 PROTO_DEPRECATED(isxdigit_l); 86 PROTO_DEPRECATED(toascii); 87 PROTO_NORMAL(tolower); 88 PROTO_DEPRECATED(tolower_l); 89 PROTO_NORMAL(toupper); 90 PROTO_DEPRECATED(toupper_l); 91 PROTO_STD_DEPRECATED(_tolower); 92 PROTO_STD_DEPRECATED(_toupper); 93 94 #include_next <ctype.h> 95 96 #if 0 97 extern PROTO_NORMAL(_ctype_); 98 extern PROTO_NORMAL(_tolower_tab_); 99 extern PROTO_NORMAL(_toupper_tab_); 100 #endif 101 102 #endif /* !_LIBC_CTYPE_H_ */ 103