#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
#define fePutChar |
( |
|
c | ) |
fputc((unsigned char)(c),stdout) |
◆ 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 373 of file reporter.cc.
374{
376
377 if (*
s >=
'0' && *
s <=
'9')
378 {
380 while (*
s >=
'0' && *
s <=
'9')
381 {
386 {
388 Werror(
"`%s` greater than %d(max. integer representation)",
391 }
392 }
393 }
396}
const CanonicalForm int s
void Werror(const char *fmt,...)
◆ feStringAppendResources()
void feStringAppendResources |
( |
int |
warn | ) |
|
Definition at line 398 of file reporter.cc.
399{
401 char* r;
404 {
407 (r !=
NULL ? r :
""));
409 }
410}
VAR feResourceConfig_s feResourceConfigs[]
static char * feResource(feResourceConfig config, int warn)
◆ Print()
void Print |
( |
const char * |
fmt, |
|
|
|
... |
|
) |
| |
Definition at line 315 of file reporter.cc.
316{
318 {
322 int ls = strlen(fmt);
323 if (fmt !=
NULL && ls > 0)
324 {
325 char* ns;
327 ns = (
char*)
omAlloc(
sizeof(
char)*(ls +
l + 512));
329
330#ifdef HAVE_VSNPRINTF
331 l = vsnprintf(&(ns[
l]), ls+511, fmt,
ap);
333#else
334 vsprintf(&(ns[
l]), fmt,
ap);
335#endif
339 }
341 return;
342 }
344 {
348 long ls=strlen(fmt);
350#ifdef HAVE_VSNPRINTF
351 l = vsnprintf(
s, ls+511, fmt,
ap);
352 if ((
l==-1)||(
s[
l]!=
'\0')||(
l!=(
int)strlen(
s)))
353 {
354 printf(
"Print problem: l=%d, fmt=>>%s<<\n",
l,fmt);
355 }
356#else
357 vsprintf(
s, fmt,
ap);
358#endif
362 }
363}
#define omCheckAddr(addr)
void PrintS(const char *s)
◆ PrintLn()
◆ PrintNSpaces()
void PrintNSpaces |
( |
const int |
n | ) |
|
◆ PrintS()
void PrintS |
( |
const char * |
s | ) |
|
Definition at line 284 of file reporter.cc.
285{
287 {
289 return;
290 }
292 {
293
295 {
297 }
298 else
299 {
300 fwrite(
s,1,strlen(
s),stdout);
301 fflush(stdout);
303 {
305 }
306 }
307 }
308}
VAR void(* PrintS_callback)(const char *s)
static void SPrintS(const char *s)
◆ SPrintEnd()
Definition at line 273 of file reporter.cc.
274{
279 return ns;
280}
STATIC_VAR char * sprint_backup
◆ SPrintS()
static void SPrintS |
( |
const char * |
s | ) |
|
|
inlinestatic |
Definition at line 256 of file reporter.cc.
257{
259 if ((
s ==
NULL)||(*
s ==
'\0'))
return;
261
262 char* ns;
264 ns = (
char*)
omAlloc((
l + ls + 1)*
sizeof(char));
266
271}
◆ SPrintStart()
Definition at line 246 of file reporter.cc.
247{
249 {
252 }
254}
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#ifdef BSD_SPRINTF
87#else
88#ifdef HAVE_VSNPRINTF
90 if (vs == -1)
91 {
94 }
95 else
96 {
98 }
99#else
101#endif
102#endif
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 227 of file reporter.cc.
228{
232#ifdef HAVE_VSNPRINTF
233 vsnprintf(
s, 256, fmt,
ap);
234#else
235 vsprintf(
s, fmt,
ap);
236#endif
240}
#define omFreeSize(addr, size)
◆ WarnS()
void WarnS |
( |
const char * |
s | ) |
|
Definition at line 202 of file reporter.cc.
203{
204 #define warn_str "// ** "
206 {
208 {
210 fwrite(
s,1,strlen(
s),stdout);
211 fwrite("\n",1,1,stdout);
212 fflush(stdout);
214 {
218 }
219 }
220 else
221 {
223 }
224 }
225}
VAR void(* WarnS_callback)(const char *s)
◆ Werror()
void Werror |
( |
const char * |
fmt, |
|
|
|
... |
|
) |
| |
◆ 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