Functions
message.h File Reference
#include <stdio.h>
#include <stdarg.h>

Go to the source code of this file.

Functions

void msg (const char *fmt,...)
 
void warn (const char *file, int line, const char *fmt,...)
 
void va_warn (const char *file, int line, const char *fmt, va_list args)
 
void warn_simple (const char *file, int line, const char *text)
 
void warn_undoc (const char *file, int line, const char *fmt,...)
 
void warn_doc_error (const char *file, int line, const char *fmt,...)
 
void warn_uncond (const char *fmt,...)
 
void err (const char *fmt,...)
 
void err_full (const char *file, int line, const char *fmt,...)
 
void initWarningFormat ()
 
void printlex (int dbg, bool enter, const char *lexName, const char *fileName)
 

Function Documentation

void err ( const char *  fmt,
  ... 
)

Definition at line 226 of file message.cpp.

227 {
228  va_list args;
229  va_start(args, fmt);
230  vfprintf(warnFile, (QCString(error_str) + fmt).data(), args);
231  va_end(args);
232 }
static const char * error_str
Definition: message.cpp:28
static QCString args
Definition: declinfo.cpp:674
static FILE * warnFile
Definition: message.cpp:36
void err_full ( const char *  file,
int  line,
const char *  fmt,
  ... 
)

Definition at line 234 of file message.cpp.

235 {
236  va_list args;
237  va_start(args, fmt);
238  do_warn(NULL, file, line, error_str, fmt, args);
239  va_end(args);
240 }
static const char * error_str
Definition: message.cpp:28
static QCString args
Definition: declinfo.cpp:674
static void do_warn(const char *tag, const char *file, int line, const char *prefix, const char *fmt, va_list args)
Definition: message.cpp:167
void line(double t, double *p, double &x, double &y, double &z)
void initWarningFormat ( )

Definition at line 38 of file message.cpp.

39 {
40 // int filePos = Config_getString("WARN_FORMAT").find("$file");
41 // int linePos = Config_getString("WARN_FORMAT").find("$line");
42 // int textPos = Config_getString("WARN_FORMAT").find("$text");
43 //
44 // // sort items on position (there are 6 cases)
45 // warnFormatOrder = 1;
46 // if (filePos>linePos && filePos>textPos)
47 // {
48 // if (linePos>textPos) // $text,$line,$file
49 // {
50 // warnFormatOrder = 2;
51 // }
52 // else // $line,$text,$file
53 // {
54 // warnFormatOrder = 3;
55 // }
56 // }
57 // else if (filePos<linePos && filePos<textPos)
58 // {
59 // if (linePos>textPos) // $file,$text,$line
60 // {
61 // warnFormatOrder = 4;
62 // }
63 // }
64 // else if (filePos<linePos && filePos>textPos) // $text,$file,$line
65 // {
66 // warnFormatOrder = 5;
67 // }
68 // else // $line,$file,$text
69 // {
70 // warnFormatOrder = 6;
71 // }
72 // outputFormat =
73 // substitute(
74 // substitute(
75 // substitute(
76 // Config_getString("WARN_FORMAT"),
77 // "$file","%s"
78 // ),
79 // "$text","%s"
80 // ),
81 // "$line","%d"
82 // )+'\n';
83 
84  // replace(QRegExp("\\$file"),"%s").
85  // replace(QRegExp("\\$text"),"%s").
86  // replace(QRegExp("\\$line"),"%d")+
87  // '\n';
88 
89  outputFormat = Config_getString("WARN_FORMAT");
90 
91  if (!Config_getString("WARN_LOGFILE").isEmpty())
92  {
93  warnFile = portable_fopen(Config_getString("WARN_LOGFILE"),"w");
94  }
95  if (!warnFile) // point it to something valid, because warn() relies on it
96  {
97  warnFile = stderr;
98  }
99 
100  if (Config_getBool("WARN_AS_ERROR"))
101  {
103  }
104 }
static const char * error_str
Definition: message.cpp:28
static const char * warning_str
Definition: message.cpp:27
#define Config_getString(val)
Definition: config.cpp:660
#define Config_getBool(val)
Definition: config.cpp:664
static QCString outputFormat
Definition: message.cpp:26
static FILE * warnFile
Definition: message.cpp:36
FILE * portable_fopen(const char *fileName, const char *mode)
Definition: portable.cpp:344
void msg ( const char *  fmt,
  ... 
)

Definition at line 107 of file message.cpp.

108 {
109  if (!Config_getBool("QUIET"))
110  {
112  {
113  printf("%.3f sec: ",((double)Doxygen::runningTime.elapsed())/1000.0);
114  }
115  va_list args;
116  va_start(args, fmt);
117  vfprintf(stdout, fmt, args);
118  va_end(args);
119  }
120 }
static QCString args
Definition: declinfo.cpp:674
#define Config_getBool(val)
Definition: config.cpp:664
static bool isFlagSet(DebugMask mask)
Definition: debug.cpp:119
static QTime runningTime
Definition: doxygen.h:132
void printlex ( int  dbg,
bool  enter,
const char *  lexName,
const char *  fileName 
)

