aboutsummaryrefslogtreecommitdiff
path: root/include/ctype.h
Commit message (Collapse)AuthorAgeFilesLines
* include: Remove ancient SCCS tags.Warner Losh2023-11-271-2/+0
| | | | | | | | Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script. Sponsored by: Netflix
* Remove $FreeBSD$: one-line .h patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
* include: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-1/+3
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326024
* Commit log from Dragonfly:Baptiste Daroussin2015-10-131-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | FreeBSD extended ctypes to include numbers (e.g. isnumber()) but never actually implemented it. The isnumber() function was equivalent to the isdigit() function in every case. Now that DragonFly's ctype source files have number definitions, the number ctype can finally be implemented. It's given a new flag _CTYPE_N. The isalnum() and iswalnum() functions have been changed to use this flag rather than the _CTYPE_D digit flag. While isalnum(), isnumber(), and their wide equivalents now return different values in locale cases, the ishexnumber() and iswhexnumber() functions are unchanged. They are still aliases for isxdigit() and iswxdigit(). Also change ctype.h for isdigit and isxdigit to use sbistype like the other functions. Obtained from: dragonfly Notes: svn path=/projects/collation/; revision=289263
* Correctly expose xlocale functions if people include the headers in the wrongDavid Chisnall2012-03-281-1/+1
| | | | | | | | | order (as some ports apparently do). Approved by: dim (mentor) Notes: svn path=/head/; revision=233600
* Reapply 227753 (xlocale cleanup), plus some fixes so that it passes buildDavid Chisnall2012-03-041-0/+4
| | | | | | | | | universe with gcc. Approved by: dim (mentor) Notes: svn path=/head/; revision=232498
* Revert r231673 and r231682 for now, until we can run a full makeDimitry Andric2012-02-141-4/+0
| | | | | | | | | universe with them. Sorry for the breakage. Pointy hat to: me and brooks Notes: svn path=/head/; revision=231714
* Cleanup of xlocale:David Chisnall2012-02-141-0/+4
| | | | | | | | | | | | | | | | | | | - Address performance regressions encountered by das@ by caching per-thread data in TLS where available. - Add a __NO_TLS flag to cdefs.h to indicate where not available. - Reorganise the xlocale.h definitions into xlocale/*.h so that they can be included from multiple places. - Export the POSIX2008 subset of xlocale when POSIX2008 says it should be exported, independently of whether xlocale.h is included. - Fix the bug where programs using ctype functions always assumed ASCII unless recompiled. - Fix some style(9) violations. Reviewed by: brooks (mentor) Approved by: dim (mentor) Notes: svn path=/head/; revision=231673
* Hide some more macros that will break C++ when compiling in C++ mode.David Chisnall2011-11-131-1/+3
| | | | | | | Approved by: dim (mentor) Notes: svn path=/head/; revision=227490
* Remove the Berkeley clause 3's.Warner Losh2010-02-161-5/+1
| | | | | | | Add a few $FreeBSD$ Notes: svn path=/head/; revision=203964
* Don't prototype _tolower() and _toupper(). They're not supposed to beDavid Schultz2009-03-141-2/+0
| | | | | | | functions, and there's no implementation of them in any case. Notes: svn path=/head/; revision=189811
* The problem is: currently our single byte ctype(3) functions are brokenAndrey A. Chernov2007-10-131-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | for wide characters locales in the argument range >= 0x80 - they may return false positives. Example 1: for UTF-8 locale we currently have: iswspace(0xA0)==1 and isspace(0xA0)==1 (because iswspace() and isspace() are the same code) but must have iswspace(0xA0)==1 and isspace(0xA0)==0 (because there is no such character and all others in the range 0x80..0xff for the UTF-8 locale, it keeps ASCII only in the single byte range because our internal wchar_t representation for UTF-8 is UCS-4). Example 2: for all wide character locales isalpha(arg) when arg > 0xFF may return false positives (must be 0). (because iswalpha() and isalpha() are the same code) This change address this issue separating single byte and wide ctype and also fix iswascii() (currently iswascii() is broken for arguments > 0xFF). This change is 100% binary compatible with old binaries. Reviewied by: i18n@ Notes: svn path=/head/; revision=172619
* Move some internal macros and inlines from ctype.h to a new file, _ctype.h,Tim J. Robbins2004-08-121-89/+1
| | | | | | | | | which has been repo-copied from ctype.h. This will allow us to remove namespace pollution from <wctype.h> and to make wcwidth() an inline function without introducing more pollution. Notes: svn path=/head/; revision=133559
* Now that <runetype.h> no longer brings in namespace pollution,Tim J. Robbins2004-06-231-11/+0
| | | | | | | bring back the inline functions for the !__BSD_VISIBLE case. Notes: svn path=/head/; revision=130962
* Prefix the names of members of _RuneLocale and its sub-structuresTim J. Robbins2004-06-231-4/+4
| | | | | | | | | with ``__'' to avoid polluting the namespace. This doesn't change the documented rune interface at all, but breaks applications that accessed _RuneLocale directly. Notes: svn path=/head/; revision=130961
* Make isblank() visible in the C99 namespace.Tim J. Robbins2004-04-211-2/+8
| | | | | | | | PR: 63371 Submitted by: Stefan Farfeleder Notes: svn path=/head/; revision=128523
* Solve the <runetype.h> pollution problem by disabling inlineMike Barcroft2002-09-091-4/+16
| | | | | | | | optimizations when a standard has been requested, except when the inline optimizations are also specifically requested. Notes: svn path=/head/; revision=103113
* o Fix namespace scope issues in <ctype.h> by using the relatively newMike Barcroft2002-09-061-9/+29
| | | | | | | | | | | | | | | visibility primitives. o Implement _tolower() and _toupper() POSIX.1-2001 (XSI) macros in <ctype.h>. o Reduce pollution in <runetype.h> by removing typedefs and using implementation namespaced types. o Add a typedef in <rune.h> to compensate for <runetype.h> losing its typedefs. Reviewed by: bde Notes: svn path=/head/; revision=102998
* o Merge <machine/ansi.h> and <machine/types.h> into a new headerMike Barcroft2002-08-211-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | called <machine/_types.h>. o <machine/ansi.h> will continue to live so it can define MD clock macros, which are only MD because of gratuitous differences between architectures. o Change all headers to make use of this. This mainly involves changing: #ifdef _BSD_FOO_T_ typedef _BSD_FOO_T_ foo_t; #undef _BSD_FOO_T_ #endif to: #ifndef _FOO_T_DECLARED typedef __foo_t foo_t; #define _FOO_T_DECLARED #endif Concept by: bde Reviewed by: jake, obrien Notes: svn path=/head/; revision=102227
* Move internal defines from here to libc/locale/wcwidth.cAndrey A. Chernov2002-08-191-3/+0
| | | | Notes: svn path=/head/; revision=102094
* Properly define SWIDTH1, add autowidth (was SWIDTH1)Andrey A. Chernov2002-08-191-1/+2
| | | | Notes: svn path=/head/; revision=102093
* Add swidth definition for wchar stuffMichael C . Wu2002-08-161-0/+6
| | | | | | | | | | Submitted by: clkao@clkao.org Reviewed by: keichii Obtained from: NetBSD MFC after: 1 month Notes: svn path=/head/; revision=101984
* Breath deep and take __P out of the system include files.Warner Losh2002-03-231-31/+31
| | | | | | | | | # This appears to not break X11, but I'm having problems compiling the # glide part of the server with or without this patch, so I can't tell # for sure. Notes: svn path=/head/; revision=93032
* Makes __istype() an inline (and a non inlined) function to avoid C++Rob Braun2002-02-051-2/+7
| | | | | | | | | | | compile issues. std::isspace(' ') was expanding to std::(!!_maskrune...) which would cause a C++ compile error. Making __istype() an inline causes the expansion to be std::__istype() instead, which is valid. Reviewed by: jkh Notes: svn path=/head/; revision=90231
* There is a problem in that one cannot use ctype.h at the same time as partsDavid E. O'Brien2000-02-081-31/+31
| | | | | | | | | | | | | | | | | of the C++ stdlib. Our ctype.h uses symbols of the form _<X> to denote the various character classes. Our ctype.h also extends the usual ctype.h offering by adding the "_T" (special) class. Problem is parts of the STL also use the symbol "_T" as its parameterized type. These two uses are incompatible. Thus change the form of the symbols used in ctype to something that fixes the current problem and is less likely to cause conflicts in the future. Requested by: Tomoaki NISHIYAMA <tomoaki@biol.s.u-tokyo.ac.jp> Ok'ed by: JKH Notes: svn path=/head/; revision=57035
* Back up following macros by functions: ishexnumber, isideogram, isnumber,Alexey Zelkin1999-12-171-5/+10
| | | | | | | | | isphonogram, isrune, isspecial. Fix ordering. Reviewed by: bde Notes: svn path=/head/; revision=54746
* Oops, fix typo in istype definitionAndrey A. Chernov1997-09-271-1/+1
| | | | Notes: svn path=/head/; revision=29884
* 1) Bring '!!' back since we wan't overflow even a charAndrey A. Chernov1997-09-271-17/+19
| | | | | | | | | 2) Revive __maskrune, just return mask now 3) Express __istype via !!__maskrune 4) Use __maskrune in digittoint Notes: svn path=/head/; revision=29883
* Oops, wrong version of digittoint fix was commited, step back to v1.8Andrey A. Chernov1997-09-251-8/+6
| | | | | | | | instead just remove '!!' to make digittoint() work and re-arrange things a little Notes: svn path=/head/; revision=29855
* Fix digittoint broken long agoAndrey A. Chernov1997-09-251-14/+8
| | | | | | | | Redesign to allow digittoint work for runes too __maskrune removed, __istype become a macro, __runeflags added Notes: svn path=/head/; revision=29854
* Bandaid for the build-breaking reference to _BSD_RUNE_T_. I'm not surePeter Wemm1997-09-251-3/+3
| | | | | | | that this is right, but the old reference defaintely was not. Notes: svn path=/head/; revision=29843
* Submitted by: Sin'ichiro MIYATANI / Phase One, Inc <siu@phaseone.co.jp>Julian Elischer1997-09-241-1/+10
| | | | | | | | Basic support for the Shift JIS encoding of japanese. (and one tiny typo fixed in a comment) Notes: svn path=/head/; revision=29818
* Fixed longstanding namespace convolution involving rune_t vs wchar_t.Bruce Evans1996-05-011-14/+14
| | | | | | | | | | | | | | If _ANSI_SOURCE or _POSIX_SOURCE is defined, then <ctype.h> had to be included before <stddef.h> or <stdlib.h> to get rune_t declared. Now rune_t is declared perfectly bogusly in all cases when <ctype.h> is included. This change breaks similar (but more convoluted) convolutions in the stddef.h in gcc distributions. Ports of gcc should avoid using the gcc headers. Notes: svn path=/head/; revision=15483
* Slightly simplify inlined functionsAndrey A. Chernov1996-03-251-6/+3
| | | | Notes: svn path=/head/; revision=14813
* Fix isspecial/isphonogram, they was swappedAndrey A. Chernov1995-11-031-18/+13
| | | | | | | | | Remove EOF hack, now it is recognized per ANSI/POSIX Add upper bounds check Handle all negative chars inside locale functions Notes: svn path=/head/; revision=12028
* Reviewed by: ache and wollman (long ago)Bruce Evans1995-04-071-52/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix numerous ANSI conformance bugs and other nits. ctype.h: o There were no prototypes behind the macros (conformance bug). o isascii() didn't have enough parentheses (plain bug). o tolower() and toupper were always static inline (conformance bug? You could undef them and take their address, but this gave different addresses in different modules. You couldn't undef them and declare them (correctly) again). <stdio.h>'s treatment of putc() shows one way to handle this problem, but it only works because the putc() macro is allowed to reevaluate its args. I used a hack controlled by _EXTERNALIZE_CTYPE_INLINES_ to get <ctype.h> to generate the code (the previous hack involving _ANSI_LIBRARY_ goes away). This has the advantage that the core of the functions is only written down once and the disadvantage that another layer of functions is required. The extra layer goes away if inline functions are used, leaving only the problem of understanding why there are functions named toupper(), __toupper and ___toupper() as well as a macro named toupper. o Nothing seems to define _USE_CTYPE_LIBRARY_. Eliminate it o Let the user set _USE_CTYPE_INLINE_ and _DONT_USE_CTYPE_INLINE_ for full control over inlining. o The args for the inline functions didn't have enough underscores (conformance bug). o The formatting and ordering was inconsistent (style bug). o TODO: fix conformance bugs brought by including <runetype.h>. Notes: svn path=/head/; revision=7655
* Move inline args out of user namespace.Andrey A. Chernov1995-04-071-20/+20
| | | | | | | Obtained from: 1.x Notes: svn path=/head/; revision=7654
* Remove EOF handling after Bruce explanation. This step returnsAndrey A. Chernov1994-10-091-13/+0
| | | | | | | | to 4.4 way to not allow EOF in ctype and now all signed chars (including '\377' which becomes EOF) converted to (unsigned char) properly. Notes: svn path=/head/; revision=3456
* Handle EOF case in all macros by ANSI standard.Andrey A. Chernov1994-10-081-0/+21
| | | | | | | | Cast all ints < 0 to (unsigned char) to fix common problem with sign extention on signed char. Notes: svn path=/head/; revision=3433
* BSD 4.4 Lite Include SourcesRodney W. Grimes1994-05-241-0/+147
Notes: svn path=/head/; revision=1539