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
|
|
|
|
|
|
|
#include <locale.h>
|
1989-12-18 15:49:11 +00:00
|
|
|
#include <string.h>
|
1989-06-14 16:11:19 +00:00
|
|
|
|
|
|
|
struct lconv _lc;
|
|
|
|
|
|
|
|
char *
|
|
|
|
setlocale(int category, const char *locale)
|
|
|
|
{
|
1989-12-18 15:49:11 +00:00
|
|
|
if (!locale) return "C";
|
|
|
|
if (*locale && strcmp(locale, "C")) return (char *)NULL;
|
1989-06-14 16:11:19 +00:00
|
|
|
|
|
|
|
switch(category) {
|
|
|
|
case LC_ALL:
|
|
|
|
case LC_CTYPE:
|
1989-12-18 15:49:11 +00:00
|
|
|
case LC_COLLATE:
|
1989-06-14 16:11:19 +00:00
|
|
|
case LC_TIME:
|
1989-12-18 15:49:11 +00:00
|
|
|
case LC_NUMERIC:
|
|
|
|
case LC_MONETARY:
|
|
|
|
return *locale ? (char *)locale : "C";
|
1989-06-14 16:11:19 +00:00
|
|
|
default:
|
|
|
|
return (char *)NULL;
|
|
|
|
}
|
|
|
|
}
|