/**************************************** * Computer Algebra System SINGULAR * ****************************************/ /* $Id: febase.cc,v 1.60 1998-07-10 17:03:43 Singular Exp $ */ /* * ABSTRACT: i/o system */ #include "mod2.h" #include #include #include #include #ifndef __MWERKS__ #include #endif #ifdef NeXT #include #endif #include "tok.h" #include "febase.h" #include "mmemory.h" #include "subexpr.h" #include "ipshell.h" #include "si_paths.h" #ifndef MAXPATHLEN #define MAXPATHLEN 1024 #endif #ifndef MAXNAMLEN #define MAXNAMLEN MAXPATHLEN #endif #define fePutChar(c) fputc((uchar)(c),stdout) /*0 implementation */ char fe_promptstr[] #ifdef macintosh =" \n"; #else =" "; #endif #define INITIAL_PRINT_BUFFER 24*1024 static int feBufferLength=INITIAL_PRINT_BUFFER; static char * feBuffer=(char *)Alloc(INITIAL_PRINT_BUFFER); int si_echo = 0; int printlevel = 0; #ifndef macintosh int pagelength = 24; #else int pagelength = -1; #endif int colmax = 80; char prompt_char = '>'; /*1 either '>' or '.'*/ extern "C" { BITSET verbose = 1 | Sy_bit(V_REDEFINE) | Sy_bit(V_LOAD_LIB) | Sy_bit(V_SHOW_USE) | Sy_bit(V_PROMPT) /* | Sy_bit(V_DEBUG_MEM) */ ;} BOOLEAN errorreported = FALSE; BOOLEAN feBatch; char * feErrors=NULL; int feErrorsLen=0; #ifdef macintosh static int lines = 0; static int cols = 0; #endif const char feNotImplemented[]="not implemented"; BOOLEAN feProt = FALSE; FILE* feProtFile; BOOLEAN tclmode=FALSE; /* TCL-Protocoll (Singular -x): :: \n * E:l:s error * W:l:s warning * N:l:s stdout * Q:0: quit * P:0: prompt > * P:1: prompt . * R:l: ring change * plan: * O:l: