summaryrefslogtreecommitdiffstats
path: root/src/message.cpp
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2002-12-07 21:08:27 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2002-12-07 21:08:27 (GMT)
commit6f118034b4528e83e5668bb4bfbcc2947bd180c7 (patch)
tree17668f7d76b3d88c791ebb8eec8dc386256af3e6 /src/message.cpp
parentf3e7209fed9703e8be668753d1083ba335121a6e (diff)
downloadDoxygen-6f118034b4528e83e5668bb4bfbcc2947bd180c7.zip
Doxygen-6f118034b4528e83e5668bb4bfbcc2947bd180c7.tar.gz
Doxygen-6f118034b4528e83e5668bb4bfbcc2947bd180c7.tar.bz2
Release-1.3-rc1-20021207
Diffstat (limited to 'src/message.cpp')
-rw-r--r--src/message.cpp86
1 files changed, 40 insertions, 46 deletions
diff --git a/src/message.cpp b/src/message.cpp
index 1f04dea..95a63db 100644
--- a/src/message.cpp
+++ b/src/message.cpp
@@ -103,65 +103,59 @@ void msg(const char *fmt, ...)
}
}
-void warn(const char *file,int line,const char *fmt, ...)
+static void do_warn(const char *tag, const char *file, int line, const char *fmt, va_list args)
{
- if (Config_getBool("WARNINGS"))
+ if (!Config_getBool(tag)) return; // warning type disabled
+ char text[4096];
+ vsprintf(text, fmt, args);
+ if (file==0) file="<unknown>";
+ switch(warnFormatOrder)
{
- if (file==0) file="<unknown>";
- char text[4096];
- va_list args;
- va_start(args, fmt);
- vsprintf(text, fmt, args);
- va_end(args);
- switch(warnFormatOrder)
- {
- case 1: fprintf(warnFile,outputFormat,file,line,text); break;
- case 2: fprintf(warnFile,outputFormat,text,line,file); break;
- case 3: fprintf(warnFile,outputFormat,line,text,file); break;
- case 4: fprintf(warnFile,outputFormat,file,text,line); break;
- case 5: fprintf(warnFile,outputFormat,text,file,line); break;
- case 6: fprintf(warnFile,outputFormat,line,file,text); break;
- default:
- printf("Error: warning format has not been initialized!\n");
- }
+ case 1: fprintf(warnFile,outputFormat,file,line,text); break;
+ case 2: fprintf(warnFile,outputFormat,text,line,file); break;
+ case 3: fprintf(warnFile,outputFormat,line,text,file); break;
+ case 4: fprintf(warnFile,outputFormat,file,text,line); break;
+ case 5: fprintf(warnFile,outputFormat,text,file,line); break;
+ case 6: fprintf(warnFile,outputFormat,line,file,text); break;
+ default:
+ printf("Error: warning format has not been initialized!\n");
}
}
+void warn(const char *file,int line,const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ do_warn("WARNINGS", file, line, fmt, args);
+ va_end(args);
+}
+
void warn_cont(const char *fmt, ...)
{
- if (Config_getBool("WARNINGS"))
- {
- va_list args;
- va_start(args, fmt);
- vfprintf(warnFile, fmt, args);
- va_end(args);
- }
+ if (!Config_getBool("WARNINGS"))
+ return;
+ va_list args;
+ va_start(args, fmt);
+ vfprintf(warnFile, fmt, args);
+ va_end(args);
}
void warn_undoc(const char *file,int line,const char *fmt, ...)
{
- if (Config_getBool("WARN_IF_UNDOCUMENTED"))
- {
- if (file==0) file="<unknwon>";
- char text[4096];
- va_list args;
- va_start(args, fmt);
- vsprintf(text, fmt, args);
- va_end(args);
- switch(warnFormatOrder)
- {
- case 1: fprintf(warnFile,outputFormat,file,line,text); break;
- case 2: fprintf(warnFile,outputFormat,text,line,file); break;
- case 3: fprintf(warnFile,outputFormat,line,text,file); break;
- case 4: fprintf(warnFile,outputFormat,file,text,line); break;
- case 5: fprintf(warnFile,outputFormat,text,file,line); break;
- case 6: fprintf(warnFile,outputFormat,line,file,text); break;
- default:
- printf("Error: warning format has not been initialized!\n");
- }
- }
+ va_list args;
+ va_start(args, fmt);
+ do_warn("WARN_IF_UNDOCUMENTED", file, line, fmt, args);
+ va_end(args);
}
+void warn_doc_error(const char *file,int line,const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ do_warn("WARN_IF_DOC_ERROR", file, line, fmt, args);
+ va_end(args);
+}
+
void err(const char *fmt, ...)
{
va_list args;