prompt function corrected.
[scilab.git] / scilab / modules / console / sci_gateway / c / sci_clc.c
1 /*
2  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3  * Copyright (C) 2007 - INRIA - Allan CORNET 
4  * 
5  * This file must be used under the terms of the CeCILL.
6  * This source file is licensed as described in the file COPYING, which
7  * you should have received as part of this distribution.  The terms
8  * are also available at    
9  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
10  *
11  */
12 /*--------------------------------------------------------------------------*/
13 /* desc : interface for clc primitive                                       */
14 /*--------------------------------------------------------------------------*/
15 #include "gw_console.h"
16 #include "stack-c.h"
17 #include "clc.h"
18 #include "Scierror.h"
19 #include "localization.h"
20 #include "sciprint.h"
21 /*--------------------------------------------------------------------------*/
22 int sci_clc(char *fname,unsigned long fname_len)
23 {
24         BOOL res = FALSE;
25         int nblines = -1;
26
27         Rhs = Max(Rhs,0);
28         CheckRhs(0,1);
29         CheckLhs(0,1);
30
31         if (Rhs == 1)
32         {
33                 if ( GetType(1) == sci_matrix )
34                 {
35                         int l1,m1=1,n1=1;
36                         GetRhsVar(1,MATRIX_OF_INTEGER_DATATYPE,&m1,&n1,&l1);
37                         nblines=*istk(l1);
38
39                         if (nblines < 0)
40                         {
41                                 Scierror(999,_("%s: Wrong value for input argument #%d.\n"),fname,1);
42                                 return 0;
43                         }
44                 }
45                 else
46                 {
47                         Scierror(999,_("%s: This feature has not been implemented.\n"),fname);
48                         return 0;
49                 }
50         }
51         else
52         {
53                 /* Clear console full */
54                 nblines = -1;
55         }
56
57         res = clc(nblines);
58         if (!res)
59         {
60                 sciprint(_("%s: This feature has not been implemented in this mode.\n"),fname);
61         }
62
63         LhsVar(1) = 0;
64         PutLhsVar();
65         return 0;
66 }
67 /*--------------------------------------------------------------------------*/