febase.cc
Go to the documentation of this file.
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 <stdlib.h>
19 #include <stdio.h>
20 #include <misc/mylimits.h>
21 #include <stdarg.h>
22 #include <sys/stat.h>
23 #include <ctype.h>
24 #include <unistd.h>
25 
26 #ifdef HAVE_PWD_H
27 #include <pwd.h>
28 #endif
29 
30 #define fePutChar(c) fputc((unsigned char)(c),stdout)
31 /*0 implementation */
32 
33 // char fe_promptstr[] =" ";
34 
35 // output/print buffer:
36 // line buffer for reading:
37 // minimal value for MAX_FILE_BUFFER: 4*4096 - see Tst/Long/gcd0_l.tst
38 // this is an upper limit for the size of monomials/numbers read via the interpreter
39 #define MAX_FILE_BUFFER 4*4096
40 
41 int si_echo = 0;
42 int printlevel = 0;
43 int colmax = 80;
44 char prompt_char = '>'; /*1 either '>' or '.'*/
45 int yylineno = 0;
46 int myynest = -1;
47 int traceit = 0;
48 char my_yylinebuf[80];
49 
50 
51 #if 0
52 void monitor(char* s, int mode)
53 {
54  if (feProt)
55  {
56  fclose(feProtFile);
57  feProt = 0;
58  }
59  if ((s!=NULL) && (*s!='\0'))
60  {
61  feProtFile = myfopen(s,"w");
62  if (feProtFile==NULL)
63  {
64  Werror("cannot open %s",s);
65  feProt=0;
66  }
67  else
68  feProt = mode;
69  }
70 }
71 #else
72 void monitor(void *F, int mode)
73 {
74  if (feProt)
75  {
76  fclose(feProtFile);
77  feProt = 0;
78  }
79  if (F!=NULL)
80  {
81  feProtFile = (FILE *)F;
82  feProt = mode;
83  }
84 }
85 #endif
86 
87 
88 #else /* ! STANDALONE_PARSER */
89 #include <stdio.h>
90 
91 #endif
92 
FILE * feProtFile
Definition: reporter.cc:57
const CanonicalForm int s
Definition: facAbsFact.cc:55
int yylineno
Definition: febase.cc:45
int feProt
Definition: reporter.cc:56
void monitor(void *F, int mode)
Definition: febase.cc:72
int myynest
Definition: febase.cc:46
char prompt_char
Definition: febase.cc:44
char my_yylinebuf[80]
Definition: febase.cc:48
int colmax
Definition: febase.cc:43
FILE * myfopen(const char *path, const char *mode)
Definition: feFopen.cc:167
#define NULL
Definition: omList.c:10
int traceit
Definition: febase.cc:47
int printlevel
Definition: febase.cc:42
void Werror(const char *fmt,...)
Definition: reporter.cc:199
int si_echo
Definition: febase.cc:41