diff options
author | bde <bde@FreeBSD.org> | 1995-04-07 11:52:17 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1995-04-07 11:52:17 +0000 |
commit | 76e6f5422f092b70e192619fa53058412c766b13 (patch) | |
tree | 4c261639777ed1b89c5712618d7216c38caa9529 /lib/libc/locale/nomacros.c | |
parent | d60c039cdc1a7c5a23d38be0c4062ee46545edba (diff) | |
download | FreeBSD-src-76e6f5422f092b70e192619fa53058412c766b13.zip FreeBSD-src-76e6f5422f092b70e192619fa53058412c766b13.tar.gz |
Reviewed by: ache and wollman (long ago)
isctype.c:
o The tolower() and toupper() functions duplicated too much code
and were out of date (surprise). This didn't matter because
it was difficult to call them.
o Change formatting to be more like that in <ctype.h> (with
extra parentheses as in the macros). Perhaps this file should
be machine generated or everything should be handled like
__tolower() so that no code is repeated.
nomacros.c:
o Instead of looking at _USE_CTYPE_INLINE_ to see what <ctype.h>
has done, set _EXTERNALIZE_CTYPE_INLINES_ to tell <ctype.h>
what to do, so that we don't have anything left to do. Note
that code is now generated even if inlines are used by default.
This allows users to switch to non-inline versions.
Diffstat (limited to 'lib/libc/locale/nomacros.c')
-rw-r--r-- | lib/libc/locale/nomacros.c | 52 |
1 files changed, 6 insertions, 46 deletions
diff --git a/lib/libc/locale/nomacros.c b/lib/libc/locale/nomacros.c index 3880e10..45c0db7 100644 --- a/lib/libc/locale/nomacros.c +++ b/lib/libc/locale/nomacros.c @@ -1,49 +1,9 @@ -#include <ctype.h> -#include <rune.h> - -#if !defined(_USE_CTYPE_INLINE_) && !defined(_USE_CTYPE_MACROS_) /* - * See comments in <machine/ansi.h> + * Tell <ctype.h> to generate extern versions of all its inline + * functions. The extern versions get called if the system doesn't + * support inlines or the user defines _DONT_USE_CTYPE_INLINE_ + * before including <ctype.h>. */ -int -__istype(c, f) - _BSD_RUNE_T_ c; - unsigned long f; -{ - if (c < 0) - c = (unsigned char) c; - return ((((c & _CRMASK) ? ___runetype(c) - : _CurrentRuneLocale->runetype[c]) & f) ? 1 : 0); -} - -int -__isctype(_BSD_RUNE_T_ c, unsigned long f) - _BSD_RUNE_T_ c; - unsigned long f; -{ - if (c < 0) - c = (unsigned char) c; - return ((((c & _CRMASK) ? 0 - : _DefaultRuneLocale.runetype[c]) & f) ? 1 : 0); -} +#define _EXTERNALIZE_CTYPE_INLINES_ -_BSD_RUNE_T_ -toupper(c) - _BSD_RUNE_T_ c; -{ - if (c < 0) - c = (unsigned char) c; - return ((c & _CRMASK) ? - ___toupper(c) : _CurrentRuneLocale->mapupper[c]); -} - -_BSD_RUNE_T_ -tolower(c) - _BSD_RUNE_T_ c; -{ - if (c < 0) - c = (unsigned char) c; - return ((c & _CRMASK) ? - ___tolower(c) : _CurrentRuneLocale->maplower[c]); -} -#endif +#include <ctype.h> |