Tor  0.4.7.0-alpha-dev
printf.h
Go to the documentation of this file.
1 /* Copyright (c) 2003-2004, Roger Dingledine
2  * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
3  * Copyright (c) 2007-2021, The Tor Project, Inc. */
4 /* See LICENSE for licensing information */
5 
6 /**
7  * \file printf.h
8  * \brief Header for printf.c
9  **/
10 
11 #ifndef TOR_UTIL_PRINTF_H
12 #define TOR_UTIL_PRINTF_H
13 
14 #include "orconfig.h"
15 #include "lib/cc/compat_compiler.h"
16 
17 #include <stdarg.h>
18 #include <stddef.h>
19 
20 int tor_snprintf(char *str, size_t size, const char *format, ...)
21  CHECK_PRINTF(3,4);
22 int tor_vsnprintf(char *str, size_t size, const char *format, va_list args)
23  CHECK_PRINTF(3,0);
24 
25 int tor_asprintf(char **strp, const char *fmt, ...)
26  CHECK_PRINTF(2,3);
27 int tor_vasprintf(char **strp, const char *fmt, va_list args)
28  CHECK_PRINTF(2,0);
29 
30 #endif /* !defined(TOR_UTIL_PRINTF_H) */
Utility macros to handle different features and behavior in different compilers.
int tor_vsnprintf(char *str, size_t size, const char *format, va_list args)
Definition: printf.c:41
int tor_vasprintf(char **strp, const char *fmt, va_list args)
Definition: printf.c:96
int tor_asprintf(char **strp, const char *fmt,...)
Definition: printf.c:75
int tor_snprintf(char *str, size_t size, const char *format,...)
Definition: printf.c:27