]> git.saurik.com Git - apple/libc.git/blob - locale/FreeBSD/big5.c.patch
Libc-763.12.tar.gz
[apple/libc.git] / locale / FreeBSD / big5.c.patch
1 --- big5.c.orig 2009-11-09 15:24:27.000000000 -0800
2 +++ big5.c 2009-11-09 18:41:35.000000000 -0800
3 @@ -41,6 +41,8 @@ static char sccsid[] = "@(#)big5.c 8.1 (
4 #include <sys/cdefs.h>
5 __FBSDID("$FreeBSD: src/lib/libc/locale/big5.c,v 1.18 2007/10/13 16:28:21 ache Exp $");
6
7 +#include "xlocale_private.h"
8 +
9 #include <sys/types.h>
10 #include <errno.h>
11 #include <runetype.h>
12 @@ -49,33 +51,30 @@ __FBSDID("$FreeBSD: src/lib/libc/locale/
13 #include <wchar.h>
14 #include "mblocal.h"
15
16 -extern int __mb_sb_limit;
17 -
18 static size_t _BIG5_mbrtowc(wchar_t * __restrict, const char * __restrict,
19 - size_t, mbstate_t * __restrict);
20 -static int _BIG5_mbsinit(const mbstate_t *);
21 + size_t, mbstate_t * __restrict, locale_t);
22 +static int _BIG5_mbsinit(const mbstate_t *, locale_t);
23 static size_t _BIG5_wcrtomb(char * __restrict, wchar_t,
24 - mbstate_t * __restrict);
25 + mbstate_t * __restrict, locale_t);
26
27 typedef struct {
28 wchar_t ch;
29 } _BIG5State;
30
31 -int
32 -_BIG5_init(_RuneLocale *rl)
33 +__private_extern__ int
34 +_BIG5_init(struct __xlocale_st_runelocale *xrl)
35 {
36
37 - __mbrtowc = _BIG5_mbrtowc;
38 - __wcrtomb = _BIG5_wcrtomb;
39 - __mbsinit = _BIG5_mbsinit;
40 - _CurrentRuneLocale = rl;
41 - __mb_cur_max = 2;
42 - __mb_sb_limit = 128;
43 + xrl->__mbrtowc = _BIG5_mbrtowc;
44 + xrl->__wcrtomb = _BIG5_wcrtomb;
45 + xrl->__mbsinit = _BIG5_mbsinit;
46 + xrl->__mb_cur_max = 2;
47 + xrl->__mb_sb_limit = 128;
48 return (0);
49 }
50
51 static int
52 -_BIG5_mbsinit(const mbstate_t *ps)
53 +_BIG5_mbsinit(const mbstate_t *ps, locale_t loc __unused)
54 {
55
56 return (ps == NULL || ((const _BIG5State *)ps)->ch == 0);
57 @@ -91,7 +90,7 @@ _big5_check(u_int c)
58
59 static size_t
60 _BIG5_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n,
61 - mbstate_t * __restrict ps)
62 + mbstate_t * __restrict ps, locale_t loc __unused)
63 {
64 _BIG5State *bs;
65 wchar_t wc;
66 @@ -151,7 +150,7 @@ _BIG5_mbrtowc(wchar_t * __restrict pwc,
67 }
68
69 static size_t
70 -_BIG5_wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps)
71 +_BIG5_wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps, locale_t loc __unused)
72 {
73 _BIG5State *bs;
74