1989-06-14 16:11:19 +00:00
|
|
|
/*
|
|
|
|
* setlocale - set the programs locale
|
|
|
|
*/
|
1994-06-24 14:02:31 +00:00
|
|
|
/* $Id$ */
|
1989-06-14 16:11:19 +00:00
|
|
|
|
2018-06-21 20:33:47 +00:00
|
|
|
#include <locale.h>
|
|
|
|
#include <string.h>
|
1989-06-14 16:11:19 +00:00
|
|
|
|
|
|
|
struct lconv _lc;
|
|
|
|
|
2018-06-21 20:33:47 +00:00
|
|
|
char* setlocale(int category, const char* locale)
|
1989-06-14 16:11:19 +00:00
|
|
|
{
|
2018-06-21 20:33:47 +00:00
|
|
|
if (!locale)
|
|
|
|
return "C";
|
|
|
|
if (*locale && strcmp(locale, "C"))
|
|
|
|
return (char*)NULL;
|
|
|
|
|
|
|
|
switch (category)
|
|
|
|
{
|
|
|
|
case LC_ALL:
|
|
|
|
case LC_CTYPE:
|
|
|
|
case LC_COLLATE:
|
|
|
|
case LC_TIME:
|
|
|
|
case LC_NUMERIC:
|
|
|
|
case LC_MONETARY:
|
|
|
|
return *locale ? (char*)locale : "C";
|
|
|
|
default:
|
|
|
|
return (char*)NULL;
|
1989-06-14 16:11:19 +00:00
|
|
|
}
|
|
|
|
}
|