From: Wilfried Göesgens Date: Thu, 25 Feb 2010 19:05:04 +0000 (+0000) Subject: * remove header of a function which was moved to libcitadel a while ago X-Git-Tag: v7.86~377 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=6ef495f61980e6126bd9c945399337ea75bdb39a * remove header of a function which was moved to libcitadel a while ago * if UBER_VERBOSE_DEBUGGING is defined, wc_printf will wrap its output with File:Function:Line[string] --- diff --git a/webcit/webcit.c b/webcit/webcit.c index 360ba4108..faf3d7462 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -50,17 +50,27 @@ void tmplput_HANDLER_DISPLAYNAME(StrBuf *Target, WCTemplputParams *TP) /* * web-printing funcion. uses our vsnprintf wrapper */ +#ifdef UBER_VERBOSE_DEBUGGING +void wcc_printf(const char *FILE, const char *FUNCTION, long LINE, const char *format,...) +#else void wc_printf(const char *format,...) +#endif { wcsession *WCC = WC; va_list arg_ptr; if (WCC->WBuf == NULL) WCC->WBuf = NewStrBuf(); +#ifdef UBER_VERBOSE_DEBUGGING + StrBufAppendPrintf(WCC->WBuf, "\n%s:%s:%d[", FILE, FUNCTION, LINE); +#endif va_start(arg_ptr, format); StrBufVAppendPrintf(WCC->WBuf, format, arg_ptr); va_end(arg_ptr); +#ifdef UBER_VERBOSE_DEBUGGING + StrBufAppendPrintf(WCC->WBuf, "]\n"); +#endif } /* diff --git a/webcit/webcit.h b/webcit/webcit.h index c93fec496..2aa529bfb 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -645,7 +645,14 @@ void output_headers( int do_httpheaders, int suppress_check, int cache); void output_custom_content_header(const char *ctype); + +#ifdef UBER_VERBOSE_DEBUGGING +#define wc_printf(...) wcc_printf(__FILE__, __FUNCTION__, __LINE__, __VA_ARGS__) +void wcc_printf(const char *FILE, const char *FUNCTION, long LINE, const char *format, ...); +#else void wc_printf(const char *format,...)__attribute__((__format__(__printf__,1,2))); +#endif + void hprintf(const char *format,...)__attribute__((__format__(__printf__,1,2))); void output_static(const char* What); @@ -706,8 +713,6 @@ void clear_local_substs(void); int lingering_close(int fd); -char *memreadline(char *start, char *buf, int maxlen); -char *memreadlinelen(char *start, char *buf, int maxlen, int *retlen); long extract_token(char *dest, const char *source, int parmnum, char separator, int maxlen); void remove_token(char *source, int parmnum, char separator); StrBuf *load_mimepart(long msgnum, char *partnum);