]> git.saurik.com Git - apple/libc.git/blame - locale/FreeBSD/runetype.c.patch
Libc-498.tar.gz
[apple/libc.git] / locale / FreeBSD / runetype.c.patch
CommitLineData
3d9156a7
A
1--- runetype.c.orig 2004-11-25 11:38:19.000000000 -0800
2+++ runetype.c 2005-02-16 22:43:53.000000000 -0800
3@@ -37,20 +37,25 @@
4 #include <sys/cdefs.h>
5 __FBSDID("$FreeBSD: src/lib/libc/locale/runetype.c,v 1.11 2004/07/29 06:16:19 tjr Exp $");
9385eb3d 6
3d9156a7 7+#include "xlocale_private.h"
9385eb3d 8+
3d9156a7
A
9 #include <stdio.h>
10 #include <runetype.h>
9385eb3d
A
11
12 unsigned long
3d9156a7
A
13-___runetype(c)
14+___runetype_l(c, loc)
9385eb3d 15 __ct_rune_t c;
3d9156a7 16+ locale_t loc;
9385eb3d 17 {
3d9156a7
A
18 size_t lim;
19- _RuneRange *rr = &_CurrentRuneLocale->__runetype_ext;
20+ _RuneRange *rr;
21 _RuneEntry *base, *re;
9385eb3d
A
22
23 if (c < 0 || c == EOF)
24 return(0L);
25
3d9156a7
A
26+ NORMALIZE_LOCALE(loc);
27+ rr = &loc->__lc_ctype->_CurrentRuneLocale.__runetype_ext;
28 /* Binary search -- see bsearch.c for explanation. */
29 base = rr->__ranges;
30 for (lim = rr->__nranges; lim != 0; lim >>= 1) {
31@@ -68,3 +73,10 @@
9385eb3d
A
32
33 return(0L);
3d9156a7
A
34 }
35+
36+unsigned long
37+___runetype(c)
38+ __ct_rune_t c;
39+{
40+ return ___runetype_l(c, __current_locale());
41+}