-/* $OpenBSD: ctype.h,v 1.25 2017/09/05 03:16:13 schwarze Exp $ */
+/* $OpenBSD: ctype.h,v 1.26 2024/02/04 13:03:18 jca Exp $ */
/* $NetBSD: ctype.h,v 1.14 1994/10/26 00:55:47 cgd Exp $ */
/*
#include <sys/cdefs.h>
-#define _U 0x01
-#define _L 0x02
-#define _N 0x04
-#define _S 0x08
-#define _P 0x10
-#define _C 0x20
-#define _X 0x40
-#define _B 0x80
+#define _CTYPE_U 0x01
+#define _CTYPE_L 0x02
+#define _CTYPE_N 0x04
+#define _CTYPE_S 0x08
+#define _CTYPE_P 0x10
+#define _CTYPE_C 0x20
+#define _CTYPE_X 0x40
+#define _CTYPE_B 0x80
#if __POSIX_VISIBLE >= 200809
#ifndef _LOCALE_T_DEFINED_
__only_inline int isalnum(int _c)
{
- return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] & (_U|_L|_N)));
+ return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] &
+ (_CTYPE_U|_CTYPE_L|_CTYPE_N)));
}
__only_inline int isalpha(int _c)
{
- return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] & (_U|_L)));
+ return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] &
+ (_CTYPE_U|_CTYPE_L)));
}
__only_inline int iscntrl(int _c)
{
- return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] & _C));
+ return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] & _CTYPE_C));
}
__only_inline int isdigit(int _c)
{
- return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] & _N));
+ return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] & _CTYPE_N));
}
__only_inline int isgraph(int _c)
{
- return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] & (_P|_U|_L|_N)));
+ return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] &
+ (_CTYPE_P|_CTYPE_U|_CTYPE_L|_CTYPE_N)));
}
__only_inline int islower(int _c)
{
- return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] & _L));
+ return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] & _CTYPE_L));
}
__only_inline int isprint(int _c)
{
- return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] & (_P|_U|_L|_N|_B)));
+ return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] &
+ (_CTYPE_P|_CTYPE_U|_CTYPE_L|_CTYPE_N|_CTYPE_B)));
}
__only_inline int ispunct(int _c)
{
- return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] & _P));
+ return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] & _CTYPE_P));
}
__only_inline int isspace(int _c)
{
- return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] & _S));
+ return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] & _CTYPE_S));
}
__only_inline int isupper(int _c)
{
- return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] & _U));
+ return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] & _CTYPE_U));
}
__only_inline int isxdigit(int _c)
{
- return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] & (_N|_X)));
+ return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] &
+ (_CTYPE_N|_CTYPE_X)));
}
__only_inline int tolower(int _c)
-/* $OpenBSD: ctype_.c,v 1.12 2015/09/19 04:02:21 guenther Exp $ */
+/* $OpenBSD: ctype_.c,v 1.13 2024/02/04 13:03:18 jca Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
* All rights reserved.
#include <ctype.h>
#include "ctype_private.h"
+/* Shorter names for the defines provided by <ctype.h> */
+#define _U _CTYPE_U
+#define _L _CTYPE_L
+#define _N _CTYPE_N
+#define _S _CTYPE_S
+#define _P _CTYPE_P
+#define _C _CTYPE_C
+#define _X _CTYPE_X
+#define _B _CTYPE_B
+
const char _C_ctype_[1 + CTYPE_NUM_CHARS] = {
0,
_C, _C, _C, _C, _C, _C, _C, _C,
-/* $OpenBSD: isctype.c,v 1.12 2015/09/13 11:38:08 guenther Exp $ */
+/* $OpenBSD: isctype.c,v 1.13 2024/02/04 13:03:18 jca Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
* All rights reserved.
int
isalnum(int c)
{
- return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & (_U|_L|_N)));
+ return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] &
+ (_CTYPE_U|_CTYPE_L|_CTYPE_N)));
}
DEF_STRONG(isalnum);
int
isalpha(int c)
{
- return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & (_U|_L)));
+ return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] &
+ (_CTYPE_U|_CTYPE_L)));
}
DEF_STRONG(isalpha);
int
iscntrl(int c)
{
- return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _C));
+ return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _CTYPE_C));
}
DEF_STRONG(iscntrl);
int
isdigit(int c)
{
- return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _N));
+ return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _CTYPE_N));
}
DEF_STRONG(isdigit);
int
isgraph(int c)
{
- return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & (_P|_U|_L|_N)));
+ return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] &
+ (_CTYPE_P|_CTYPE_U|_CTYPE_L|_CTYPE_N)));
}
DEF_STRONG(isgraph);
int
islower(int c)
{
- return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _L));
+ return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _CTYPE_L));
}
DEF_STRONG(islower);
int
isprint(int c)
{
- return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & (_P|_U|_L|_N|_B)));
+ return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] &
+ (_CTYPE_P|_CTYPE_U|_CTYPE_L|_CTYPE_N|_CTYPE_B)));
}
DEF_STRONG(isprint);
int
ispunct(int c)
{
- return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _P));
+ return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _CTYPE_P));
}
DEF_STRONG(ispunct);
int
isspace(int c)
{
- return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _S));
+ return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _CTYPE_S));
}
DEF_STRONG(isspace);
int
isupper(int c)
{
- return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _U));
+ return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _CTYPE_U));
}
DEF_STRONG(isupper);
int
isxdigit(int c)
{
- return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & (_N|_X)));
+ return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] &
+ (_CTYPE_N|_CTYPE_X)));
}
DEF_STRONG(isxdigit);