Fixed problems related to *printf arguments checking and kdoc.

git-svn-id: http://yate.null.ro/svn/yate/trunk@52 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2004-09-11 10:43:49 +00:00
parent 9c85409fc9
commit 182e839f24
3 changed files with 17 additions and 16 deletions

View File

@ -60,7 +60,7 @@ engine: tables yatepaths.h $(LIBS) $(SLIBS) $(PROGS)
.PHONY: apidocs-build
apidocs-build: check-topdir
kdoc -d docs/api/ $(INCS)
kdoc -C ./kdoc-filter.sh -d docs/api/ $(INCS)
apidocs: @srcdir@/docs/api/index.html

7
kdoc-filter.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
# Filter the Yate header files so they can be parsed by kdoc
filter='s/FORMAT_CHECK(.*)//'
test -f "$2" && sed "$filter" "$2"

View File

@ -16,6 +16,12 @@ struct timeval;
*/
namespace TelEngine {
#ifdef HAVE_GCC_FORMAT_CHECK
#define FORMAT_CHECK(f) __attribute__((format(printf,(f),(f)+1)))
#else
#define FORMAT_CHECK(f)
#endif
/**
* Standard debugging levels.
*/
@ -54,11 +60,7 @@ bool debugAt(int level);
* @param format A printf() style format string
* @return True if message was output, false otherwise
*/
bool Debug(int level, const char *format, ...)
#ifdef HAVE_GCC_FORMAT_CHECK
__attribute__((format(printf,2,3)))
#endif
;
bool Debug(int level, const char *format, ...) FORMAT_CHECK(2);
/**
* Outputs a debug string for a specific facility.
@ -67,22 +69,14 @@ __attribute__((format(printf,2,3)))
* @param format A printf() style format string
* @return True if message was output, false otherwise
*/
bool Debug(const char *facility, int level, const char *format, ...)
#ifdef HAVE_GCC_FORMAT_CHECK
__attribute__((format(printf,3,4)))
#endif
;
bool Debug(const char *facility, int level, const char *format, ...) FORMAT_CHECK(3);
/**
* Outputs a string to the debug console with formatting
* @param facility Facility that outputs the message
* @param format A printf() style format string
*/
void Output(const char *format, ...)
#ifdef HAVE_GCC_FORMAT_CHECK
__attribute__((format(printf,1,2)))
#endif
;
void Output(const char *format, ...) FORMAT_CHECK(1);
/**
* An object that logs messages on creation and destruction