source: git/kernel/febase.cc @ 05f61f

fieker-DuValspielwiese
Last change on this file since 05f61f was e7d5ef, checked in by Oleksandr Motsak <motsak@…>, 13 years ago
FIX: consistenly include <misc/mylimits.h> (no omalloc/mylimits.h anymore!)
  • Property mode set to 100644
File size: 1.7 KB
RevLine 
[35aab3]1/****************************************
2*  Computer Algebra System SINGULAR     *
3****************************************/
[341696]4/* $Id$ */
[35aab3]5/*
6* ABSTRACT: i/o system
7*/
8
9/* I need myfread in standalone_parser */
10#ifndef STANDALONE_PARSER
[599326]11#include <kernel/mod2.h>
[35aab3]12
13#include <stdlib.h>
14#include <stdio.h>
[e7d5ef]15#include <misc/mylimits.h>
[35aab3]16#include <stdarg.h>
17#include <sys/stat.h>
18#include <ctype.h>
19#include <unistd.h>
20
21#ifdef HAVE_PWD_H
[599326]22#include <pwd.h>
[35aab3]23#endif
24
[599326]25#include <kernel/febase.h>
[b1dfaf]26#include <omalloc/omalloc.h>
[0f401f]27#include <reporter/reporter.h>
28#include <resources/feFopen.h>
29#include <misc/options.h>
[35aab3]30
[b07ba77]31#define fePutChar(c) fputc((unsigned char)(c),stdout)
[35aab3]32/*0 implementation */
33
[d7c1c8]34// char fe_promptstr[] ="  ";
[35aab3]35
[1d77df]36// output/print buffer:
37// line buffer for reading:
38// minimal value for MAX_FILE_BUFFER: 4*4096 - see Tst/Long/gcd0_l.tst
39// this is an upper limit for the size of monomials/numbers read via the interpreter
40#define MAX_FILE_BUFFER 4*4096
[35aab3]41
42int     si_echo = 0;
43int     printlevel = 0;
44int     colmax = 80;
45char    prompt_char = '>'; /*1 either '>' or '.'*/
[88ece17]46int     yylineno  = 0;
47int  myynest = -1; 
48int  traceit = 0;
49char       my_yylinebuf[80];
[35aab3]50
51
[9539de6]52#if 0
[35aab3]53void monitor(char* s, int mode)
54{
55  if (feProt)
56  {
57    fclose(feProtFile);
58    feProt = 0;
59  }
60  if ((s!=NULL) && (*s!='\0'))
61  {
62    feProtFile = myfopen(s,"w");
63    if (feProtFile==NULL)
64    {
65      Werror("cannot open %s",s);
66      feProt=0;
67    }
68    else
[73a932e]69      feProt = mode;
[35aab3]70  }
71}
[9539de6]72#else
73void monitor(void *F, int mode)
74{
75  if (feProt)
76  {
77    fclose(feProtFile);
78    feProt = 0;
79  }
80  if (F!=NULL)
81  {
82    feProtFile = (FILE *)F;
83    feProt = mode;
84  }
85}
86#endif
[35aab3]87
88
89#else /* ! STANDALONE_PARSER */
90#include <stdio.h>
91
92#endif
93
Note: See TracBrowser for help on using the repository browser.