History log of /openbsd-current/include/ctype.h
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.26 04-Feb-2024 jca

Move ctype.h defines to the _CTYPE_ prefix, avoids clashes with identifiers in ports

Even if those _[BCNLPSUX] defines are in the reserved namespace, some
ports make use of those identifiers and thus need pointless
headscratching and patches. Just use a longer reserved prefix.
We can't just #undef those defines as they are used in libc.

Change similar to what NetBSD did around 2010. Went through base builds
and an amd64 bulk build, the only fallout was lib(e)stdc++ base_ctype.h.
"make includes" will install the latest ctype.h and libstdc++ ctype_base.h.

"makes sense" deraadt@, ok sthen@ tb@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE OPENBSD_6_9_BASE OPENBSD_7_0_BASE OPENBSD_7_1_BASE OPENBSD_7_2_BASE OPENBSD_7_3_BASE OPENBSD_7_4_BASE
# 1.25 05-Sep-2017 schwarze

New POSIX xlocale implementation written from scratch.
Complete in the sense that all POSIX *locale(3) and *_l(3) functions
are included, but in OpenBSD, we of course only really care about
LC_CTYPE and we only support ASCII and UTF-8.

With important help from kettenis@, guenther@, and jca@.
Repeated testing in ports bulk builds by naddy@.
Additional testing by jca@, sebastia@, dcoppa@, and others.
OK kettenis@ dcoppa@, and guenther@ on an earlier version.
Riding guenther@'s libc/librthread major bump.


Revision tags: OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.24 26-May-2014 guenther

Can't use a variable 'c' in a standard include; rename it to '_c'

ok deraadt@ millert@


# 1.23 16-Mar-2014 guenther

lint is dead (long live the lint!), so stop using it as a cpp conditional
(namespace pollution!) or talking about its opinion on code.

ok krw@


Revision tags: OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE
# 1.22 01-Oct-2010 guenther

Now that __only_inline is in <sys/cdefs.h>, replace the local versions in
<ctype.h> and <signal.h>

ok kettenis@ millert@ deraadt@


Revision tags: OPENBSD_4_8_BASE
# 1.21 25-Jul-2010 kettenis

When using GCC, we always want GNU inline semantics. Fixes issues with
-Wsystem-headers and -std=c99, where GCC 4.2 would warn that it couldn't
give us C99 inline semantics.

ok guenther@, dcoppa@, millert@, deraadt@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE
# 1.20 17-Mar-2007 espie

allow extern inline stuff to proceed unchanged thru the mess that the
combined GCC and ISO committees managed to make out of it.

With this, gcc >= 4.3 can grok its way through it correctly.

okay kettenis@, with some help figuring stuff out.


Revision tags: OPENBSD_3_9_BASE OPENBSD_4_0_BASE OPENBSD_4_1_BASE
# 1.19 13-Dec-2005 millert

First step in include files overhaul. Use __FOO_VISIBLE (as defined
in sys/cdefs.h) instead of _FOO_SOURCE. Also fix several namespace
pollution issues, including the byte order defines. OK deraadt@


Revision tags: OPENBSD_3_8_BASE
# 1.18 08-Aug-2005 espie

activate LC_CTYPE for 8 bits locale.
Make sure tolower/toupper use the whole 8 bits.

okay deraadt@
thanks to everyone who tested


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.17 02-Apr-2004 avsm

fix non-gnu ansi compilers by not using 'inline' but '__inline' instead.
lets tendra build again.
ok deraadt@, pvalchev@, millert@


Revision tags: OPENBSD_3_5_BASE
# 1.16 15-Jan-2004 millert

If lint is defined, act like _ANSI_LIBRARY was defined. That way
lint gets the prototypes it expects and doesn't get confused by the
inline functions. OK deraadt@


# 1.15 13-Jan-2004 millert

Allow this to compile on non-gcc. OK deraadt@ art@


Revision tags: OPENBSD_3_4_BASE
# 1.14 10-Jun-2003 millert

Remove an extraneous "& 0xff" (the cast to unsigned char is sufficient).

Use "extern __inline" instead of "static __inline" since the extern
flavor behaves more like a macro (which is what we want).

