ack/lang/cem/libcc.ansi/locale/setlocale.c

29 lines
460 B
C
Raw Normal View History

1989-06-14 16:11:19 +00:00
/*
* setlocale - set the programs locale
*/
/* $Header$ */
#include <locale.h>
#include <string.h>
1989-06-14 16:11:19 +00:00
struct lconv _lc;
char *
setlocale(int category, const char *locale)
{
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:
case LC_COLLATE:
1989-06-14 16:11:19 +00:00
case LC_TIME:
case LC_NUMERIC:
case LC_MONETARY:
return *locale ? (char *)locale : "C";
1989-06-14 16:11:19 +00:00
default:
return (char *)NULL;
}
}