]> pd.if.org Git - pdclib/blob - functions/locale/uselocale.c
PDCLib includes with quotes, not <>.
[pdclib] / functions / locale / uselocale.c
1 /* uselocale( locale_t )
2
3    This file is part of the Public Domain C Library (PDCLib).
4    Permission is granted to use, modify, and / or redistribute at will.
5 */
6
7 #include <locale.h>
8 #ifndef REGTEST
9 #include "_PDCLIB_locale.h"
10
11 #ifdef _PDCLIB_LOCALE_METHOD
12 locale_t uselocale( locale_t newloc )
13 {
14     locale_t oldloc = _PDCLIB_threadlocale();
15
16     if(newloc == LC_GLOBAL_LOCALE) {
17         _PDCLIB_setthreadlocale(NULL);
18     } else if(newloc != NULL) {
19         _PDCLIB_setthreadlocale(newloc);
20     }
21
22     return oldloc;
23 }
24 #endif
25
26 #endif
27
28 #ifdef TEST
29 #include "_PDCLIB_test.h"
30
31 int main( void )
32 {
33     TESTCASE( NO_TESTDRIVER );
34     return TEST_RESULTS;
35 }
36 #endif