summaryrefslogtreecommitdiffstats
path: root/include/_ctype.h
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1997-09-24 20:38:12 +0000
committerjulian <julian@FreeBSD.org>1997-09-24 20:38:12 +0000
commit60b0e6fbbf1a5776748be4767011d3e485732adc (patch)
treec773c2cc8f832bee4890aa75b31542b803276d8b /include/_ctype.h
parent176f82ad6924c1a3f56e27bd1161e134ae121875 (diff)
downloadFreeBSD-src-60b0e6fbbf1a5776748be4767011d3e485732adc.zip
FreeBSD-src-60b0e6fbbf1a5776748be4767011d3e485732adc.tar.gz
Submitted by: Sin'ichiro MIYATANI / Phase One, Inc <siu@phaseone.co.jp>
Basic support for the Shift JIS encoding of japanese. (and one tiny typo fixed in a comment)
Diffstat (limited to 'include/_ctype.h')
-rw-r--r--include/_ctype.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/_ctype.h b/include/_ctype.h
index e14e514..093e766 100644
--- a/include/_ctype.h
+++ b/include/_ctype.h
@@ -84,6 +84,7 @@ int toupper __P((int));
int isascii __P((int));
int isblank __P((int));
int toascii __P((int));
+int digittoint __P((int));
#endif
__END_DECLS
@@ -105,9 +106,9 @@ __END_DECLS
#define isascii(c) (((c) & ~0x7F) == 0)
#define isblank(c) __istype((c), _B)
#define toascii(c) ((c) & 0x7F)
+#define digittoint(c) (__maskrune((c), 0xFF))
/* XXX the following macros are not backed up by functions. */
-#define digittoint(c) __istype((c), 0xFF)
#define ishexnumber(c) __istype((c), _X)
#define isideogram(c) __istype((c), _I)
#define isnumber(c) __istype((c), _D)
@@ -166,11 +167,19 @@ __tolower(_BSD_CT_RUNE_T_ _c)
_CurrentRuneLocale->maplower[_c];
}
+static __inline int
+__maskrune(_BSD_RUNE_T_ c, unsigned long f)
+{
+ return(((c & _CRMASK)
+ ? ___runetype(c) : _CurrentRuneLocale->runetype[c]) & f);
+}
+
#else /* not using inlines */
__BEGIN_DECLS
int __istype __P((_BSD_CT_RUNE_T_, unsigned long));
int __isctype __P((_BSD_CT_RUNE_T_, unsigned long));
+int __maskrune __P((_BSD_CT_RUNE_T_, unsigned long));
_BSD_CT_RUNE_T_ __toupper __P((_BSD_CT_RUNE_T_));
_BSD_CT_RUNE_T_ __tolower __P((_BSD_CT_RUNE_T_));
__END_DECLS
OpenPOWER on IntegriCloud