*/
#include <sys/param.h>
-__FBSDID("$FreeBSD: src/lib/libc/locale/gb2312.c,v 1.8 2004/05/12 14:09:04 tjr Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/locale/gb2312.c,v 1.10 2007/10/13 16:28:21 ache Exp $");
#include "xlocale_private.h"
#define GB2312_MB_CUR_MAX 2
-__private_extern__ int _GB2312_init(struct __xlocale_st_runelocale *);
-static size_t _GB2312_mbrtowc(wchar_t * __restrict, const char * __restrict, size_t,
- mbstate_t * __restrict, locale_t);
+static size_t _GB2312_mbrtowc(wchar_t * __restrict, const char * __restrict,
+ size_t, mbstate_t * __restrict, locale_t);
static int _GB2312_mbsinit(const mbstate_t *, locale_t);
-static size_t _GB2312_wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict, locale_t);
-
+static size_t _GB2312_wcrtomb(char * __restrict, wchar_t,
+ mbstate_t * __restrict, locale_t);
typedef struct {
int count;
u_char bytes[2];
xrl->__wcrtomb = _GB2312_wcrtomb;
xrl->__mbsinit = _GB2312_mbsinit;
xrl->__mb_cur_max = GB2312_MB_CUR_MAX;
+ xrl->__mb_sb_limit = 128;
return (0);
}
static int
-_GB2312_mbsinit(const mbstate_t *ps, locale_t loc)
+_GB2312_mbsinit(const mbstate_t *ps, locale_t loc __unused)
{
return (ps == NULL || ((const _GB2312State *)ps)->count == 0);
static size_t
_GB2312_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n,
- mbstate_t * __restrict ps, locale_t loc)
+ mbstate_t * __restrict ps, locale_t loc __unused)
{
_GB2312State *gs;
wchar_t wc;
}
static size_t
-_GB2312_wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps, locale_t loc)
+_GB2312_wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps, locale_t loc __unused)
{
_GB2312State *gs;