summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2002-08-19 09:02:49 +0000
committerache <ache@FreeBSD.org>2002-08-19 09:02:49 +0000
commit2094c3243718f9b4ea0ccf6ff3209ef2f4264a79 (patch)
tree88380573a0d806bcf602cea5ef23d7b84b1b84f4
parent357ca3e7e3c2488784d8e1261f4572c2114af6dc (diff)
downloadFreeBSD-src-2094c3243718f9b4ea0ccf6ff3209ef2f4264a79.zip
FreeBSD-src-2094c3243718f9b4ea0ccf6ff3209ef2f4264a79.tar.gz
Move internal defines from ctype.h here
-rw-r--r--lib/libc/locale/wcwidth.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libc/locale/wcwidth.c b/lib/libc/locale/wcwidth.c
index 2be3bcb..dab0808 100644
--- a/lib/libc/locale/wcwidth.c
+++ b/lib/libc/locale/wcwidth.c
@@ -45,12 +45,16 @@ __FBSDID("$FreeBSD$");
#include <wchar.h>
#include <wctype.h>
+#define _CTYPE_SWM 0xe0000000L /* Mask to get screen width data */
+#define _CTYPE_SWS 30 /* Bits to shift to get width */
+
int
wcwidth(wc)
wchar_t wc;
{
int width = __maskrune(wc, _CTYPE_SWM);
+ /* 0 is autowidth (default) */
return (width ? (int)((unsigned)width >> _CTYPE_SWS)
: (iswprint(wc) ? 1 : -1));
}
OpenPOWER on IntegriCloud