#include "misc/auxiliary.h"
#include "reporter/reporter.h"
#include "resources/feResource.h"
#include "resources/feFopen.h"
#include "omalloc/omalloc.h"
#include <stdlib.h>
#include <stdio.h>
#include "misc/mylimits.h"
#include <stdarg.h>
#include <sys/stat.h>
#include <ctype.h>
#include <unistd.h>
Go to the source code of this file.
◆ fePutChar
Value:fputc((unsigned char)(c),stdout)
Definition at line 30 of file reporter.cc.
◆ INITIAL_PRINT_BUFFER
| #define INITIAL_PRINT_BUFFER 24*1024L |
◆ MAX_FILE_BUFFER
| #define MAX_FILE_BUFFER 4*4096 |
◆ warn_str
| #define warn_str "// ** " |
◆ eati()
Definition at line 377 of file reporter.cc.
378{
380
381 if (*
s >=
'0' && *
s <=
'9')
382 {
384 while (*
s >=
'0' && *
s <=
'9')
385 {
390 {
392 Werror(
"`%s` greater than %d(max. integer representation)",
395 }
396 }
397 }
400}
const CanonicalForm int s
void Werror(const char *fmt,...)
◆ feStringAppendResources()
| void feStringAppendResources |
( |
int | warn | ) |
|
Definition at line 402 of file reporter.cc.
403{
405 char* r;
408 {
411 (r !=
NULL ? r :
""));
413 }
414}
VAR feResourceConfig_s feResourceConfigs[]
static char * feResource(feResourceConfig config, int warn)
◆ Print()
| void Print |
( |
const char * | fmt, |
|
|
| ... ) |
Definition at line 319 of file reporter.cc.
320{
322 {
326 int ls = strlen(fmt);
327 if (fmt !=
NULL && ls > 0)
328 {
329 char* ns;
331 ns = (
char*)
omAlloc(
sizeof(
char)*(ls +
l + 512));
333
334#ifdef HAVE_VSNPRINTF
335 l = vsnprintf(&(ns[
l]), ls+511, fmt,
ap);
337#else
338 vsprintf(&(ns[
l]), fmt,
ap);
339#endif
343 }
345 return;
346 }
348 {
352 long ls=strlen(fmt);
354#ifdef HAVE_VSNPRINTF
355 l = vsnprintf(
s, ls+511, fmt,
ap);
356 if ((
l==-1)||(
s[
l]!=
'\0')||(
l!=(
int)strlen(
s)))
357 {
358 printf(
"Print problem: l=%d, fmt=>>%s<<\n",
l,fmt);
359 }
360#else
361 vsprintf(
s, fmt,
ap);
362#endif
366 }
367}
#define omCheckAddr(addr)
void PrintS(const char *s)
◆ PrintLn()
◆ PrintNSpaces()
| void PrintNSpaces |
( |
const int | n | ) |
|
◆ PrintS()
| void PrintS |
( |
const char * | s | ) |
|
Definition at line 288 of file reporter.cc.
289{
291 {
293 return;
294 }
296 {
297
299 {
301 }
302 else
303 {
304 fwrite(
s,1,strlen(
s),stdout);
305 fflush(stdout);
307 {
309 }
310 }
311 }
312}
VAR void(* PrintS_callback)(const char *s)
static void SPrintS(const char *s)
◆ SPrintEnd()
Definition at line 277 of file reporter.cc.
278{
283 return ns;
284}
STATIC_VAR char * sprint_backup
◆ SPrintS()
| void SPrintS |
( |
const char * | s | ) |
|
|
inlinestatic |
Definition at line 260 of file reporter.cc.
261{
263 if ((
s ==
NULL)||(*
s ==
'\0'))
return;
265
266 char* ns;
268 ns = (
char*)
omAlloc((
l + ls + 1)*
sizeof(
char));
270
275}
◆ SPrintStart()
Definition at line 250 of file reporter.cc.
251{
253 {
256 }
258}
void WerrorS(const char *s)
◆ StringAppend()
| void StringAppend |
( |
const char * | fmt, |
|
|
| ... ) |
Definition at line 61 of file reporter.cc.
62{
65 int vs;
66 long more;
69 {
70 more = ((more + (8*1024-1))/(8*1024))*(8*1024);
73 more);
74#if (!defined(SING_NDEBUG)) && (!defined(OM_NDEBUG))
76#endif
79#ifndef BSD_SPRINTF
81#endif
82 }
83
84
85
86
87
88#ifdef HAVE_VSNPRINTF
90 if (vs == -1)
91 {
94 }
95 else
96 {
98 }
99#else
101#endif
102
105}
#define omReallocSize(addr, o_size, size)
#define omCheckAddrSize(addr, size)
STATIC_VAR char * feBuffer
STATIC_VAR char * feBufferStart
STATIC_VAR long feBufferLength
#define omMarkAsStaticAddr(A)
◆ StringAppendS()
| void StringAppendS |
( |
const char * | st | ) |
|
Definition at line 107 of file reporter.cc.
108{
109 if (*st!='\0')
110 {
111
113 long more;
116 {
117 more = ((more + (8*1024-1))/(8*1024))*(8*1024);
119 more);
122 }
125 }
126}
#define omreallocSize(addr, o_size, size)
◆ StringEndS()
Definition at line 151 of file reporter.cc.
152{
159 if (strlen(r)<1024)
160 {
161
162
164 }
165 return r;
166}
STATIC_VAR char * feBufferStart_save[8]
STATIC_VAR char * feBuffer_save[8]
STATIC_VAR long feBufferLength_save[8]
STATIC_VAR int feBuffer_cnt
◆ StringSetS()
| void StringSetS |
( |
const char * | st | ) |
|
Definition at line 128 of file reporter.cc.
129{
139 long more;
141 {
142 more = ((
l + (4*1024-1))/(4*1024))*(4*1024);
144 more);
146 }
149}
#define INITIAL_PRINT_BUFFER
◆ Warn()
| void Warn |
( |
const char * | fmt, |
|
|
| ... ) |
Definition at line 231 of file reporter.cc.
232{
236#ifdef HAVE_VSNPRINTF
237 vsnprintf(
s, 256, fmt,
ap);
238#else
239 vsprintf(
s, fmt,
ap);
240#endif
244}
#define omFreeSize(addr, size)
◆ WarnS()
| void WarnS |
( |
const char * | s | ) |
|
Definition at line 206 of file reporter.cc.
207{
208 #define warn_str "// ** "
210 {
212 {
214 fwrite(
s,1,strlen(
s),stdout);
215 fwrite("\n",1,1,stdout);
216 fflush(stdout);
218 {
222 }
223 }
224 else
225 {
227 }
228 }
229}
VAR void(* WarnS_callback)(const char *s)
◆ Werror()
| void Werror |
( |
const char * | fmt, |
|
|
| ... ) |
Definition at line 189 of file reporter.cc.
190{
194#ifdef HAVE_VSNPRINTF
195 vsnprintf(
s,256, fmt,
ap);
196#else
197 vsprintf(
s, fmt,
ap);
198#endif
202}
◆ WerrorS_batch()
| void WerrorS_batch |
( |
const char * | s | ) |
|
Definition at line 168 of file reporter.cc.
169{
171 {
175 }
176 else
177 {
179 {
182 }
183 }
184 strcat(
feErrors,
"Singular error: ");
187}
◆ feBuffer
◆ feBuffer_cnt
◆ feBuffer_save
◆ feBufferLength
◆ feBufferLength_save
◆ feBufferStart
◆ feBufferStart_save
◆ feErrors
◆ feErrorsLen
◆ feNotImplemented
| const char feNotImplemented[] ="not implemented" |
◆ feOut
◆ feProt
◆ feProtFile
◆ feWarn
◆ sprint
◆ sprint_backup
◆ WarnS_callback