/*-
- * Copyright (c) 2002 Tim J. Robbins.
+ * Copyright (c) 2002-2004 Tim J. Robbins.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/locale/mbsinit.c,v 1.1 2002/08/18 06:30:10 tjr Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/locale/mbsinit.c,v 1.3 2004/05/12 14:09:04 tjr Exp $");
+
+#include "xlocale_private.h"
#include <wchar.h>
+#include "mblocal.h"
int
-mbsinit(const mbstate_t *ps __unused)
+mbsinit_l(const mbstate_t *ps, locale_t loc)
{
- /*
- * Stateful multibyte conversion is not supported; there are no
- * states other than the initial state.
- */
+ NORMALIZE_LOCALE(loc);
+ return (loc->__lc_ctype->__mbsinit(ps, loc));
+}
- return (1);
+int
+mbsinit(const mbstate_t *ps)
+{
+ return mbsinit_l(ps, __current_locale());
}