1 /**************************************** 2 * Computer Algebra System SINGULAR * 3 ****************************************/ 4 /* 5 * ABSTRACT: i/o system 6 */ 7 #include "kernel/mod2.h" 8 9 /* I need myfread in standalone_parser */ 10 #ifndef STANDALONE_PARSER 11 12 #include "omalloc/omalloc.h" 13 #include "reporter/reporter.h" 14 #include "misc/options.h" 15 16 //#include "Singular/febase.h" 17 18 #include "misc/mylimits.h" 19 20 #ifdef HAVE_PWD_H 21 #include <pwd.h> 22 #endif 23 24 #define fePutChar(c) fputc((unsigned char)(c),stdout) 25 /*0 implementation */ 26 27 // char fe_promptstr[] =" "; 28 29 // output/print buffer: 30 // line buffer for reading: 31 // minimal value for MAX_FILE_BUFFER: 4*4096 - see Tst/Long/gcd0_l.tst 32 // this is an upper limit for the size of monomials/numbers read via the interpreter 33 #define MAX_FILE_BUFFER 4*4096 34 35 VAR int si_echo = 0; 36 VAR int printlevel = 0; 37 VAR int colmax = 80; 38 VAR int pagelength = 24; 39 VAR char prompt_char = '>'; /*1 either '>' or '.'*/ 40 VAR int yylineno = 0; 41 VAR int myynest = -1; 42 VAR int traceit = 0; 43 VAR int traceit_stop = 0; 44 VAR char my_yylinebuf[80]; 45 46 47 #if 0 48 void monitor(char* s, int mode) 49 { 50 if (feProt) 51 { 52 fclose(feProtFile); 53 feProt = 0; 54 } 55 if ((s!=NULL) && (*s!='\0')) 56 { 57 feProtFile = myfopen(s,"w"); 58 if (feProtFile==NULL) 59 { 60 Werror("cannot open %s",s); 61 feProt=0; 62 } 63 else 64 feProt = mode; 65 } 66 } 67 #else monitor(void * F,int mode)68void monitor(void *F, int mode) 69 { 70 if (feProt) 71 { 72 fclose(feProtFile); 73 feProt = 0; 74 } 75 if (F!=NULL) 76 { 77 feProtFile = (FILE *)F; 78 feProt = mode; 79 } 80 } 81 #endif 82 83 #endif 84 85