repo.or.cz
/
minix3.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
. use library function to parse memory string
[minix3.git]
/
lib
/
ansi
/
setlocale.c
blob
87bb74a551e27bfe5aca889aa701edb26126c3f2
1
/*
2
* setlocale - set the programs locale
3
*/
4
/* $Header$ */
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
}