printf.h 799 B

123456789101112131415161718192021222324252627282930
  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. /**
  6. * \file printf.h
  7. * \brief Header for printf.c
  8. **/
  9. #ifndef TOR_UTIL_PRINTF_H
  10. #define TOR_UTIL_PRINTF_H
  11. #include "orconfig.h"
  12. #include "lib/cc/compat_compiler.h"
  13. #include <stdarg.h>
  14. #include <stddef.h>
  15. int tor_snprintf(char *str, size_t size, const char *format, ...)
  16. CHECK_PRINTF(3,4);
  17. int tor_vsnprintf(char *str, size_t size, const char *format, va_list args)
  18. CHECK_PRINTF(3,0);
  19. int tor_asprintf(char **strp, const char *fmt, ...)
  20. CHECK_PRINTF(2,3);
  21. int tor_vasprintf(char **strp, const char *fmt, va_list args)
  22. CHECK_PRINTF(2,0);
  23. #endif /* !defined(TOR_UTIL_STRING_H) */