]> git.saurik.com Git - apple/libc.git/blob - locale/FreeBSD/runetype.c.patch
Libc-391.tar.gz
[apple/libc.git] / locale / FreeBSD / runetype.c.patch
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 $");
6
7 +#include "xlocale_private.h"
8 +
9 #include <stdio.h>
10 #include <runetype.h>
11
12 unsigned long
13 -___runetype(c)
14 +___runetype_l(c, loc)
15 __ct_rune_t c;
16 + locale_t loc;
17 {
18 size_t lim;
19 - _RuneRange *rr = &_CurrentRuneLocale->__runetype_ext;
20 + _RuneRange *rr;
21 _RuneEntry *base, *re;
22
23 if (c < 0 || c == EOF)
24 return(0L);
25
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 @@
32
33 return(0L);
34 }
35 +
36 +unsigned long
37 +___runetype(c)
38 + __ct_rune_t c;
39 +{
40 + return ___runetype_l(c, __current_locale());
41 +}