Pristine Ack-5.5
[Ack-5.5.git] / lang / cem / libcc.ansi / locale / setlocale.c
1 /*
2  * setlocale - set the programs locale
3  */
4 /* $Id: setlocale.c,v 1.3 1994/06/24 11:42:16 ceriel Exp $ */
5
6 #include        <locale.h>
7 #include        <string.h>
8
9 struct lconv _lc;
10
11 char *
12 setlocale(int category, const char *locale)
13 {
14         if (!locale) return "C";
15         if (*locale && strcmp(locale, "C")) return (char *)NULL;
16         
17         switch(category) {
18         case LC_ALL:
19         case LC_CTYPE:
20         case LC_COLLATE:
21         case LC_TIME:
22         case LC_NUMERIC:
23         case LC_MONETARY:
24                 return *locale ? (char *)locale : "C";
25         default:
26                 return (char *)NULL;
27         }
28 }