newlib/winsup/mingw/mingwex/mb_wc_common.h
Danny Smith 6fbeb6a3f0 * mingwex/mbrtowc.c: New file.
* mingwex/wcrtomb.c: New file.
	* mingwex/btowc.c: New file.
	* mingwex/wctob.c: New file.
	* mingwex/mb_wc_common.h: New file.
	* mingwex/Makefile.in (DISTFILES): Add new files.
	(Q8_OBJS): Add new objects.
	* include/wchar.h: Adjust comment about mbrtowc() and related
	funcions. Add __restrict__ to pointer params in prototypes.
	(wmemset. wmemchr, wmemcpy, wmemmove, wcstoll, wcstoull): Remove
	arg names from protototypes.
2005-04-24 11:30:27 +00:00

19 lines
342 B
C
Executable File

#include <locale.h>
#include <string.h>
#include <stdlib.h>
static inline
unsigned int get_cp_from_locale (void)
{
char* cp_string;
/*
locale :: "lang[_country[.code_page]]"
| ".code_page"
*/
if ((cp_string = strchr(setlocale(LC_CTYPE, NULL), '.')))
return ((unsigned) atoi (cp_string + 1));
return 0;
}