source: trunk/minix/lib/ansi/setlocale.c@ 11

Last change on this file since 11 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 539 bytes
RevLine 
[9]1/*
2 * setlocale - set the programs locale
3 */
4/* $Header: /cvsup/minix/src/lib/ansi/setlocale.c,v 1.1.1.1 2005/04/21 14:56:06 beng Exp $ */
5
6#include <locale.h>
7#include <string.h>
8
9struct lconv _lc;
10
11char *
12setlocale(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}
Note: See TracBrowser for help on using the repository browser.