1 | #ifndef OUTPUT_H |
---|
2 | #define OUTPUT_H |
---|
3 | /**************************************** |
---|
4 | * Computer Algebra System SINGULAR * |
---|
5 | ****************************************/ |
---|
6 | /* $Id$ */ |
---|
7 | /* |
---|
8 | * ABSTRACT: basic output |
---|
9 | */ |
---|
10 | #include <stdio.h> |
---|
11 | #include <string.h> |
---|
12 | |
---|
13 | extern char* feErrors; |
---|
14 | extern int feErrorsLen; |
---|
15 | extern FILE* feProtFile; |
---|
16 | extern int pagelength, colmax; |
---|
17 | extern int yy_blocklineno; |
---|
18 | extern int yy_noeof; |
---|
19 | extern const char feNotImplemented[]; |
---|
20 | extern BOOLEAN errorreported; |
---|
21 | extern int feProt; |
---|
22 | extern BOOLEAN feWarn; |
---|
23 | extern BOOLEAN feOut; |
---|
24 | extern int traceit ; |
---|
25 | #define TRACE_SHOW_PROC 1 |
---|
26 | #define TRACE_SHOW_LINENO 2 |
---|
27 | #define TRACE_SHOW_LINE 4 |
---|
28 | #define TRACE_SHOW_RINGS 8 |
---|
29 | #define TRACE_SHOW_LINE1 16 |
---|
30 | #define TRACE_BREAKPOINT 32 |
---|
31 | #define TRACE_TMP_BREAKPOINT 64 |
---|
32 | |
---|
33 | #define PROT_NONE 0 |
---|
34 | #define PROT_I 1 |
---|
35 | #define PROT_O 2 |
---|
36 | #define PROT_IO 3 |
---|
37 | |
---|
38 | /* the C-part: */ |
---|
39 | #define mflush() fflush(stdout) |
---|
40 | |
---|
41 | #ifdef __cplusplus |
---|
42 | extern "C" { |
---|
43 | #endif |
---|
44 | |
---|
45 | void Werror(const char *fmt, ...) __attribute__((format(printf,1,2))); |
---|
46 | void WerrorS(const char *s); |
---|
47 | void WarnS(const char *s); |
---|
48 | void Print(const char* fmt, ...) __attribute__((format(printf,1,2))); |
---|
49 | /* Print should not produce more than strlen(fmt)+510 characters! */ |
---|
50 | |
---|
51 | void PrintNSpaces(const int n); |
---|
52 | void PrintLn(); |
---|
53 | #ifdef HAVE_TCL |
---|
54 | void PrintTCLS(const char c, const char * s); |
---|
55 | #else |
---|
56 | #define PrintTCLS(A,B) Print("TCL-ErrS:%s",B) |
---|
57 | #endif |
---|
58 | void PrintS(const char* s); |
---|
59 | |
---|
60 | #ifdef __cplusplus |
---|
61 | } |
---|
62 | /* the C++-part: */ |
---|
63 | |
---|
64 | #ifdef HAVE_TCL |
---|
65 | |
---|
66 | inline void PrintTCL(const char c, int l,const char *s) |
---|
67 | { |
---|
68 | if (s!=NULL) printf("%c:%d:%s",c,l,s); |
---|
69 | else if(l==0) printf("%c:0:",c); |
---|
70 | else printf("%c:1:%c",c,'0'+l); |
---|
71 | fflush(stdout); |
---|
72 | } |
---|
73 | #else |
---|
74 | #define PrintTCL(A,B,C) Print("TCL-Err:%s",C) |
---|
75 | #endif /* HAVE_TCL */ |
---|
76 | |
---|
77 | char * StringAppend(const char *fmt, ...); |
---|
78 | char * StringAppendS(const char *s); |
---|
79 | char * StringSetS(const char* s); |
---|
80 | void Warn(const char *fmt, ...); |
---|
81 | |
---|
82 | #endif /* c++ only */ |
---|
83 | |
---|
84 | /* everything in between calls to these procedures is printed into a string |
---|
85 | * which is returned by SprintEnd() |
---|
86 | */ |
---|
87 | void SPrintStart(); |
---|
88 | char* SPrintEnd(); |
---|
89 | |
---|
90 | |
---|
91 | #endif /* ifndef OUTPUT_H */ |
---|