aboutsummaryrefslogtreecommitdiff
path: root/vendor/curl/c/mprintf.h
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2025-09-04 12:43:56 +0100
committergingerBill <gingerBill@users.noreply.github.com>2025-09-04 12:44:09 +0100
commitbb44b02b3e220d7019aba8b547a6d3e6fbd49dba (patch)
tree85621f2859569aafc5c5277bed32ee03824472a0 /vendor/curl/c/mprintf.h
parent9c0a41552dbfbb394c4b7f24ad4acdc7a53bd6b6 (diff)
Rename directory
Diffstat (limited to 'vendor/curl/c/mprintf.h')
-rw-r--r--vendor/curl/c/mprintf.h85
1 files changed, 85 insertions, 0 deletions
diff --git a/vendor/curl/c/mprintf.h b/vendor/curl/c/mprintf.h
new file mode 100644
index 000000000..88059c851
--- /dev/null
+++ b/vendor/curl/c/mprintf.h
@@ -0,0 +1,85 @@
+#ifndef CURLINC_MPRINTF_H
+#define CURLINC_MPRINTF_H
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at https://curl.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ * SPDX-License-Identifier: curl
+ *
+ ***************************************************************************/
+
+#include <stdarg.h>
+#include <stdio.h> /* needed for FILE */
+#include "curl.h" /* for CURL_EXTERN */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef CURL_TEMP_PRINTF
+#if (defined(__GNUC__) || defined(__clang__) || \
+ defined(__IAR_SYSTEMS_ICC__)) && \
+ defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \
+ !defined(CURL_NO_FMT_CHECKS)
+#if defined(__MINGW32__) && !defined(__clang__)
+#if defined(__MINGW_PRINTF_FORMAT) /* mingw-w64 3.0.0+. Needs stdio.h. */
+#define CURL_TEMP_PRINTF(fmt, arg) \
+ __attribute__((format(__MINGW_PRINTF_FORMAT, fmt, arg)))
+#else
+#define CURL_TEMP_PRINTF(fmt, arg)
+#endif
+#else
+#define CURL_TEMP_PRINTF(fmt, arg) \
+ __attribute__((format(printf, fmt, arg)))
+#endif
+#else
+#define CURL_TEMP_PRINTF(fmt, arg)
+#endif
+#endif
+
+CURL_EXTERN int curl_mprintf(const char *format, ...)
+ CURL_TEMP_PRINTF(1, 2);
+CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...)
+ CURL_TEMP_PRINTF(2, 3);
+CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...)
+ CURL_TEMP_PRINTF(2, 3);
+CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength,
+ const char *format, ...)
+ CURL_TEMP_PRINTF(3, 4);
+CURL_EXTERN int curl_mvprintf(const char *format, va_list args)
+ CURL_TEMP_PRINTF(1, 0);
+CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args)
+ CURL_TEMP_PRINTF(2, 0);
+CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args)
+ CURL_TEMP_PRINTF(2, 0);
+CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength,
+ const char *format, va_list args)
+ CURL_TEMP_PRINTF(3, 0);
+CURL_EXTERN char *curl_maprintf(const char *format, ...)
+ CURL_TEMP_PRINTF(1, 2);
+CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args)
+ CURL_TEMP_PRINTF(1, 0);
+
+#undef CURL_TEMP_PRINTF
+
+#ifdef __cplusplus
+} /* end of extern "C" */
+#endif
+
+#endif /* CURLINC_MPRINTF_H */