OK deraadt@ and tested on all platforms by various folks.


# 1.13 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_3_BASE
# 1.12 30-Dec-2002 millert

Back out __EOF stuff and just use -1 in ctype.h. This is OK since
we don't want any user defines to change how the inlined ctype
functions behave.


# 1.11 29-Dec-2002 millert

Don't define EOF In ctype.h, some 3rd party code checks whether or
not EOF is defined to determine if stdio.h has been included.
Instead, use __EOF which should be OK wrt namespace safety.


# 1.10 15-Dec-2002 millert

Casting to unsigned int in isfoo() causes problems on alpha and
sparc64. Change cast back to unsigned char but do a bitwise AND
with 0xff to avoid any sign extension weirdness and to make it
impossible for us to overflow _C_ctype_. The bitwise AND is probably
not needed and may be removed later if this does not trigger compiler bugs.


# 1.9 14-Dec-2002 millert

fix typo; noticed by David Krause


# 1.8 14-Dec-2002 millert

Instead of doing "if (c == EOF) return 0;" use the hook ('?') operator
instead to make these one-liners. Works around a compiler bug on vax
that affects both the libc and inline versions identically.


# 1.7 13-Dec-2002 millert

Less stupid check for 7-bit ascii in toupper/tolower
Remove useless check for EOF in isascii


# 1.6 13-Dec-2002 millert

Cast to unsigned int, not unsigned char, since what is being cast is an
int, not a char.


# 1.5 11-Dec-2002 millert

Convert ctype.h macros into inline functions. This fixes the issues we
currently have with the macro versions and makes the ctype.h versions
100% identical to what is in libc.
Discussed with pjanzen@ and OK'd by deraadt@.


Revision tags: OPENBSD_3_1_BASE OPENBSD_3_2_BASE
# 1.4 16-Feb-2002 millert

Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.


Revision tags: OPENBSD_2_4_BASE OPENBSD_2_5_BASE OPENBSD_2_6_BASE OPENBSD_2_7_BASE OPENBSD_2_8_BASE OPENBSD_2_9_BASE OPENBSD_3_0_BASE
# 1.3 30-Apr-1998 deraadt

make ctype macros on char 0x82 and such work


Revision tags: OPENBSD_2_2_BASE OPENBSD_2_3_BASE
# 1.2 21-Sep-1997 niklas

Well, as we are heading for a release people are encouraged to rebuild their
entire trees for testing anyway, I might as well do this intrusive touching
of include files now. Added openBSD tags.


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


Revision tags: OPENBSD_6_2_BASE
# 1.25 05-Sep-2017 schwarze

New POSIX xlocale implementation written from scratch.
Complete in the sense that all POSIX *locale(3) and *_l(3) functions
are included, but in OpenBSD, we of course only really care about
LC_CTYPE and we only support ASCII and UTF-8.

With important help from kettenis@, guenther@, and jca@.
Repeated testing in ports bulk builds by naddy@.
Additional testing by jca@, sebastia@, dcoppa@, and others.
OK kettenis@ dcoppa@, and guenther@ on an earlier version.
Riding guenther@'s libc/librthread major bump.


Revision tags: OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE
# 1.24 26-May-2014 guenther

Can't use a variable 'c' in a standard include; rename it to '_c'

ok deraadt@ millert@


# 1.23 16-Mar-2014 guenther

lint is dead (long live the lint!), so stop using it as a cpp conditional
(namespace pollution!) or talking about its opinion on code.

ok krw@


Revision tags: OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE
# 1.22 01-Oct-2010 guenther

Now that __only_inline is in <sys/cdefs.h>, replace the local versions in
<ctype.h> and <signal.h>

ok kettenis@ millert@ deraadt@


Revision tags: OPENBSD_4_8_BASE
# 1.21 25-Jul-2010 kettenis

When using GCC, we always want GNU inline semantics. Fixes issues with
-Wsystem-headers and -std=c99, where GCC 4.2 would warn that it couldn't
give us C99 inline semantics.

ok guenther@, dcoppa@, millert@, deraadt@


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE
# 1.20 17-Mar-2007 espie

