* Bug #13901 fixed - lines() was not updated when resizing Scilab console.
[scilab.git] / scilab / modules / console / src / c / scilines.c
index 8dcea8c..d758d9a 100644 (file)
@@ -45,8 +45,8 @@
 #include "stack-def.h"
 #ifdef _MSC_VER
 #include "../../../windows_tools/src/c/scilab_windows/console.h"
-#include "scilabmode.h"
 #endif
+#include "configvariable_interface.h"
 /*--------------------------------------------------------------------------*/
 #define DEFAULT_NUMBERS_LINES 28
 #define DEFAULT_NUMBERS_COLUMNS 80
@@ -55,8 +55,8 @@
 /*--------------------------------------------------------------------------*/
 int scilines(int nblines, int nbcolumns)
 {
-    setLinesSize(nblines);
-    setColumnsSize(nbcolumns);
+    setConsoleLines(nblines);
+    setConsoleWidth(nbcolumns);
     return 0;
 }
 /*--------------------------------------------------------------------------*/
@@ -67,15 +67,15 @@ int scilinesdefault(void)
     char tc_buf[1024];       /* holds termcap buffer */
     if (tgetent(tc_buf, getenv("TERM")) == 1)
     {
-        setLinesSize(tgetnum("li")); /* retrieve from the term info the number
+        setConsoleLines(tgetnum("li")); /* retrieve from the term info the number
                                                                                of lines */
-        setColumnsSize(tgetnum("co")); /* And the number of columns */
+        setConsoleWidth(tgetnum("co")); /* And the number of columns */
     }
     else
     {
         /* Haven't been able to detect the terminal */
-        setLinesSize(DEFAULT_NUMBERS_LINES);
-        setColumnsSize(DEFAULT_NUMBERS_COLUMNS);
+        setConsoleLines(DEFAULT_NUMBERS_LINES);
+        setConsoleWidth(DEFAULT_NUMBERS_COLUMNS);
     }
 
 #else
@@ -93,13 +93,13 @@ int scilinesdefault(void)
         {
             Y = DEFAULT_NUMBERS_LINES;
         }
-        setColumnsSize(X);
-        setLinesSize(Y);
+        setConsoleWidth(X);
+        setConsoleLines(Y);
     }
     else
     {
-        setLinesSize(DEFAULT_NUMBERS_LINES);
-        setColumnsSize(DEFAULT_NUMBERS_COLUMNS);
+        setConsoleLines(DEFAULT_NUMBERS_LINES);
+        setConsoleWidth(DEFAULT_NUMBERS_COLUMNS);
     }
 #endif
     return 0;
@@ -115,25 +115,3 @@ int C2F(scilinesdefault)(void)
     return scilinesdefault();
 }
 /*--------------------------------------------------------------------------*/
-BOOL setColumnsSize(int colums)
-{
-    C2F(iop).lct[4] = Max(MIN_NUMBERS_COLUMNS, colums);
-    return TRUE;
-}
-/*--------------------------------------------------------------------------*/
-BOOL setLinesSize(int lines_)
-{
-    C2F(iop).lct[1] = Max(MIN_NUMBERS_LINES, lines_);
-    return TRUE;
-}
-/*--------------------------------------------------------------------------*/
-int getColumnsSize(void)
-{
-    return C2F(iop).lct[4];
-}
-/*--------------------------------------------------------------------------*/
-int getLinesSize(void)
-{
-    return C2F(iop).lct[1];
-}
-/*--------------------------------------------------------------------------*/