]> git.saurik.com Git - apple/libc.git/blob - locale/FreeBSD/mskanji.c.patch
Libc-391.1.21.tar.gz
[apple/libc.git] / locale / FreeBSD / mskanji.c.patch
1 --- mskanji.c.orig Thu Nov 25 11:38:18 2004
2 +++ mskanji.c Fri Feb 18 15:49:37 2005
3 @@ -36,9 +36,12 @@
4 #if defined(LIBC_SCCS) && !defined(lint)
5 static char sccsid[] = "@(#)mskanji.c 1.0 (Phase One) 5/5/95";
6 #endif /* LIBC_SCCS and not lint */
7 -#include <sys/param.h>
8 +#include <sys/cdefs.h>
9 __FBSDID("$FreeBSD: src/lib/libc/locale/mskanji.c,v 1.16 2004/05/14 15:40:47 tjr Exp $");
10
11 +#include "xlocale_private.h"
12 +
13 +#include <sys/param.h>
14 #include <errno.h>
15 #include <runetype.h>
16 #include <stdlib.h>
17 @@ -46,38 +49,37 @@
18 #include <wchar.h>
19 #include "mblocal.h"
20
21 -int _MSKanji_init(_RuneLocale *);
22 -size_t _MSKanji_mbrtowc(wchar_t * __restrict, const char * __restrict, size_t,
23 - mbstate_t * __restrict);
24 -int _MSKanji_mbsinit(const mbstate_t *);
25 -size_t _MSKanji_wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict);
26 +__private_extern__ int _MSKanji_init(struct __xlocale_st_runelocale *);
27 +static size_t _MSKanji_mbrtowc(wchar_t * __restrict, const char * __restrict, size_t,
28 + mbstate_t * __restrict, locale_t);
29 +static int _MSKanji_mbsinit(const mbstate_t *, locale_t);
30 +static size_t _MSKanji_wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict, locale_t);
31
32 typedef struct {
33 wchar_t ch;
34 } _MSKanjiState;
35
36 -int
37 -_MSKanji_init(_RuneLocale *rl)
38 +__private_extern__ int
39 +_MSKanji_init(struct __xlocale_st_runelocale *xrl)
40 {
41
42 - __mbrtowc = _MSKanji_mbrtowc;
43 - __wcrtomb = _MSKanji_wcrtomb;
44 - __mbsinit = _MSKanji_mbsinit;
45 - _CurrentRuneLocale = rl;
46 - __mb_cur_max = 2;
47 + xrl->__mbrtowc = _MSKanji_mbrtowc;
48 + xrl->__wcrtomb = _MSKanji_wcrtomb;
49 + xrl->__mbsinit = _MSKanji_mbsinit;
50 + xrl->__mb_cur_max = 2;
51 return (0);
52 }
53
54 -int
55 -_MSKanji_mbsinit(const mbstate_t *ps)
56 +static int
57 +_MSKanji_mbsinit(const mbstate_t *ps, locale_t loc)
58 {
59
60 return (ps == NULL || ((const _MSKanjiState *)ps)->ch == 0);
61 }
62
63 -size_t
64 +static size_t
65 _MSKanji_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n,
66 - mbstate_t * __restrict ps)
67 + mbstate_t * __restrict ps, locale_t loc)
68 {
69 _MSKanjiState *ms;
70 wchar_t wc;
71 @@ -133,8 +135,8 @@
72 }
73 }
74
75 -size_t
76 -_MSKanji_wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps)
77 +static size_t
78 +_MSKanji_wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps, locale_t loc)
79 {
80 _MSKanjiState *ms;
81 int len, i;