source: git/Singular/febase.h @ 0da09b5

spielwiese
Last change on this file since 0da09b5 was 0da09b5, checked in by Hans Schönemann <hannes@…>, 26 years ago
* hannes: moved WerrorS from C++ to C (it's now used in mm*.c) febase.cc, febase.h git-svn-id: file:///usr/local/Singular/svn/trunk@909 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 2.8 KB
Line 
1#ifndef FEBASE_H
2#define FEBASE_H
3/****************************************
4*  Computer Algebra System SINGULAR     *
5****************************************/
6/* $Id: febase.h,v 1.5 1997-11-18 16:30:57 Singular Exp $ */
7/*
8* ABSTRACT
9*/
10#include <stdio.h>
11#include "structs.h"
12
13extern int    si_echo, printlevel;
14extern int    pagelength, colmax;
15extern int    voice;
16extern int    fileVoice;
17extern char   prompt_char;
18extern BOOLEAN tclmode;
19extern int    blocklineno;
20extern BOOLEAN errorreported;
21extern short*  ifswitch;
22extern BOOLEAN fe_use_fgets;
23extern BOOLEAN feBatch;
24extern char*   feErrors;
25extern BOOLEAN feProt;
26extern FILE*   feProtFile;
27extern char    fe_promptstr[];
28
29#define PROT_NONE 0
30#define PROT_I    1
31#define PROT_O    2
32#define PROT_IO   3
33
34/* the C-part: */
35#ifdef __cplusplus
36extern "C" {
37#endif
38
39void   Werror(char *fmt, ...);
40void   WerrorS(char *s);
41
42#ifdef __cplusplus
43}
44/* the C++-part: */
45
46enum   /* BufferTypes */
47{
48  BT_break = 1,  // while, for
49  BT_proc,       // proc, script
50  BT_example,    // example
51  BT_file,       // <"file"
52  BT_execute,    // execute
53  BT_if,         // if
54  BT_else        // else
55};
56
57void   I_FEbase(void);
58FILE * feFopen(char *path, char *mode, char *where=NULL, int useWerror=FALSE);
59void   fePause(void);
60void   Print(char* fmt, ...);
61void   PrintS(char* s);
62void   PrintLn();
63void   PrintTCLS(char c, char * s);
64#ifndef macintosh
65inline void PrintTCL(char c, int l,char *s)
66{
67#ifdef HAVE_TCL
68  if (s!=NULL) printf("%c:%d:%s\n",c,l,s);
69  else         printf("%c:%d:\n",c,l);
70  fflush(stdout);
71#endif
72}
73#endif
74
75char * StringAppend(char *fmt, ...);
76char * StringAppendS(char *s);
77char * StringSet(char *fmt, ...);
78char * StringSetS(char* s);
79const  char * VoiceName();
80const  char * VoiceName(int v);
81int    VoiceType();
82void   WarnS(char *s);
83void   Warn(char *fmt, ...);
84int    contBuffer(int typ);
85char * eati(char *s, int *i);
86int    exitBuffer(int typ);
87int    exitVoice(void);
88#define mflush() fflush(stdout)
89void   monitor(char* s,int mode);
90void   newBuffer(char* s, int t, char *pname = NULL);
91int    newVoice(char* fn);
92int    readbuf(char* b, int l);
93void   showInput(void);
94void * myynewbuffer();
95void   myyoldbuffer(void * oldb);
96
97/* feread.cc: */
98#ifdef HAVE_FEREAD
99  void fe_set_input_mode (void);
100  void fe_temp_set (void);
101  void fe_temp_reset (void);
102  char * fe_fgets_stdin(char *s, int size);
103  #ifndef MSDOS
104    #ifdef HAVE_ATEXIT
105      void fe_reset_input_mode (void);
106    #else
107      void fe_reset_input_mode (int i, void *v);
108    #endif
109  #else
110    #define fe_reset_input_mode()
111  #endif
112#else
113  #ifdef HAVE_READLINE
114    void fe_set_input_mode (void);
115    char * fe_fgets_stdin_rl(char *pr,char *s, int size);
116    #define fe_fgets_stdin(A,B) fe_fgets_stdin_rl(fe_promptstr,A,B)
117  #else
118    #define fe_fgets_stdin(A,B) fgets(A,B,stdin)
119  #endif
120#endif
121#endif
122#endif
Note: See TracBrowser for help on using the repository browser.