File indexing completed on 2025-01-18 09:55:11
0001 #ifndef CURLINC_MPRINTF_H
0002 #define CURLINC_MPRINTF_H
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027 #include <stdarg.h>
0028 #include <stdio.h> /* needed for FILE */
0029 #include "curl.h" /* for CURL_EXTERN */
0030
0031 #ifdef __cplusplus
0032 extern "C" {
0033 #endif
0034
0035 #ifndef CURL_TEMP_PRINTF
0036 #if (defined(__GNUC__) || defined(__clang__) || \
0037 defined(__IAR_SYSTEMS_ICC__)) && \
0038 defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \
0039 !defined(CURL_NO_FMT_CHECKS)
0040 #if defined(__MINGW32__) && !defined(__clang__)
0041 #if defined(__MINGW_PRINTF_FORMAT)
0042 #define CURL_TEMP_PRINTF(fmt, arg) \
0043 __attribute__((format(__MINGW_PRINTF_FORMAT, fmt, arg)))
0044 #else
0045 #define CURL_TEMP_PRINTF(fmt, arg)
0046 #endif
0047 #else
0048 #define CURL_TEMP_PRINTF(fmt, arg) \
0049 __attribute__((format(printf, fmt, arg)))
0050 #endif
0051 #else
0052 #define CURL_TEMP_PRINTF(fmt, arg)
0053 #endif
0054 #endif
0055
0056 CURL_EXTERN int curl_mprintf(const char *format, ...)
0057 CURL_TEMP_PRINTF(1, 2);
0058 CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...)
0059 CURL_TEMP_PRINTF(2, 3);
0060 CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...)
0061 CURL_TEMP_PRINTF(2, 3);
0062 CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength,
0063 const char *format, ...)
0064 CURL_TEMP_PRINTF(3, 4);
0065 CURL_EXTERN int curl_mvprintf(const char *format, va_list args)
0066 CURL_TEMP_PRINTF(1, 0);
0067 CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args)
0068 CURL_TEMP_PRINTF(2, 0);
0069 CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args)
0070 CURL_TEMP_PRINTF(2, 0);
0071 CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength,
0072 const char *format, va_list args)
0073 CURL_TEMP_PRINTF(3, 0);
0074 CURL_EXTERN char *curl_maprintf(const char *format, ...)
0075 CURL_TEMP_PRINTF(1, 2);
0076 CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args)
0077 CURL_TEMP_PRINTF(1, 0);
0078
0079 #undef CURL_TEMP_PRINTF
0080
0081 #ifdef __cplusplus
0082 }
0083 #endif
0084
0085 #endif