1 --- gbk.c.orig Thu Nov 25 11:38:17 2004
2 +++ gbk.c Fri Feb 18 15:46:58 2005
5 __FBSDID("$FreeBSD: src/lib/libc/locale/gbk.c,v 1.11 2004/05/17 11:16:14 tjr Exp $");
7 +#include "xlocale_private.h"
16 -int _GBK_init(_RuneLocale *);
17 -size_t _GBK_mbrtowc(wchar_t * __restrict, const char * __restrict, size_t,
18 - mbstate_t * __restrict);
19 -int _GBK_mbsinit(const mbstate_t *);
20 -size_t _GBK_wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict);
21 +__private_extern__ int _GBK_init(struct __xlocale_st_runelocale *);
22 +static size_t _GBK_mbrtowc(wchar_t * __restrict, const char * __restrict, size_t,
23 + mbstate_t * __restrict, locale_t);
24 +static int _GBK_mbsinit(const mbstate_t *, locale_t);
25 +static size_t _GBK_wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict, locale_t);
32 -_GBK_init(_RuneLocale *rl)
33 +__private_extern__ int
34 +_GBK_init(struct __xlocale_st_runelocale *xrl)
37 - __mbrtowc = _GBK_mbrtowc;
38 - __wcrtomb = _GBK_wcrtomb;
39 - __mbsinit = _GBK_mbsinit;
40 - _CurrentRuneLocale = rl;
42 + xrl->__mbrtowc = _GBK_mbrtowc;
43 + xrl->__wcrtomb = _GBK_wcrtomb;
44 + xrl->__mbsinit = _GBK_mbsinit;
45 + xrl->__mb_cur_max = 2;
50 -_GBK_mbsinit(const mbstate_t *ps)
52 +_GBK_mbsinit(const mbstate_t *ps, locale_t loc)
55 return (ps == NULL || ((const _GBKState *)ps)->ch == 0);
57 return ((c >= 0x81 && c <= 0xfe) ? 2 : 1);
62 _GBK_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n,
63 - mbstate_t * __restrict ps)
64 + mbstate_t * __restrict ps, locale_t loc)
73 -_GBK_wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps)
75 +_GBK_wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps, locale_t loc)