Definition at line 242 of file message.cpp.

243 {
244  const char *enter_txt = "entering";
245  const char *enter_txt_uc = "Entering";
246 
247  if (!enter)
248  {
249  enter_txt = "finished";
250  enter_txt_uc = "Finished";
251  }
252 
253  if (dbg)
254  {
255  if (fileName)
256  fprintf(stderr,"--%s lexical analyzer: %s (for: %s)\n",enter_txt, qPrint(lexName), qPrint(fileName));
257  else
258  fprintf(stderr,"--%s lexical analyzer: %s\n",enter_txt, qPrint(lexName));
259  }
260  else
261  {
262  if (fileName)
263  Debug::print(Debug::Lex,0,"%s lexical analyzer: %s (for: %s)\n",enter_txt_uc, qPrint(lexName), qPrint(fileName));
264  else
265  Debug::print(Debug::Lex,0,"%s lexical analyzer: %s\n",enter_txt_uc, qPrint(lexName));
266  }
267 }
bool dbg
fileName
Definition: dumpTree.py:9
static void print(DebugMask mask, int prio, const char *fmt,...)
Definition: debug.cpp:84
const char * qPrint(const char *s)
Definition: qcstring.h:797
void va_warn ( const char *  file,
int  line,
const char *  fmt,
va_list  args 
)

Definition at line 191 of file message.cpp.

192 {
193  do_warn("WARNINGS", file, line, warning_str, fmt, args);
194 }
static const char * warning_str
Definition: message.cpp:27
static QCString args
Definition: declinfo.cpp:674
static void do_warn(const char *tag, const char *file, int line, const char *prefix, const char *fmt, va_list args)
Definition: message.cpp:167
void line(double t, double *p, double &x, double &y, double &z)
void warn ( const char *  file,
int  line,
const char *  fmt,
  ... 
)

Definition at line 183 of file message.cpp.

184 {
185  va_list args;
186  va_start(args, fmt);
187  do_warn("WARNINGS", file, line, warning_str, fmt, args);
188  va_end(args);
189 }
static const char * warning_str
Definition: message.cpp:27
static QCString args
Definition: declinfo.cpp:674
static void do_warn(const char *tag, const char *file, int line, const char *prefix, const char *fmt, va_list args)
Definition: message.cpp:167
void line(double t, double *p, double &x, double &y, double &z)
void warn_doc_error ( const char *  file,
int  line,
const char *  fmt,
  ... 
)

Definition at line 210 of file message.cpp.

211 {
212  va_list args;
213  va_start(args, fmt);
214  do_warn("WARN_IF_DOC_ERROR", file, line, warning_str, fmt, args);
215  va_end(args);
216 }
static const char * warning_str
Definition: message.cpp:27
static QCString args
Definition: declinfo.cpp:674
static void do_warn(const char *tag, const char *file, int line, const char *prefix, const char *fmt, va_list args)
Definition: message.cpp:167
void line(double t, double *p, double &x, double &y, double &z)
void warn_simple ( const char *  file,
int  line,
const char *  text 
)

Definition at line 196 of file message.cpp.

197 {
198  if (!Config_getBool("WARNINGS")) return; // warning type disabled
200 }
static const char * warning_str
Definition: message.cpp:27
#define Config_getBool(val)
Definition: config.cpp:664
void line(double t, double *p, double &x, double &y, double &z)
static void format_warn(const char *file, int line, const char *text)
Definition: message.cpp:122
void warn_uncond ( const char *  fmt,
  ... 
)

Definition at line 218 of file message.cpp.

219 {
220  va_list args;
221  va_start(args, fmt);
222  vfprintf(warnFile, (QCString(warning_str) + fmt).data(), args);
223  va_end(args);
224 }
static const char * warning_str
Definition: message.cpp:27
static QCString args
Definition: declinfo.cpp:674
static FILE * warnFile
Definition: message.cpp:36
void warn_undoc ( const char *  file,
int  line,
const char *  fmt,
  ... 
)

Definition at line 202 of file message.cpp.

203 {
204  va_list args;
205  va_start(args, fmt);
206  do_warn("WARN_IF_UNDOCUMENTED", file, line, warning_str, fmt, args);
207  va_end(args);
208 }
static const char * warning_str
Definition: message.cpp:27
static QCString args
Definition: declinfo.cpp:674
static void do_warn(const char *tag, const char *file, int line, const char *prefix, const char *fmt, va_list args)
Definition: message.cpp:167
void line(double t, double *p, double &x, double &y, double &z)