]>
Commit | Line | Data |
---|---|---|
1 | --- none.c.orig Fri Feb 18 15:34:30 2005 | |
2 | +++ none.c Fri Feb 18 15:37:15 2005 | |
3 | @@ -41,6 +41,8 @@ | |
4 | #include <sys/cdefs.h> | |
5 | __FBSDID("$FreeBSD: src/lib/libc/locale/none.c,v 1.12 2004/07/21 10:54:57 tjr Exp $"); | |
6 | ||
7 | +#include "xlocale_private.h" | |
8 | + | |
9 | #include <errno.h> | |
10 | #include <limits.h> | |
11 | #include <runetype.h> | |
12 | @@ -51,33 +53,32 @@ | |
13 | #include <wchar.h> | |
14 | #include "mblocal.h" | |
15 | ||
16 | -int _none_init(_RuneLocale *); | |
17 | -size_t _none_mbrtowc(wchar_t * __restrict, const char * __restrict, size_t, | |
18 | - mbstate_t * __restrict); | |
19 | -int _none_mbsinit(const mbstate_t *); | |
20 | -size_t _none_mbsnrtowcs(wchar_t * __restrict dst, | |
21 | +__private_extern__ int _none_init(struct __xlocale_st_runelocale *); | |
22 | +__private_extern__ size_t _none_mbrtowc(wchar_t * __restrict, const char * __restrict, size_t, | |
23 | + mbstate_t * __restrict, locale_t); | |
24 | +__private_extern__ int _none_mbsinit(const mbstate_t *, locale_t); | |
25 | +__private_extern__ size_t _none_mbsnrtowcs(wchar_t * __restrict dst, | |
26 | const char ** __restrict src, size_t nms, size_t len, | |
27 | - mbstate_t * __restrict ps __unused); | |
28 | -size_t _none_wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict); | |
29 | -size_t _none_wcsnrtombs(char * __restrict, const wchar_t ** __restrict, | |
30 | - size_t, size_t, mbstate_t * __restrict); | |
31 | + mbstate_t * __restrict ps __unused, locale_t); | |
32 | +__private_extern__ size_t _none_wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict, locale_t); | |
33 | +__private_extern__ size_t _none_wcsnrtombs(char * __restrict, const wchar_t ** __restrict, | |
34 | + size_t, size_t, mbstate_t * __restrict, locale_t); | |
35 | ||
36 | -int | |
37 | -_none_init(_RuneLocale *rl) | |
38 | +__private_extern__ int | |
39 | +_none_init(struct __xlocale_st_runelocale *xrl) | |
40 | { | |
41 | ||
42 | - __mbrtowc = _none_mbrtowc; | |
43 | - __mbsinit = _none_mbsinit; | |
44 | - __mbsnrtowcs = _none_mbsnrtowcs; | |
45 | - __wcrtomb = _none_wcrtomb; | |
46 | - __wcsnrtombs = _none_wcsnrtombs; | |
47 | - _CurrentRuneLocale = rl; | |
48 | - __mb_cur_max = 1; | |
49 | + xrl->__mbrtowc = _none_mbrtowc; | |
50 | + xrl->__mbsinit = _none_mbsinit; | |
51 | + xrl->__mbsnrtowcs = _none_mbsnrtowcs; | |
52 | + xrl->__wcrtomb = _none_wcrtomb; | |
53 | + xrl->__wcsnrtombs = _none_wcsnrtombs; | |
54 | + xrl->__mb_cur_max = 1; | |
55 | return(0); | |
56 | } | |
57 | ||
58 | -int | |
59 | -_none_mbsinit(const mbstate_t *ps __unused) | |
60 | +__private_extern__ int | |
61 | +_none_mbsinit(const mbstate_t *ps __unused, locale_t loc) | |
62 | { | |
63 | ||
64 | /* | |
65 | @@ -87,9 +88,9 @@ | |
66 | return (1); | |
67 | } | |
68 | ||
69 | -size_t | |
70 | +__private_extern__ size_t | |
71 | _none_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, | |
72 | - mbstate_t * __restrict ps __unused) | |
73 | + mbstate_t * __restrict ps __unused, locale_t loc) | |
74 | { | |
75 | ||
76 | if (s == NULL) | |
77 | @@ -103,9 +104,9 @@ | |
78 | return (*s == '\0' ? 0 : 1); | |
79 | } | |
80 | ||
81 | -size_t | |
82 | +__private_extern__ size_t | |
83 | _none_wcrtomb(char * __restrict s, wchar_t wc, | |
84 | - mbstate_t * __restrict ps __unused) | |
85 | + mbstate_t * __restrict ps __unused, locale_t loc) | |
86 | { | |
87 | ||
88 | if (s == NULL) | |
89 | @@ -119,9 +120,9 @@ | |
90 | return (1); | |
91 | } | |
92 | ||
93 | -size_t | |
94 | +__private_extern__ size_t | |
95 | _none_mbsnrtowcs(wchar_t * __restrict dst, const char ** __restrict src, | |
96 | - size_t nms, size_t len, mbstate_t * __restrict ps __unused) | |
97 | + size_t nms, size_t len, mbstate_t * __restrict ps __unused, locale_t loc) | |
98 | { | |
99 | const char *s; | |
100 | size_t nchr; | |
101 | @@ -144,9 +145,9 @@ | |
102 | return (nchr); | |
103 | } | |
104 | ||
105 | -size_t | |
106 | +__private_extern__ size_t | |
107 | _none_wcsnrtombs(char * __restrict dst, const wchar_t ** __restrict src, | |
108 | - size_t nwc, size_t len, mbstate_t * __restrict ps __unused) | |
109 | + size_t nwc, size_t len, mbstate_t * __restrict ps __unused, locale_t loc) | |
110 | { | |
111 | const wchar_t *s; | |
112 | size_t nchr; |