add localization gateway
[scilab.git] / scilab / modules / localization / sci_gateway / sci_setlanguage.c
1 /*-----------------------------------------------------------------------------------*/\r
2 /* INRIA 2007 */\r
3 /* Allan CORNET */\r
4 /*-----------------------------------------------------------------------------------*/ \r
5 #include "sci_setlanguage.h"\r
6 #include "setgetlanguage.h"\r
7 #include "Scierror.h"\r
8 #include "sciprint.h"\r
9 /*-----------------------------------------------------------------------------------*/ \r
10 int C2F(sci_setlanguage) _PARAMS((char *fname,unsigned long fname_len))\r
11 {\r
12         static int l1,n1,m1;\r
13 \r
14         CheckRhs(0,1);\r
15         CheckLhs(1,1);\r
16 \r
17         if (GetType(1) == sci_strings)\r
18         {\r
19                 char *param=NULL;\r
20 \r
21                 GetRhsVar(1,"c",&m1,&n1,&l1);\r
22                 param=cstk(l1);\r
23                 if (!setlanguage(param))\r
24                 {\r
25                         sciprint("%s is a invalid language. see 'help setlanguage'.\n\n");\r
26                         CreateVar(Rhs+1, "b", &n1,&n1,&l1);\r
27                         *istk(l1)=(int)(FALSE);\r
28                 }\r
29                 else\r
30                 {\r
31                         CreateVar(Rhs+1, "b", &n1,&n1,&l1);\r
32                         *istk(l1)=(int)(TRUE);\r
33                 }\r
34                 LhsVar(1)=Rhs+1;\r
35                 C2F(putlhsvar)();\r
36         }\r
37         else\r
38         {\r
39                 Scierror(999,"parameter incorrect: see 'help setlanguage'");\r
40                 return 0;\r
41         }\r
42 \r
43         return 0;\r
44 }\r
45 /*-----------------------------------------------------------------------------------*/ \r