michael@0: #ifndef __CURL_MPRINTF_H michael@0: #define __CURL_MPRINTF_H michael@0: /*************************************************************************** michael@0: * _ _ ____ _ michael@0: * Project ___| | | | _ \| | michael@0: * / __| | | | |_) | | michael@0: * | (__| |_| | _ <| |___ michael@0: * \___|\___/|_| \_\_____| michael@0: * michael@0: * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. michael@0: * michael@0: * This software is licensed as described in the file COPYING, which michael@0: * you should have received as part of this distribution. The terms michael@0: * are also available at http://curl.haxx.se/docs/copyright.html. michael@0: * michael@0: * You may opt to use, copy, modify, merge, publish, distribute and/or sell michael@0: * copies of the Software, and permit persons to whom the Software is michael@0: * furnished to do so, under the terms of the COPYING file. michael@0: * michael@0: * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY michael@0: * KIND, either express or implied. michael@0: * michael@0: * $Id: mprintf.h,v 1.16 2008-05-20 10:21:50 patrickm Exp $ michael@0: ***************************************************************************/ michael@0: michael@0: #include michael@0: #include /* needed for FILE */ michael@0: michael@0: #include "curl.h" michael@0: michael@0: #ifdef __cplusplus michael@0: extern "C" { michael@0: #endif michael@0: michael@0: CURL_EXTERN int curl_mprintf(const char *format, ...); michael@0: CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...); michael@0: CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...); michael@0: CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength, michael@0: const char *format, ...); michael@0: CURL_EXTERN int curl_mvprintf(const char *format, va_list args); michael@0: CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args); michael@0: CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args); michael@0: CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength, michael@0: const char *format, va_list args); michael@0: CURL_EXTERN char *curl_maprintf(const char *format, ...); michael@0: CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args); michael@0: michael@0: #ifdef _MPRINTF_REPLACE michael@0: # undef printf michael@0: # undef fprintf michael@0: # undef sprintf michael@0: # undef vsprintf michael@0: # undef snprintf michael@0: # undef vprintf michael@0: # undef vfprintf michael@0: # undef vsnprintf michael@0: # undef aprintf michael@0: # undef vaprintf michael@0: # define printf curl_mprintf michael@0: # define fprintf curl_mfprintf michael@0: #ifdef CURLDEBUG michael@0: /* When built with CURLDEBUG we define away the sprintf() functions since we michael@0: don't want internal code to be using them */ michael@0: # define sprintf sprintf_was_used michael@0: # define vsprintf vsprintf_was_used michael@0: #else michael@0: # define sprintf curl_msprintf michael@0: # define vsprintf curl_mvsprintf michael@0: #endif michael@0: # define snprintf curl_msnprintf michael@0: # define vprintf curl_mvprintf michael@0: # define vfprintf curl_mvfprintf michael@0: # define vsnprintf curl_mvsnprintf michael@0: # define aprintf curl_maprintf michael@0: # define vaprintf curl_mvaprintf michael@0: #endif michael@0: michael@0: #ifdef __cplusplus michael@0: } michael@0: #endif michael@0: michael@0: #endif /* __CURL_MPRINTF_H */