My Project
Toggle main menu visibility
Loading...
Searching...
No Matches
libpolys
reporter
reporter.h
Go to the documentation of this file.
1
#ifndef OUTPUT_H
2
#define OUTPUT_H
3
/****************************************
4
* Computer Algebra System SINGULAR *
5
****************************************/
6
/*
7
* ABSTRACT: basic output
8
*/
9
#include <stdio.h>
10
#include <string.h>
11
#include "
misc/auxiliary.h
"
12
#include "
resources/feFopen.h
"
13
14
EXTERN_VAR
char
*
feErrors
;
15
EXTERN_VAR
int
feErrorsLen
;
16
EXTERN_VAR
FILE*
feProtFile
;
17
EXTERN_VAR
int
pagelength
,
colmax
;
18
EXTERN_VAR
int
yy_blocklineno
;
19
EXTERN_VAR
int
yy_noeof
;
20
extern
const
char
feNotImplemented
[];
21
EXTERN_VAR
int
feProt
;
22
EXTERN_VAR
BOOLEAN
feWarn
;
23
EXTERN_VAR
BOOLEAN
feOut
;
24
EXTERN_VAR
int
traceit
;
25
EXTERN_VAR
int
traceit_stop
;
26
EXTERN_VAR
void (*
WarnS_callback
)(
const
char
*
s
);
27
28
// show entering/leaving proc:
29
#define TRACE_SHOW_PROC 1
30
// show current line-no:
31
#define TRACE_SHOW_LINENO 2
32
// show current line and wait for <RET>:
33
#define TRACE_SHOW_LINE 4
34
// show basering for all levels of the proc-stack at enteringing/leaving proc,
35
// requires RDEBUG to be defined:
36
#define TRACE_SHOW_RINGS 8
37
// show current line and do not wait for <RET>:
38
#define TRACE_SHOW_LINE1 16
39
//
40
#define TRACE_BREAKPOINT 32
41
//
42
#define TRACE_TMP_BREAKPOINT 64
43
// show all calls to kernel routines (via iparith):
44
#define TRACE_CALL 128
45
// show all assigns (via ipassign):
46
#define TRACE_ASSIGN 256
47
// show all automatic type conversions (via ipconv):
48
#define TRACE_CONV 512
49
// profiling: print line-no to smon.out:
50
#define TRACE_PROFILING 1024
51
52
53
#define SI_PROT_I 1
54
#define SI_PROT_O 2
55
#define SI_PROT_IO 3
56
57
/* the C-part: */
58
#define mflush() fflush(stdout)
59
60
#ifdef __cplusplus
61
extern
"C"
{
62
#endif
63
64
void
Werror
(
const
char
*fmt, ...)
__attribute__
((format(printf,1,2)));
65
void
WerrorS_batch
(
const
char
*
s
);
66
void
WarnS
(
const
char
*
s
);
67
void
Print
(
const
char
* fmt, ...)
__attribute__
((format(printf,1,2)));
68
/* Print should not produce more than strlen(fmt)+510 characters! */
69
70
void
PrintNSpaces
(
const
int
n);
71
void
PrintLn
();
72
void
PrintS
(
const
char
*
s
);
73
74
#ifdef __cplusplus
75
}
76
/* the C++-part: */
77
78
// a new output buffer will be allocated by StringSetS,
79
// used by several calls to StringAppend/StringAppendS
80
// and closed by StringEndS:
81
// StringEndS() returns this buffer which must be freed by omFree
82
// several buffer may be active at the same time
83
// (for example in subroutines)
84
void
StringAppend
(
const
char
*fmt, ...);
85
void
StringAppendS
(
const
char
*
s
);
86
void
StringSetS
(
const
char
*
s
);
87
char
*
StringEndS
();
88
void
Warn
(
const
char
*fmt, ...);
89
90
const
char
*
eati
(
const
char
*
s
,
int
*
i
);
91
92
// Prints resources into string with StringAppend, etc
93
void
feStringAppendResources
(
int
warn = -1);
94
#endif
/* c++ only */
95
96
/* everything in between calls to these procedures is printed into a string
97
* which is returned by SprintEnd()
98
* Shall ONLY be used for a temporary redirection of the standard output
99
* (i.e. if Singular runs as a server)
100
*/
101
// unlike the StringSet/StringEndS stuff:
102
// only one SPrintStart/SPrintEnd buffer may be active
103
// the returned string must be free via omFree
104
void
SPrintStart
();
105
char
*
SPrintEnd
();
106
107
/* error reporting */
108
#ifdef __cplusplus
109
extern
"C"
110
{
111
#endif
112
extern
int
dReportError
(
const
char
* fmt, ...);
113
#define dReportBug(s) \
114
dReportError("Bug reported: %s\n occurred at %s,%d\n", s, __FILE__, __LINE__)
115
116
// this is just a dummy procedure which is called after the error
117
// has been reported. Within the debugger, set a breakpoint on this
118
// proc.
119
extern
void
dErrorBreak
();
120
#ifdef __cplusplus
121
}
122
#endif
123
124
#ifdef SING_NDEBUG
125
#define assume(x) do {} while (0)
126
#define r_assume(x) do {} while (0)
127
#else
/* !SING_NDEBUG */
128
129
#define assume_violation(s,f,l) \
130
dReportError("assume violation at %s:%d condition: %s", f,l,s)
131
132
#define assume(x) _assume(x, __FILE__, __LINE__)
133
#define r_assume(x) _r_assume(x, __FILE__, __LINE__)
134
135
#define _assume(x, f, l) \
136
do \
137
{ \
138
if (! (x)) \
139
{ \
140
assume_violation(#x, f, l); \
141
} \
142
} \
143
while (0)
144
145
#define _r_assume(x, f, l) \
146
do \
147
{ \
148
if (! (x)) \
149
{ \
150
assume_violation(#x, f, l); \
151
return 0; \
152
} \
153
} \
154
while (0)
155
#endif
/* !SING_NDEBUG */
156
157
#endif
/* ifndef OUTPUT_H */
auxiliary.h
All the auxiliary stuff.
BOOLEAN
int BOOLEAN
Definition
auxiliary.h:88
i
int i
Definition
cfEzgcd.cc:132
Print
#define Print
Definition
emacs.cc:80
Warn
#define Warn
Definition
emacs.cc:77
WarnS
#define WarnS
Definition
emacs.cc:78
StringAppend
#define StringAppend
Definition
emacs.cc:79
s
const CanonicalForm int s
Definition
facAbsFact.cc:51
feFopen.h
const
#define const
Definition
fegetopt.c:39
EXTERN_VAR
#define EXTERN_VAR
Definition
globaldefs.h:6
__attribute__
#define __attribute__(x)
Definition
mod2.h:429
WerrorS_batch
void WerrorS_batch(const char *s)
Definition
reporter.cc:168
PrintNSpaces
void PrintNSpaces(const int n)
Definition
reporter.cc:368
feNotImplemented
const char feNotImplemented[]
Definition
reporter.cc:54
feErrorsLen
VAR int feErrorsLen
Definition
reporter.cc:48
PrintS
void PrintS(const char *s)
Definition
reporter.cc:288
feProt
VAR int feProt
Definition
reporter.cc:56
WarnS_callback
VAR void(* WarnS_callback)(const char *s)
Definition
reporter.cc:204
feErrors
VAR char * feErrors
Definition
reporter.cc:47
feWarn
VAR BOOLEAN feWarn
Definition
reporter.cc:49
PrintLn
void PrintLn()
Definition
reporter.cc:314
feProtFile
VAR FILE * feProtFile
Definition
reporter.cc:57
feOut
VAR BOOLEAN feOut
Definition
reporter.cc:50
Werror
void Werror(const char *fmt,...) __attribute__((format(printf
SPrintStart
void SPrintStart()
Definition
reporter.cc:250
StringAppendS
void StringAppendS(const char *s)
Definition
reporter.cc:107
pagelength
EXTERN_VAR int pagelength
Definition
reporter.h:17
traceit
EXTERN_VAR int traceit
Definition
reporter.h:24
dErrorBreak
void dErrorBreak()
Definition
dError.cc:140
eati
const char * eati(const char *s, int *i)
Definition
reporter.cc:377
traceit_stop
EXTERN_VAR int traceit_stop
Definition
reporter.h:25
yy_noeof
EXTERN_VAR int yy_noeof
Definition
reporter.h:19
StringEndS
char * StringEndS()
Definition
reporter.cc:151
feStringAppendResources
void feStringAppendResources(int warn=-1)
Definition
reporter.cc:402
SPrintEnd
char * SPrintEnd()
Definition
reporter.cc:277
yy_blocklineno
EXTERN_VAR int yy_blocklineno
Definition
reporter.h:18
colmax
EXTERN_VAR int colmax
Definition
reporter.h:17
dReportError
int dReportError(const char *fmt,...)
Definition
dError.cc:44
StringSetS
void StringSetS(const char *s)
Definition
reporter.cc:128
Generated on
for My Project by
doxygen 1.17.0
for
Singular