summaryrefslogtreecommitdiff
path: root/src/lib/string/printf.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-06-26 11:27:33 -0400
committerNick Mathewson <nickm@torproject.org>2018-06-26 11:27:33 -0400
commit92d8284a9792267514cbe21f3ce1564f6ad0e10b (patch)
treef4a82d867c9fb863f7a3f56a2baffb509a2af5c5 /src/lib/string/printf.h
parentb4e23dba930cbb8168151e1fe9dcf280615d6f3b (diff)
parent1b93b065fc3eb52fe5674d6df05c71c505ed1ef3 (diff)
downloadtor-92d8284a9792267514cbe21f3ce1564f6ad0e10b.tar.gz
tor-92d8284a9792267514cbe21f3ce1564f6ad0e10b.zip
Merge branch 'log_dependencies'
Diffstat (limited to 'src/lib/string/printf.h')
-rw-r--r--src/lib/string/printf.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/lib/string/printf.h b/src/lib/string/printf.h
new file mode 100644
index 0000000000..2f46206545
--- /dev/null
+++ b/src/lib/string/printf.h
@@ -0,0 +1,25 @@
+/* Copyright (c) 2003-2004, Roger Dingledine
+ * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
+ * Copyright (c) 2007-2018, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+#ifndef TOR_UTIL_PRINTF_H
+#define TOR_UTIL_PRINTF_H
+
+#include "orconfig.h"
+#include "lib/cc/compat_compiler.h"
+
+#include <stdarg.h>
+#include <stddef.h>
+
+int tor_snprintf(char *str, size_t size, const char *format, ...)
+ CHECK_PRINTF(3,4) ATTR_NONNULL((1,3));
+int tor_vsnprintf(char *str, size_t size, const char *format, va_list args)
+ CHECK_PRINTF(3,0) ATTR_NONNULL((1,3));
+
+int tor_asprintf(char **strp, const char *fmt, ...)
+ CHECK_PRINTF(2,3);
+int tor_vasprintf(char **strp, const char *fmt, va_list args)
+ CHECK_PRINTF(2,0);
+
+#endif /* !defined(TOR_UTIL_STRING_H) */