Backport
[AROS.git] / workbench / c / SetLocale.c
blobe4d8d72e6dc69bbc22430aa7c1897d3b667bed7a
1 /*
2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: SetLocale CLI command
6 Lang: English
7 */
9 #include <exec/types.h>
10 #include <dos/dos.h>
11 #include <libraries/locale.h>
12 #include <proto/exec.h>
13 #include <proto/dos.h>
14 #include <proto/locale.h>
16 int main(int argc, char **av)
18 LONG error;
19 struct Locale *new;
21 if(argc != 2)
23 PrintFault(ERROR_REQUIRED_ARG_MISSING, "SetLocale");
24 return RETURN_FAIL;
27 new = OpenLocale(av[1]);
28 error = IoErr();
29 FPuts(Output(), "Locale opened\n");
30 if(new)
32 struct Locale *old = NULL;
33 old = LocalePrefsUpdate(new);
34 FPuts(Output(), "Locale set\n");
35 CloseLocale(old);
36 CloseLocale(new);
38 else
40 PrintFault(error, "SetLocale");
41 return RETURN_FAIL;
44 return 0;