From 1cbadb0f362ac338dae1b9c29ea4d78ad8611132 Mon Sep 17 00:00:00 2001 From: gombasg Date: Wed, 8 Feb 2006 15:53:54 +0000 Subject: [PATCH] Use gcc for checking the arguments of DC_log() and DC_vlog() git-svn-id: svn+ssh://cvs.lpds.sztaki.hu/var/lib/svn/szdg/dcapi/trunk@322 a7169a2c-3604-0410-bc95-c702d8d87f7a --- dcapi/include/dc.h | 20 ++++++++++++++------ dcapi/include/dc_common.h | 5 +++++ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/dcapi/include/dc.h b/dcapi/include/dc.h index ddce814f65..98aad33d86 100644 --- a/dcapi/include/dc.h +++ b/dcapi/include/dc.h @@ -16,8 +16,6 @@ extern "C" { #include typedef enum { - DC_RESULT_ACCEPT, - DC_RESULT_INVALID, DC_RESULT_FINAL, DC_RESULT_SUB } DC_ResultStatus; @@ -186,22 +184,32 @@ int DC_checkForResult(int timeout, It will be deallocated automatically after the return from assimilation. - int cb_check_result( DC_Result result) + int cb_check_result(DC_Result result) Checking the result when it is available. Return DC_RESULT_ACCEPT if result is accepted DC_RESULT_INVALID if result is invalid - void cb_assimilate_result( DC_Result result) + void cb_assimilate_result(DC_Result result) Assimilate the result within the application. On return, the result will be deleted within DC. */ -void DC_log(int level, const char *fmt, ...); -void DC_vlog(int level, const char *fmt, va_list args); +/** Logging function, like printf + * In configfile (given at DC_Init()), you can define to which level logging information + * will be printed, and also, to which file it should be printed: + * LogLevel = Debug (or Error, Warning, Notice, Info, Debug) + * LogFile = dsp.log + * + * Logging levels: LOG_ERR, LOG_WARNING, LOG_NOTICE, LOG_INFO, LOG_DEBUG + */ +void DC_log(int level, const char *fmt, ...) + __attribute__((format(printf, 2, 3))); +void DC_vlog(int level, const char *fmt, va_list args) + __attribute__((format(printf, 2, 0))); #ifdef __cplusplus } diff --git a/dcapi/include/dc_common.h b/dcapi/include/dc_common.h index 1fe18f8421..217bf10628 100644 --- a/dcapi/include/dc_common.h +++ b/dcapi/include/dc_common.h @@ -15,6 +15,11 @@ enum { DC_ERROR }; +/* Support non-gcc compatible compilers */ +#ifndef __GNUC__ +#define __attribute__(x) +#endif + #ifdef __cplusplus } #endif