4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-01-16 19:40:07 +08:00
Corinna Vinschen 956565be70 Move localeconv, duplocale, freelocale, newlocale, uselocale into separate files
Signed-off by: Corinna Vinschen <corinna@vinschen.de>
2016-08-15 10:56:57 +02:00

28 lines
561 B
C

#include <newlib.h>
#include <reent.h>
#include <stdlib.h>
#include "setlocale.h"
struct __locale_t *
_uselocale_r (struct _reent *p, struct __locale_t *newloc)
{
struct __locale_t *current_locale;
current_locale = __get_locale_r (p);
if (!current_locale)
current_locale = LC_GLOBAL_LOCALE;
if (newloc == LC_GLOBAL_LOCALE)
p->_locale = NULL;
else if (newloc)
p->_locale = newloc;
return current_locale;
}
#ifndef _REENT_ONLY
struct __locale_t *
uselocale (struct __locale_t *newloc)
{
return _uselocale_r (_REENT, newloc);
}
#endif