diff options
author | Andrey A. Chernov <ache@FreeBSD.org> | 1994-09-24 15:59:33 +0000 |
---|---|---|
committer | Andrey A. Chernov <ache@FreeBSD.org> | 1994-09-24 15:59:33 +0000 |
commit | 2f04ec53ccd75ea72690588f8ca0265cd5f0711b (patch) | |
tree | c421c8fdc2c907798a87f84e37c8407eb2618aad /lib/libc/locale/runetype.c | |
parent | cbe192eeb8f43b5095db27b51c7dc46edf036680 (diff) | |
download | src-2f04ec53ccd75ea72690588f8ca0265cd5f0711b.tar.gz src-2f04ec53ccd75ea72690588f8ca0265cd5f0711b.zip |
Notes
Diffstat (limited to 'lib/libc/locale/runetype.c')
-rw-r--r-- | lib/libc/locale/runetype.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/libc/locale/runetype.c b/lib/libc/locale/runetype.c new file mode 100644 index 000000000000..b2c0e391f4e2 --- /dev/null +++ b/lib/libc/locale/runetype.c @@ -0,0 +1,26 @@ +#include <stdio.h> +#include <rune.h> + +unsigned long +___runetype(c) + _BSD_RUNE_T_ c; +{ + int x; + _RuneRange *rr = &_CurrentRuneLocale->runetype_ext; + _RuneEntry *re = rr->ranges; + + if (c == EOF) + return(0); + for (x = 0; x < rr->nranges; ++x, ++re) { + if (c < re->min) + return(0L); + if (c <= re->max) { + if (re->types) + return(re->types[c - re->min]); + else + return(re->map); + } + } + return(0L); +} + |