printf.h 781 B

12345678910111213141516171819202122232425
  1. /* Copyright (c) 2003-2004, Roger Dingledine
  2. * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
  3. * Copyright (c) 2007-2018, The Tor Project, Inc. */
  4. /* See LICENSE for licensing information */
  5. #ifndef TOR_UTIL_PRINTF_H
  6. #define TOR_UTIL_PRINTF_H
  7. #include "orconfig.h"
  8. #include "lib/cc/compat_compiler.h"
  9. #include <stdarg.h>
  10. #include <stddef.h>
  11. int tor_snprintf(char *str, size_t size, const char *format, ...)
  12. CHECK_PRINTF(3,4) ATTR_NONNULL((1,3));
  13. int tor_vsnprintf(char *str, size_t size, const char *format, va_list args)
  14. CHECK_PRINTF(3,0) ATTR_NONNULL((1,3));
  15. int tor_asprintf(char **strp, const char *fmt, ...)
  16. CHECK_PRINTF(2,3);
  17. int tor_vasprintf(char **strp, const char *fmt, va_list args)
  18. CHECK_PRINTF(2,0);
  19. #endif /* !defined(TOR_UTIL_STRING_H) */