basout.c

Go to the documentation of this file.
00001 /*-----------------------------------------------------------------------------------*/
00002 /* INRIA 2006 */
00003 /* Allan CORNET */
00004 /*-----------------------------------------------------------------------------------*/ 
00005 #include <string.h>
00006 #include "machine.h"
00007 #include "stack-def.h"
00008 #include "basout.h"
00009 /*-----------------------------------------------------------------------------------*/ 
00010 extern int C2F(xscimore)();
00011 extern int C2F(writewtemore)();
00012 extern int C2F(diary)();
00013 extern int C2F(writelunitstring)();
00014 extern int C2F(xscion)();
00015 extern int C2F(xscistring)();
00016 extern int C2F(readrtechar)();
00017 /*-----------------------------------------------------------------------------------*/ 
00018 int C2F(basout)(integer *io,integer *lunit,char *string,long int notused)
00019 {
00020         static integer iflag;
00021         static char ch[1];
00022         static integer ich;
00023 
00024         if (*lunit == C2F(iop).wte)
00025         {
00026                 /* Sortie sur la sortie standard */
00027                 C2F(xscion)(&iflag);
00028                 *io = 0;
00029                 if (C2F(iop).lct[0] == -1) { return 0; }
00030                 if (C2F(iop).lct[1] > 0) 
00031                 {
00032                         /* Gestion de la pagination */
00033                         if (C2F(iop).lct[0] + 3 > C2F(iop).lct[1])
00034                         {
00035                                 /* nombre maxi de ligne atteint,gestion du more */
00036                                 C2F(iop).lct[0] = 0;
00037                                 if (iflag == 0) 
00038                                 {
00039                                         /* scilab n'a pas de  fenetre propre */
00040                                         C2F(writewtemore)();
00041                                         *(unsigned char *)ch = ' ';
00042                                         C2F(readrtechar)(ch, 1L);
00043                                         if (*(unsigned char *)ch != ' ') 
00044                                         {
00045                                                 ich = 1;
00046                                         }
00047                                 }
00048                                 else
00049                                 {
00050                                         /* scilab a une  fenetre  en propre */
00051                                         C2F(xscimore)(&ich);
00052                                 }
00053                                 if (ich == 1) 
00054                                 {
00055                                         C2F(iop).lct[0] = -1;
00056                                         *io = -1;
00057                                         return 0;
00058                                 }
00059                         } 
00060                         else
00061                         {
00062                                 ++C2F(iop).lct[0];
00063                         }
00064                 }
00065 
00066                 if (iflag == 0) 
00067                 {
00068                         C2F(writelunitstring)(lunit, string, notused);
00069                 } 
00070                 else 
00071                 {
00072                         C2F(xscistring)(string, &notused, notused);
00073                 }
00074                 /* write to diary file if required */
00075                 C2F(diary)(string, &notused, notused);
00076         } 
00077         else
00078         {
00079                 /* sortie sur fichier */
00080                 if (*lunit == C2F(iop).wio) 
00081                 {
00082                         C2F(diary)(string, &notused, notused);
00083                 }
00084                 else 
00085                 {
00086                         C2F(writelunitstring)(lunit, string,notused);
00087                 }
00088         }
00089         return 0;
00090 } 
00091 /*-----------------------------------------------------------------------------------*/ 

Generated on Sun Mar 4 15:03:45 2007 for Scilab [trunk] by  doxygen 1.5.1