allow extern inline stuff to proceed unchanged thru the mess that the
combined GCC and ISO committees managed to make out of it.

With this, gcc >= 4.3 can grok its way through it correctly.

okay kettenis@, with some help figuring stuff out.


Revision tags: OPENBSD_3_9_BASE OPENBSD_4_0_BASE OPENBSD_4_1_BASE
# 1.19 13-Dec-2005 millert

First step in include files overhaul. Use __FOO_VISIBLE (as defined
in sys/cdefs.h) instead of _FOO_SOURCE. Also fix several namespace
pollution issues, including the byte order defines. OK deraadt@


Revision tags: OPENBSD_3_8_BASE
# 1.18 08-Aug-2005 espie

activate LC_CTYPE for 8 bits locale.
Make sure tolower/toupper use the whole 8 bits.

okay deraadt@
thanks to everyone who tested


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.17 02-Apr-2004 avsm

fix non-gnu ansi compilers by not using 'inline' but '__inline' instead.
lets tendra build again.
ok deraadt@, pvalchev@, millert@


Revision tags: OPENBSD_3_5_BASE
# 1.16 15-Jan-2004 millert

If lint is defined, act like _ANSI_LIBRARY was defined. That way
lint gets the prototypes it expects and doesn't get confused by the
inline functions. OK deraadt@


# 1.15 13-Jan-2004 millert

Allow this to compile on non-gcc. OK deraadt@ art@


Revision tags: OPENBSD_3_4_BASE
# 1.14 10-Jun-2003 millert

Remove an extraneous "& 0xff" (the cast to unsigned char is sufficient).

Use "extern __inline" instead of "static __inline" since the extern
flavor behaves more like a macro (which is what we want).

OK deraadt@ and tested on all platforms by various folks.


# 1.13 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_3_BASE
# 1.12 30-Dec-2002 millert

Back out __EOF stuff and just use -1 in ctype.h. This is OK since
we don't want any user defines to change how the inlined ctype
functions behave.


# 1.11 29-Dec-2002 millert

Don't define EOF In ctype.h, some 3rd party code checks whether or
not EOF is defined to determine if stdio.h has been included.
Instead, use __EOF which should be OK wrt namespace safety.


# 1.10 15-Dec-2002 millert

Casting to unsigned int in isfoo() causes problems on alpha and
sparc64. Change cast back to unsigned char but do a bitwise AND
with 0xff to avoid any sign extension weirdness and to make it
impossible for us to overflow _C_ctype_. The bitwise AND is probably
not needed and may be removed later if this does not trigger compiler bugs.


# 1.9 14-Dec-2002 millert

fix typo; noticed by David Krause


# 1.8 14-Dec-2002 millert

Instead of doing "if (c == EOF) return 0;" use the hook ('?') operator
instead to make these one-liners. Works around a compiler bug on vax
that affects both the libc and inline versions identically.


# 1.7 13-Dec-2002 millert

Less stupid check for 7-bit ascii in toupper/tolower
Remove useless check for EOF in isascii


# 1.6 13-Dec-2002 millert

Cast to unsigned int, not unsigned char, since what is being cast is an
int, not a char.


# 1.5 11-Dec-2002 millert

Convert ctype.h macros into inline functions. This fixes the issues we
currently have with the macro versions and makes the ctype.h versions
100% identical to what is in libc.
Discussed with pjanzen@ and OK'd by deraadt@.


Revision tags: OPENBSD_3_1_BASE OPENBSD_3_2_BASE
# 1.4 16-Feb-2002 millert

Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.


Revision tags: OPENBSD_2_4_BASE OPENBSD_2_5_BASE OPENBSD_2_6_BASE OPENBSD_2_7_BASE OPENBSD_2_8_BASE OPENBSD_2_9_BASE OPENBSD_3_0_BASE
# 1.3 30-Apr-1998 deraadt

make ctype macros on char 0x82 and such work


Revision tags: OPENBSD_2_2_BASE OPENBSD_2_3_BASE
# 1.2 21-Sep-1997 niklas

Well, as we are heading for a release people are encouraged to rebuild their
entire trees for testing anyway, I might as well do this intrusive touching
of include files now. Added openBSD tags.


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision